This section describes the programming interface of the MSCAN driver. The MSCAN driver configures MSCAN module and provides functional and transactional interfaces to build the MSCAN application.
Typical use case
Message Buffer Send Operation
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/mscan
Message Buffer Receive Operation
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/mscan
Receive FIFO Operation
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/mscan
Calculate
Provides static functions to calculate improved timing configuration.
The feature need to be enabled by user like that.
#define FSL_FEATURE_FLEXCAN_HAS_IMPROVED_TIMING_CONFIG (1)
|
enum | {
kStatus_MSCAN_TxBusy = MAKE_STATUS(kStatusGroup_MSCAN, 0),
kStatus_MSCAN_TxIdle = MAKE_STATUS(kStatusGroup_MSCAN, 1),
kStatus_MSCAN_TxSwitchToRx,
kStatus_MSCAN_RxBusy = MAKE_STATUS(kStatusGroup_MSCAN, 3),
kStatus_MSCAN_RxIdle = MAKE_STATUS(kStatusGroup_MSCAN, 4),
kStatus_MSCAN_RxOverflow = MAKE_STATUS(kStatusGroup_MSCAN, 5),
kStatus_MSCAN_RxFifoBusy = MAKE_STATUS(kStatusGroup_MSCAN, 6),
kStatus_MSCAN_RxFifoIdle = MAKE_STATUS(kStatusGroup_MSCAN, 7),
kStatus_MSCAN_RxFifoOverflow = MAKE_STATUS(kStatusGroup_MSCAN, 8),
kStatus_MSCAN_RxFifoWarning = MAKE_STATUS(kStatusGroup_MSCAN, 9),
kStatus_MSCAN_ErrorStatus = MAKE_STATUS(kStatusGroup_MSCAN, 10),
kStatus_MSCAN_UnHandled = MAKE_STATUS(kStatusGroup_MSCAN, 11)
} |
| FlexCAN transfer status. More...
|
|
enum | mscan_frame_format_t {
kMSCAN_FrameFormatStandard = 0x0U,
kMSCAN_FrameFormatExtend = 0x1U
} |
| MsCAN frame format. More...
|
|
enum | mscan_frame_type_t {
kMSCAN_FrameTypeData = 0x0U,
kMSCAN_FrameTypeRemote = 0x1U
} |
| MsCAN frame type. More...
|
|
enum | mscan_clock_source_t {
kMSCAN_ClkSrcOsc = 0x0U,
kMSCAN_ClkSrcBus = 0x1U
} |
| MsCAN clock source. More...
|
|
enum | mscan_busoffrec_mode_t {
kMSCAN_BusoffrecAuto = 0x0U,
kMSCAN_BusoffrecUsr = 0x1U
} |
| MsCAN bus-off recovery mode. More...
|
|
enum | _mscan_tx_buffer_empty_flag {
kMSCAN_TxBuf0Empty = 0x1U,
kMSCAN_TxBuf1Empty = 0x2U,
kMSCAN_TxBuf2Empty = 0x4U,
kMSCAN_TxBufFull = 0x0U
} |
| MsCAN Tx buffer empty flag. More...
|
|
enum | mscan_id_filter_mode_t {
kMSCAN_Filter32Bit = 0x0U,
kMSCAN_Filter16Bit = 0x1U,
kMSCAN_Filter8Bit = 0x2U,
kMSCAN_FilterClose = 0x3U
} |
| MsCAN id filter mode. More...
|
|
enum | _mscan_interrupt_enable {
kMSCAN_WakeUpInterruptEnable = MSCAN_CANRIER_WUPIE_MASK,
kMSCAN_StatusChangeInterruptEnable = MSCAN_CANRIER_CSCIE_MASK,
kMSCAN_RxStatusChangeInterruptEnable = MSCAN_CANRIER_RSTATE_MASK,
kMSCAN_TxStatusChangeInterruptEnable = MSCAN_CANRIER_TSTATE_MASK,
kMSCAN_OverrunInterruptEnable = MSCAN_CANRIER_OVRIE_MASK,
kMSCAN_RxFullInterruptEnable = MSCAN_CANRIER_RXFIE_MASK,
kMSCAN_TxEmptyInterruptEnable = MSCAN_CANTIER_TXEIE_MASK
} |
| MsCAN interrupt configuration structure, default settings all disabled. More...
|
|
|
static uint8_t | MSCAN_GetTxBufferEmptyFlag (MSCAN_Type *base) |
| Get the transmit buffer empty status. More...
|
|
static void | MSCAN_TxBufferSelect (MSCAN_Type *base, uint8_t txBuf) |
| The selection of the actual transmit message buffer. More...
|
|
static uint8_t | MSCAN_GetTxBufferSelect (MSCAN_Type *base) |
| Get the actual transmit message buffer. More...
|
|
static void | MSCAN_TxBufferLaunch (MSCAN_Type *base, uint8_t txBuf) |
| Clear TFLG to schedule for transmission. More...
|
|
static uint8_t | MSCAN_GetTxBufferStatusFlags (MSCAN_Type *base, uint8_t mask) |
| Get Tx buffer status flag. More...
|
|
static uint8_t | MSCAN_GetRxBufferFullFlag (MSCAN_Type *base) |
| Check Receive Buffer Full Flag. More...
|
|
static void | MSCAN_ClearRxBufferFullFlag (MSCAN_Type *base) |
| Clear Receive buffer Full flag. More...
|
|
static uint8_t | MSCAN_ReadRIDR0 (MSCAN_Type *base) |
|
static uint8_t | MSCAN_ReadRIDR1 (MSCAN_Type *base) |
|
static uint8_t | MSCAN_ReadRIDR2 (MSCAN_Type *base) |
|
static uint8_t | MSCAN_ReadRIDR3 (MSCAN_Type *base) |
|
static void | MSCAN_WriteTIDR0 (MSCAN_Type *base, uint8_t id) |
|
static void | MSCAN_WriteTIDR1 (MSCAN_Type *base, uint8_t id) |
|
static void | MSCAN_WriteTIDR2 (MSCAN_Type *base, uint8_t id) |
|
static void | MSCAN_WriteTIDR3 (MSCAN_Type *base, uint8_t id) |
|
static void | MSCAN_SetIDFilterMode (MSCAN_Type *base, mscan_id_filter_mode_t mode) |
|
static void | MSCAN_WriteIDAR0 (MSCAN_Type *base, uint8_t *pID) |
|
static void | MSCAN_WriteIDAR1 (MSCAN_Type *base, uint8_t *pID) |
|
static void | MSCAN_WriteIDMR0 (MSCAN_Type *base, uint8_t *pID) |
|
static void | MSCAN_WriteIDMR1 (MSCAN_Type *base, uint8_t *pID) |
|
void | MSCAN_SetTimingConfig (MSCAN_Type *base, const mscan_timing_config_t *config) |
| Sets the MsCAN protocol timing characteristic. More...
|
|
|
void | MSCAN_TransferCreateHandle (MSCAN_Type *base, mscan_handle_t *handle, mscan_transfer_callback_t callback, void *userData) |
| Initializes the MsCAN handle. More...
|
|
status_t | MSCAN_TransferSendBlocking (MSCAN_Type *base, mscan_frame_t *pTxFrame) |
| Performs a polling send transaction on the CAN bus. More...
|
|
status_t | MSCAN_TransferReceiveBlocking (MSCAN_Type *base, mscan_frame_t *pRxFrame) |
| Performs a polling receive transaction on the CAN bus. More...
|
|
status_t | MSCAN_TransferSendNonBlocking (MSCAN_Type *base, mscan_handle_t *handle, mscan_mb_transfer_t *xfer) |
| Sends a message using IRQ. More...
|
|
status_t | MSCAN_TransferReceiveNonBlocking (MSCAN_Type *base, mscan_handle_t *handle, mscan_mb_transfer_t *xfer) |
| Receives a message using IRQ. More...
|
|
void | MSCAN_TransferAbortSend (MSCAN_Type *base, mscan_handle_t *handle, uint8_t mask) |
| Aborts the interrupt driven message send process. More...
|
|
void | MSCAN_TransferAbortReceive (MSCAN_Type *base, mscan_handle_t *handle, uint8_t mask) |
| Aborts the interrupt driven message receive process. More...
|
|
void | MSCAN_TransferHandleIRQ (MSCAN_Type *base, mscan_handle_t *handle) |
| MSCAN IRQ handle function. More...
|
|
Data Fields |
uint8_t | EID17_15: 3 |
| Extended Format Identifier 17-15.
|
|
uint8_t | R_TEIDE: 1 |
| ID Extended.
|
|
uint8_t | R_TSRR: 1 |
| Substitute Remote Request.
|
|
uint8_t | EID20_18_OR_SID2_0: 3 |
| Extended Format Identifier 18-20 or standard format bit 0-2.
|
|
Data Fields |
uint8_t | ERTR: 1 |
| Remote Transmission Request.
|
|
uint8_t | EID6_0: 7 |
| Extended Format Identifier 6-0.
|
|
struct MSCAN_ExtendIDType |
struct MSCAN_StandardIDType |
Data Fields |
uint32_t | EID2_0: 3 |
| ID[0:2].
|
|
uint32_t | EID10_3: 8 |
| ID[10:3].
|
|
Data Fields |
uint8_t | EIDR0 |
| Extended Identifier Register 0.
|
|
uint8_t | EIDR1 |
| Extended Identifier Register 1.
|
|
uint8_t | EIDR2 |
| Extended Identifier Register 2.
|
|
uint8_t | EIDR3 |
| Extended Identifier Register 3.
|
|
uint8_t | EDSR [8] |
| Extended Data Segment Register.
|
|
uint8_t | DLR |
| data length field
|
|
uint8_t | BPR |
| Buffer Priority Register.
|
|
uint8_t | TSRH |
| Time Stamp Register High.
|
|
uint8_t | TSRL |
| Time Stamp Register Low.
|
|
uint32_t mscan_frame_t::dataWord0 |
uint32_t mscan_frame_t::dataWord1 |
uint8_t mscan_frame_t::dataByte0 |
uint8_t mscan_frame_t::dataByte1 |
uint8_t mscan_frame_t::dataByte2 |
uint8_t mscan_frame_t::dataByte3 |
uint8_t mscan_frame_t::dataByte4 |
uint8_t mscan_frame_t::dataByte5 |
uint8_t mscan_frame_t::dataByte6 |
uint8_t mscan_frame_t::dataByte7 |
struct mscan_idfilter_config_t |
Data Fields |
mscan_id_filter_mode_t | filterMode |
| MSCAN Identifier Acceptance Filter Mode.
|
|
uint32_t | u32IDAR0 |
| MSCAN Identifier Acceptance Register n of First Bank.
|
|
uint32_t | u32IDAR1 |
| MSCAN Identifier Acceptance Register n of Second Bank.
|
|
uint32_t | u32IDMR0 |
| MSCAN Identifier Mask Register n of First Bank.
|
|
uint32_t | u32IDMR1 |
| MSCAN Identifier Mask Register n of Second Bank.
|
|
uint32_t mscan_config_t::baudRate |
bool mscan_config_t::enableTimer |
bool mscan_config_t::enableWakeup |
bool mscan_config_t::enableLoopBack |
bool mscan_config_t::enableListen |
struct mscan_timing_config_t |
uint8_t mscan_timing_config_t::priDiv |
uint8_t mscan_timing_config_t::sJumpwidth |
uint8_t mscan_timing_config_t::timeSeg1 |
uint8_t mscan_timing_config_t::timeSeg2 |
uint8_t mscan_timing_config_t::samp |
struct mscan_mb_transfer_t |
uint8_t mscan_mb_transfer_t::mask |
MsCAN handle structure definition.
void* mscan_handle_t::userData |
volatile uint8_t mscan_handle_t::mbStateTx |
volatile uint8_t mscan_handle_t::mbStateRx |
#define MSCAN_RX_MB_STD_MASK |
( |
|
id | ) |
|
Value:((uint32_t)((((uint32_t)(id)&0x7) << 21) | \
((((uint32_t)(id) >> 3) & 0xFF) << 24)))
Standard Rx Message Buffer Mask helper macro.
#define MSCAN_RX_MB_EXT_MASK |
( |
|
id | ) |
|
Value:((uint32_t)(((((uint32_t)(id) >> 21) & 0xFF) << 24) | ((((uint32_t)(id) >> 18) & 0x7) << 21) | \
((((uint32_t)(id) >> 15) & 0x7) << 16) | (((((uint32_t)(id) >> 7) & 0xFF)) << 8) | \
(((uint32_t)(id)&0x7F) << 1)))
typedef void(* mscan_transfer_callback_t)(MSCAN_Type *base, mscan_handle_t *handle, status_t status, void *userData) |
The MsCAN transfer callback returns a value from the underlying layer. If the status equals to kStatus_MSCAN_ErrorStatus, the result parameter is the Content of MsCAN status register which can be used to get the working status(or error status) of MsCAN module. If the status equals to other MsCAN Message Buffer transfer status, the result is the index of Message Buffer that generate transfer event. If the status equals to other MsCAN Message Buffer transfer status, the result is meaningless and should be Ignored.
Enumerator |
---|
kStatus_MSCAN_TxBusy |
Tx Message Buffer is Busy.
|
kStatus_MSCAN_TxIdle |
Tx Message Buffer is Idle.
|
kStatus_MSCAN_TxSwitchToRx |
Remote Message is send out and Message buffer changed to Receive one.
|
kStatus_MSCAN_RxBusy |
Rx Message Buffer is Busy.
|
kStatus_MSCAN_RxIdle |
Rx Message Buffer is Idle.
|
kStatus_MSCAN_RxOverflow |
Rx Message Buffer is Overflowed.
|
kStatus_MSCAN_RxFifoBusy |
Rx Message FIFO is Busy.
|
kStatus_MSCAN_RxFifoIdle |
Rx Message FIFO is Idle.
|
kStatus_MSCAN_RxFifoOverflow |
Rx Message FIFO is overflowed.
|
kStatus_MSCAN_RxFifoWarning |
Rx Message FIFO is almost overflowed.
|
kStatus_MSCAN_ErrorStatus |
FlexCAN Module Error and Status.
|
kStatus_MSCAN_UnHandled |
UnHadled Interrupt asserted.
|
Enumerator |
---|
kMSCAN_FrameFormatStandard |
Standard frame format attribute.
|
kMSCAN_FrameFormatExtend |
Extend frame format attribute.
|
Enumerator |
---|
kMSCAN_FrameTypeData |
Data frame type attribute.
|
kMSCAN_FrameTypeRemote |
Remote frame type attribute.
|
Enumerator |
---|
kMSCAN_ClkSrcOsc |
MsCAN Protocol Engine clock from Oscillator.
|
kMSCAN_ClkSrcBus |
MsCAN Protocol Engine clock from Bus Clock.
|
Enumerator |
---|
kMSCAN_BusoffrecAuto |
MsCAN automatic bus-off recovery.
|
kMSCAN_BusoffrecUsr |
MsCAN bus-off recovery upon user request.
|
Enumerator |
---|
kMSCAN_TxBuf0Empty |
MsCAN Tx Buffer 0 empty.
|
kMSCAN_TxBuf1Empty |
MsCAN Tx Buffer 1 empty.
|
kMSCAN_TxBuf2Empty |
MsCAN Tx Buffer 2 empty.
|
kMSCAN_TxBufFull |
MsCAN Tx Buffer all not empty.
|
Enumerator |
---|
kMSCAN_Filter32Bit |
Two 32-bit acceptance filters.
|
kMSCAN_Filter16Bit |
Four 16-bit acceptance filters.
|
kMSCAN_Filter8Bit |
Eight 8-bit acceptance filters.
|
kMSCAN_FilterClose |
Filter closed.
|
This structure contains the settings for all of the MsCAN Module interrupt configurations.
Enumerator |
---|
kMSCAN_WakeUpInterruptEnable |
Wake Up interrupt.
|
kMSCAN_StatusChangeInterruptEnable |
Status change interrupt.
|
kMSCAN_RxStatusChangeInterruptEnable |
Rx status change interrupt.
|
kMSCAN_TxStatusChangeInterruptEnable |
Tx status change interrupt.
|
kMSCAN_OverrunInterruptEnable |
Overrun interrupt.
|
kMSCAN_RxFullInterruptEnable |
Rx buffer full interrupt.
|
kMSCAN_TxEmptyInterruptEnable |
Tx buffer empty interrupt.
|
void MSCAN_Init |
( |
MSCAN_Type * |
base, |
|
|
const mscan_config_t * |
config, |
|
|
uint32_t |
sourceClock_Hz |
|
) |
| |
This function initializes the MsCAN module with user-defined settings. This example shows how to set up the mscan_config_t parameters and how to call the MSCAN_Init function by passing in these parameters.
- Parameters
-
base | MsCAN peripheral base address. |
config | Pointer to the user-defined configuration structure. |
sourceClock_Hz | MsCAN Protocol Engine clock source frequency in Hz. |
void MSCAN_Deinit |
( |
MSCAN_Type * |
base | ) |
|
This function disables the MsCAN module clock and sets all register values to the reset value.
- Parameters
-
base | MsCAN peripheral base address. |
This function initializes the MsCAN configuration structure to default values.
- Parameters
-
config | Pointer to the MsCAN configuration structure. |
static uint8_t MSCAN_GetTxBufferEmptyFlag |
( |
MSCAN_Type * |
base | ) |
|
|
inlinestatic |
This flag indicates that the associated transmit message buffer is empty.
- Parameters
-
base | MsCAN peripheral base address. |
static void MSCAN_TxBufferSelect |
( |
MSCAN_Type * |
base, |
|
|
uint8_t |
txBuf |
|
) |
| |
|
inlinestatic |
To get the next available transmit buffer, read the CANTFLG register and write its value back into the CANTBSEL register.
- Parameters
-
base | MsCAN peripheral base address. |
txBuf | The value read from CANTFLG. |
static uint8_t MSCAN_GetTxBufferSelect |
( |
MSCAN_Type * |
base | ) |
|
|
inlinestatic |
After write TFLG value back into the CANTBSEL register, read again CANBSEL to get the actual trasnsmit message buffer.
- Parameters
-
base | MsCAN peripheral base address. |
static void MSCAN_TxBufferLaunch |
( |
MSCAN_Type * |
base, |
|
|
uint8_t |
txBuf |
|
) |
| |
|
inlinestatic |
The CPU must clear the flag after a message is set up in the transmit buffer and is due for transmission.
- Parameters
-
base | MsCAN peripheral base address. |
txBuf | Message buffer(s) to be cleared. |
static uint8_t MSCAN_GetTxBufferStatusFlags |
( |
MSCAN_Type * |
base, |
|
|
uint8_t |
mask |
|
) |
| |
|
inlinestatic |
The bit is set after successful transmission.
- Parameters
-
base | MsCAN peripheral base address. |
mask | Message buffer(s) mask. |
static uint8_t MSCAN_GetRxBufferFullFlag |
( |
MSCAN_Type * |
base | ) |
|
|
inlinestatic |
RXF is set by the MSCAN when a new message is shifted in the receiver FIFO. This flag indicates whether the shifted buffer is loaded with a correctly received message.
- Parameters
-
base | MsCAN peripheral base address. |
static void MSCAN_ClearRxBufferFullFlag |
( |
MSCAN_Type * |
base | ) |
|
|
inlinestatic |
After the CPU has read that message from the RxFG buffer in the receiver FIFO The RXF flag must be cleared to release the buffer.
- Parameters
-
base | MsCAN peripheral base address. |
This function gives user settings to CAN bus timing characteristic. The function is for an experienced user. For less experienced users, call the MSCAN_Init() and fill the baud rate field with a desired value. This provides the default timing characteristics to the module.
Note that calling MSCAN_SetTimingConfig() overrides the baud rate set in MSCAN_Init().
- Parameters
-
base | MsCAN peripheral base address. |
config | Pointer to the timing configuration structure. |
static uint8_t MSCAN_GetTxBufEmptyFlags |
( |
MSCAN_Type * |
base | ) |
|
|
inlinestatic |
This function gets MsCAN Tx buffer empty flags. It's returned as the value of the enumerators _mscan_tx_buffer_empty_flag.
- Parameters
-
base | MsCAN peripheral base address. |
- Returns
- Tx buffer empty flags in the _mscan_tx_buffer_empty_flag.
static void MSCAN_EnableTxInterrupts |
( |
MSCAN_Type * |
base, |
|
|
uint8_t |
mask |
|
) |
| |
|
inlinestatic |
This function enables the MsCAN Tx empty interrupts according to the mask.
- Parameters
-
base | MsCAN peripheral base address. |
mask | The Tx interrupts mask to enable. |
static void MSCAN_DisableTxInterrupts |
( |
MSCAN_Type * |
base, |
|
|
uint8_t |
mask |
|
) |
| |
|
inlinestatic |
This function disables the MsCAN Tx emtpy interrupts according to the mask.
- Parameters
-
base | MsCAN peripheral base address. |
mask | The Tx interrupts mask to disable. |
static void MSCAN_EnableRxInterrupts |
( |
MSCAN_Type * |
base, |
|
|
uint8_t |
mask |
|
) |
| |
|
inlinestatic |
This function enables the MsCAN Rx interrupts according to the provided mask which is a logical OR of enumeration members, see _mscan_interrupt_enable.
- Parameters
-
static void MSCAN_DisableRxInterrupts |
( |
MSCAN_Type * |
base, |
|
|
uint8_t |
mask |
|
) |
| |
|
inlinestatic |
This function disables the MsCAN Rx interrupts according to the provided mask which is a logical OR of enumeration members, see _mscan_interrupt_enable.
- Parameters
-
static void MSCAN_AbortTxRequest |
( |
MSCAN_Type * |
base, |
|
|
uint8_t |
mask |
|
) |
| |
|
inlinestatic |
This function allows abort request of queued messages.
- Parameters
-
base | MsCAN peripheral base address. |
mask | The Tx mask to abort. |
static void MSCAN_Enable |
( |
MSCAN_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
This function enables or disables the MsCAN module.
- Parameters
-
base | MsCAN base pointer. |
enable | true to enable, false to disable. |
This function writes a CAN Message to the specified Transmit Message Buffer and changes the Message Buffer state to start CAN Message transmit. After that the function returns immediately.
- Parameters
-
base | MsCAN peripheral base address. |
pTxFrame | Pointer to CAN message frame to be sent. |
- Return values
-
kStatus_Success | - Write Tx Message Buffer Successfully. |
kStatus_Fail | - Tx Message Buffer is currently in use. |
This function reads a CAN message from a specified Receive Message Buffer. The function fills a receive CAN message frame structure with just received data and activates the Message Buffer again. The function returns immediately.
- Parameters
-
base | MsCAN peripheral base address. |
pRxFrame | Pointer to CAN message frame structure for reception. |
- Return values
-
kStatus_Success | - Rx Message Buffer is full and has been read successfully. |
kStatus_Fail | - Rx Message Buffer is empty. |
void MSCAN_TransferCreateHandle |
( |
MSCAN_Type * |
base, |
|
|
mscan_handle_t * |
handle, |
|
|
mscan_transfer_callback_t |
callback, |
|
|
void * |
userData |
|
) |
| |
This function initializes the MsCAN handle, which can be used for other MsCAN transactional APIs. Usually, for a specified MsCAN instance, call this API once to get the initialized handle.
- Parameters
-
base | MsCAN peripheral base address. |
handle | MsCAN handle pointer. |
callback | The callback function. |
userData | The parameter of the callback function. |
Note that a transfer handle does not need to be created before calling this API.
- Parameters
-
base | MsCAN peripheral base pointer. |
pTxFrame | Pointer to CAN message frame to be sent. |
- Return values
-
kStatus_Success | - Write Tx Message Buffer Successfully. |
kStatus_Fail | - Tx Message Buffer is currently in use. |
Note that a transfer handle does not need to be created before calling this API.
- Parameters
-
base | MsCAN peripheral base pointer. |
pRxFrame | Pointer to CAN message frame to be received. |
- Return values
-
kStatus_Success | - Read Rx Message Buffer Successfully. |
kStatus_Fail | - Tx Message Buffer is currently in use. |
This function sends a message using IRQ. This is a non-blocking function, which returns right away. When messages have been sent out, the send callback function is called.
- Parameters
-
base | MsCAN peripheral base address. |
handle | MsCAN handle pointer. |
xfer | MsCAN Message Buffer transfer structure. See the mscan_mb_transfer_t. |
- Return values
-
kStatus_Success | Start Tx Message Buffer sending process successfully. |
kStatus_Fail | Write Tx Message Buffer failed. |
This function receives a message using IRQ. This is non-blocking function, which returns right away. When the message has been received, the receive callback function is called.
- Parameters
-
base | MsCAN peripheral base address. |
handle | MsCAN handle pointer. |
xfer | MsCAN Message Buffer transfer structure. See the mscan_mb_transfer_t. |
- Return values
-
kStatus_Success | - Start Rx Message Buffer receiving process successfully. |
kStatus_MSCAN_RxBusy | - Rx Message Buffer is in use. |
void MSCAN_TransferAbortSend |
( |
MSCAN_Type * |
base, |
|
|
mscan_handle_t * |
handle, |
|
|
uint8_t |
mask |
|
) |
| |
This function aborts the interrupt driven message send process.
- Parameters
-
base | MsCAN peripheral base address. |
handle | MsCAN handle pointer. |
mask | The MsCAN Tx Message Buffer mask. |
void MSCAN_TransferAbortReceive |
( |
MSCAN_Type * |
base, |
|
|
mscan_handle_t * |
handle, |
|
|
uint8_t |
mask |
|
) |
| |
This function aborts the interrupt driven message receive process.
- Parameters
-
base | MsCAN peripheral base address. |
handle | MsCAN handle pointer. |
mask | The MsCAN Rx Message Buffer mask. |
void MSCAN_TransferHandleIRQ |
( |
MSCAN_Type * |
base, |
|
|
mscan_handle_t * |
handle |
|
) |
| |
This function handles the MSCAN Error, the Message Buffer, and the Rx FIFO IRQ request.
- Parameters
-
base | MSCAN peripheral base address. |
handle | MSCAN handle pointer. |