38 #ifndef __DRIVERLIB_CAN_H__ 39 #define __DRIVERLIB_CAN_H__ 78 #define MSG_OBJ_TX_INT_ENABLE 0x00000001 83 #define MSG_OBJ_RX_INT_ENABLE 0x00000002 88 #define MSG_OBJ_EXTENDED_ID 0x00000004 94 #define MSG_OBJ_USE_ID_FILTER 0x00000008 99 #define MSG_OBJ_NEW_DATA 0x00000080 105 #define MSG_OBJ_DATA_LOST 0x00000100 112 #define MSG_OBJ_USE_DIR_FILTER (0x00000010 | MSG_OBJ_USE_ID_FILTER) 119 #define MSG_OBJ_USE_EXT_FILTER (0x00000020 | MSG_OBJ_USE_ID_FILTER) 124 #define MSG_OBJ_REMOTE_FRAME 0x00000040 130 #define MSG_OBJ_FIFO 0x00000200 135 #define MSG_OBJ_NO_FLAGS 0x00000000 143 #define MSG_OBJ_STATUS_MASK (MSG_OBJ_NEW_DATA | MSG_OBJ_DATA_LOST) 278 #define CAN_INT_ERROR 0x00000008 284 #define CAN_INT_STATUS 0x00000004 291 #define CAN_INT_MASTER 0x00000002 337 #define CAN_STATUS_BUS_OFF 0x00000080 342 #define CAN_STATUS_EWARN 0x00000040 347 #define CAN_STATUS_EPASS 0x00000020 352 #define CAN_STATUS_RXOK 0x00000010 358 #define CAN_STATUS_TXOK 0x00000008 363 #define CAN_STATUS_LEC_MSK 0x00000007 368 #define CAN_STATUS_LEC_NONE 0x00000000 373 #define CAN_STATUS_LEC_STUFF 0x00000001 378 #define CAN_STATUS_LEC_FORM 0x00000002 383 #define CAN_STATUS_LEC_ACK 0x00000003 388 #define CAN_STATUS_LEC_BIT1 0x00000004 393 #define CAN_STATUS_LEC_BIT0 0x00000005 398 #define CAN_STATUS_LEC_CRC 0x00000006 403 #define CAN_STATUS_LEC_MASK 0x00000007 419 extern uint32_t
CANBitRateSet(uint32_t ui32Base, uint32_t ui32SourceClock,
420 uint32_t ui32BitRate);
422 extern void CANEnable(uint32_t ui32Base);
423 extern bool CANErrCntrGet(uint32_t ui32Base, uint32_t *pui32RxCount,
424 uint32_t *pui32TxCount);
425 extern void CANInit(uint32_t ui32Base);
426 extern void CANIntClear(uint32_t ui32Base, uint32_t ui32IntClr);
427 extern void CANIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags);
428 extern void CANIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags);
429 extern void CANIntRegister(uint32_t ui32Base,
void (*pfnHandler)(
void));
430 extern uint32_t
CANIntStatus(uint32_t ui32Base, tCANIntStsReg eIntStsReg);
433 extern void CANMessageGet(uint32_t ui32Base, uint32_t ui32ObjID,
435 extern void CANMessageSet(uint32_t ui32Base, uint32_t ui32ObjID,
438 extern void CANRetrySet(uint32_t ui32Base,
bool bAutoRetry);
439 extern uint32_t
CANStatusGet(uint32_t ui32Base, tCANStsReg eStatusReg);
450 #endif // __DRIVERLIB_CAN_H__
void CANEnable(uint32_t ui32Base)
Definition: can.c:407
uint32_t ui32Phase2Seg
Definition: can.h:201
void CANIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: can.c:924
bool CANRetryGet(uint32_t ui32Base)
Definition: can.c:1173
uint32_t ui32MsgLen
This value is the number of bytes of data in the message object.
Definition: can.h:172
void CANMessageGet(uint32_t ui32Base, uint32_t ui32ObjID, tCANMsgObject *psMsgObject, bool bClrPendingInt)
Definition: can.c:1818
uint32_t ui32MsgID
The CAN message identifier used for 11 or 29 bit identifiers.
Definition: can.h:156
uint32_t ui32SyncPropPhase1Seg
Definition: can.h:195
void CANInit(uint32_t ui32Base)
Definition: can.c:308
uint8_t * pui8MsgData
This is a pointer to the message object's data.
Definition: can.h:177
void CANBitTimingGet(uint32_t ui32Base, tCANBitClkParms *psClkParms)
Definition: can.c:466
tCANIntStsReg
Definition: can.h:223
void CANIntUnregister(uint32_t ui32Base)
Definition: can.c:835
uint32_t ui32QuantumPrescaler
Definition: can.h:213
void CANBitTimingSet(uint32_t ui32Base, tCANBitClkParms *psClkParms)
Definition: can.c:693
uint32_t ui32MsgIDMask
The message identifier mask used when identifier filtering is enabled.
Definition: can.h:161
Receive message object.
Definition: can.h:314
uint32_t ui32SJW
Definition: can.h:207
Transmit remote request message object.
Definition: can.h:309
void CANDisable(uint32_t ui32Base)
Definition: can.c:436
bool CANErrCntrGet(uint32_t ui32Base, uint32_t *pui32RxCount, uint32_t *pui32TxCount)
Definition: can.c:1344
uint32_t CANStatusGet(uint32_t ui32Base, tCANStsReg eStatusReg)
Definition: can.c:1256
Transmit message object.
Definition: can.h:304
tCANStsReg
Definition: can.h:243
void CANMessageSet(uint32_t ui32Base, uint32_t ui32ObjID, tCANMsgObject *psMsgObject, tMsgObjType eMsgType)
Definition: can.c:1457
void CANIntRegister(uint32_t ui32Base, void(*pfnHandler)(void))
Definition: can.c:793
uint32_t ui32Flags
Definition: can.h:167
uint32_t CANBitRateSet(uint32_t ui32Base, uint32_t ui32SourceClock, uint32_t ui32BitRate)
Definition: can.c:534
void CANIntClear(uint32_t ui32Base, uint32_t ui32IntClr)
Definition: can.c:1064
Read the full CAN controller status.
Definition: can.h:248
void CANRetrySet(uint32_t ui32Base, bool bAutoRetry)
Definition: can.c:1124
Read the CAN interrupt status information.
Definition: can.h:228
Read the full 32-bit mask of message objects that are enabled.
Definition: can.h:264
Read a message object's interrupt status.
Definition: can.h:233
uint32_t CANIntStatus(uint32_t ui32Base, tCANIntStsReg eIntStsReg)
Definition: can.c:975
Read the full 32-bit mask of message objects with new data available.
Definition: can.h:259
Receive remote request message object.
Definition: can.h:319
tMsgObjType
Definition: can.h:299
Remote frame receive remote, with auto-transmit message object.
Definition: can.h:324
void CANIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: can.c:892
void CANMessageClear(uint32_t ui32Base, uint32_t ui32ObjID)
Definition: can.c:2063