In order to be able to use the FlexCAN in your application, the first thing to do is initializing it with the desired configuration. This is done by calling the FLEXCAN_DRV_Init function. One of the arguments passed to this function is the configuration which will be used for the FlexCAN module, specified by the flexcan_user_config_t structure.
The flexcan_user_config_t structure allows you to configure the following:
The bitrate is represented by a flexcan_time_segment_t structure, with the following fields:
Details about these fields can be found in the reference manual.
In order to use a mailbox for transmission/reception, it should be initialized using either FLEXCAN_DRV_ConfigRxMb, FLEXCAN_DRV_ConfigRxFifo or FLEXCAN_DRV_ConfigTxMb.
After having the mailbox configured, you can start sending/receiving data using the specified mailbox, by calling one of the following functions:
A default FlexCAN configuration can be accesed by calling the FLEXCAN_DRV_GetDefaultConfig function. This function takes as argument a flexcan_user_config_t structure and fills it according to the following settings:
The Rx FIFO is receive-only and 6-message deep. The user can read the received messages sequentially, in the order they were received, by repeatedly reading Message Buffer 0 (zero). The Rx FIFO ID filter table (configurable from 8 to 128 table elements) specifies filtering criteria for accepting frames into the FIFO. This table is represented through a structure of flexcan_id_table_t type, which specifies if specifies if Remote Frames are accepted into the FIFO if they match the target ID, whether extended or standard frames are accepted into the FIFO if they match the target ID and the target ID.
The number of elements in the ID filter table is defined by the following formula:
Each element in the ID filter table specifies an ID to be used as acceptance criteria for the FIFO, as follows:
When Rx FIFO feature is enabled, buffer 0 (zero) cannot be used for transmission.
Data Structures | |
struct | flexcan_msgbuff_t |
FlexCAN message buffer structure Implements : flexcan_msgbuff_t_Class. More... | |
struct | flexcan_mb_handle_t |
Information needed for internal handling of a given MB. Implements : flexcan_mb_handle_t_Class. More... | |
struct | FlexCANState |
Internal driver state information. More... | |
struct | flexcan_data_info_t |
FlexCAN data info from user Implements : flexcan_data_info_t_Class. More... | |
struct | flexcan_id_table_t |
FlexCAN Rx FIFO ID filter table structure Implements : flexcan_id_table_t_Class. More... | |
struct | flexcan_time_segment_t |
FlexCAN bitrate related structures Implements : flexcan_time_segment_t_Class. More... | |
struct | flexcan_user_config_t |
FlexCAN configuration. More... | |
struct | flexcan_pn_id_filter_t |
Pretended Networking ID filter. More... | |
struct | flexcan_pn_payload_filter_t |
Pretended Networking payload filter. More... | |
struct | flexcan_pn_config_t |
Pretended Networking configuration structure Implements : flexcan_pn_config_t_Class. More... | |
Typedefs | |
typedef struct FlexCANState | flexcan_state_t |
Internal driver state information. More... | |
typedef void(* | flexcan_callback_t) (uint8_t instance, flexcan_event_type_t eventType, uint32_t buffIdx, flexcan_state_t *flexcanState) |
FlexCAN Driver callback function type Implements : flexcan_callback_t_Class. More... | |
typedef void(* | flexcan_error_callback_t) (uint8_t instance, flexcan_event_type_t eventType, flexcan_state_t *flexcanState) |
FlexCAN Driver error callback function type Implements : flexcan_error_callback_t_Class. More... | |
Bit rate | |
void | FLEXCAN_DRV_SetBitrate (uint8_t instance, const flexcan_time_segment_t *bitrate) |
Sets the FlexCAN bit rate for standard frames or the arbitration phase of FD frames. More... | |
void | FLEXCAN_DRV_SetBitrateCbt (uint8_t instance, const flexcan_time_segment_t *bitrate) |
Sets the FlexCAN bit rate for the data phase of FD frames (BRS enabled). More... | |
void | FLEXCAN_DRV_GetBitrate (uint8_t instance, flexcan_time_segment_t *bitrate) |
Gets the FlexCAN bit rate for standard frames or the arbitration phase of FD frames. More... | |
void | FLEXCAN_DRV_GetBitrateFD (uint8_t instance, flexcan_time_segment_t *bitrate) |
Gets the FlexCAN bit rate for the data phase of FD frames (BRS enabled). More... | |
Rx MB and Rx FIFO masks | |
void | FLEXCAN_DRV_SetRxMaskType (uint8_t instance, flexcan_rx_mask_type_t type) |
Sets the Rx masking type. More... | |
void | FLEXCAN_DRV_SetRxFifoGlobalMask (uint8_t instance, flexcan_msgbuff_id_type_t id_type, uint32_t mask) |
Sets the FlexCAN Rx FIFO global mask (standard or extended). More... | |
void | FLEXCAN_DRV_SetRxMbGlobalMask (uint8_t instance, flexcan_msgbuff_id_type_t id_type, uint32_t mask) |
Sets the FlexCAN Rx MB global mask (standard or extended). More... | |
void | FLEXCAN_DRV_SetRxMb14Mask (uint8_t instance, flexcan_msgbuff_id_type_t id_type, uint32_t mask) |
Sets the FlexCAN Rx MB 14 mask (standard or extended). More... | |
void | FLEXCAN_DRV_SetRxMb15Mask (uint8_t instance, flexcan_msgbuff_id_type_t id_type, uint32_t mask) |
Sets the FlexCAN Rx MB 15 mask (standard or extended). More... | |
status_t | FLEXCAN_DRV_SetRxIndividualMask (uint8_t instance, flexcan_msgbuff_id_type_t id_type, uint8_t mb_idx, uint32_t mask) |
Sets the FlexCAN Rx individual mask (standard or extended). More... | |
Initialization and Shutdown | |
void | FLEXCAN_DRV_GetDefaultConfig (flexcan_user_config_t *config) |
Gets the default configuration structure. More... | |
status_t | FLEXCAN_DRV_Init (uint8_t instance, flexcan_state_t *state, const flexcan_user_config_t *data) |
Initializes the FlexCAN peripheral. More... | |
status_t | FLEXCAN_DRV_Deinit (uint8_t instance) |
Shuts down a FlexCAN instance. More... | |
void | FLEXCAN_DRV_SetTDCOffset (uint8_t instance, bool enable, uint8_t offset) |
Enables/Disables the Transceiver Delay Compensation feature and sets the Transceiver Delay Compensation Offset (offset value to be added to the measured transceiver's loop delay in order to define the position of the delayed comparison point when bit rate switching is active). More... | |
uint8_t | FLEXCAN_DRV_GetTDCValue (uint8_t instance) |
Gets the value of the Transceiver Delay Compensation. More... | |
bool | FLEXCAN_DRV_GetTDCFail (uint8_t instance) |
Gets the value of the TDC Fail flag. More... | |
void | FLEXCAN_DRV_ClearTDCFail (uint8_t instance) |
Clears the TDC Fail flag. More... | |
Send configuration | |
status_t | FLEXCAN_DRV_ConfigTxMb (uint8_t instance, uint8_t mb_idx, const flexcan_data_info_t *tx_info, uint32_t msg_id) |
FlexCAN transmit message buffer field configuration. More... | |
status_t | FLEXCAN_DRV_ConfigRemoteResponseMb (uint8_t instance, uint8_t mb_idx, const flexcan_data_info_t *tx_info, uint32_t msg_id, const uint8_t *mb_data) |
Configures a transmit message buffer for remote frame response. More... | |
status_t | FLEXCAN_DRV_SendBlocking (uint8_t instance, uint8_t mb_idx, const flexcan_data_info_t *tx_info, uint32_t msg_id, const uint8_t *mb_data, uint32_t timeout_ms) |
Sends a CAN frame using the specified message buffer, in a blocking manner. More... | |
status_t | FLEXCAN_DRV_Send (uint8_t instance, uint8_t mb_idx, const flexcan_data_info_t *tx_info, uint32_t msg_id, const uint8_t *mb_data) |
Sends a CAN frame using the specified message buffer. More... | |
Receive configuration | |
status_t | FLEXCAN_DRV_ConfigRxMb (uint8_t instance, uint8_t mb_idx, const flexcan_data_info_t *rx_info, uint32_t msg_id) |
FlexCAN receive message buffer field configuration. More... | |
void | FLEXCAN_DRV_ConfigRxFifo (uint8_t instance, flexcan_rx_fifo_id_element_format_t id_format, const flexcan_id_table_t *id_filter_table) |
FlexCAN Rx FIFO field configuration. More... | |
status_t | FLEXCAN_DRV_ReceiveBlocking (uint8_t instance, uint8_t mb_idx, flexcan_msgbuff_t *data, uint32_t timeout_ms) |
Receives a CAN frame using the specified message buffer, in a blocking manner. More... | |
status_t | FLEXCAN_DRV_Receive (uint8_t instance, uint8_t mb_idx, flexcan_msgbuff_t *data) |
Receives a CAN frame using the specified message buffer. More... | |
status_t | FLEXCAN_DRV_RxFifoBlocking (uint8_t instance, flexcan_msgbuff_t *data, uint32_t timeout_ms) |
Receives a CAN frame using the message FIFO, in a blocking manner. More... | |
status_t | FLEXCAN_DRV_RxFifo (uint8_t instance, flexcan_msgbuff_t *data) |
Receives a CAN frame using the message FIFO. More... | |
Transfer status | |
status_t | FLEXCAN_DRV_AbortTransfer (uint8_t instance, uint8_t mb_idx) |
Ends a non-blocking FlexCAN transfer early. More... | |
status_t | FLEXCAN_DRV_GetTransferStatus (uint8_t instance, uint8_t mb_idx) |
Returns whether the previous FlexCAN transfer has finished. More... | |
uint32_t | FLEXCAN_DRV_GetErrorStatus (uint8_t instance) |
Returns reported error conditions. More... | |
IRQ handler callback | |
void | FLEXCAN_DRV_InstallEventCallback (uint8_t instance, flexcan_callback_t callback, void *callbackParam) |
Installs a callback function for the IRQ handler. More... | |
void | FLEXCAN_DRV_InstallErrorCallback (uint8_t instance, flexcan_error_callback_t callback, void *callbackParam) |
Installs an error callback function for the IRQ handler and enables error interrupts. More... | |
Pretended Networking | |
void | FLEXCAN_DRV_ConfigPN (uint8_t instance, bool enable, const flexcan_pn_config_t *pnConfig) |
Configures Pretended Networking settings. More... | |
void | FLEXCAN_DRV_GetWMB (uint8_t instance, uint8_t wmbIndex, flexcan_msgbuff_t *wmb) |
Extracts one of the frames which triggered the wake up event. More... | |
typedef void(* flexcan_callback_t) (uint8_t instance, flexcan_event_type_t eventType, uint32_t buffIdx, flexcan_state_t *flexcanState) |
FlexCAN Driver callback function type Implements : flexcan_callback_t_Class.
Definition at line 331 of file flexcan_driver.h.
typedef void(* flexcan_error_callback_t) (uint8_t instance, flexcan_event_type_t eventType, flexcan_state_t *flexcanState) |
FlexCAN Driver error callback function type Implements : flexcan_error_callback_t_Class.
Definition at line 337 of file flexcan_driver.h.
typedef struct FlexCANState flexcan_state_t |
Internal driver state information.
enum flexcan_clk_source_t |
FlexCAN PE clock sources Implements : flexcan_clk_source_t_Class.
Enumerator | |
---|---|
FLEXCAN_CLK_SOURCE_OSC |
The CAN engine clock source is the oscillator clock. |
FLEXCAN_CLK_SOURCE_PERIPH |
The CAN engine clock source is the peripheral clock. |
Definition at line 87 of file flexcan_driver.h.
enum flexcan_event_type_t |
The type of the event which occurred when the callback was invoked. Implements : flexcan_event_type_t_Class.
Definition at line 52 of file flexcan_driver.h.
FlexCAN payload sizes Implements : flexcan_fd_payload_size_t_Class.
Definition at line 226 of file flexcan_driver.h.
enum flexcan_mb_state_t |
The state of a given MB (idle/Rx busy/Tx busy). Implements : flexcan_mb_state_t_Class.
Enumerator | |
---|---|
FLEXCAN_MB_IDLE |
The MB is not used by any transfer. |
FLEXCAN_MB_RX_BUSY |
The MB is used for a reception. |
FLEXCAN_MB_TX_BUSY |
The MB is used for a transmission. |
Definition at line 69 of file flexcan_driver.h.
FlexCAN Message Buffer ID type Implements : flexcan_msgbuff_id_type_t_Class.
Enumerator | |
---|---|
FLEXCAN_MSG_ID_STD |
Standard ID |
FLEXCAN_MSG_ID_EXT |
Extended ID |
Definition at line 78 of file flexcan_driver.h.
FlexCAN operation modes Implements : flexcan_operation_modes_t_Class.
Definition at line 214 of file flexcan_driver.h.
Pretended Networking filtering combinations.
Definition at line 294 of file flexcan_driver.h.
Pretended Networking matching schemes.
Definition at line 302 of file flexcan_driver.h.
ID formats for Rx FIFO Implements : flexcan_rx_fifo_id_element_format_t_Class.
Definition at line 194 of file flexcan_driver.h.
FlexCAN Rx FIFO filters number Implements : flexcan_rx_fifo_id_filter_num_t_Class.
Definition at line 164 of file flexcan_driver.h.
FlexCAN Rx mask type. Implements : flexcan_rx_mask_type_t_Class.
Enumerator | |
---|---|
FLEXCAN_RX_MASK_GLOBAL |
Rx global mask |
FLEXCAN_RX_MASK_INDIVIDUAL |
Rx individual mask |
Definition at line 186 of file flexcan_driver.h.
The type of the RxFIFO transfer (interrupts/DMA). Implements : flexcan_rxfifo_transfer_type_t_Class.
Enumerator | |
---|---|
FLEXCAN_RXFIFO_USING_INTERRUPTS |
Use interrupts for RxFIFO. |
FLEXCAN_RXFIFO_USING_DMA |
Use DMA for RxFIFO. |
Definition at line 42 of file flexcan_driver.h.
status_t FLEXCAN_DRV_AbortTransfer | ( | uint8_t | instance, |
uint8_t | mb_idx | ||
) |
Ends a non-blocking FlexCAN transfer early.
instance | A FlexCAN instance number |
mb_idx | The index of the message buffer |
Definition at line 1484 of file flexcan_driver.c.
void FLEXCAN_DRV_ClearTDCFail | ( | uint8_t | instance | ) |
Clears the TDC Fail flag.
base | The FlexCAN base address |
Definition at line 1168 of file flexcan_driver.c.
void FLEXCAN_DRV_ConfigPN | ( | uint8_t | instance, |
bool | enable, | ||
const flexcan_pn_config_t * | pnConfig | ||
) |
Configures Pretended Networking settings.
instance | The FlexCAN instance number. |
enable | Enable/Disable Pretended Networking mode. |
pnConfig | Pointer to the Pretended Networking configuration structure. |
Definition at line 1855 of file flexcan_driver.c.
status_t FLEXCAN_DRV_ConfigRemoteResponseMb | ( | uint8_t | instance, |
uint8_t | mb_idx, | ||
const flexcan_data_info_t * | tx_info, | ||
uint32_t | msg_id, | ||
const uint8_t * | mb_data | ||
) |
Configures a transmit message buffer for remote frame response.
instance | A FlexCAN instance number |
mb_idx | Index of the message buffer |
tx_info | Data info |
msg_id | ID of the message to transmit |
mb_data | Bytes of the FlexCAN message |
Definition at line 725 of file flexcan_driver.c.
void FLEXCAN_DRV_ConfigRxFifo | ( | uint8_t | instance, |
flexcan_rx_fifo_id_element_format_t | id_format, | ||
const flexcan_id_table_t * | id_filter_table | ||
) |
FlexCAN Rx FIFO field configuration.
Each element in the ID filter table specifies an ID to be used as acceptance criteria for the FIFO as follows:
instance | A FlexCAN instance number |
id_format | The format of the Rx FIFO ID Filter Table Elements |
id_filter_table | The ID filter table elements which contain RTR bit, IDE bit, and Rx message ID |
Definition at line 894 of file flexcan_driver.c.
status_t FLEXCAN_DRV_ConfigRxMb | ( | uint8_t | instance, |
uint8_t | mb_idx, | ||
const flexcan_data_info_t * | rx_info, | ||
uint32_t | msg_id | ||
) |
FlexCAN receive message buffer field configuration.
instance | A FlexCAN instance number |
mb_idx | Index of the message buffer |
rx_info | Data info |
msg_id | ID of the message to transmit |
Definition at line 846 of file flexcan_driver.c.
status_t FLEXCAN_DRV_ConfigTxMb | ( | uint8_t | instance, |
uint8_t | mb_idx, | ||
const flexcan_data_info_t * | tx_info, | ||
uint32_t | msg_id | ||
) |
FlexCAN transmit message buffer field configuration.
instance | A FlexCAN instance number |
mb_idx | Index of the message buffer |
tx_info | Data info |
msg_id | ID of the message to transmit |
Definition at line 687 of file flexcan_driver.c.
status_t FLEXCAN_DRV_Deinit | ( | uint8_t | instance | ) |
Shuts down a FlexCAN instance.
instance | A FlexCAN instance number |
Definition at line 1055 of file flexcan_driver.c.
void FLEXCAN_DRV_GetBitrate | ( | uint8_t | instance, |
flexcan_time_segment_t * | bitrate | ||
) |
Gets the FlexCAN bit rate for standard frames or the arbitration phase of FD frames.
instance | A FlexCAN instance number |
bitrate | A pointer to a variable for returning the FlexCAN bit rate settings |
Definition at line 218 of file flexcan_driver.c.
void FLEXCAN_DRV_GetBitrateFD | ( | uint8_t | instance, |
flexcan_time_segment_t * | bitrate | ||
) |
Gets the FlexCAN bit rate for the data phase of FD frames (BRS enabled).
instance | A FlexCAN instance number |
bitrate | A pointer to a variable for returning the FlexCAN bit rate settings |
Definition at line 243 of file flexcan_driver.c.
void FLEXCAN_DRV_GetDefaultConfig | ( | flexcan_user_config_t * | config | ) |
Gets the default configuration structure.
This function gets the default configuration structure, with the following settings:
[out] | config | The configuration structure |
Definition at line 2060 of file flexcan_driver.c.
uint32_t FLEXCAN_DRV_GetErrorStatus | ( | uint8_t | instance | ) |
Returns reported error conditions.
Reports various error conditions detected in the reception and transmission of a CAN frame and some general status of the device.
instance | The FlexCAN instance number. |
Definition at line 1465 of file flexcan_driver.c.
bool FLEXCAN_DRV_GetTDCFail | ( | uint8_t | instance | ) |
Gets the value of the TDC Fail flag.
base | The FlexCAN base address |
Definition at line 1152 of file flexcan_driver.c.
uint8_t FLEXCAN_DRV_GetTDCValue | ( | uint8_t | instance | ) |
Gets the value of the Transceiver Delay Compensation.
base | The FlexCAN base address |
Definition at line 1136 of file flexcan_driver.c.
status_t FLEXCAN_DRV_GetTransferStatus | ( | uint8_t | instance, |
uint8_t | mb_idx | ||
) |
Returns whether the previous FlexCAN transfer has finished.
When performing an async transfer, call this function to ascertain the state of the current transfer: in progress (or busy) or complete (success).
instance | The FlexCAN instance number. |
mb_idx | The index of the message buffer. |
Definition at line 1438 of file flexcan_driver.c.
void FLEXCAN_DRV_GetWMB | ( | uint8_t | instance, |
uint8_t | wmbIndex, | ||
flexcan_msgbuff_t * | wmb | ||
) |
Extracts one of the frames which triggered the wake up event.
instance | The FlexCAN instance number. |
wmbIndex | The index of the message buffer to be extracted. |
wmb | Pointer to the message buffer structure where the frame will be saved. |
Definition at line 1883 of file flexcan_driver.c.
status_t FLEXCAN_DRV_Init | ( | uint8_t | instance, |
flexcan_state_t * | state, | ||
const flexcan_user_config_t * | data | ||
) |
Initializes the FlexCAN peripheral.
This function initializes
instance | A FlexCAN instance number |
state | Pointer to the FlexCAN driver state structure. |
data | The FlexCAN platform data |
Definition at line 481 of file flexcan_driver.c.
void FLEXCAN_DRV_InstallErrorCallback | ( | uint8_t | instance, |
flexcan_error_callback_t | callback, | ||
void * | callbackParam | ||
) |
Installs an error callback function for the IRQ handler and enables error interrupts.
instance | The FlexCAN instance number. |
callback | The error callback function. |
callbackParam | User parameter passed to the error callback function through the state parameter. |
Definition at line 1818 of file flexcan_driver.c.
void FLEXCAN_DRV_InstallEventCallback | ( | uint8_t | instance, |
flexcan_callback_t | callback, | ||
void * | callbackParam | ||
) |
Installs a callback function for the IRQ handler.
instance | The FlexCAN instance number. |
callback | The callback function. |
callbackParam | User parameter passed to the callback function through the state parameter. |
Definition at line 1798 of file flexcan_driver.c.
status_t FLEXCAN_DRV_Receive | ( | uint8_t | instance, |
uint8_t | mb_idx, | ||
flexcan_msgbuff_t * | data | ||
) |
Receives a CAN frame using the specified message buffer.
This function receives a CAN frame using a configured message buffer. The function returns immediately. If a callback is installed, it will be invoked after the frame was received and read into the specified buffer.
instance | A FlexCAN instance number |
mb_idx | Index of the message buffer |
data | The FlexCAN receive message buffer data. |
Definition at line 966 of file flexcan_driver.c.
status_t FLEXCAN_DRV_ReceiveBlocking | ( | uint8_t | instance, |
uint8_t | mb_idx, | ||
flexcan_msgbuff_t * | data, | ||
uint32_t | timeout_ms | ||
) |
Receives a CAN frame using the specified message buffer, in a blocking manner.
This function receives a CAN frame using a configured message buffer. The function blocks until either a frame was received, or the specified timeout expired.
instance | A FlexCAN instance number |
mb_idx | Index of the message buffer |
data | The FlexCAN receive message buffer data. |
timeout_ms | A timeout for the transfer in milliseconds. |
Definition at line 920 of file flexcan_driver.c.
status_t FLEXCAN_DRV_RxFifo | ( | uint8_t | instance, |
flexcan_msgbuff_t * | data | ||
) |
Receives a CAN frame using the message FIFO.
This function receives a CAN frame using the Rx FIFO. The function returns immediately. If a callback is installed, it will be invoked after the frame was received and read into the specified buffer.
instance | A FlexCAN instance number |
data | The FlexCAN receive message buffer data. |
Definition at line 1034 of file flexcan_driver.c.
status_t FLEXCAN_DRV_RxFifoBlocking | ( | uint8_t | instance, |
flexcan_msgbuff_t * | data, | ||
uint32_t | timeout_ms | ||
) |
Receives a CAN frame using the message FIFO, in a blocking manner.
This function receives a CAN frame using the Rx FIFO. The function blocks until either a frame was received, or the specified timeout expired.
instance | A FlexCAN instance number |
data | The FlexCAN receive message buffer data. |
timeout_ms | A timeout for the transfer in milliseconds. |
Definition at line 989 of file flexcan_driver.c.
status_t FLEXCAN_DRV_Send | ( | uint8_t | instance, |
uint8_t | mb_idx, | ||
const flexcan_data_info_t * | tx_info, | ||
uint32_t | msg_id, | ||
const uint8_t * | mb_data | ||
) |
Sends a CAN frame using the specified message buffer.
This function sends a CAN frame using a configured message buffer. The function returns immediately. If a callback is installed, it will be invoked after the frame was sent.
instance | A FlexCAN instance number |
mb_idx | Index of the message buffer |
tx_info | Data info |
msg_id | ID of the message to transmit |
mb_data | Bytes of the FlexCAN message. |
Definition at line 809 of file flexcan_driver.c.
status_t FLEXCAN_DRV_SendBlocking | ( | uint8_t | instance, |
uint8_t | mb_idx, | ||
const flexcan_data_info_t * | tx_info, | ||
uint32_t | msg_id, | ||
const uint8_t * | mb_data, | ||
uint32_t | timeout_ms | ||
) |
Sends a CAN frame using the specified message buffer, in a blocking manner.
This function sends a CAN frame using a configured message buffer. The function blocks until either the frame was sent, or the specified timeout expired.
instance | A FlexCAN instance number |
mb_idx | Index of the message buffer |
tx_info | Data info |
msg_id | ID of the message to transmit |
mb_data | Bytes of the FlexCAN message |
timeout_ms | A timeout for the transfer in milliseconds. |
Definition at line 757 of file flexcan_driver.c.
void FLEXCAN_DRV_SetBitrate | ( | uint8_t | instance, |
const flexcan_time_segment_t * | bitrate | ||
) |
Sets the FlexCAN bit rate for standard frames or the arbitration phase of FD frames.
instance | A FlexCAN instance number |
bitrate | A pointer to the FlexCAN bit rate settings. |
Definition at line 154 of file flexcan_driver.c.
void FLEXCAN_DRV_SetBitrateCbt | ( | uint8_t | instance, |
const flexcan_time_segment_t * | bitrate | ||
) |
Sets the FlexCAN bit rate for the data phase of FD frames (BRS enabled).
instance | A FlexCAN instance number |
bitrate | A pointer to the FlexCAN bit rate settings. |
Definition at line 193 of file flexcan_driver.c.
void FLEXCAN_DRV_SetRxFifoGlobalMask | ( | uint8_t | instance, |
flexcan_msgbuff_id_type_t | id_type, | ||
uint32_t | mask | ||
) |
Sets the FlexCAN Rx FIFO global mask (standard or extended).
instance | A FlexCAN instance number |
id_type | Standard ID or extended ID |
mask | Mask value |
Definition at line 289 of file flexcan_driver.c.
status_t FLEXCAN_DRV_SetRxIndividualMask | ( | uint8_t | instance, |
flexcan_msgbuff_id_type_t | id_type, | ||
uint8_t | mb_idx, | ||
uint32_t | mask | ||
) |
Sets the FlexCAN Rx individual mask (standard or extended).
instance | A FlexCAN instance number |
id_type | A standard ID or an extended ID |
mb_idx | Index of the message buffer |
mask | Mask value |
Definition at line 433 of file flexcan_driver.c.
void FLEXCAN_DRV_SetRxMaskType | ( | uint8_t | instance, |
flexcan_rx_mask_type_t | type | ||
) |
Sets the Rx masking type.
instance | A FlexCAN instance number |
type | The FlexCAN RX mask type |
Definition at line 268 of file flexcan_driver.c.
void FLEXCAN_DRV_SetRxMb14Mask | ( | uint8_t | instance, |
flexcan_msgbuff_id_type_t | id_type, | ||
uint32_t | mask | ||
) |
Sets the FlexCAN Rx MB 14 mask (standard or extended).
instance | A FlexCAN instance number |
id_type | Standard ID or extended ID |
mask | Mask value |
Definition at line 361 of file flexcan_driver.c.
void FLEXCAN_DRV_SetRxMb15Mask | ( | uint8_t | instance, |
flexcan_msgbuff_id_type_t | id_type, | ||
uint32_t | mask | ||
) |
Sets the FlexCAN Rx MB 15 mask (standard or extended).
instance | A FlexCAN instance number |
id_type | Standard ID or extended ID |
mask | Mask value |
Definition at line 397 of file flexcan_driver.c.
void FLEXCAN_DRV_SetRxMbGlobalMask | ( | uint8_t | instance, |
flexcan_msgbuff_id_type_t | id_type, | ||
uint32_t | mask | ||
) |
Sets the FlexCAN Rx MB global mask (standard or extended).
instance | A FlexCAN instance number |
id_type | Standard ID or extended ID |
mask | Mask value |
Definition at line 325 of file flexcan_driver.c.
void FLEXCAN_DRV_SetTDCOffset | ( | uint8_t | instance, |
bool | enable, | ||
uint8_t | offset | ||
) |
Enables/Disables the Transceiver Delay Compensation feature and sets the Transceiver Delay Compensation Offset (offset value to be added to the measured transceiver's loop delay in order to define the position of the delayed comparison point when bit rate switching is active).
instance | A FlexCAN instance number |
enable | Enable/Disable Transceiver Delay Compensation |
offset | Transceiver Delay Compensation Offset |
Definition at line 1115 of file flexcan_driver.c.