40 #ifndef __DRIVERLIB_CAN_H__
41 #define __DRIVERLIB_CAN_H__
77 #define MSG_OBJ_TX_INT_ENABLE 0x00000001
82 #define MSG_OBJ_RX_INT_ENABLE 0x00000002
87 #define MSG_OBJ_EXTENDED_ID 0x00000004
93 #define MSG_OBJ_USE_ID_FILTER 0x00000008
98 #define MSG_OBJ_NEW_DATA 0x00000080
104 #define MSG_OBJ_DATA_LOST 0x00000100
111 #define MSG_OBJ_USE_DIR_FILTER (0x00000010 | MSG_OBJ_USE_ID_FILTER)
118 #define MSG_OBJ_USE_EXT_FILTER (0x00000020 | MSG_OBJ_USE_ID_FILTER)
123 #define MSG_OBJ_REMOTE_FRAME 0x00000040
129 #define MSG_OBJ_FIFO 0x00000200
134 #define MSG_OBJ_NO_FLAGS 0x00000000
142 #define MSG_OBJ_STATUS_MASK (MSG_OBJ_NEW_DATA | MSG_OBJ_DATA_LOST)
277 #define CAN_INT_ERROR 0x00000008
283 #define CAN_INT_STATUS 0x00000004
290 #define CAN_INT_MASTER 0x00000002
336 #define CAN_STATUS_BUS_OFF 0x00000080
341 #define CAN_STATUS_EWARN 0x00000040
346 #define CAN_STATUS_EPASS 0x00000020
351 #define CAN_STATUS_RXOK 0x00000010
357 #define CAN_STATUS_TXOK 0x00000008
362 #define CAN_STATUS_LEC_MSK 0x00000007
367 #define CAN_STATUS_LEC_NONE 0x00000000
372 #define CAN_STATUS_LEC_STUFF 0x00000001
377 #define CAN_STATUS_LEC_FORM 0x00000002
382 #define CAN_STATUS_LEC_ACK 0x00000003
387 #define CAN_STATUS_LEC_BIT1 0x00000004
392 #define CAN_STATUS_LEC_BIT0 0x00000005
397 #define CAN_STATUS_LEC_CRC 0x00000006
402 #define CAN_STATUS_LEC_MASK 0x00000007
418 extern uint32_t
CANBitRateSet(uint32_t ui32Base, uint32_t ui32SourceClock,
419 uint32_t ui32BitRate);
421 extern void CANEnable(uint32_t ui32Base);
422 extern bool CANErrCntrGet(uint32_t ui32Base, uint32_t *pui32RxCount,
423 uint32_t *pui32TxCount);
424 extern void CANInit(uint32_t ui32Base);
425 extern void CANIntClear(uint32_t ui32Base, uint32_t ui32IntClr);
426 extern void CANIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags);
427 extern void CANIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags);
428 extern void CANIntRegister(uint32_t ui32Base,
void (*pfnHandler)(
void));
432 extern void CANMessageGet(uint32_t ui32Base, uint32_t ui32ObjID,
434 extern void CANMessageSet(uint32_t ui32Base, uint32_t ui32ObjID,
437 extern void CANRetrySet(uint32_t ui32Base,
bool bAutoRetry);
449 #endif // __DRIVERLIB_CAN_H__
void CANEnable(uint32_t ui32Base)
void CANIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags)
bool CANRetryGet(uint32_t ui32Base)
uint32_t ui32MsgLen
This value is the number of bytes of data in the message object.
void CANMessageGet(uint32_t ui32Base, uint32_t ui32ObjID, tCANMsgObject *psMsgObject, bool bClrPendingInt)
uint32_t ui32MsgID
The CAN message identifier used for 11 or 29 bit identifiers.
uint32_t ui32SyncPropPhase1Seg
void CANInit(uint32_t ui32Base)
uint8_t * pui8MsgData
This is a pointer to the message object's data.
void CANBitTimingGet(uint32_t ui32Base, tCANBitClkParms *psClkParms)
void CANIntUnregister(uint32_t ui32Base)
uint32_t ui32QuantumPrescaler
void CANBitTimingSet(uint32_t ui32Base, tCANBitClkParms *psClkParms)
uint32_t ui32MsgIDMask
The message identifier mask used when identifier filtering is enabled.
Transmit remote request message object.
void CANDisable(uint32_t ui32Base)
bool CANErrCntrGet(uint32_t ui32Base, uint32_t *pui32RxCount, uint32_t *pui32TxCount)
uint32_t CANStatusGet(uint32_t ui32Base, tCANStsReg eStatusReg)
void CANMessageSet(uint32_t ui32Base, uint32_t ui32ObjID, tCANMsgObject *psMsgObject, tMsgObjType eMsgType)
void CANIntRegister(uint32_t ui32Base, void(*pfnHandler)(void))
uint32_t CANBitRateSet(uint32_t ui32Base, uint32_t ui32SourceClock, uint32_t ui32BitRate)
void CANIntClear(uint32_t ui32Base, uint32_t ui32IntClr)
Read the full CAN controller status.
void CANRetrySet(uint32_t ui32Base, bool bAutoRetry)
Read the CAN interrupt status information.
Read the full 32-bit mask of message objects that are enabled.
Read a message object's interrupt status.
uint32_t CANIntStatus(uint32_t ui32Base, tCANIntStsReg eIntStsReg)
Read the full 32-bit mask of message objects with new data available.
Receive remote request message object.
Remote frame receive remote, with auto-transmit message object.
void CANIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags)
void CANMessageClear(uint32_t ui32Base, uint32_t ui32ObjID)