S32 SDK

Detailed Description

How to use the FlexCAN driver in your application

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, 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 using it by calling one of the following functions:

Important Notes

Example:

#define INST_CANCOM1 (0U)
flexcan_state_t canCom1_State;
const flexcan_user_config_t canCom1_InitConfig0 = {
.fd_enable = true,
.max_num_mb = 16,
.num_id_filters = FLEXCAN_RX_FIFO_ID_FILTERS_8,
.is_rx_fifo_needed = false,
.flexcanMode = FLEXCAN_NORMAL_MODE,
.bitrate = {
.propSeg = 7,
.phaseSeg1 = 4,
.phaseSeg2 = 1,
.preDivider = 0,
.rJumpwidth = 1
},
.bitrate_cbt = {
.propSeg = 11,
.phaseSeg1 = 1,
.phaseSeg2 = 1,
.preDivider = 0,
.rJumpwidth = 1
},
.rxFifoDMAChannel = 0U
};
/* Initialize FlexCAN driver */
FLEXCAN_DRV_Init(INST_CANCOM1, &canCom1_State, &canCom1_InitConfig0);
/* Set information about the data to be received */
{
.data_length = 1U,
.msg_id_type = FLEXCAN_MSG_ID_STD,
.enable_brs = true,
.fd_enable = true,
.fd_padding = 0U
};
/* Configure Rx message buffer with index 1 to receive frames with ID 1 */
FLEXCAN_DRV_ConfigRxMb(INST_CANCOM1, 1, &dataInfo, 1);
/* Receive a frame in the recvBuff variable */
recvBuff.msgId = 1;
FLEXCAN_DRV_Receive(INST_CANCOM1, 1, &recvBuff);
/* Wait for the message to be received */
while (FLEXCAN_DRV_GetTransferStatus(INST_CANCOM1, 1) == STATUS_BUSY);
/* De-initialize driver */
FLEXCAN_DRV_Deinit(INST_CANCOM1);

Data Structures

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_user_config_t
 FlexCAN configuration. 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, flexcan_state_t *flexcanState)
 FlexCAN Driver callback function type Implements : flexcan_callback_t_Class. More...
 

Enumerations

enum  flexcan_rxfifo_transfer_type_t { FLEXCAN_RXFIFO_USING_INTERRUPTS, FLEXCAN_RXFIFO_USING_DMA }
 The type of the RxFIFO transfer (interrupts/DMA). Implements : flexcan_rxfifo_transfer_type_t_Class. More...
 
enum  flexcan_event_type_t { FLEXCAN_EVENT_RX_COMPLETE, FLEXCAN_EVENT_RXFIFO_COMPLETE, FLEXCAN_EVENT_TX_COMPLETE }
 The type of the event which occured when the callback was invoked. Implements : flexcan_event_type_t_Class. More...
 
enum  flexcan_mb_state_t { FLEXCAN_MB_IDLE, FLEXCAN_MB_RX_BUSY, FLEXCAN_MB_TX_BUSY }
 The state of a given MB (idle/Rx busy/Tx busy). Implements : flexcan_mb_state_t_Class. More...
 
enum  flexcan_rx_fifo_id_filter_num_t {
  FLEXCAN_RX_FIFO_ID_FILTERS_8 = 0x0, FLEXCAN_RX_FIFO_ID_FILTERS_16 = 0x1, FLEXCAN_RX_FIFO_ID_FILTERS_24 = 0x2, FLEXCAN_RX_FIFO_ID_FILTERS_32 = 0x3,
  FLEXCAN_RX_FIFO_ID_FILTERS_40 = 0x4, FLEXCAN_RX_FIFO_ID_FILTERS_48 = 0x5, FLEXCAN_RX_FIFO_ID_FILTERS_56 = 0x6, FLEXCAN_RX_FIFO_ID_FILTERS_64 = 0x7,
  FLEXCAN_RX_FIFO_ID_FILTERS_72 = 0x8, FLEXCAN_RX_FIFO_ID_FILTERS_80 = 0x9, FLEXCAN_RX_FIFO_ID_FILTERS_88 = 0xA, FLEXCAN_RX_FIFO_ID_FILTERS_96 = 0xB,
  FLEXCAN_RX_FIFO_ID_FILTERS_104 = 0xC, FLEXCAN_RX_FIFO_ID_FILTERS_112 = 0xD, FLEXCAN_RX_FIFO_ID_FILTERS_120 = 0xE, FLEXCAN_RX_FIFO_ID_FILTERS_128 = 0xF
}
 FlexCAN Rx FIFO filters number Implements : flexcan_rx_fifo_id_filter_num_t_Class. More...
 

