xWRL6432 MMWAVE-L-SDK  05.04.00.01
CANFD Driver

The CANFD driver provides functionality of transferring data between CANFD peripherals. This driver does not interpret any of the data sent to or received from using this peripheral.

Initializing the driver

The CANFD Driver needs to be initialized once across the System. This is done using the CANFD_lld_init. None of the CANFD API's can be used without invoking this API.

Once the CANFD Driver has been initialized; the bit timing can be configured using CANFD_lld_configBitTime. This APIs can be called multiple times to reconfigure bit timings.

Creating the message objects

Message objects are used to transmit or receive data over the CANFD peripheral. A message object is created using CANFD_lld_createMsgObject.

Sending and receiving data

Data is transmitted using the CANFD_lld_write. The application will be notified when the transmit is complete if it has enabled dataInterruptEnable and registered a callback function appDataCallBack when initializing the CANFD driver.

If the receive interrupts are enabled using dataInterruptEnable field and a callback function appCallBack has been registered when initializing the CANFD driver, the driver notifies the application when the data has arrived. The application needs to call the CANFD_lld_read function to read the received data.

Error and status handling

The application can monitor the ECC error, Bus off error and Protocol Errors by enabling the error interrupts errInterruptEnable. The driver will call the registered callback function appErrCallBack to indicate which error fields caused the interrupt. It is up to the application to take appropriate action.

Get/Set Options

Helper APIs to get and set various statistics, error counters, ECC diagnostics, power down have been provided. Refer to CANFDLLD_Option for more information.

Limitation

The CANFD driver does not support the DMA or power down.