8#ifndef INC_CAN_DRIVER_H_
9#define INC_CAN_DRIVER_H_
29#define DLL_CALL(funcname) funcname##_driver
37UNS8 DLL_CALL(canReceive)(CAN_HANDLE,
Message *)FCT_PTR_INIT;
38UNS8 DLL_CALL(canSend)(CAN_HANDLE,
Message *)FCT_PTR_INIT;
39CAN_HANDLE DLL_CALL(canOpen)(
s_BOARD *)FCT_PTR_INIT;
40int DLL_CALL(canClose)(CAN_HANDLE)FCT_PTR_INIT;
41UNS8 DLL_CALL(canChangeBaudRate)(CAN_HANDLE,
char *)FCT_PTR_INIT;
43#if defined DEBUG_MSG_CONSOLE_ON || defined NEED_PRINT_MESSAGE
46#define _P(fc) case fc: MSG(#fc" ");break;
48static inline void print_message(
Message *m)
52 MSG(
"id:%02x ", m->
cob_id & 0x7F);
86 switch(m->
data[0] >> 5)
89 _P(UPLOAD_SEGMENT_RESPONSE)
90 _P(DOWNLOAD_SEGMENT_RESPONSE)
91 _P(INITIATE_DOWNLOAD_RESPONSE)
92 _P(INITIATE_UPLOAD_RESPONSE)
93 _P(ABORT_TRANSFER_REQUEST)
95 }
else if( fc == SDOrx)
97 switch(m->
data[0] >> 5)
100 _P(DOWNLOAD_SEGMENT_REQUEST)
101 _P(INITIATE_DOWNLOAD_REQUEST)
102 _P(INITIATE_UPLOAD_REQUEST)
103 _P(UPLOAD_SEGMENT_REQUEST)
104 _P(ABORT_TRANSFER_REQUEST)
107 MSG(
" rtr:%d", m->
rtr);
108 MSG(
" len:%d", m->
len);
109 for (i = 0 ; i < m->
len ; i++)
110 MSG(
" %02x", m->
data[i]);
#define UNS8
Unsigned int8 representation in CANFest.
The CAN board configuration.