Functions

void FLEXCAN_DRV_IRQHandler (uint8_t instance)
 Interrupt handler for a FlexCAN instance. More...
 
status_t FLEXCAN_DRV_GetTransferStatus (uint32_t instance, uint8_t mb_idx)
 Returns whether the previous FLEXCAN transfer has finished. More...
 
void FLEXCAN_DRV_InstallEventCallback (uint8_t instance, flexcan_callback_t callback, void *callbackParam)
 Installs a callback function for the IRQ handler. More...
 

Variables

CAN_Type *const g_flexcanBase [CAN_INSTANCE_COUNT]
 Table of base addresses for FlexCAN instances. More...
 
const IRQn_Type g_flexcanRxWarningIrqId [CAN_INSTANCE_COUNT]
 Table to save RX Warning IRQ numbers for FlexCAN instances. More...
 
const IRQn_Type g_flexcanTxWarningIrqId [CAN_INSTANCE_COUNT]
 Table to save TX Warning IRQ numbers for FlexCAN instances. More...
 
const IRQn_Type g_flexcanWakeUpIrqId [CAN_INSTANCE_COUNT]
 Table to save wakeup IRQ numbers for FlexCAN instances. More...
 
const IRQn_Type g_flexcanErrorIrqId [CAN_INSTANCE_COUNT]
 Table to save error IRQ numbers for FlexCAN instances. More...
 
const IRQn_Type g_flexcanBusOffIrqId [CAN_INSTANCE_COUNT]
 Table to save Bus off IRQ numbers for FlexCAN instances. More...
 
const IRQn_Type g_flexcanOredMessageBufferIrqId [CAN_INSTANCE_COUNT][FEATURE_CAN_MB_IRQS_MAX_COUNT]
 Table to save message buffer IRQ numbers for FlexCAN instances. More...
 

Bit rate

void FLEXCAN_DRV_SetBitrate (uint8_t instance, const flexcan_time_segment_t *bitrate)
 Sets the FlexCAN bit rate. More...
 

Set baud rate for BRS FD

void FLEXCAN_DRV_SetBitrateCbt (uint8_t instance, const flexcan_time_segment_t *bitrate)
 Sets the FlexCAN bit rate for FD BRS. More...
 
void FLEXCAN_DRV_GetBitrate (uint8_t instance, flexcan_time_segment_t *bitrate)
 Gets the FlexCAN bit rate. More...
 

Global mask

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 standard or extended mask. More...
 
void FLEXCAN_DRV_SetRxMbGlobalMask (uint8_t instance, flexcan_msgbuff_id_type_t id_type, uint32_t mask)
 Sets the FlexCAN RX MB global standard or extended mask. 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 standard or extended mask. More...
 

Initialization and Shutdown

