RTEMS 6.1-rc4
|
Data Structures | |
struct | _flexcan_frame |
FlexCAN message frame structure. More... | |
struct | _flexcan_timing_config |
FlexCAN protocol timing characteristic configuration structure. More... | |
struct | _flexcan_config |
FlexCAN module configuration structure. More... | |
struct | _flexcan_rx_mb_config |
FlexCAN Receive Message Buffer configuration structure. More... | |
struct | _flexcan_rx_fifo_config |
FlexCAN Legacy Rx FIFO configuration structure. More... | |
struct | _flexcan_mb_transfer |
FlexCAN Message Buffer transfer. More... | |
struct | _flexcan_fifo_transfer |
FlexCAN Rx FIFO transfer. More... | |
struct | _flexcan_handle |
FlexCAN handle structure. More... | |
Driver version | |
enum | { kStatus_FLEXCAN_TxBusy = MAKE_STATUS(kStatusGroup_FLEXCAN, 0) , kStatus_FLEXCAN_TxIdle = MAKE_STATUS(kStatusGroup_FLEXCAN, 1) , kStatus_FLEXCAN_TxSwitchToRx , kStatus_FLEXCAN_RxBusy = MAKE_STATUS(kStatusGroup_FLEXCAN, 3) , kStatus_FLEXCAN_RxIdle = MAKE_STATUS(kStatusGroup_FLEXCAN, 4) , kStatus_FLEXCAN_RxOverflow = MAKE_STATUS(kStatusGroup_FLEXCAN, 5) , kStatus_FLEXCAN_RxFifoBusy = MAKE_STATUS(kStatusGroup_FLEXCAN, 6) , kStatus_FLEXCAN_RxFifoIdle = MAKE_STATUS(kStatusGroup_FLEXCAN, 7) , kStatus_FLEXCAN_RxFifoOverflow = MAKE_STATUS(kStatusGroup_FLEXCAN, 8) , kStatus_FLEXCAN_RxFifoWarning = MAKE_STATUS(kStatusGroup_FLEXCAN, 9) , kStatus_FLEXCAN_RxFifoDisabled , kStatus_FLEXCAN_ErrorStatus = MAKE_STATUS(kStatusGroup_FLEXCAN, 11) , kStatus_FLEXCAN_WakeUp = MAKE_STATUS(kStatusGroup_FLEXCAN, 12) , kStatus_FLEXCAN_UnHandled = MAKE_STATUS(kStatusGroup_FLEXCAN, 13) , kStatus_FLEXCAN_RxRemote = MAKE_STATUS(kStatusGroup_FLEXCAN, 14) } |
FlexCAN transfer status. More... | |
enum | _flexcan_frame_format { kFLEXCAN_FrameFormatStandard = 0x0U , kFLEXCAN_FrameFormatExtend = 0x1U } |
FlexCAN frame format. More... | |
enum | _flexcan_frame_type { kFLEXCAN_FrameTypeData = 0x0U , kFLEXCAN_FrameTypeRemote = 0x1U } |
FlexCAN frame type. More... | |
enum | _flexcan_clock_source { kFLEXCAN_ClkSrcOsc = 0x0U , kFLEXCAN_ClkSrcPeri = 0x1U , kFLEXCAN_ClkSrc0 = 0x0U , kFLEXCAN_ClkSrc1 = 0x1U } |
FlexCAN clock source. More... | |
enum | _flexcan_wake_up_source { kFLEXCAN_WakeupSrcUnfiltered = 0x0U , kFLEXCAN_WakeupSrcFiltered = 0x1U } |
FlexCAN wake up source. More... | |
enum | _flexcan_rx_fifo_filter_type { kFLEXCAN_RxFifoFilterTypeA = 0x0U , kFLEXCAN_RxFifoFilterTypeB , kFLEXCAN_RxFifoFilterTypeC , kFLEXCAN_RxFifoFilterTypeD = 0x3U } |
FlexCAN Rx Fifo Filter type. More... | |
enum | _flexcan_rx_fifo_priority { kFLEXCAN_RxFifoPrioLow = 0x0U , kFLEXCAN_RxFifoPrioHigh = 0x1U } |
FlexCAN Enhanced/Legacy Rx FIFO priority. More... | |
enum | _flexcan_interrupt_enable { kFLEXCAN_BusOffInterruptEnable = CAN_CTRL1_BOFFMSK_MASK , kFLEXCAN_ErrorInterruptEnable = CAN_CTRL1_ERRMSK_MASK , kFLEXCAN_TxWarningInterruptEnable = CAN_CTRL1_TWRNMSK_MASK , kFLEXCAN_RxWarningInterruptEnable = CAN_CTRL1_RWRNMSK_MASK , kFLEXCAN_WakeUpInterruptEnable = CAN_MCR_WAKMSK_MASK } |
FlexCAN interrupt enable enumerations. More... | |
enum | _flexcan_flags { kFLEXCAN_SynchFlag = CAN_ESR1_SYNCH_MASK , kFLEXCAN_TxWarningIntFlag = CAN_ESR1_TWRNINT_MASK , kFLEXCAN_RxWarningIntFlag = CAN_ESR1_RWRNINT_MASK , kFLEXCAN_IdleFlag = CAN_ESR1_IDLE_MASK , kFLEXCAN_FaultConfinementFlag = CAN_ESR1_FLTCONF_MASK , kFLEXCAN_TransmittingFlag = CAN_ESR1_TX_MASK , kFLEXCAN_ReceivingFlag = CAN_ESR1_RX_MASK , kFLEXCAN_BusOffIntFlag = CAN_ESR1_BOFFINT_MASK , kFLEXCAN_ErrorIntFlag = CAN_ESR1_ERRINT_MASK , kFLEXCAN_WakeUpIntFlag = CAN_ESR1_WAKINT_MASK , kFLEXCAN_ErrorFlag } |
FlexCAN status flags. More... | |
enum | _flexcan_error_flags { kFLEXCAN_TxErrorWarningFlag = CAN_ESR1_TXWRN_MASK , kFLEXCAN_RxErrorWarningFlag = CAN_ESR1_RXWRN_MASK , kFLEXCAN_StuffingError = CAN_ESR1_STFERR_MASK , kFLEXCAN_FormError = CAN_ESR1_FRMERR_MASK , kFLEXCAN_CrcError = CAN_ESR1_CRCERR_MASK , kFLEXCAN_AckError = CAN_ESR1_ACKERR_MASK , kFLEXCAN_Bit0Error = CAN_ESR1_BIT0ERR_MASK , kFLEXCAN_Bit1Error = CAN_ESR1_BIT1ERR_MASK } |
FlexCAN error status flags. More... | |
enum | { kFLEXCAN_RxFifoOverflowFlag = CAN_IFLAG1_BUF7I_MASK , kFLEXCAN_RxFifoWarningFlag = CAN_IFLAG1_BUF6I_MASK , kFLEXCAN_RxFifoFrameAvlFlag = CAN_IFLAG1_BUF5I_MASK } |
FlexCAN Legacy Rx FIFO status flags. More... | |
typedef enum _flexcan_frame_format | flexcan_frame_format_t |
FlexCAN frame format. | |
typedef enum _flexcan_frame_type | flexcan_frame_type_t |
FlexCAN frame type. | |
typedef enum _flexcan_clock_source | flexcan_clock_source_t |
FlexCAN clock source. | |
typedef enum _flexcan_wake_up_source | flexcan_wake_up_source_t |
FlexCAN wake up source. | |
typedef enum _flexcan_rx_fifo_filter_type | flexcan_rx_fifo_filter_type_t |
FlexCAN Rx Fifo Filter type. | |
typedef enum _flexcan_rx_fifo_priority | flexcan_rx_fifo_priority_t |
FlexCAN Enhanced/Legacy Rx FIFO priority. | |
typedef struct _flexcan_frame | flexcan_frame_t |
FlexCAN message frame structure. | |
typedef struct _flexcan_timing_config | flexcan_timing_config_t |
FlexCAN protocol timing characteristic configuration structure. | |
typedef struct _flexcan_config | flexcan_config_t |
FlexCAN module configuration structure. | |
typedef struct _flexcan_rx_mb_config | flexcan_rx_mb_config_t |
FlexCAN Receive Message Buffer configuration structure. | |
typedef struct _flexcan_rx_fifo_config | flexcan_rx_fifo_config_t |
FlexCAN Legacy Rx FIFO configuration structure. | |
typedef struct _flexcan_mb_transfer | flexcan_mb_transfer_t |
FlexCAN Message Buffer transfer. | |
typedef struct _flexcan_fifo_transfer | flexcan_fifo_transfer_t |
FlexCAN Rx FIFO transfer. | |
typedef struct _flexcan_handle | flexcan_handle_t |
FlexCAN handle structure definition. | |
typedef void(* | flexcan_transfer_callback_t) (CAN_Type *base, flexcan_handle_t *handle, status_t status, uint32_t result, void *userData) |
#define | FSL_FLEXCAN_DRIVER_VERSION (MAKE_VERSION(2, 9, 2)) |
FlexCAN driver version. | |
#define | FLEXCAN_WAIT_TIMEOUT (1000U) |
#define | FLEXCAN_ID_STD(id) (((uint32_t)(((uint32_t)(id)) << CAN_ID_STD_SHIFT)) & CAN_ID_STD_MASK) |
FlexCAN frame length helper macro. | |
#define | FLEXCAN_ID_EXT(id) |
#define | FLEXCAN_RX_MB_STD_MASK(id, rtr, ide) |
FlexCAN Rx Message Buffer Mask helper macro. | |
#define | FLEXCAN_RX_MB_EXT_MASK(id, rtr, ide) |
#define | FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(id, rtr, ide) |
FlexCAN Legacy Rx FIFO Mask helper macro. | |
#define | FLEXCAN_RX_FIFO_STD_MASK_TYPE_B_HIGH(id, rtr, ide) |
#define | FLEXCAN_RX_FIFO_STD_MASK_TYPE_B_LOW(id, rtr, ide) |
#define | FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_HIGH(id) (((uint32_t)(id)&0x7F8) << 21) |
#define | FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_MID_HIGH(id) (((uint32_t)(id)&0x7F8) << 13) |
#define | FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_MID_LOW(id) (((uint32_t)(id)&0x7F8) << 5) |
#define | FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_LOW(id) (((uint32_t)(id)&0x7F8) >> 3) |
#define | FLEXCAN_RX_FIFO_EXT_MASK_TYPE_A(id, rtr, ide) |
#define | FLEXCAN_RX_FIFO_EXT_MASK_TYPE_B_HIGH(id, rtr, ide) |
#define | FLEXCAN_RX_FIFO_EXT_MASK_TYPE_B_LOW(id, rtr, ide) |
#define | FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_HIGH(id) ((FLEXCAN_ID_EXT(id) & 0x1FE00000) << 3) |
#define | FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_MID_HIGH(id) |
#define | FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_MID_LOW(id) |
#define | FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_LOW(id) ((FLEXCAN_ID_EXT(id) & 0x1FE00000) >> 21) |
#define | FLEXCAN_RX_FIFO_STD_FILTER_TYPE_A(id, rtr, ide) FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(id, rtr, ide) |
FlexCAN Rx FIFO Filter helper macro. | |
#define | FLEXCAN_RX_FIFO_STD_FILTER_TYPE_B_HIGH(id, rtr, ide) |
#define | FLEXCAN_RX_FIFO_STD_FILTER_TYPE_B_LOW(id, rtr, ide) |
#define | FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_HIGH(id) |
#define | FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_MID_HIGH(id) |
#define | FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_MID_LOW(id) |
#define | FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_LOW(id) |
#define | FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_A(id, rtr, ide) FLEXCAN_RX_FIFO_EXT_MASK_TYPE_A(id, rtr, ide) |
#define | FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_B_HIGH(id, rtr, ide) |
#define | FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_B_LOW(id, rtr, ide) |
#define | FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_C_HIGH(id) |
#define | FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_C_MID_HIGH(id) |
#define | FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_C_MID_LOW(id) |
#define | FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_C_LOW(id) FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_LOW(id) |
#define | FLEXCAN_ERROR_AND_STATUS_INIT_FLAG |
FlexCAN interrupt/status flag helper macro. | |
#define | FLEXCAN_WAKE_UP_FLAG ((uint32_t)kFLEXCAN_WakeUpIntFlag) |
#define | FLEXCAN_MEMORY_ERROR_INIT_FLAG (0U) |
#define | FLEXCAN_MEMORY_ENHANCED_RX_FIFO_INIT_FLAG (0U) |
FlexCAN Enhanced Rx FIFO base address helper macro. | |
#define | FLEXCAN_CALLBACK(x) void(x)(CAN_Type * base, flexcan_handle_t * handle, status_t status, uint32_t result, void *userData) |
FlexCAN transfer callback function. | |
Initialization and deinitialization | |
void | FLEXCAN_EnterFreezeMode (CAN_Type *base) |
Enter FlexCAN Freeze Mode. | |
void | FLEXCAN_ExitFreezeMode (CAN_Type *base) |
Exit FlexCAN Freeze Mode. | |
uint32_t | FLEXCAN_GetInstance (CAN_Type *base) |
Get the FlexCAN instance from peripheral base address. | |
bool | FLEXCAN_CalculateImprovedTimingValues (CAN_Type *base, uint32_t bitRate, uint32_t sourceClock_Hz, flexcan_timing_config_t *pTimingConfig) |
Calculates the improved timing values by specific bit Rates for classical CAN. | |
void | FLEXCAN_Init (CAN_Type *base, const flexcan_config_t *pConfig, uint32_t sourceClock_Hz) |
Initializes a FlexCAN instance. | |
void | FLEXCAN_Deinit (CAN_Type *base) |
De-initializes a FlexCAN instance. | |
void | FLEXCAN_GetDefaultConfig (flexcan_config_t *pConfig) |
Gets the default configuration structure. | |
Configuration. | |
void | FLEXCAN_SetTimingConfig (CAN_Type *base, const flexcan_timing_config_t *pConfig) |
Sets the FlexCAN classical CAN protocol timing characteristic. | |
status_t | FLEXCAN_SetBitRate (CAN_Type *base, uint32_t sourceClock_Hz, uint32_t bitRate_Bps) |
Set bit rate of FlexCAN classical CAN frame or CAN FD frame nominal phase. | |
void | FLEXCAN_SetRxMbGlobalMask (CAN_Type *base, uint32_t mask) |
Sets the FlexCAN receive message buffer global mask. | |
void | FLEXCAN_SetRxFifoGlobalMask (CAN_Type *base, uint32_t mask) |
Sets the FlexCAN receive FIFO global mask. | |
void | FLEXCAN_SetRxIndividualMask (CAN_Type *base, uint8_t maskIdx, uint32_t mask) |
Sets the FlexCAN receive individual mask. | |
void | FLEXCAN_SetTxMbConfig (CAN_Type *base, uint8_t mbIdx, bool enable) |
Configures a FlexCAN transmit message buffer. | |
void | FLEXCAN_SetRxMbConfig (CAN_Type *base, uint8_t mbIdx, const flexcan_rx_mb_config_t *pRxMbConfig, bool enable) |
Configures a FlexCAN Receive Message Buffer. | |
void | FLEXCAN_SetRxFifoConfig (CAN_Type *base, const flexcan_rx_fifo_config_t *pRxFifoConfig, bool enable) |
Configures the FlexCAN Legacy Rx FIFO. | |
Bus Operations | |
status_t | FLEXCAN_WriteTxMb (CAN_Type *base, uint8_t mbIdx, const flexcan_frame_t *pTxFrame) |
Writes a FlexCAN Message to the Transmit Message Buffer. | |
status_t | FLEXCAN_ReadRxMb (CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pRxFrame) |
Reads a FlexCAN Message from Receive Message Buffer. | |
status_t | FLEXCAN_ReadRxFifo (CAN_Type *base, flexcan_frame_t *pRxFrame) |
Reads a FlexCAN Message from Legacy Rx FIFO. | |
Transactional | |
status_t | FLEXCAN_TransferSendBlocking (CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pTxFrame) |
Performs a polling send transaction on the CAN bus. | |
status_t | FLEXCAN_TransferReceiveBlocking (CAN_Type *base, uint8_t mbIdx, flexcan_frame_t *pRxFrame) |
Performs a polling receive transaction on the CAN bus. | |
status_t | FLEXCAN_TransferReceiveFifoBlocking (CAN_Type *base, flexcan_frame_t *pRxFrame) |
Performs a polling receive transaction from Legacy Rx FIFO on the CAN bus. | |
void | FLEXCAN_TransferCreateHandle (CAN_Type *base, flexcan_handle_t *handle, flexcan_transfer_callback_t callback, void *userData) |
Initializes the FlexCAN handle. | |
status_t | FLEXCAN_TransferSendNonBlocking (CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer) |
Sends a message using IRQ. | |
status_t | FLEXCAN_TransferReceiveNonBlocking (CAN_Type *base, flexcan_handle_t *handle, flexcan_mb_transfer_t *pMbXfer) |
Receives a message using IRQ. | |
status_t | FLEXCAN_TransferReceiveFifoNonBlocking (CAN_Type *base, flexcan_handle_t *handle, flexcan_fifo_transfer_t *pFifoXfer) |
Receives a message from Rx FIFO using IRQ. | |
status_t | FLEXCAN_TransferGetReceiveFifoCount (CAN_Type *base, flexcan_handle_t *handle, size_t *count) |
Gets the Legacy Rx Fifo transfer status during a interrupt non-blocking receive. | |
uint32_t | FLEXCAN_GetTimeStamp (flexcan_handle_t *handle, uint8_t mbIdx) |
Gets the detail index of Mailbox's Timestamp by handle. | |
void | FLEXCAN_TransferAbortSend (CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx) |
Aborts the interrupt driven message send process. | |
void | FLEXCAN_TransferAbortReceive (CAN_Type *base, flexcan_handle_t *handle, uint8_t mbIdx) |
Aborts the interrupt driven message receive process. | |
void | FLEXCAN_TransferAbortReceiveFifo (CAN_Type *base, flexcan_handle_t *handle) |
Aborts the interrupt driven message receive from Rx FIFO process. | |
void | FLEXCAN_TransferHandleIRQ (CAN_Type *base, flexcan_handle_t *handle) |
FlexCAN IRQ handle function. | |
#define FLEXCAN_CALLBACK | ( | x | ) | void(x)(CAN_Type * base, flexcan_handle_t * handle, status_t status, uint32_t result, void *userData) |
FlexCAN transfer callback function.
The FlexCAN transfer callback returns a value from the underlying layer. If the status equals to kStatus_FLEXCAN_ErrorStatus, the result parameter is the Content of FlexCAN status register which can be used to get the working status(or error status) of FlexCAN module. If the status equals to other FlexCAN Message Buffer transfer status, the result is the index of Message Buffer that generate transfer event. If the status equals to other FlexCAN Message Buffer transfer status, the result is meaningless and should be Ignored.
#define FLEXCAN_ERROR_AND_STATUS_INIT_FLAG |
FlexCAN interrupt/status flag helper macro.
#define FLEXCAN_ID_EXT | ( | id | ) |
Extend Frame ID helper macro.
#define FLEXCAN_ID_STD | ( | id | ) | (((uint32_t)(((uint32_t)(id)) << CAN_ID_STD_SHIFT)) & CAN_ID_STD_MASK) |
FlexCAN frame length helper macro.
FlexCAN Frame ID helper macro. Standard Frame ID helper macro.
#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_A | ( | id, | |
rtr, | |||
ide | |||
) | FLEXCAN_RX_FIFO_EXT_MASK_TYPE_A(id, rtr, ide) |
Extend Rx FIFO Filter helper macro Type A helper macro.
#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_B_HIGH | ( | id, | |
rtr, | |||
ide | |||
) |
Extend Rx FIFO Filter helper macro Type B upper part helper macro.
#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_B_LOW | ( | id, | |
rtr, | |||
ide | |||
) |
Extend Rx FIFO Filter helper macro Type B lower part helper macro.
#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_C_HIGH | ( | id | ) |
Extend Rx FIFO Filter helper macro Type C upper part helper macro.
#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_C_LOW | ( | id | ) | FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_LOW(id) |
Extend Rx FIFO Filter helper macro Type C lower part helper macro.
#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_C_MID_HIGH | ( | id | ) |
Extend Rx FIFO Filter helper macro Type C mid-upper part helper macro.
#define FLEXCAN_RX_FIFO_EXT_FILTER_TYPE_C_MID_LOW | ( | id | ) |
Extend Rx FIFO Filter helper macro Type C mid-lower part helper macro.
#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_A | ( | id, | |
rtr, | |||
ide | |||
) |
Extend Rx FIFO Mask helper macro Type A helper macro.
#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_B_HIGH | ( | id, | |
rtr, | |||
ide | |||
) |
Extend Rx FIFO Mask helper macro Type B upper part helper macro.
#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_B_LOW | ( | id, | |
rtr, | |||
ide | |||
) |
Extend Rx FIFO Mask helper macro Type B lower part helper macro.
#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_HIGH | ( | id | ) | ((FLEXCAN_ID_EXT(id) & 0x1FE00000) << 3) |
Extend Rx FIFO Mask helper macro Type C upper part helper macro.
#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_LOW | ( | id | ) | ((FLEXCAN_ID_EXT(id) & 0x1FE00000) >> 21) |
Extend Rx FIFO Mask helper macro Type C lower part helper macro.
#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_MID_HIGH | ( | id | ) |
Extend Rx FIFO Mask helper macro Type C mid-upper part helper macro.
#define FLEXCAN_RX_FIFO_EXT_MASK_TYPE_C_MID_LOW | ( | id | ) |
Extend Rx FIFO Mask helper macro Type C mid-lower part helper macro.
#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_A | ( | id, | |
rtr, | |||
ide | |||
) | FLEXCAN_RX_FIFO_STD_MASK_TYPE_A(id, rtr, ide) |
FlexCAN Rx FIFO Filter helper macro.
Standard Rx FIFO Filter helper macro Type A helper macro.
#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_B_HIGH | ( | id, | |
rtr, | |||
ide | |||
) |
Standard Rx FIFO Filter helper macro Type B upper part helper macro.
#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_B_LOW | ( | id, | |
rtr, | |||
ide | |||
) |
Standard Rx FIFO Filter helper macro Type B lower part helper macro.
#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_HIGH | ( | id | ) |
Standard Rx FIFO Filter helper macro Type C upper part helper macro.
#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_LOW | ( | id | ) |
Standard Rx FIFO Filter helper macro Type C lower part helper macro.
#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_MID_HIGH | ( | id | ) |
Standard Rx FIFO Filter helper macro Type C mid-upper part helper macro.
#define FLEXCAN_RX_FIFO_STD_FILTER_TYPE_C_MID_LOW | ( | id | ) |
Standard Rx FIFO Filter helper macro Type C mid-lower part helper macro.
#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_A | ( | id, | |
rtr, | |||
ide | |||
) |
FlexCAN Legacy Rx FIFO Mask helper macro.
Standard Rx FIFO Mask helper macro Type A helper macro.
#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_B_HIGH | ( | id, | |
rtr, | |||
ide | |||
) |
Standard Rx FIFO Mask helper macro Type B upper part helper macro.
#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_B_LOW | ( | id, | |
rtr, | |||
ide | |||
) |
Standard Rx FIFO Mask helper macro Type B lower part helper macro.
#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_HIGH | ( | id | ) | (((uint32_t)(id)&0x7F8) << 21) |
Standard Rx FIFO Mask helper macro Type C upper part helper macro.
#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_LOW | ( | id | ) | (((uint32_t)(id)&0x7F8) >> 3) |
Standard Rx FIFO Mask helper macro Type C lower part helper macro.
#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_MID_HIGH | ( | id | ) | (((uint32_t)(id)&0x7F8) << 13) |
Standard Rx FIFO Mask helper macro Type C mid-upper part helper macro.
#define FLEXCAN_RX_FIFO_STD_MASK_TYPE_C_MID_LOW | ( | id | ) | (((uint32_t)(id)&0x7F8) << 5) |
Standard Rx FIFO Mask helper macro Type C mid-lower part helper macro.
#define FLEXCAN_RX_MB_EXT_MASK | ( | id, | |
rtr, | |||
ide | |||
) |
Extend Rx Message Buffer Mask helper macro.
#define FLEXCAN_RX_MB_STD_MASK | ( | id, | |
rtr, | |||
ide | |||
) |
FlexCAN Rx Message Buffer Mask helper macro.
Standard Rx Message Buffer Mask helper macro.
typedef enum _flexcan_clock_source flexcan_clock_source_t |
FlexCAN clock source.
Do not use the kFLEXCAN_ClkSrcOs. It has been superceded kFLEXCAN_ClkSrc0
Do not use the kFLEXCAN_ClkSrcPeri. It has been superceded kFLEXCAN_ClkSrc1
typedef struct _flexcan_config flexcan_config_t |
FlexCAN module configuration structure.
Do not use the baudRate. It has been superceded bitRate
Do not use the baudRateFD. It has been superceded bitRateFD
typedef enum _flexcan_rx_fifo_priority flexcan_rx_fifo_priority_t |
FlexCAN Enhanced/Legacy Rx FIFO priority.
The matching process starts from the Rx MB(or Enhanced/Legacy Rx FIFO) with higher priority. If no MB(or Enhanced/Legacy Rx FIFO filter) is satisfied, the matching process goes on with the Enhanced/Legacy Rx FIFO(or Rx MB) with lower priority.
typedef struct _flexcan_rx_mb_config flexcan_rx_mb_config_t |
FlexCAN Receive Message Buffer configuration structure.
This structure is used as the parameter of FLEXCAN_SetRxMbConfig() function. The FLEXCAN_SetRxMbConfig() function is used to configure FlexCAN Receive Message Buffer. The function abort previous receiving process, clean the Message Buffer and activate the Rx Message Buffer using given Message Buffer setting.
anonymous enum |
FlexCAN transfer status.
anonymous enum |
FlexCAN Legacy Rx FIFO status flags.
The FlexCAN Legacy Rx FIFO Status enumerations are used to determine the status of the Rx FIFO. Because Rx FIFO occupy the MB0 ~ MB7 (Rx Fifo filter also occupies more Message Buffer space), Rx FIFO status flags are mapped to the corresponding Message Buffer status flags.
Enumerator | |
---|---|
kFLEXCAN_RxFifoOverflowFlag | Rx FIFO overflow flag. |
kFLEXCAN_RxFifoWarningFlag | Rx FIFO almost full flag. |
kFLEXCAN_RxFifoFrameAvlFlag | Frames available in Rx FIFO flag. |
FlexCAN clock source.
Do not use the kFLEXCAN_ClkSrcOs. It has been superceded kFLEXCAN_ClkSrc0
Do not use the kFLEXCAN_ClkSrcPeri. It has been superceded kFLEXCAN_ClkSrc1
enum _flexcan_error_flags |
FlexCAN error status flags.
The FlexCAN Error Status enumerations is used to report current error of the FlexCAN bus. This enumerations should be used with KFLEXCAN_ErrorFlag in _flexcan_flags enumerations to ditermine which error is generated.
enum _flexcan_flags |
FlexCAN status flags.
This provides constants for the FlexCAN status flags for use in the FlexCAN functions.
enum _flexcan_frame_type |
FlexCAN interrupt enable enumerations.
This provides constants for the FlexCAN interrupt enable enumerations for use in the FlexCAN functions.
FlexCAN Rx Fifo Filter type.
FlexCAN Enhanced/Legacy Rx FIFO priority.
The matching process starts from the Rx MB(or Enhanced/Legacy Rx FIFO) with higher priority. If no MB(or Enhanced/Legacy Rx FIFO filter) is satisfied, the matching process goes on with the Enhanced/Legacy Rx FIFO(or Rx MB) with lower priority.
Enumerator | |
---|---|
kFLEXCAN_RxFifoPrioLow | Matching process start from Rx Message Buffer first. |
kFLEXCAN_RxFifoPrioHigh | Matching process start from Enhanced/Legacy Rx FIFO first. |
bool FLEXCAN_CalculateImprovedTimingValues | ( | CAN_Type * | base, |
uint32_t | bitRate, | ||
uint32_t | sourceClock_Hz, | ||
flexcan_timing_config_t * | pTimingConfig | ||
) |
Calculates the improved timing values by specific bit Rates for classical CAN.
This function use to calculates the Classical CAN timing values according to the given bit rate. The Calculated timing values will be set in CTRL1/CBT/ENCBT register. The calculation is based on the recommendation of the CiA 301 v4.2.0 and previous version document.
base | FlexCAN peripheral base address. |
bitRate | The classical CAN speed in bps defined by user, should be less than or equal to 1Mbps. |
sourceClock_Hz | The Source clock frequency in Hz. |
pTimingConfig | Pointer to the FlexCAN timing configuration structure. |
brief Calculates the improved timing values by specific bit Rates for classical CAN.
This function use to calculates the Classical CAN timing values according to the given bit rate. The Calculated timing values will be set in CTRL1/CBT/ENCBT register. The calculation is based on the recommendation of the CiA 301 v4.2.0 and previous version document.
param base FlexCAN peripheral base address. param bitRate The classical CAN speed in bps defined by user, should be less than or equal to 1Mbps. param sourceClock_Hz The Source clock frequency in Hz. param pTimingConfig Pointer to the FlexCAN timing configuration structure.
return TRUE if timing configuration found, FALSE if failed to find configuration.
void FLEXCAN_Deinit | ( | CAN_Type * | base | ) |
De-initializes a FlexCAN instance.
This function disables the FlexCAN module clock and sets all register values to the reset value.
base | FlexCAN peripheral base address. |
brief De-initializes a FlexCAN instance.
This function disables the FlexCAN module clock and sets all register values to the reset value.
param base FlexCAN peripheral base address.
void FLEXCAN_EnterFreezeMode | ( | CAN_Type * | base | ) |
Enter FlexCAN Freeze Mode.
This function makes the FlexCAN work under Freeze Mode.
base | FlexCAN peripheral base address. |
brief Enter FlexCAN Freeze Mode.
This function makes the FlexCAN work under Freeze Mode.
param base FlexCAN peripheral base address.
void FLEXCAN_ExitFreezeMode | ( | CAN_Type * | base | ) |
Exit FlexCAN Freeze Mode.
This function makes the FlexCAN leave Freeze Mode.
base | FlexCAN peripheral base address. |
brief Exit FlexCAN Freeze Mode.
This function makes the FlexCAN leave Freeze Mode.
param base FlexCAN peripheral base address.
void FLEXCAN_GetDefaultConfig | ( | flexcan_config_t * | pConfig | ) |
Gets the default configuration structure.
This function initializes the FlexCAN configuration structure to default values. The default values are as follows. flexcanConfig->clkSrc = kFLEXCAN_ClkSrc0; flexcanConfig->bitRate = 1000000U; flexcanConfig->bitRateFD = 2000000U; flexcanConfig->maxMbNum = 16; flexcanConfig->enableLoopBack = false; flexcanConfig->enableSelfWakeup = false; flexcanConfig->enableIndividMask = false; flexcanConfig->disableSelfReception = false; flexcanConfig->enableListenOnlyMode = false; flexcanConfig->enableDoze = false; flexcanConfig->enableMemoryErrorControl = true; flexcanConfig->enableNonCorrectableErrorEnterFreeze = true; flexcanConfig.timingConfig = timingConfig;
pConfig | Pointer to the FlexCAN configuration structure. |
brief Gets the default configuration structure.
This function initializes the FlexCAN configuration structure to default values. The default values are as follows. flexcanConfig->clkSrc = kFLEXCAN_ClkSrc0; flexcanConfig->bitRate = 1000000U; flexcanConfig->bitRateFD = 2000000U; flexcanConfig->maxMbNum = 16; flexcanConfig->enableLoopBack = false; flexcanConfig->enableSelfWakeup = false; flexcanConfig->enableIndividMask = false; flexcanConfig->disableSelfReception = false; flexcanConfig->enableListenOnlyMode = false; flexcanConfig->enableDoze = false; flexcanConfig->enablePretendedeNetworking = false; flexcanConfig->enableMemoryErrorControl = true; flexcanConfig->enableNonCorrectableErrorEnterFreeze = true; flexcanConfig->enableTransceiverDelayMeasure = true; flexcanConfig.timingConfig = timingConfig;
param pConfig Pointer to the FlexCAN configuration structure.
uint32_t FLEXCAN_GetInstance | ( | CAN_Type * | base | ) |
Get the FlexCAN instance from peripheral base address.
base | FlexCAN peripheral base address. |
brief Get the FlexCAN instance from peripheral base address.
param base FlexCAN peripheral base address. return FlexCAN instance.
uint32_t FLEXCAN_GetTimeStamp | ( | flexcan_handle_t * | handle, |
uint8_t | mbIdx | ||
) |
Gets the detail index of Mailbox's Timestamp by handle.
Then function can only be used when calling non-blocking Data transfer (TX/RX) API, After TX/RX data transfer done (User can get the status by handler's callback function), we can get the detail index of Mailbox's timestamp by handle, Detail non-blocking data transfer API (TX/RX) contain. -FLEXCAN_TransferSendNonBlocking -FLEXCAN_TransferFDSendNonBlocking -FLEXCAN_TransferReceiveNonBlocking -FLEXCAN_TransferFDReceiveNonBlocking -FLEXCAN_TransferReceiveFifoNonBlocking
handle | FlexCAN handle pointer. |
mbIdx | The FlexCAN Message Buffer index. |
the | index of mailbox 's timestamp stored in the handle. |
brief Gets the detail index of Mailbox's Timestamp by handle.
Then function can only be used when calling non-blocking Data transfer (TX/RX) API, After TX/RX data transfer done (User can get the status by handler's callback function), we can get the detail index of Mailbox's timestamp by handle, Detail non-blocking data transfer API (TX/RX) contain. -FLEXCAN_TransferSendNonBlocking -FLEXCAN_TransferFDSendNonBlocking -FLEXCAN_TransferReceiveNonBlocking -FLEXCAN_TransferFDReceiveNonBlocking -FLEXCAN_TransferReceiveFifoNonBlocking
param handle FlexCAN handle pointer. param mbIdx The FlexCAN FD Message Buffer index. return the index of mailbox 's timestamp stored in the handle.
void FLEXCAN_Init | ( | CAN_Type * | base, |
const flexcan_config_t * | pConfig, | ||
uint32_t | sourceClock_Hz | ||
) |
Initializes a FlexCAN instance.
This function initializes the FlexCAN module with user-defined settings. This example shows how to set up the flexcan_config_t parameters and how to call the FLEXCAN_Init function by passing in these parameters.
base | FlexCAN peripheral base address. |
pConfig | Pointer to the user-defined configuration structure. |
sourceClock_Hz | FlexCAN Protocol Engine clock source frequency in Hz. |
brief Initializes a FlexCAN instance.
This function initializes the FlexCAN module with user-defined settings. This example shows how to set up the flexcan_config_t parameters and how to call the FLEXCAN_Init function by passing in these parameters. code flexcan_config_t flexcanConfig; flexcanConfig.clkSrc = kFLEXCAN_ClkSrc0; flexcanConfig.bitRate = 1000000U; flexcanConfig.maxMbNum = 16; flexcanConfig.enableLoopBack = false; flexcanConfig.enableSelfWakeup = false; flexcanConfig.enableIndividMask = false; flexcanConfig.disableSelfReception = false; flexcanConfig.enableListenOnlyMode = false; flexcanConfig.enableDoze = false; flexcanConfig.timingConfig = timingConfig; FLEXCAN_Init(CAN0, &flexcanConfig, 40000000UL); endcode
param base FlexCAN peripheral base address. param pConfig Pointer to the user-defined configuration structure. param sourceClock_Hz FlexCAN Protocol Engine clock source frequency in Hz.
status_t FLEXCAN_ReadRxFifo | ( | CAN_Type * | base, |
flexcan_frame_t * | pRxFrame | ||
) |
Reads a FlexCAN Message from Legacy Rx FIFO.
This function reads a CAN message from the FlexCAN Legacy Rx FIFO.
base | FlexCAN peripheral base address. |
pRxFrame | Pointer to CAN message frame structure for reception. |
kStatus_Success | - Read Message from Rx FIFO successfully. |
kStatus_Fail | - Rx FIFO is not enabled. |
brief Reads a FlexCAN Message from Legacy Rx FIFO.
This function reads a CAN message from the FlexCAN Legacy Rx FIFO.
param base FlexCAN peripheral base address. param pRxFrame Pointer to CAN message frame structure for reception. retval kStatus_Success - Read Message from Rx FIFO successfully. retval kStatus_Fail - Rx FIFO is not enabled.
status_t FLEXCAN_ReadRxMb | ( | CAN_Type * | base, |
uint8_t | mbIdx, | ||
flexcan_frame_t * | pRxFrame | ||
) |
Reads a FlexCAN Message from Receive Message Buffer.
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.
base | FlexCAN peripheral base address. |
mbIdx | The FlexCAN Message Buffer index. |
pRxFrame | Pointer to CAN message frame structure for reception. |
kStatus_Success | - Rx Message Buffer is full and has been read successfully. |
kStatus_FLEXCAN_RxOverflow | - Rx Message Buffer is already overflowed and has been read successfully. |
kStatus_Fail | - Rx Message Buffer is empty. |
brief Reads a FlexCAN Message from Receive Message Buffer.
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.
param base FlexCAN peripheral base address. param mbIdx The FlexCAN Message Buffer index. param pRxFrame Pointer to CAN message frame structure for reception. retval kStatus_Success - Rx Message Buffer is full and has been read successfully. retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. retval kStatus_Fail - Rx Message Buffer is empty.
Set bit rate of FlexCAN classical CAN frame or CAN FD frame nominal phase.
This function set the bit rate of classical CAN frame or CAN FD frame nominal phase base on FLEXCAN_CalculateImprovedTimingValues() API calculated timing values.
base | FlexCAN peripheral base address. |
sourceClock_Hz | Source Clock in Hz. |
bitRate_Bps | Bit rate in Bps. |
brief Set bit rate of FlexCAN classical CAN frame or CAN FD frame nominal phase.
This function set the bit rate of classical CAN frame or CAN FD frame nominal phase base on FLEXCAN_CalculateImprovedTimingValues() API calculated timing values.
note Calling FLEXCAN_SetBitRate() overrides the bit rate set in FLEXCAN_Init().
param base FlexCAN peripheral base address. param sourceClock_Hz Source Clock in Hz. param bitRate_Bps Bit rate in Bps. return kStatus_Success - Set CAN baud rate (only Nominal phase) successfully.
void FLEXCAN_SetRxFifoConfig | ( | CAN_Type * | base, |
const flexcan_rx_fifo_config_t * | pRxFifoConfig, | ||
bool | enable | ||
) |
Configures the FlexCAN Legacy Rx FIFO.
This function configures the FlexCAN Rx FIFO with given configuration.
base | FlexCAN peripheral base address. |
pRxFifoConfig | Pointer to the FlexCAN Legacy Rx FIFO configuration structure. Can be NULL when enable parameter is false. |
enable | Enable/disable Legacy Rx FIFO.
|
brief Configures the FlexCAN Legacy Rx FIFO.
This function configures the FlexCAN Rx FIFO with given configuration. note Legacy Rx FIFO only can receive classic CAN message.
param base FlexCAN peripheral base address. param pRxFifoConfig Pointer to the FlexCAN Legacy Rx FIFO configuration structure. Can be NULL when enable parameter is false. param enable Enable/disable Legacy Rx FIFO.
void FLEXCAN_SetRxFifoGlobalMask | ( | CAN_Type * | base, |
uint32_t | mask | ||
) |
Sets the FlexCAN receive FIFO global mask.
This function sets the global mask for FlexCAN FIFO in a matching process.
base | FlexCAN peripheral base address. |
mask | Rx Fifo Global Mask value. |
brief Sets the FlexCAN receive FIFO global mask.
This function sets the global mask for FlexCAN FIFO in a matching process.
param base FlexCAN peripheral base address. param mask Rx Fifo Global Mask value.
void FLEXCAN_SetRxIndividualMask | ( | CAN_Type * | base, |
uint8_t | maskIdx, | ||
uint32_t | mask | ||
) |
Sets the FlexCAN receive individual mask.
This function sets the individual mask for the FlexCAN matching process. The configuration is only effective when the Rx individual mask is enabled in the FLEXCAN_Init(). If the Rx FIFO is disabled, the individual mask is applied to the corresponding Message Buffer. If the Rx FIFO is enabled, the individual mask for Rx FIFO occupied Message Buffer is applied to the Rx Filter with the same index. Note that only the first 32 individual masks can be used as the Rx FIFO filter mask.
base | FlexCAN peripheral base address. |
maskIdx | The Index of individual Mask. |
mask | Rx Individual Mask value. |
brief Sets the FlexCAN receive individual mask.
This function sets the individual mask for the FlexCAN matching process. The configuration is only effective when the Rx individual mask is enabled in the FLEXCAN_Init(). If the Rx FIFO is disabled, the individual mask is applied to the corresponding Message Buffer. If the Rx FIFO is enabled, the individual mask for Rx FIFO occupied Message Buffer is applied to the Rx Filter with the same index. Note that only the first 32 individual masks can be used as the Rx FIFO filter mask.
param base FlexCAN peripheral base address. param maskIdx The Index of individual Mask. param mask Rx Individual Mask value.
void FLEXCAN_SetRxMbConfig | ( | CAN_Type * | base, |
uint8_t | mbIdx, | ||
const flexcan_rx_mb_config_t * | pRxMbConfig, | ||
bool | enable | ||
) |
Configures a FlexCAN Receive Message Buffer.
This function cleans a FlexCAN build-in Message Buffer and configures it as a Receive Message Buffer.
base | FlexCAN peripheral base address. |
mbIdx | The Message Buffer index. |
pRxMbConfig | Pointer to the FlexCAN Message Buffer configuration structure. |
enable | Enable/disable Rx Message Buffer.
|
brief Configures a FlexCAN Receive Message Buffer.
This function cleans a FlexCAN build-in Message Buffer and configures it as a Receive Message Buffer.
param base FlexCAN peripheral base address. param mbIdx The Message Buffer index. param pRxMbConfig Pointer to the FlexCAN Message Buffer configuration structure. param enable Enable/disable Rx Message Buffer.
void FLEXCAN_SetRxMbGlobalMask | ( | CAN_Type * | base, |
uint32_t | mask | ||
) |
Sets the FlexCAN receive message buffer global mask.
This function sets the global mask for the FlexCAN message buffer in a matching process. The configuration is only effective when the Rx individual mask is disabled in the FLEXCAN_Init().
base | FlexCAN peripheral base address. |
mask | Rx Message Buffer Global Mask value. |
brief Sets the FlexCAN receive message buffer global mask.
This function sets the global mask for the FlexCAN message buffer in a matching process. The configuration is only effective when the Rx individual mask is disabled in the FLEXCAN_Init().
param base FlexCAN peripheral base address. param mask Rx Message Buffer Global Mask value.
void FLEXCAN_SetTimingConfig | ( | CAN_Type * | base, |
const flexcan_timing_config_t * | pConfig | ||
) |
Sets the FlexCAN classical CAN protocol timing characteristic.
This function gives user settings to classical CAN or CAN FD nominal phase timing characteristic. The function is for an experienced user. For less experienced users, call the FLEXCAN_SetBitRate() instead.
base | FlexCAN peripheral base address. |
pConfig | Pointer to the timing configuration structure. |
brief Sets the FlexCAN classical protocol timing characteristic.
This function gives user settings to classical CAN or CAN FD nominal phase timing characteristic. The function is for an experienced user. For less experienced users, call the FLEXCAN_GetDefaultConfig() and get the default timing characteristicsthe, then call FLEXCAN_Init() and fill the bit rate field.
note Calling FLEXCAN_SetTimingConfig() overrides the bit rate set in FLEXCAN_Init().
param base FlexCAN peripheral base address. param pConfig Pointer to the timing configuration structure.
void FLEXCAN_SetTxMbConfig | ( | CAN_Type * | base, |
uint8_t | mbIdx, | ||
bool | enable | ||
) |
Configures a FlexCAN transmit message buffer.
This function aborts the previous transmission, cleans the Message Buffer, and configures it as a Transmit Message Buffer.
base | FlexCAN peripheral base address. |
mbIdx | The Message Buffer index. |
enable | Enable/disable Tx Message Buffer.
|
brief Configures a FlexCAN transmit message buffer.
This function aborts the previous transmission, cleans the Message Buffer, and configures it as a Transmit Message Buffer.
param base FlexCAN peripheral base address. param mbIdx The Message Buffer index. param enable Enable/disable Tx Message Buffer.
void FLEXCAN_TransferAbortReceive | ( | CAN_Type * | base, |
flexcan_handle_t * | handle, | ||
uint8_t | mbIdx | ||
) |
Aborts the interrupt driven message receive process.
This function aborts the interrupt driven message receive process.
base | FlexCAN peripheral base address. |
handle | FlexCAN handle pointer. |
mbIdx | The FlexCAN Message Buffer index. |
brief Aborts the interrupt driven message receive process.
This function aborts the interrupt driven message receive process.
param base FlexCAN peripheral base address. param handle FlexCAN handle pointer. param mbIdx The FlexCAN Message Buffer index.
void FLEXCAN_TransferAbortReceiveFifo | ( | CAN_Type * | base, |
flexcan_handle_t * | handle | ||
) |
Aborts the interrupt driven message receive from Rx FIFO process.
This function aborts the interrupt driven message receive from Rx FIFO process.
base | FlexCAN peripheral base address. |
handle | FlexCAN handle pointer. |
brief Aborts the interrupt driven message receive from Legacy Rx FIFO process.
This function aborts the interrupt driven message receive from Legacy Rx FIFO process.
param base FlexCAN peripheral base address. param handle FlexCAN handle pointer.
void FLEXCAN_TransferAbortSend | ( | CAN_Type * | base, |
flexcan_handle_t * | handle, | ||
uint8_t | mbIdx | ||
) |
Aborts the interrupt driven message send process.
This function aborts the interrupt driven message send process.
base | FlexCAN peripheral base address. |
handle | FlexCAN handle pointer. |
mbIdx | The FlexCAN Message Buffer index. |
brief Aborts the interrupt driven message send process.
This function aborts the interrupt driven message send process.
param base FlexCAN peripheral base address. param handle FlexCAN handle pointer. param mbIdx The FlexCAN Message Buffer index.
void FLEXCAN_TransferCreateHandle | ( | CAN_Type * | base, |
flexcan_handle_t * | handle, | ||
flexcan_transfer_callback_t | callback, | ||
void * | userData | ||
) |
Initializes the FlexCAN handle.
This function initializes the FlexCAN handle, which can be used for other FlexCAN transactional APIs. Usually, for a specified FlexCAN instance, call this API once to get the initialized handle.
base | FlexCAN peripheral base address. |
handle | FlexCAN handle pointer. |
callback | The callback function. |
userData | The parameter of the callback function. |
brief Initializes the FlexCAN handle.
This function initializes the FlexCAN handle, which can be used for other FlexCAN transactional APIs. Usually, for a specified FlexCAN instance, call this API once to get the initialized handle.
param base FlexCAN peripheral base address. param handle FlexCAN handle pointer. param callback The callback function. param userData The parameter of the callback function.
status_t FLEXCAN_TransferGetReceiveFifoCount | ( | CAN_Type * | base, |
flexcan_handle_t * | handle, | ||
size_t * | count | ||
) |
Gets the Legacy Rx Fifo transfer status during a interrupt non-blocking receive.
base | FlexCAN peripheral base address. |
handle | FlexCAN handle pointer. |
count | Number of CAN messages receive so far by the non-blocking transaction. |
kStatus_InvalidArgument | count is Invalid. |
kStatus_Success | Successfully return the count. |
brief Gets the Legacy Rx Fifo transfer status during a interrupt non-blocking receive.
param base FlexCAN peripheral base address. param handle FlexCAN handle pointer. param count Number of CAN messages receive so far by the non-blocking transaction. retval kStatus_InvalidArgument count is Invalid. retval kStatus_Success Successfully return the count.
void FLEXCAN_TransferHandleIRQ | ( | CAN_Type * | base, |
flexcan_handle_t * | handle | ||
) |
FlexCAN IRQ handle function.
This function handles the FlexCAN Error, the Message Buffer, and the Rx FIFO IRQ request.
base | FlexCAN peripheral base address. |
handle | FlexCAN handle pointer. |
brief FlexCAN IRQ handle function.
This function handles the FlexCAN Error, the Message Buffer, and the Rx FIFO IRQ request.
param base FlexCAN peripheral base address. param handle FlexCAN handle pointer.
status_t FLEXCAN_TransferReceiveBlocking | ( | CAN_Type * | base, |
uint8_t | mbIdx, | ||
flexcan_frame_t * | pRxFrame | ||
) |
Performs a polling receive transaction on the CAN bus.
base | FlexCAN peripheral base pointer. |
mbIdx | The FlexCAN Message Buffer index. |
pRxFrame | Pointer to CAN message frame structure for reception. |
kStatus_Success | - Rx Message Buffer is full and has been read successfully. |
kStatus_FLEXCAN_RxOverflow | - Rx Message Buffer is already overflowed and has been read successfully. |
kStatus_Fail | - Rx Message Buffer is empty. |
brief Performs a polling receive transaction on the CAN bus.
note A transfer handle does not need to be created before calling this API.
param base FlexCAN peripheral base pointer. param mbIdx The FlexCAN Message Buffer index. param pRxFrame Pointer to CAN message frame structure for reception. retval kStatus_Success - Rx Message Buffer is full and has been read successfully. retval kStatus_FLEXCAN_RxOverflow - Rx Message Buffer is already overflowed and has been read successfully. retval kStatus_Fail - Rx Message Buffer is empty.
status_t FLEXCAN_TransferReceiveFifoBlocking | ( | CAN_Type * | base, |
flexcan_frame_t * | pRxFrame | ||
) |
Performs a polling receive transaction from Legacy Rx FIFO on the CAN bus.
base | FlexCAN peripheral base pointer. |
pRxFrame | Pointer to CAN message frame structure for reception. |
kStatus_Success | - Read Message from Rx FIFO successfully. |
kStatus_Fail | - Rx FIFO is not enabled. |
brief Performs a polling receive transaction from Legacy Rx FIFO on the CAN bus.
note A transfer handle does not need to be created before calling this API.
param base FlexCAN peripheral base pointer. param pRxFrame Pointer to CAN message frame structure for reception. retval kStatus_Success - Read Message from Rx FIFO successfully. retval kStatus_Fail - Rx FIFO is not enabled.
status_t FLEXCAN_TransferReceiveFifoNonBlocking | ( | CAN_Type * | base, |
flexcan_handle_t * | handle, | ||
flexcan_fifo_transfer_t * | pFifoXfer | ||
) |
Receives a message from Rx FIFO using IRQ.
This function receives a message using IRQ. This is a non-blocking function, which returns right away. When all messages have been received, the receive callback function is called.
base | FlexCAN peripheral base address. |
handle | FlexCAN handle pointer. |
pFifoXfer | FlexCAN Rx FIFO transfer structure. See the flexcan_fifo_transfer_t. |
kStatus_Success | - Start Rx FIFO receiving process successfully. |
kStatus_FLEXCAN_RxFifoBusy | - Rx FIFO is currently in use. |
brief Receives a message from Legacy Rx FIFO using IRQ.
This function receives a message using IRQ. This is a non-blocking function, which returns right away. When all messages have been received, the receive callback function is called.
param base FlexCAN peripheral base address. param handle FlexCAN handle pointer. param pFifoXfer FlexCAN Rx FIFO transfer structure. See the ref flexcan_fifo_transfer_t. retval kStatus_Success - Start Rx FIFO receiving process successfully. retval kStatus_FLEXCAN_RxFifoBusy - Rx FIFO is currently in use.
status_t FLEXCAN_TransferReceiveNonBlocking | ( | CAN_Type * | base, |
flexcan_handle_t * | handle, | ||
flexcan_mb_transfer_t * | pMbXfer | ||
) |
Receives a message using IRQ.
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.
base | FlexCAN peripheral base address. |
handle | FlexCAN handle pointer. |
pMbXfer | FlexCAN Message Buffer transfer structure. See the flexcan_mb_transfer_t. |
kStatus_Success | - Start Rx Message Buffer receiving process successfully. |
kStatus_FLEXCAN_RxBusy | - Rx Message Buffer is in use. |
brief Receives a message using IRQ.
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.
param base FlexCAN peripheral base address. param handle FlexCAN handle pointer. param pMbXfer FlexCAN Message Buffer transfer structure. See the flexcan_mb_transfer_t. retval kStatus_Success - Start Rx Message Buffer receiving process successfully. retval kStatus_FLEXCAN_RxBusy - Rx Message Buffer is in use.
status_t FLEXCAN_TransferSendBlocking | ( | CAN_Type * | base, |
uint8_t | mbIdx, | ||
flexcan_frame_t * | pTxFrame | ||
) |
Performs a polling send transaction on the CAN bus.
base | FlexCAN peripheral base pointer. |
mbIdx | The FlexCAN Message Buffer index. |
pTxFrame | Pointer to CAN message frame to be sent. |
kStatus_Success | - Write Tx Message Buffer Successfully. |
kStatus_Fail | - Tx Message Buffer is currently in use. |
brief Performs a polling send transaction on the CAN bus.
note A transfer handle does not need to be created before calling this API.
param base FlexCAN peripheral base pointer. param mbIdx The FlexCAN Message Buffer index. param pTxFrame Pointer to CAN message frame to be sent. retval kStatus_Success - Write Tx Message Buffer Successfully. retval kStatus_Fail - Tx Message Buffer is currently in use.
status_t FLEXCAN_TransferSendNonBlocking | ( | CAN_Type * | base, |
flexcan_handle_t * | handle, | ||
flexcan_mb_transfer_t * | pMbXfer | ||
) |
Sends a message using IRQ.
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.
base | FlexCAN peripheral base address. |
handle | FlexCAN handle pointer. |
pMbXfer | FlexCAN Message Buffer transfer structure. See the flexcan_mb_transfer_t. |
kStatus_Success | Start Tx Message Buffer sending process successfully. |
kStatus_Fail | Write Tx Message Buffer failed. |
kStatus_FLEXCAN_TxBusy | Tx Message Buffer is in use. |
brief Sends a message using IRQ.
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.
param base FlexCAN peripheral base address. param handle FlexCAN handle pointer. param pMbXfer FlexCAN Message Buffer transfer structure. See the flexcan_mb_transfer_t. retval kStatus_Success Start Tx Message Buffer sending process successfully. retval kStatus_Fail Write Tx Message Buffer failed. retval kStatus_FLEXCAN_TxBusy Tx Message Buffer is in use.
status_t FLEXCAN_WriteTxMb | ( | CAN_Type * | base, |
uint8_t | mbIdx, | ||
const flexcan_frame_t * | pTxFrame | ||
) |
Writes a FlexCAN Message to the Transmit Message Buffer.
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.
base | FlexCAN peripheral base address. |
mbIdx | The FlexCAN Message Buffer index. |
pTxFrame | Pointer to CAN message frame to be sent. |
kStatus_Success | - Write Tx Message Buffer Successfully. |
kStatus_Fail | - Tx Message Buffer is currently in use. |
brief Writes a FlexCAN Message to the Transmit Message Buffer.
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.
param base FlexCAN peripheral base address. param mbIdx The FlexCAN Message Buffer index. param pTxFrame Pointer to CAN message frame to be sent. retval kStatus_Success - Write Tx Message Buffer Successfully. retval kStatus_Fail - Tx Message Buffer is currently in use.
uint32_t _flexcan_frame::__pad0__ |
Reserved.
uint32_t { ... } ::__pad0__ |
Reserved.
uint32_t { ... } ::__pad0__ |
Reserved.
uint32_t { ... } ::baudRate |
FlexCAN bit rate in bps, for classical CAN or CANFD nominal phase.
uint32_t _flexcan_config::baudRate |
FlexCAN bit rate in bps, for classical CAN or CANFD nominal phase.
uint32_t _flexcan_config::bitRate |
FlexCAN bit rate in bps, for classical CAN or CANFD nominal phase.
uint32_t { ... } ::bitRate |
FlexCAN bit rate in bps, for classical CAN or CANFD nominal phase.
flexcan_transfer_callback_t _flexcan_handle::callback |
Callback function.
flexcan_clock_source_t _flexcan_config::clkSrc |
Clock source for FlexCAN Protocol Engine.
uint8_t { ... } ::dataByte0 |
CAN Frame payload byte0.
uint8_t _flexcan_frame::dataByte0 |
CAN Frame payload byte0.
uint8_t { ... } ::dataByte1 |
CAN Frame payload byte1.
uint8_t _flexcan_frame::dataByte1 |
CAN Frame payload byte1.
uint8_t _flexcan_frame::dataByte2 |
CAN Frame payload byte2.
uint8_t { ... } ::dataByte2 |
CAN Frame payload byte2.
uint8_t _flexcan_frame::dataByte3 |
CAN Frame payload byte3.
uint8_t { ... } ::dataByte3 |
CAN Frame payload byte3.
uint8_t _flexcan_frame::dataByte4 |
CAN Frame payload byte4.
uint8_t { ... } ::dataByte4 |
CAN Frame payload byte4.
uint8_t _flexcan_frame::dataByte5 |
CAN Frame payload byte5.
uint8_t { ... } ::dataByte5 |
CAN Frame payload byte5.
uint8_t _flexcan_frame::dataByte6 |
CAN Frame payload byte6.
uint8_t { ... } ::dataByte6 |
CAN Frame payload byte6.
uint8_t _flexcan_frame::dataByte7 |
CAN Frame payload byte7.
uint8_t { ... } ::dataByte7 |
CAN Frame payload byte7.
uint32_t { ... } ::dataWord0 |
CAN Frame payload word0.
uint32_t _flexcan_frame::dataWord0 |
CAN Frame payload word0.
uint32_t { ... } ::dataWord1 |
CAN Frame payload word1.
uint32_t _flexcan_frame::dataWord1 |
CAN Frame payload word1.
bool _flexcan_config::disableSelfReception |
Enable or Disable Self Reflection.
bool _flexcan_config::enableIndividMask |
Enable or Disable Rx Individual Mask and Queue feature.
bool _flexcan_config::enableListenOnlyMode |
Enable or Disable Listen Only Mode.
bool _flexcan_config::enableLoopBack |
Enable or Disable Loop Back Self Test Mode.
bool _flexcan_config::enableSelfWakeup |
Enable or Disable Self Wakeup Mode.
bool _flexcan_config::enableSupervisorMode |
Enable or Disable Supervisor Mode, enable this mode will make registers allow only Supervisor access.
bool _flexcan_config::enableTimerSync |
Enable or Disable Timer Synchronization.
uint32_t { ... } ::format |
CAN Frame Identifier(STD or EXT format).
uint32_t _flexcan_frame::format |
CAN Frame Identifier(STD or EXT format).
flexcan_frame_format_t _flexcan_rx_mb_config::format |
CAN Frame Identifier format(Standard of Extend).
flexcan_frame_t* _flexcan_mb_transfer::frame |
The buffer of CAN Message to be transfer.
flexcan_frame_t* _flexcan_fifo_transfer::frame |
The buffer of CAN Message to be received from Legacy Rx FIFO.
size_t _flexcan_fifo_transfer::frameNum |
Number of CAN Message need to be received from Legacy or Ehanced Rx FIFO.
uint32_t { ... } ::id |
CAN Frame Identifier, should be set using FLEXCAN_ID_EXT() or FLEXCAN_ID_STD() macro.
uint32_t _flexcan_frame::id |
CAN Frame Identifier, should be set using FLEXCAN_ID_EXT() or FLEXCAN_ID_STD() macro.
uint32_t _flexcan_rx_mb_config::id |
CAN Message Buffer Frame Identifier, should be set using FLEXCAN_ID_EXT() or FLEXCAN_ID_STD() macro.
uint8_t _flexcan_rx_fifo_config::idFilterNum |
The FlexCAN Legacy Rx FIFO Filter elements quantity.
uint32_t* _flexcan_rx_fifo_config::idFilterTable |
Pointer to the FlexCAN Legacy Rx FIFO identifier filter table.
flexcan_rx_fifo_filter_type_t _flexcan_rx_fifo_config::idFilterType |
The FlexCAN Legacy Rx FIFO Filter type.
uint32_t { ... } ::idhit |
CAN Rx FIFO filter hit id(This value is only used in Rx FIFO receive mode).
uint32_t _flexcan_frame::idhit |
CAN Rx FIFO filter hit id(This value is only used in Rx FIFO receive mode).
uint32_t { ... } ::length |
CAN frame data length in bytes (Range: 0~8).
uint32_t _flexcan_frame::length |
CAN frame data length in bytes (Range: 0~8).
uint8_t _flexcan_config::maxMbNum |
The maximum number of Message Buffers used by user.
flexcan_frame_t* volatile _flexcan_handle::mbFrameBuf[CAN_WORD1_COUNT] |
The buffer for received CAN data from Message Buffers.
uint8_t _flexcan_mb_transfer::mbIdx |
The index of Message buffer used to transfer Message.
volatile uint8_t _flexcan_handle::mbState[CAN_WORD1_COUNT] |
Message Buffer transfer state.
uint8_t _flexcan_timing_config::phaseSeg1 |
Classic CAN or CAN FD nominal phase Segment 1.
uint8_t _flexcan_timing_config::phaseSeg2 |
Classic CAN or CAN FD nominal phase Segment 2.
uint16_t _flexcan_timing_config::preDivider |
Classic CAN or CAN FD nominal phase bit rate prescaler.
flexcan_rx_fifo_priority_t _flexcan_rx_fifo_config::priority |
The FlexCAN Legacy Rx FIFO receive priority.
uint8_t _flexcan_timing_config::propSeg |
Classic CAN or CAN FD nominal phase Propagation Segment.
uint8_t _flexcan_timing_config::rJumpwidth |
Classic CAN or CAN FD nominal phase Re-sync Jump Width.
flexcan_frame_t* volatile _flexcan_handle::rxFifoFrameBuf |
The buffer for received CAN data from Legacy Rx FIFO.
size_t _flexcan_handle::rxFifoFrameNum |
The number of CAN messages remaining to be received from Legacy or Ehanced Rx FIFO.
volatile uint8_t _flexcan_handle::rxFifoState |
Rx FIFO transfer state.
size_t _flexcan_handle::rxFifoTransferTotalNum |
Total CAN Message number need to be received from Legacy or Ehanced Rx FIFO.
uint32_t _flexcan_frame::timestamp |
FlexCAN internal Free-Running Counter Time Stamp.
uint32_t { ... } ::timestamp |
FlexCAN internal Free-Running Counter Time Stamp.
volatile uint32_t _flexcan_handle::timestamp[CAN_WORD1_COUNT] |
Mailbox transfer timestamp.
uint32_t { ... } ::type |
CAN Frame Type(DATA or REMOTE).
uint32_t _flexcan_frame::type |
CAN Frame Type(DATA or REMOTE).
flexcan_frame_type_t _flexcan_rx_mb_config::type |
CAN Frame Type(Data or Remote).
void* _flexcan_handle::userData |
FlexCAN callback function parameter.
flexcan_wake_up_source_t _flexcan_config::wakeupSrc |
Wake up source selection.