Functions | |
int32_t | CANFD_lld_init (CANFDLLD_Handle hCanfd) |
int32_t | CANFD_lld_deInit (CANFDLLD_Handle handle) |
int32_t | CANFD_lld_configBitTime (CANFDLLD_Handle handle, const CANFDLLD_MCANBitTimingParams *bitTimeParams) |
int32_t | CANFD_lld_createMsgObject (CANFDLLD_Handle handle, CANFDLLD_MessageObject *ptrCanMsgObj) |
int32_t | CANFD_lld_createRxRangeMsgObject (CANFDLLD_Handle handle, CANFDLLD_MessageObject *ptrCanMsgObj) |
int32_t | CANFD_lld_deleteMsgObject (CANFDLLD_MsgObjHandle handle) |
int32_t | CANFD_lld_write (CANFDLLD_MsgObjHandle handle, uint32_t id, CANFDLLD_MCANFrameType frameType, uint32_t dataLength, const uint8_t *data) |
int32_t | CANFD_lld_writeCancel (CANFDLLD_MsgObjHandle handle) |
int32_t | CANFD_lld_writeDma (CANFDLLD_MsgObjHandle handle, uint32_t id, CANFDLLD_MCANFrameType frameType, uint32_t dataLengthPerMsg, uint32_t numMsgs, void *data) |
int32_t | CANFD_lld_writeDmaTriggerNext (CANFDLLD_MsgObjHandle handle) |
uint32_t | CANFD_lld_getFilterEventConfig (uint32_t eventNum) |
int32_t | CANFD_lld_read (CANFDLLD_MsgObjHandle handle, uint32_t *id, CANFDLLD_MCANFrameType *ptrFrameType, CANFDLLD_MCANXidType *idType, uint32_t *ptrDataLength, uint8_t *data) |
int32_t | CANFD_lld_readDmaConfig (CANFDLLD_MsgObjHandle handle, void *data, uint32_t numDmaRxBuf) |
int32_t | CANFD_lld_getOptions (CANFDLLD_Handle handle, CANFDLLD_OptionTLV *ptrOptInfo) |
int32_t | CANFD_lld_setOptions (CANFDLLD_Handle handle, const CANFDLLD_OptionTLV *ptrOptInfo) |
void | CANFD_lld_int0Isr (CANFDLLD_Object *ptrCanFdObj) |
void | CANFD_lld_int1Isr (CANFDLLD_Object *ptrCanFdObj) |
ATTRIBUTE_WEAK void | CANFD_lld_dataAppCallBack (CANFDLLD_MsgObjHandle handle, CANFDLLD_Reason reason) |
Application specified callback function which is invoked by the CANFD driver once transmit is complete or data has been received for the specified message object. More... | |
ATTRIBUTE_WEAK void | CANFD_lld_errStatusAppCallBack (CANFDLLD_Handle handle, CANFDLLD_Reason reason, CANFDLLD_ErrStatusResp *errStatusResp) |
Application specified callback function which is invoked by the CANFD driver on error or status change. More... | |
int32_t | CANFD_lld_dmaOpen (CANFDLLD_Handle canfdHandle, CANFDLLD_DmaChConfig dmaChCfg) |
API to open an CANFD DMA channel. More... | |
int32_t | CANFD_lld_dmaClose (CANFDLLD_Handle canfdHandle) |
API to close an CANFD DMA channel. More... | |
int32_t | CANFD_lld_createDmaTxMsgObject (CANFDLLD_Object *ptrCanFdObj, CANFDLLD_MessageObject *ptrCanMsgObj) |
API to configure dma for the Tx message object. Called from the API CANFD_lld_createMsgObject. More... | |
int32_t | CANFD_lld_deleteDmaTxMsgObject (CANFDLLD_Object *ptrCanFdObj, CANFDLLD_MessageObject *ptrCanMsgObj) |
API to delete dma configuration for the Tx message object. Called from the API CANFD_lld_deleteMsgObject. More... | |
int32_t | CANFD_lld_configureDmaTx (CANFDLLD_Object *ptrCanFdObj, CANFDLLD_MessageObject *ptrCanMsgObj, uint32_t dataLengthPerMsg, uint32_t numMsgs, const void *data) |
API to enable dma event transfer for the Tx. Called from the API CANFD_lld_writeDma. More... | |
int32_t | CANFD_lld_cancelDmaTx (CANFDLLD_Object *ptrCanFdObj, CANFDLLD_MessageObject *ptrCanMsgObj) |
API to disbale dma event transfer for the Tx to cancel the transfer. More... | |
ATTRIBUTE_WEAK void | CANFD_dmaTxCompletionCallback (CANFDLLD_MessageObject *ptrCanMsgObj, void *data, uint32_t completionType) |
Callback function for the Tx completion. This is called for each message in the array of msgs provided in CANFD_lld_configureDmaTx. data will point to the current transmitted message. For intermediate message transfer completion the completionType will be set to CANFD_DMA_TX_COMPLETION_INTERMEDIATE for last message transfer completion the completionType will be set to CANFD_DMA_TX_COMPLETION_FINAL. More... | |
int32_t | CANFD_lld_createDmaRxMsgObject (CANFDLLD_Object *ptrCanFdObj, CANFDLLD_MessageObject *ptrCanMsgObj) |
API to configure dma for the Rx message object. Called from the CANFD_lld_createMsgObject. More... | |
int32_t | CANFD_lld_deleteDmaRxMsgObject (CANFDLLD_Object *ptrCanFdObj, CANFDLLD_MessageObject *ptrCanMsgObj) |
API to delete dma configuration for the Rx message object. Called from the CANFD_lld_deleteMsgObject. More... | |
int32_t | CANFD_lld_configureDmaRx (CANFDLLD_Object *ptrCanFdObj, CANFDLLD_MessageObject *ptrCanMsgObj, uint32_t dataLengthPerMsg, uint32_t numMsgs, const void *data) |
API to enable dma event transfer for the Rx. Called from the API CANFD_lld_readDma. More... | |
ATTRIBUTE_WEAK void | CANFD_dmaRxCompletionCallback (CANFDLLD_MessageObject *ptrCanMsgObj, void *data, uint32_t completionType) |
Callback function for the Rx completion. This is called for each message in the array of msgs provided in CANFD_lld_configureDmaRx. data will point to the current received message. For intermediate message transfer completion the completionType will be set to CANFD_DMA_RX_COMPLETION_INTERMEDIATE for last message transfer completion the completionType will be set to CANFD_DMA_RX_COMPLETION_FINAL. More... | |
int32_t CANFD_lld_init | ( | CANFDLLD_Handle | hCanfd | ) |
Description
Function initializes the CANFD driver with the specified hardware attributes. It resets and configures the MCAN module, sets up the Message RAM and ECC Aggregator. It configures the CANFD driver with the control parameters.
hCanfd | CANFD handle of type CANFDLLD_Handle |
int32_t CANFD_lld_deInit | ( | CANFDLLD_Handle | handle | ) |
Description
Function closes the CANFD driver instance and cleanups all the memory allocated by the CANFD driver.
handle | Handle to the CANFD Driver |
int32_t CANFD_lld_configBitTime | ( | CANFDLLD_Handle | handle, |
const CANFDLLD_MCANBitTimingParams * | bitTimeParams | ||
) |
Description
Function configures the bit time parameters for the CANFD module.
handle | Handle to the CANFD Driver |
bitTimeParams | Bit time configuration parameters |
int32_t CANFD_lld_createMsgObject | ( | CANFDLLD_Handle | handle, |
CANFDLLD_MessageObject * | ptrCanMsgObj | ||
) |
Description
Function configures the receive or transmit message object. It also enables Tx completion and Tx cancelation interrupts . The callback function will be invoked on data transmit complete for transmit message objects OR upon receiving data for receive message objects. The application MUST then call CANFD_lld_read() API to process the received data.
handle | Handle to the CANFD Driver |
ptrCanMsgObj | Message Object configuration parameters |
int32_t CANFD_lld_createRxRangeMsgObject | ( | CANFDLLD_Handle | handle, |
CANFDLLD_MessageObject * | ptrCanMsgObj | ||
) |
Description
Function configures a receive message objects for a range of message identifiers. It also enables Rx interrupts. The callback function will be invoked upon receiving data for receive message objects. The application MUST then call CANFD_lld_read() API to process the received data.
handle | Handle to the CANFD Driver |
ptrCanMsgObj | Message Object configuration parameters |
int32_t CANFD_lld_deleteMsgObject | ( | CANFDLLD_MsgObjHandle | handle | ) |
Description
Function deletes a message object.
handle | Handle to the message object |
int32_t CANFD_lld_write | ( | CANFDLLD_MsgObjHandle | handle, |
uint32_t | id, | ||
CANFDLLD_MCANFrameType | frameType, | ||
uint32_t | dataLength, | ||
const uint8_t * | data | ||
) |
Description
Function used by the application to transmit data.
handle | Handle to the message object |
id | Message Identifier |
frameType | Frame type - Classic or FD |
dataLength | Data Length to be transmitted. Valid values: 1 to 64 bytes. |
data | Data to be transmitted |
int32_t CANFD_lld_writeCancel | ( | CANFDLLD_MsgObjHandle | handle | ) |
Description
Function used by the application to cancel a pending data transmit.
handle | Handle to the message object |
int32_t CANFD_lld_writeDma | ( | CANFDLLD_MsgObjHandle | handle, |
uint32_t | id, | ||
CANFDLLD_MCANFrameType | frameType, | ||
uint32_t | dataLengthPerMsg, | ||
uint32_t | numMsgs, | ||
void * | data | ||
) |
Description
Function used by the application to initiate transmit data in dma mode. DMA mode is recommended to be used when multiple msgs needs to be transmitted. This will transmit first msg and configure the dma to copy subsequent msgs in message ram. Once first msg transfer is completed the CANFD_dmaTxCompletionCallback function is called. Application needs to call the API CANFD_lld_writeDmaTriggerNext to trigger transmission of subsequent msgs.
handle | Handle to the message object |
id | Message Identifier |
frameType | Frame type - Classic or FD |
dataLengthPerMsg | Data Length to be transmitted per msg. Valid values: 1 to 64 bytes. |
numMsgs | Number of msgs to be transmitted |
data | Data to be transmitted. This should be a 2d array of uint8[numMsgs][dataLengthPerMsg] |
int32_t CANFD_lld_writeDmaTriggerNext | ( | CANFDLLD_MsgObjHandle | handle | ) |
Description
Function used by the application to strat transmission of next msg in dma mode. Transfer should be initiated using the API CANFD_lld_writeDma before calling this function. This should be called after the previous transfer is completed and CANFD_dmaTxCompletionCallback is called.
handle | Handle to the message object |
uint32_t CANFD_lld_getFilterEventConfig | ( | uint32_t | eventNum | ) |
Description
Function used by the application to get the filter element number.
eventNum | DMA event number |
int32_t CANFD_lld_read | ( | CANFDLLD_MsgObjHandle | handle, |
uint32_t * | id, | ||
CANFDLLD_MCANFrameType * | ptrFrameType, | ||
CANFDLLD_MCANXidType * | idType, | ||
uint32_t * | ptrDataLength, | ||
uint8_t * | data | ||
) |
Description
Function is used by the application to get the CAN message from message RAM using a receive message object. NOTE: This API must ONLY be called from the callback context.
handle | Handle to the message object |
id | Message Identifier |
ptrFrameType | Frame type - Classic or FD |
idType | Meassage Id type - 11 bit standard or 29 bit extended |
ptrDataLength | Data Length of the received frame. Valid values: 1 to 64 bytes. |
data | Received data. |
int32_t CANFD_lld_readDmaConfig | ( | CANFDLLD_MsgObjHandle | handle, |
void * | data, | ||
uint32_t | numDmaRxBuf | ||
) |
Description
Function is used by the application to configure reading the received msgs from message ram. This API will configure the DMA to copy msg from MCAN message ram to application buffer. For every message received the CANFD_dmaRxCompletionCallback will be called by driver by pointing to the latest msg in the data buffer.
handle | Handle to the message object |
data | Array of CANFDLLD_DmaRxBuf to receive the data from message ram. This should be an array of type CANFDLLD_DmaRxBuf and length numDmaRxBuf |
numDmaRxBuf | Number of dma buffers to read. |
int32_t CANFD_lld_getOptions | ( | CANFDLLD_Handle | handle, |
CANFDLLD_OptionTLV * | ptrOptInfo | ||
) |
Description
Function is used by the application to get the error and status information from the driver.
handle | Handle to the CANFD Driver |
ptrOptInfo | Option info in TLV format which is populated with the requested information |
int32_t CANFD_lld_setOptions | ( | CANFDLLD_Handle | handle, |
const CANFDLLD_OptionTLV * | ptrOptInfo | ||
) |
Description
Function is used by the application to configure the driver options.
handle | Handle to the CANFD Driver |
ptrOptInfo | Option info in TLV format which is used to configure the driver |
void CANFD_lld_int0Isr | ( | CANFDLLD_Object * | ptrCanFdObj | ) |
Description
The function is the registered interrupt 0 ISR for the CANFD Driver.
ptrCanFdObj | Handle to the CANFD Driver |
void CANFD_lld_int1Isr | ( | CANFDLLD_Object * | ptrCanFdObj | ) |
Description
The function is the registered interrupt 1 ISR for the CANFD Driver.
ptrCanFdObj | Handle to the CANFD Driver |
ATTRIBUTE_WEAK void CANFD_lld_dataAppCallBack | ( | CANFDLLD_MsgObjHandle | handle, |
CANFDLLD_Reason | reason | ||
) |
Application specified callback function which is invoked by the CANFD driver once transmit is complete or data has been received for the specified message object.
handle | Message object handle for which the callback function is invoked. |
reason | Cause of the interrupt which prompted the callback. |
ATTRIBUTE_WEAK void CANFD_lld_errStatusAppCallBack | ( | CANFDLLD_Handle | handle, |
CANFDLLD_Reason | reason, | ||
CANFDLLD_ErrStatusResp * | errStatusResp | ||
) |
Application specified callback function which is invoked by the CANFD driver on error or status change.
handle | Handle to the CANFD Driver |
reason | Cause of the interrupt which prompted the callback. |
errStatusResp | Response structure populated with the value of the fields that caused the error or status interrupt. Processing of this structure is dependent on the callback reason. |
int32_t CANFD_lld_dmaOpen | ( | CANFDLLD_Handle | canfdHandle, |
CANFDLLD_DmaChConfig | dmaChCfg | ||
) |
API to open an CANFD DMA channel.
This API will open a DMA Channel using the appropriate DMA driver callbacks and the registered via Sysconfig
canfdHandle | CANFD Handle |
dmaChCfg | CANFD Channel config |
int32_t CANFD_lld_dmaClose | ( | CANFDLLD_Handle | canfdHandle | ) |
API to close an CANFD DMA channel.
canfdHandle | CANFD handle returned from CANFD_lld_init |
int32_t CANFD_lld_createDmaTxMsgObject | ( | CANFDLLD_Object * | ptrCanFdObj, |
CANFDLLD_MessageObject * | ptrCanMsgObj | ||
) |
API to configure dma for the Tx message object. Called from the API CANFD_lld_createMsgObject.
ptrCanFdObj | pointer to the CANFD driver object |
ptrCanMsgObj | pointer to the CANFD message object |
int32_t CANFD_lld_deleteDmaTxMsgObject | ( | CANFDLLD_Object * | ptrCanFdObj, |
CANFDLLD_MessageObject * | ptrCanMsgObj | ||
) |
API to delete dma configuration for the Tx message object. Called from the API CANFD_lld_deleteMsgObject.
ptrCanFdObj | pointer to the CANFD driver object |
ptrCanMsgObj | pointer to the CANFD message object |
int32_t CANFD_lld_configureDmaTx | ( | CANFDLLD_Object * | ptrCanFdObj, |
CANFDLLD_MessageObject * | ptrCanMsgObj, | ||
uint32_t | dataLengthPerMsg, | ||
uint32_t | numMsgs, | ||
const void * | data | ||
) |
API to enable dma event transfer for the Tx. Called from the API CANFD_lld_writeDma.
ptrCanFdObj | pointer to the CANFD driver object |
ptrCanMsgObj | pointer to the CANFD message object |
dataLengthPerMsg | data length in bytes for each message |
numMsgs | Number f messages to transmit |
data | pointer to the data buffer to transmit |
int32_t CANFD_lld_cancelDmaTx | ( | CANFDLLD_Object * | ptrCanFdObj, |
CANFDLLD_MessageObject * | ptrCanMsgObj | ||
) |
API to disbale dma event transfer for the Tx to cancel the transfer.
ptrCanFdObj | pointer to the CANFD driver object |
ptrCanMsgObj | pointer to the CANFD message object |
ATTRIBUTE_WEAK void CANFD_dmaTxCompletionCallback | ( | CANFDLLD_MessageObject * | ptrCanMsgObj, |
void * | data, | ||
uint32_t | completionType | ||
) |
Callback function for the Tx completion. This is called for each message in the array of msgs provided in CANFD_lld_configureDmaTx. data will point to the current transmitted message. For intermediate message transfer completion the completionType will be set to CANFD_DMA_TX_COMPLETION_INTERMEDIATE for last message transfer completion the completionType will be set to CANFD_DMA_TX_COMPLETION_FINAL.
ptrCanMsgObj | pointer to the CANFD message object |
data | pointer to current completed message |
completionType | specifie completion type for the callback |
int32_t CANFD_lld_createDmaRxMsgObject | ( | CANFDLLD_Object * | ptrCanFdObj, |
CANFDLLD_MessageObject * | ptrCanMsgObj | ||
) |
API to configure dma for the Rx message object. Called from the CANFD_lld_createMsgObject.
ptrCanFdObj | pointer to the CANFD driver object |
ptrCanMsgObj | pointer to the CANFD message object |
int32_t CANFD_lld_deleteDmaRxMsgObject | ( | CANFDLLD_Object * | ptrCanFdObj, |
CANFDLLD_MessageObject * | ptrCanMsgObj | ||
) |
API to delete dma configuration for the Rx message object. Called from the CANFD_lld_deleteMsgObject.
ptrCanFdObj | pointer to the CANFD driver object |
ptrCanMsgObj | pointer to the CANFD message object |
int32_t CANFD_lld_configureDmaRx | ( | CANFDLLD_Object * | ptrCanFdObj, |
CANFDLLD_MessageObject * | ptrCanMsgObj, | ||
uint32_t | dataLengthPerMsg, | ||
uint32_t | numMsgs, | ||
const void * | data | ||
) |
API to enable dma event transfer for the Rx. Called from the API CANFD_lld_readDma.
ptrCanFdObj | pointer to the CANFD driver object |
ptrCanMsgObj | pointer to the CANFD message object |
dataLengthPerMsg | data length in bytes for each message |
numMsgs | Number of messages to transmit |
data | pointer to the data buffer to transmit |
ATTRIBUTE_WEAK void CANFD_dmaRxCompletionCallback | ( | CANFDLLD_MessageObject * | ptrCanMsgObj, |
void * | data, | ||
uint32_t | completionType | ||
) |
Callback function for the Rx completion. This is called for each message in the array of msgs provided in CANFD_lld_configureDmaRx. data will point to the current received message. For intermediate message transfer completion the completionType will be set to CANFD_DMA_RX_COMPLETION_INTERMEDIATE for last message transfer completion the completionType will be set to CANFD_DMA_RX_COMPLETION_FINAL.
ptrCanMsgObj | pointer to the CANFD message object |
data | pointer to current recieved message |
completionType | specifie completion type for the callback |