status_t FLEXCAN_DRV_Init (uint32_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...
 

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_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...
 
status_t FLEXCAN_DRV_AbortTransfer (uint32_t instance, uint8_t mb_idx)
 Ends a non-blocking FlexCAN transfer early. 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...
 

Typedef Documentation

typedef void(* flexcan_callback_t) (uint8_t instance, flexcan_event_type_t eventType, flexcan_state_t *flexcanState)

FlexCAN Driver callback function type Implements : flexcan_callback_t_Class.

Definition at line 190 of file flexcan_driver.h.

typedef struct FlexCANState flexcan_state_t

Internal driver state information.

Note
The contents of this structure are internal to the driver and should not be modified by users. Also, contents of the structure are subject to change in future releases. Implements : flexcan_state_t_Class

Enumeration Type Documentation

The type of the event which occured when the callback was invoked. Implements : flexcan_event_type_t_Class.

Enumerator
FLEXCAN_EVENT_RX_COMPLETE 

A frame was received in the configured Rx MB.

FLEXCAN_EVENT_RXFIFO_COMPLETE 

A frame was received in the RxFIFO.

FLEXCAN_EVENT_TX_COMPLETE 

A frame was sent from the configured Tx MB.

Definition at line 81 of file flexcan_driver.h.

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 95 of file flexcan_driver.h.

FlexCAN Rx FIFO filters number Implements : flexcan_rx_fifo_id_filter_num_t_Class.

Enumerator
FLEXCAN_RX_FIFO_ID_FILTERS_8 

8 Rx FIFO Filters.

FLEXCAN_RX_FIFO_ID_FILTERS_16 

16 Rx FIFO Filters.

FLEXCAN_RX_FIFO_ID_FILTERS_24 

24 Rx FIFO Filters.

FLEXCAN_RX_FIFO_ID_FILTERS_32 

32 Rx FIFO Filters.

FLEXCAN_RX_FIFO_ID_FILTERS_40 

40 Rx FIFO Filters.

FLEXCAN_RX_FIFO_ID_FILTERS_48 

48 Rx FIFO Filters.

FLEXCAN_RX_FIFO_ID_FILTERS_56 

56 Rx FIFO Filters.

FLEXCAN_RX_FIFO_ID_FILTERS_64 

64 Rx FIFO Filters.

FLEXCAN_RX_FIFO_ID_FILTERS_72 

72 Rx FIFO Filters.

FLEXCAN_RX_FIFO_ID_FILTERS_80 

80 Rx FIFO Filters.

FLEXCAN_RX_FIFO_ID_FILTERS_88 

88 Rx FIFO Filters.

FLEXCAN_RX_FIFO_ID_FILTERS_96 

96 Rx FIFO Filters.

FLEXCAN_RX_FIFO_ID_FILTERS_104 

104 Rx FIFO Filters.

FLEXCAN_RX_FIFO_ID_FILTERS_112 

112 Rx FIFO Filters.

FLEXCAN_RX_FIFO_ID_FILTERS_120 

120 Rx FIFO Filters.

FLEXCAN_RX_FIFO_ID_FILTERS_128 

128 Rx FIFO Filters.

Definition at line 148 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 73 of file flexcan_driver.h.

Function Documentation

status_t FLEXCAN_DRV_AbortTransfer ( uint32_t  instance,
uint8_t  mb_idx 
)

Ends a non-blocking FlexCAN transfer early.

Parameters
instanceA FlexCAN instance number
mb_idxThe index of the message buffer
Returns
STATUS_SUCCESS if successful; STATUS_FLEXCAN_NO_TRANSFER_IN_PROGRESS if no transfer was running

Definition at line 990 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.

Parameters
instanceA FlexCAN instance number
id_formatThe format of the RX FIFO ID Filter Table Elements
id_filter_tableThe ID filter table elements which contain RTR bit, IDE bit, and RX message ID

Definition at line 612 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.

Parameters
instanceA FlexCAN instance number
mb_idxIndex of the message buffer
rx_infoData info
msg_idID of the message to transmit
Returns
STATUS_SUCCESS if successful; STATUS_FLEXCAN_MB_OUT_OF_RANGE if the index of a message buffer is invalid; STATUS_ERROR if other error occurred

Definition at line 566 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.

Parameters
instanceA FlexCAN instance number
mb_idxIndex of the message buffer
tx_infoData info
msg_idID of the message to transmit
Returns
STATUS_SUCCESS if successful; STATUS_FLEXCAN_MB_OUT_OF_RANGE if the index of the message buffer is invalid

Definition at line 439 of file flexcan_driver.c.

status_t FLEXCAN_DRV_Deinit ( uint8_t  instance)

Shuts down a FlexCAN instance.

Parameters
instanceA FlexCAN instance number
Returns
STATUS_SUCCESS if successful; STATUS_ERROR if failed

Definition at line 754 of file flexcan_driver.c.

void FLEXCAN_DRV_GetBitrate ( uint8_t  instance,
flexcan_time_segment_t bitrate 
)

Gets the FlexCAN bit rate.

Parameters
instanceA FlexCAN instance number
bitrateA pointer to a variable for returning the FlexCAN bit rate settings

Definition at line 159 of file flexcan_driver.c.

status_t FLEXCAN_DRV_GetTransferStatus ( uint32_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).

Parameters
instanceThe FLEXCAN module base address.
mb_idxThe index of the message buffer.
Returns
STATUS_SUCCESS if successful; STATUS_BUSY if a resource is busy;

Definition at line 961 of file flexcan_driver.c.

status_t FLEXCAN_DRV_Init ( uint32_t  instance,
flexcan_state_t state,
const flexcan_user_config_t data 
)

Initializes the FlexCAN peripheral.

This function initializes

Parameters
instanceA FlexCAN instance number
statePointer to the FlexCAN driver state structure.
dataThe FlexCAN platform data
Returns
STATUS_SUCCESS if successful; STATUS_FLEXCAN_MB_OUT_OF_RANGE if the index of a message buffer is invalid; STATUS_ERROR if other error occurred

Definition at line 295 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.

Parameters
instanceThe FLEXCAN module base address.
callbackThe callback function.
callbackParamUser parameter passed to the callback function through the state parameter.

Definition at line 1307 of file flexcan_driver.c.

void FLEXCAN_DRV_IRQHandler ( uint8_t  instance)

Interrupt handler for a FlexCAN instance.

Parameters
instanceThe FlexCAN instance number.

Definition at line 801 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.

Parameters
instanceA FlexCAN instance number
mb_idxIndex of the message buffer
dataThe FlexCAN receive message buffer data.
Returns
STATUS_SUCCESS if successful; STATUS_FLEXCAN_MB_OUT_OF_RANGE if the index of a message buffer is invalid; STATUS_BUSY if a resource is busy; STATUS_ERROR if other error occurred

Definition at line 679 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.

Parameters
instanceA FlexCAN instance number
mb_idxIndex of the message buffer
dataThe FlexCAN receive message buffer data.
timeout_msA timeout for the transfer in milliseconds.
Returns
STATUS_SUCCESS if successful; STATUS_FLEXCAN_MB_OUT_OF_RANGE if the index of a message buffer is invalid; STATUS_BUSY if a resource is busy; STATUS_TIMEOUT if the timeout is reached; STATUS_ERROR if other error occurred

Definition at line 634 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.

Parameters
instanceA FlexCAN instance number
dataThe FlexCAN receive message buffer data.
Returns
STATUS_SUCCESS if successful; STATUS_BUSY if a resource is busy; STATUS_ERROR if other error occurred

Definition at line 733 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.

Parameters
instanceA FlexCAN instance number
dataThe FlexCAN receive message buffer data.
timeout_msA timeout for the transfer in milliseconds.
Returns
STATUS_SUCCESS if successful; STATUS_BUSY if a resource is busy; STATUS_TIMEOUT if the timeout is reached; STATUS_ERROR if other error occurred

Definition at line 702 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.

Parameters
instanceA FlexCAN instance number
mb_idxIndex of the message buffer
tx_infoData info
msg_idID of the message to transmit
mb_dataBytes of the FlexCAN message.
Returns
STATUS_SUCCESS if successful; STATUS_FLEXCAN_MB_OUT_OF_RANGE if the index of a message buffer is invalid; STATUS_BUSY if a resource is busy; STATUS_ERROR if other error occurred

Definition at line 527 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.

Parameters
instanceA FlexCAN instance number
mb_idxIndex of the message buffer
tx_infoData info
msg_idID of the message to transmit
mb_dataBytes of the FlexCAN message
timeout_msA timeout for the transfer in milliseconds.
Returns
STATUS_SUCCESS if successful; STATUS_FLEXCAN_MB_OUT_OF_RANGE if the index of a message buffer is invalid; STATUS_BUSY if a resource is busy; STATUS_TIMEOUT if the timeout is reached; STATUS_ERROR if other error occurred

Definition at line 474 of file flexcan_driver.c.

void FLEXCAN_DRV_SetBitrate ( uint8_t  instance,
const flexcan_time_segment_t bitrate 
)

Sets the FlexCAN bit rate.

Parameters
instanceA FlexCAN instance number
bitrateA pointer to the FlexCAN bit rate settings.

Definition at line 124 of file flexcan_driver.c.

void FLEXCAN_DRV_SetBitrateCbt ( uint8_t  instance,
const flexcan_time_segment_t bitrate 
)

Sets the FlexCAN bit rate for FD BRS.

Parameters
instanceA FlexCAN instance number
bitrateA pointer to the FlexCAN bit rate settings.

Definition at line 142 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 standard or extended mask.

Parameters
instanceA FlexCAN instance number
id_typeStandard ID or extended ID
maskMask value

Definition at line 192 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 standard or extended mask.

Parameters
instanceA FlexCAN instance number
id_typeA standard ID or an extended ID
mb_idxIndex of the message buffer
maskMask value
Returns
STATUS_SUCCESS if successful; STATUS_FLEXCAN_MB_OUT_OF_RANGE if the index of the message buffer is invalid

Definition at line 256 of file flexcan_driver.c.

void FLEXCAN_DRV_SetRxMaskType ( uint8_t  instance,
flexcan_rx_mask_type_t  type 
)

Sets the RX masking type.

Parameters
instanceA FlexCAN instance number
typeThe FlexCAN RX mask type

Definition at line 177 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 standard or extended mask.

Parameters
instanceA FlexCAN instance number
id_typeStandard ID or extended ID
maskMask value

Definition at line 224 of file flexcan_driver.c.

Variable Documentation

CAN_Type* const g_flexcanBase[CAN_INSTANCE_COUNT]

Table of base addresses for FlexCAN instances.

Definition at line 49 of file flexcan_common.c.

const IRQn_Type g_flexcanBusOffIrqId[CAN_INSTANCE_COUNT]

Table to save Bus off IRQ numbers for FlexCAN instances.

Definition at line 56 of file flexcan_common.c.

const IRQn_Type g_flexcanErrorIrqId[CAN_INSTANCE_COUNT]

Table to save error IRQ numbers for FlexCAN instances.

Definition at line 55 of file flexcan_common.c.

const IRQn_Type g_flexcanOredMessageBufferIrqId[CAN_INSTANCE_COUNT][FEATURE_CAN_MB_IRQS_MAX_COUNT]

Table to save message buffer IRQ numbers for FlexCAN instances.

Definition at line 58 of file flexcan_common.c.

const IRQn_Type g_flexcanRxWarningIrqId[CAN_INSTANCE_COUNT]

Table to save RX Warning IRQ numbers for FlexCAN instances.

Definition at line 52 of file flexcan_common.c.

const IRQn_Type g_flexcanTxWarningIrqId[CAN_INSTANCE_COUNT]

Table to save TX Warning IRQ numbers for FlexCAN instances.

Definition at line 53 of file flexcan_common.c.

const IRQn_Type g_flexcanWakeUpIrqId[CAN_INSTANCE_COUNT]

Table to save wakeup IRQ numbers for FlexCAN instances.

Definition at line 54 of file flexcan_common.c.