40 #ifndef __DRIVERLIB_CAN_H__
41 #define __DRIVERLIB_CAN_H__
77 #define MSG_OBJ_TX_INT_ENABLE 0x00000001
83 #define MSG_OBJ_RX_INT_ENABLE 0x00000002
89 #define MSG_OBJ_EXTENDED_ID 0x00000004
95 #define MSG_OBJ_USE_ID_FILTER 0x00000008
100 #define MSG_OBJ_NEW_DATA 0x00000080
106 #define MSG_OBJ_DATA_LOST 0x00000100
113 #define MSG_OBJ_USE_DIR_FILTER (0x00000010 | MSG_OBJ_USE_ID_FILTER)
120 #define MSG_OBJ_USE_EXT_FILTER (0x00000020 | MSG_OBJ_USE_ID_FILTER)
125 #define MSG_OBJ_REMOTE_FRAME 0x00000040
131 #define MSG_OBJ_FIFO 0x00000200
136 #define MSG_OBJ_NO_FLAGS 0x00000000
144 #define MSG_OBJ_STATUS_MASK (MSG_OBJ_NEW_DATA | MSG_OBJ_DATA_LOST)
279 #define CAN_INT_ERROR 0x00000008
285 #define CAN_INT_STATUS 0x00000004
292 #define CAN_INT_MASTER 0x00000002
338 #define CAN_STATUS_BUS_OFF 0x00000080
343 #define CAN_STATUS_EWARN 0x00000040
348 #define CAN_STATUS_EPASS 0x00000020
353 #define CAN_STATUS_RXOK 0x00000010
359 #define CAN_STATUS_TXOK 0x00000008
364 #define CAN_STATUS_LEC_MSK 0x00000007
369 #define CAN_STATUS_LEC_NONE 0x00000000
374 #define CAN_STATUS_LEC_STUFF 0x00000001
379 #define CAN_STATUS_LEC_FORM 0x00000002
384 #define CAN_STATUS_LEC_ACK 0x00000003
389 #define CAN_STATUS_LEC_BIT1 0x00000004
394 #define CAN_STATUS_LEC_BIT0 0x00000005
399 #define CAN_STATUS_LEC_CRC 0x00000006
404 #define CAN_STATUS_LEC_MASK 0x00000007
420 extern uint32_t
CANBitRateSet(uint32_t ui32Base, uint32_t ui32SourceClock,
421 uint32_t ui32BitRate);
423 extern void CANEnable(uint32_t ui32Base);
424 extern bool CANErrCntrGet(uint32_t ui32Base, uint32_t *pui32RxCount,
425 uint32_t *pui32TxCount);
426 extern void CANInit(uint32_t ui32Base);
427 extern void CANIntClear(uint32_t ui32Base, uint32_t ui32IntClr);
428 extern void CANIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags);
429 extern void CANIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags);
430 extern void CANIntRegister(uint32_t ui32Base,
void (*pfnHandler)(
void));
434 extern void CANMessageGet(uint32_t ui32Base, uint32_t ui32ObjID,
436 extern void CANMessageSet(uint32_t ui32Base, uint32_t ui32ObjID,
439 extern void CANRetrySet(uint32_t ui32Base,
bool bAutoRetry);
451 #endif // __DRIVERLIB_CAN_H__
void CANEnable(uint32_t ui32Base)
Definition: can.c:413
void CANIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: can.c:933
uint32_t ui32QuantumPrescaler
Definition: can.h:214
bool CANRetryGet(uint32_t ui32Base)
Definition: can.c:1182
void CANMessageGet(uint32_t ui32Base, uint32_t ui32ObjID, tCANMsgObject *psMsgObject, bool bClrPendingInt)
Definition: can.c:1827
void CANInit(uint32_t ui32Base)
Definition: can.c:314
void CANBitTimingGet(uint32_t ui32Base, tCANBitClkParms *psClkParms)
Definition: can.c:472
tCANIntStsReg
Definition: can.h:224
uint8_t * pui8MsgData
This is a pointer to the message object's data.
Definition: can.h:178
void CANIntUnregister(uint32_t ui32Base)
Definition: can.c:844
uint32_t ui32Flags
Definition: can.h:168
void CANBitTimingSet(uint32_t ui32Base, tCANBitClkParms *psClkParms)
Definition: can.c:702
uint32_t ui32MsgLen
This value is the number of bytes of data in the message object.
Definition: can.h:173
uint32_t ui32MsgIDMask
The message identifier mask used when identifier filtering is enabled.
Definition: can.h:162
Receive message object.
Definition: can.h:315
Transmit remote request message object.
Definition: can.h:310
void CANDisable(uint32_t ui32Base)
Definition: can.c:442
bool CANErrCntrGet(uint32_t ui32Base, uint32_t *pui32RxCount, uint32_t *pui32TxCount)
Definition: can.c:1353
uint32_t ui32SyncPropPhase1Seg
Definition: can.h:196
uint32_t CANStatusGet(uint32_t ui32Base, tCANStsReg eStatusReg)
Definition: can.c:1265
Transmit message object.
Definition: can.h:305
tCANStsReg
Definition: can.h:244
void CANMessageSet(uint32_t ui32Base, uint32_t ui32ObjID, tCANMsgObject *psMsgObject, tMsgObjType eMsgType)
Definition: can.c:1466
void CANIntRegister(uint32_t ui32Base, void(*pfnHandler)(void))
Definition: can.c:802
uint32_t ui32MsgID
The CAN message identifier used for 11 or 29 bit identifiers.
Definition: can.h:157
uint32_t CANBitRateSet(uint32_t ui32Base, uint32_t ui32SourceClock, uint32_t ui32BitRate)
Definition: can.c:543
void CANIntClear(uint32_t ui32Base, uint32_t ui32IntClr)
Definition: can.c:1073
Read the full CAN controller status.
Definition: can.h:249
void CANRetrySet(uint32_t ui32Base, bool bAutoRetry)
Definition: can.c:1133
Read the CAN interrupt status information.
Definition: can.h:229
Read the full 32-bit mask of message objects that are enabled.
Definition: can.h:265
uint32_t ui32SJW
Definition: can.h:208
Read a message object's interrupt status.
Definition: can.h:234
uint32_t CANIntStatus(uint32_t ui32Base, tCANIntStsReg eIntStsReg)
Definition: can.c:984
Read the full 32-bit mask of message objects with new data available.
Definition: can.h:260
Receive remote request message object.
Definition: can.h:320
tMsgObjType
Definition: can.h:300
Remote frame receive remote, with auto-transmit message object.
Definition: can.h:325
void CANIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: can.c:901
void CANMessageClear(uint32_t ui32Base, uint32_t ui32ObjID)
Definition: can.c:2072
uint32_t ui32Phase2Seg
Definition: can.h:202