MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Overview

Data Structures

struct  ecspi_sdma_handle_t
 ECSPI SDMA transfer handle, users should not touch the content of the handle. More...
 

Typedefs

typedef void(* ecspi_sdma_callback_t )(ECSPI_Type *base, ecspi_sdma_handle_t *handle, status_t status, void *userData)
 ECSPI SDMA callback called at the end of transfer. More...
 

Driver version

#define FSL_ECSPI_FREERTOS_DRIVER_VERSION   (MAKE_VERSION(2, 0, 1))
 ECSPI FreeRTOS driver version 2.0.1. More...
 

DMA Transactional

void ECSPI_MasterTransferCreateHandleSDMA (ECSPI_Type *base, ecspi_sdma_handle_t *handle, ecspi_sdma_callback_t callback, void *userData, sdma_handle_t *txHandle, sdma_handle_t *rxHandle, uint32_t eventSourceTx, uint32_t eventSourceRx, uint32_t TxChannel, uint32_t RxChannel)
 Initialize the ECSPI master SDMA handle. More...
 
void ECSPI_SlaveTransferCreateHandleSDMA (ECSPI_Type *base, ecspi_sdma_handle_t *handle, ecspi_sdma_callback_t callback, void *userData, sdma_handle_t *txHandle, sdma_handle_t *rxHandle, uint32_t eventSourceTx, uint32_t eventSourceRx, uint32_t TxChannel, uint32_t RxChannel)
 Initialize the ECSPI Slave SDMA handle. More...
 
status_t ECSPI_MasterTransferSDMA (ECSPI_Type *base, ecspi_sdma_handle_t *handle, ecspi_transfer_t *xfer)
 Perform a non-blocking ECSPI master transfer using SDMA. More...
 
status_t ECSPI_SlaveTransferSDMA (ECSPI_Type *base, ecspi_sdma_handle_t *handle, ecspi_transfer_t *xfer)
 Perform a non-blocking ECSPI slave transfer using SDMA. More...
 
void ECSPI_MasterTransferAbortSDMA (ECSPI_Type *base, ecspi_sdma_handle_t *handle)
 Abort a ECSPI master transfer using SDMA. More...
 
void ECSPI_SlaveTransferAbortSDMA (ECSPI_Type *base, ecspi_sdma_handle_t *handle)
 Abort a ECSPI slave transfer using SDMA. More...
 

Data Structure Documentation

struct _ecspi_sdma_handle

Data Fields

bool txInProgress
 Send transfer finished.
 
bool rxInProgress
 Receive transfer finished.
 
sdma_handle_ttxSdmaHandle
 DMA handler for ECSPI send.
 
sdma_handle_trxSdmaHandle
 DMA handler for ECSPI receive.
 
ecspi_sdma_callback_t callback
 Callback for ECSPI SDMA transfer.
 
void * userData
 User Data for ECSPI SDMA callback.
 
uint32_t state
 Internal state of ECSPI SDMA transfer.
 
uint32_t ChannelTx
 Channel for send handle.
 
uint32_t ChannelRx
 Channel for receive handler.
 

Macro Definition Documentation

#define FSL_ECSPI_FREERTOS_DRIVER_VERSION   (MAKE_VERSION(2, 0, 1))

Typedef Documentation

typedef void(* ecspi_sdma_callback_t)(ECSPI_Type *base, ecspi_sdma_handle_t *handle, status_t status, void *userData)

Function Documentation

void ECSPI_MasterTransferCreateHandleSDMA ( ECSPI_Type *  base,
ecspi_sdma_handle_t *  handle,
ecspi_sdma_callback_t  callback,
void *  userData,
sdma_handle_t txHandle,
sdma_handle_t rxHandle,
uint32_t  eventSourceTx,
uint32_t  eventSourceRx,
uint32_t  TxChannel,
uint32_t  RxChannel 
)

This function initializes the ECSPI master SDMA handle which can be used for other SPI master transactional APIs. Usually, for a specified ECSPI instance, user need only call this API once to get the initialized handle.

Parameters
baseECSPI peripheral base address.
handleECSPI handle pointer.
callbackUser callback function called at the end of a transfer.
userDataUser data for callback.
txHandleSDMA handle pointer for ECSPI Tx, the handle shall be static allocated by users.
rxHandleSDMA handle pointer for ECSPI Rx, the handle shall be static allocated by users.
eventSourceTxevent source for ECSPI send, which can be found in SDMA mapping.
eventSourceRxevent source for ECSPI receive, which can be found in SDMA mapping.
TxChannelSDMA channel for ECSPI send.
RxChannelSDMA channel for ECSPI receive.
void ECSPI_SlaveTransferCreateHandleSDMA ( ECSPI_Type *  base,
ecspi_sdma_handle_t *  handle,
ecspi_sdma_callback_t  callback,
void *  userData,
sdma_handle_t txHandle,
sdma_handle_t rxHandle,
uint32_t  eventSourceTx,
uint32_t  eventSourceRx,
uint32_t  TxChannel,
uint32_t  RxChannel 
)

This function initializes the ECSPI Slave SDMA handle which can be used for other SPI Slave transactional APIs. Usually, for a specified ECSPI instance, user need only call this API once to get the initialized handle.

Parameters
baseECSPI peripheral base address.
handleECSPI handle pointer.
callbackUser callback function called at the end of a transfer.
userDataUser data for callback.
txHandleSDMA handle pointer for ECSPI Tx, the handle shall be static allocated by users.
rxHandleSDMA handle pointer for ECSPI Rx, the handle shall be static allocated by users.
eventSourceTxevent source for ECSPI send, which can be found in SDMA mapping.
eventSourceRxevent source for ECSPI receive, which can be found in SDMA mapping.
TxChannelSDMA channel for ECSPI send.
RxChannelSDMA channel for ECSPI receive.
status_t ECSPI_MasterTransferSDMA ( ECSPI_Type *  base,
ecspi_sdma_handle_t *  handle,
ecspi_transfer_t xfer 
)
Note
This interface returned immediately after transfer initiates.
Parameters
baseECSPI peripheral base address.
handleECSPI SDMA handle pointer.
xferPointer to sdma transfer structure.
Return values
kStatus_SuccessSuccessfully start a transfer.
kStatus_InvalidArgumentInput argument is invalid.
kStatus_ECSPI_BusyEECSPI is not idle, is running another transfer.
status_t ECSPI_SlaveTransferSDMA ( ECSPI_Type *  base,
ecspi_sdma_handle_t *  handle,
ecspi_transfer_t xfer 
)
Note
This interface returned immediately after transfer initiates.
Parameters
baseECSPI peripheral base address.
handleECSPI SDMA handle pointer.
xferPointer to sdma transfer structure.
Return values
kStatus_SuccessSuccessfully start a transfer.
kStatus_InvalidArgumentInput argument is invalid.
kStatus_ECSPI_BusyEECSPI is not idle, is running another transfer.
void ECSPI_MasterTransferAbortSDMA ( ECSPI_Type *  base,
ecspi_sdma_handle_t *  handle 
)
Parameters
baseECSPI peripheral base address.
handleECSPI SDMA handle pointer.
void ECSPI_SlaveTransferAbortSDMA ( ECSPI_Type *  base,
ecspi_sdma_handle_t *  handle 
)
Parameters
baseECSPI peripheral base address.
handleECSPI SDMA handle pointer.