RTEMS 6.1-rc1
Data Structures | Variables
Flexcan_edma_driver

Data Structures

struct  _flexcan_edma_handle
 FlexCAN eDMA handle. More...
 

Variables

flexcan_edma_transfer_callback_t _flexcan_edma_handle::callback
 
void * _flexcan_edma_handle::userData
 
edma_handle_t_flexcan_edma_handle::rxFifoEdmaHandle
 
volatile uint8_t _flexcan_edma_handle::rxFifoState
 
size_t _flexcan_edma_handle::frameNum
 

Driver version

typedef struct _flexcan_edma_handle flexcan_edma_handle_t
 
typedef void(* flexcan_edma_transfer_callback_t) (CAN_Type *base, flexcan_edma_handle_t *handle, status_t status, void *userData)
 FlexCAN transfer callback function.
 
#define FSL_FLEXCAN_EDMA_DRIVER_VERSION   (MAKE_VERSION(2, 9, 2))
 FlexCAN EDMA driver version.
 

eDMA transactional

void FLEXCAN_TransferCreateHandleEDMA (CAN_Type *base, flexcan_edma_handle_t *handle, flexcan_edma_transfer_callback_t callback, void *userData, edma_handle_t *rxFifoEdmaHandle)
 Initializes the FlexCAN handle, which is used in transactional functions. More...
 
void FLEXCAN_PrepareTransfConfiguration (CAN_Type *base, flexcan_fifo_transfer_t *pFifoXfer, edma_transfer_config_t *pEdmaConfig)
 Prepares the eDMA transfer configuration for FLEXCAN Legacy RX FIFO. More...
 
status_t FLEXCAN_StartTransferDatafromRxFIFO (CAN_Type *base, flexcan_edma_handle_t *handle, edma_transfer_config_t *pEdmaConfig)
 Start Transfer Data from the FLEXCAN Legacy Rx FIFO using eDMA. More...
 
status_t FLEXCAN_TransferReceiveFifoEDMA (CAN_Type *base, flexcan_edma_handle_t *handle, flexcan_fifo_transfer_t *pFifoXfer)
 Receives the CAN Message from the Legacy Rx FIFO using eDMA. More...
 
status_t FLEXCAN_TransferGetReceiveFifoCountEMDA (CAN_Type *base, flexcan_edma_handle_t *handle, size_t *count)
 Gets the Legacy Rx Fifo transfer status during a interrupt non-blocking receive. More...
 
void FLEXCAN_TransferAbortReceiveFifoEDMA (CAN_Type *base, flexcan_edma_handle_t *handle)
 Aborts the receive Legacy/Enhanced Rx FIFO process which used eDMA. More...
 

Detailed Description

Function Documentation

◆ FLEXCAN_PrepareTransfConfiguration()

void FLEXCAN_PrepareTransfConfiguration ( CAN_Type base,
flexcan_fifo_transfer_t pFifoXfer,
edma_transfer_config_t pEdmaConfig 
)

Prepares the eDMA transfer configuration for FLEXCAN Legacy RX FIFO.

This function prepares the eDMA transfer configuration structure according to FLEXCAN Legacy RX FIFO.

Parameters
baseFlexCAN peripheral base address.
pFifoXferFlexCAN Rx FIFO EDMA transfer structure, see flexcan_fifo_transfer_t.
pEdmaConfigThe user configuration structure of type edma_transfer_t.

◆ FLEXCAN_StartTransferDatafromRxFIFO()

status_t FLEXCAN_StartTransferDatafromRxFIFO ( CAN_Type base,
flexcan_edma_handle_t handle,
edma_transfer_config_t pEdmaConfig 
)

Start Transfer Data from the FLEXCAN Legacy Rx FIFO using eDMA.

This function to Update edma transfer confiugration and Start eDMA transfer

Parameters
baseFlexCAN peripheral base address.
handlePointer to flexcan_edma_handle_t structure.
pEdmaConfigThe user configuration structure of type edma_transfer_t.
Return values
kStatus_Successif succeed, others failed.
kStatus_FLEXCAN_RxFifoBusyPrevious transfer ongoing.

◆ FLEXCAN_TransferAbortReceiveFifoEDMA()

void FLEXCAN_TransferAbortReceiveFifoEDMA ( CAN_Type base,
flexcan_edma_handle_t handle 
)

Aborts the receive Legacy/Enhanced Rx FIFO process which used eDMA.

This function aborts the receive Legacy/Enhanced Rx FIFO process which used eDMA.

Parameters
baseFlexCAN peripheral base address.
handlePointer to flexcan_edma_handle_t structure.

◆ FLEXCAN_TransferCreateHandleEDMA()

void FLEXCAN_TransferCreateHandleEDMA ( CAN_Type base,
flexcan_edma_handle_t handle,
flexcan_edma_transfer_callback_t  callback,
void *  userData,
edma_handle_t rxFifoEdmaHandle 
)

Initializes the FlexCAN handle, which is used in transactional functions.

Parameters
baseFlexCAN peripheral base address.
handlePointer to flexcan_edma_handle_t structure.
callbackThe callback function.
userDataThe parameter of the callback function.
rxFifoEdmaHandleUser-requested DMA handle for Rx FIFO DMA transfer.

◆ FLEXCAN_TransferGetReceiveFifoCountEMDA()

status_t FLEXCAN_TransferGetReceiveFifoCountEMDA ( CAN_Type base,
flexcan_edma_handle_t handle,
size_t *  count 
)

Gets the Legacy Rx Fifo transfer status during a interrupt non-blocking receive.

Parameters
baseFlexCAN peripheral base address.
handleFlexCAN handle pointer.
countNumber of CAN messages receive so far by the non-blocking transaction.
Return values
kStatus_InvalidArgumentcount is Invalid.
kStatus_SuccessSuccessfully return the count.

◆ FLEXCAN_TransferReceiveFifoEDMA()

status_t FLEXCAN_TransferReceiveFifoEDMA ( CAN_Type base,
flexcan_edma_handle_t handle,
flexcan_fifo_transfer_t pFifoXfer 
)

Receives the CAN Message from the Legacy Rx FIFO using eDMA.

This function receives the CAN Message using eDMA. This is a non-blocking function, which returns right away. After the CAN Message is received, the receive callback function is called.

Parameters
baseFlexCAN peripheral base address.
handlePointer to flexcan_edma_handle_t structure.
pFifoXferFlexCAN Rx FIFO EDMA transfer structure, see flexcan_fifo_transfer_t.
Return values
kStatus_Successif succeed, others failed.
kStatus_FLEXCAN_RxFifoBusyPrevious transfer ongoing.

Variable Documentation

◆ callback

flexcan_edma_transfer_callback_t _flexcan_edma_handle::callback

Callback function.

◆ frameNum

size_t _flexcan_edma_handle::frameNum

The number of messages that need to be received.

◆ rxFifoEdmaHandle

edma_handle_t* _flexcan_edma_handle::rxFifoEdmaHandle

The EDMA handler for Rx FIFO.

◆ rxFifoState

volatile uint8_t _flexcan_edma_handle::rxFifoState

Rx FIFO transfer state.

◆ userData

void* _flexcan_edma_handle::userData

FlexCAN callback function parameter.