00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _CACEINTERFACES_H_
00030 #define _CACEINTERFACES_H_
00031 #include"../includes/defines.h"
00032 #include"../includes/canapi.h"
00033
00034
00035
00036 #define CANBOARDXL 0
00037
00038
00039
00040 #define IF_SUCCESS 0
00041 #define IF_FAILURE 1
00042
00043 #define IF_DEFAULT_RXQUEUE 256
00044 #define IF_DEFAULT_BAUD 500000
00045
00046 struct _if_board
00047 { unsigned short boardtype;
00048 unsigned int
00049 hwType,
00050 channelcount,
00051
00052 index;
00053
00054 unsigned short
00055 txErrorCounter,
00056 rxErrorCounter,
00057 status;
00058
00059 struct _if_channel*channel[32];
00060 };
00061
00062 struct _if_channel
00063 { struct _if_board*board;
00064
00065 unsigned char
00066 name[CAN_MAXBUFFER],
00067 transceiverName[CAN_MAXBUFFER];
00068
00069 int isopen,
00070 txerror,
00071 rxerror,
00072 baudrate,
00073 rxqueuesize,
00074 index;
00075
00076 struct can20bframe*previous[MAX_STACK];
00077
00078 unsigned long
00079 hwType,
00080 hwIndex,
00081 hwChannel,
00082 hwHandle,
00083
00084 hwTransType,
00085 hwTransState,
00086
00087 hwChannelIndex,
00088
00089 capabilities,
00090 buscapabilities,
00091 bustype,
00092
00093 serialNumber,
00094 articleNumber,
00095
00096 rxqueue,
00097 txqueue;
00098
00099 void*blockinghandle;
00100 int blocktimeout;
00101
00102 unsigned int flags;
00103
00104 struct
00105 { int last;
00106 long time;
00107
00108 }error;
00109
00110 as_ts lastsync;
00111
00112 struct
00113 { unsigned long
00114 code,
00115 mask;
00116 char type;
00117 }filter;
00118 };
00119
00120 enum
00121 { d_canboardxl,
00122 d_cardone,
00123 d_cardtwo
00124 };
00125
00126 struct _s_interface
00127 { int activecount;
00128 int (*probefunction)();
00129 int (*startupfunction)();
00130 int (*openchannelfunction)(int);
00131 int (*closechannelfunction)(int);
00132 int (*shutdownfunction)();
00133 int (*readfunction)(int,can_frame*);
00134 int (*writefunction)(int,can_frame*);
00135 int (*updatestatusfunction)(int);
00136 int (*changestatusfunction)(int,int,int);
00137 };
00138
00139 int boardprobe();
00140 int boardopenchannel(int);
00141 int boardclosechannel(int);
00142 int boardread(int,can_frame*);
00143 int boardwrite(int,can_frame*);
00144 int boardupdatestatus(int which);
00145 int boardchangestatus(int,int,int);
00146 int boardshutdown(int);
00147
00148 void boarddllmain();
00149
00150 int fakecrc(unsigned char*,int*);
00151 #endif