MCUXpresso SDK API Reference Manual  Rev 2.16.000
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
FlexIO eDMA SPI Driver

Overview

Data Structures

struct  flexio_spi_master_edma_handle_t
 FlexIO SPI eDMA transfer handle, users should not touch the content of the handle. More...
 

Typedefs

typedef
flexio_spi_master_edma_handle_t 
flexio_spi_slave_edma_handle_t
 Slave handle is the same with master handle. More...
 
typedef void(* flexio_spi_master_edma_transfer_callback_t )(FLEXIO_SPI_Type *base, flexio_spi_master_edma_handle_t *handle, status_t status, void *userData)
 FlexIO SPI master callback for finished transmit.
 
typedef void(* flexio_spi_slave_edma_transfer_callback_t )(FLEXIO_SPI_Type *base, flexio_spi_slave_edma_handle_t *handle, status_t status, void *userData)
 FlexIO SPI slave callback for finished transmit.
 

Driver version

#define FSL_FLEXIO_SPI_EDMA_DRIVER_VERSION   (MAKE_VERSION(2, 3, 0))
 FlexIO SPI EDMA driver version. More...
 

eDMA Transactional

status_t FLEXIO_SPI_MasterTransferCreateHandleEDMA (FLEXIO_SPI_Type *base, flexio_spi_master_edma_handle_t *handle, flexio_spi_master_edma_transfer_callback_t callback, void *userData, edma_handle_t *txHandle, edma_handle_t *rxHandle)
 Initializes the FlexIO SPI master eDMA handle. More...
 
status_t FLEXIO_SPI_MasterTransferEDMA (FLEXIO_SPI_Type *base, flexio_spi_master_edma_handle_t *handle, flexio_spi_transfer_t *xfer)
 Performs a non-blocking FlexIO SPI transfer using eDMA. More...
 
void FLEXIO_SPI_MasterTransferAbortEDMA (FLEXIO_SPI_Type *base, flexio_spi_master_edma_handle_t *handle)
 Aborts a FlexIO SPI transfer using eDMA. More...
 
status_t FLEXIO_SPI_MasterTransferGetCountEDMA (FLEXIO_SPI_Type *base, flexio_spi_master_edma_handle_t *handle, size_t *count)
 Gets the number of bytes transferred so far using FlexIO SPI master eDMA. More...
 
static void FLEXIO_SPI_SlaveTransferCreateHandleEDMA (FLEXIO_SPI_Type *base, flexio_spi_slave_edma_handle_t *handle, flexio_spi_slave_edma_transfer_callback_t callback, void *userData, edma_handle_t *txHandle, edma_handle_t *rxHandle)
 Initializes the FlexIO SPI slave eDMA handle. More...
 
status_t FLEXIO_SPI_SlaveTransferEDMA (FLEXIO_SPI_Type *base, flexio_spi_slave_edma_handle_t *handle, flexio_spi_transfer_t *xfer)
 Performs a non-blocking FlexIO SPI transfer using eDMA. More...
 
static void FLEXIO_SPI_SlaveTransferAbortEDMA (FLEXIO_SPI_Type *base, flexio_spi_slave_edma_handle_t *handle)
 Aborts a FlexIO SPI transfer using eDMA. More...
 
static status_t FLEXIO_SPI_SlaveTransferGetCountEDMA (FLEXIO_SPI_Type *base, flexio_spi_slave_edma_handle_t *handle, size_t *count)
 Gets the number of bytes transferred so far using FlexIO SPI slave eDMA. More...
 

Data Structure Documentation

struct _flexio_spi_master_edma_handle

typedef for flexio_spi_master_edma_handle_t in advance.

Data Fields

size_t transferSize
 Total bytes to be transferred. More...
 
uint8_t nbytes
 eDMA minor byte transfer count initially configured. More...
 
bool txInProgress
 Send transfer in progress.
 
bool rxInProgress
 Receive transfer in progress.
 
edma_handle_ttxHandle
 DMA handler for SPI send.
 
edma_handle_trxHandle
 DMA handler for SPI receive.
 
flexio_spi_master_edma_transfer_callback_t callback
 Callback for SPI DMA transfer.
 
void * userData
 User Data for SPI DMA callback.
 

Field Documentation

size_t flexio_spi_master_edma_handle_t::transferSize
uint8_t flexio_spi_master_edma_handle_t::nbytes

Macro Definition Documentation

#define FSL_FLEXIO_SPI_EDMA_DRIVER_VERSION   (MAKE_VERSION(2, 3, 0))

Typedef Documentation

typedef flexio_spi_master_edma_handle_t flexio_spi_slave_edma_handle_t

Function Documentation

status_t FLEXIO_SPI_MasterTransferCreateHandleEDMA ( FLEXIO_SPI_Type base,
flexio_spi_master_edma_handle_t *  handle,
flexio_spi_master_edma_transfer_callback_t  callback,
void *  userData,
edma_handle_t txHandle,
edma_handle_t rxHandle 
)

This function initializes the FlexIO SPI master eDMA handle which can be used for other FlexIO SPI master transactional APIs. For a specified FlexIO SPI instance, call this API once to get the initialized handle.

Parameters
basePointer to FLEXIO_SPI_Type structure.
handlePointer to flexio_spi_master_edma_handle_t structure to store the transfer state.
callbackSPI callback, NULL means no callback.
userDatacallback function parameter.
txHandleUser requested eDMA handle for FlexIO SPI RX eDMA transfer.
rxHandleUser requested eDMA handle for FlexIO SPI TX eDMA transfer.
Return values
kStatus_SuccessSuccessfully create the handle.
kStatus_OutOfRangeThe FlexIO SPI eDMA type/handle table out of range.
status_t FLEXIO_SPI_MasterTransferEDMA ( FLEXIO_SPI_Type base,
flexio_spi_master_edma_handle_t *  handle,
flexio_spi_transfer_t xfer 
)
Note
This interface returns immediately after transfer initiates. Call FLEXIO_SPI_MasterGetTransferCountEDMA to poll the transfer status and check whether the FlexIO SPI transfer is finished.
Parameters
basePointer to FLEXIO_SPI_Type structure.
handlePointer to flexio_spi_master_edma_handle_t structure to store the transfer state.
xferPointer to FlexIO SPI transfer structure.
Return values
kStatus_SuccessSuccessfully start a transfer.
kStatus_InvalidArgumentInput argument is invalid.
kStatus_FLEXIO_SPI_BusyFlexIO SPI is not idle, is running another transfer.
void FLEXIO_SPI_MasterTransferAbortEDMA ( FLEXIO_SPI_Type base,
flexio_spi_master_edma_handle_t *  handle 
)
Parameters
basePointer to FLEXIO_SPI_Type structure.
handleFlexIO SPI eDMA handle pointer.
status_t FLEXIO_SPI_MasterTransferGetCountEDMA ( FLEXIO_SPI_Type base,
flexio_spi_master_edma_handle_t *  handle,
size_t *  count 
)
Parameters
basePointer to FLEXIO_SPI_Type structure.
handleFlexIO SPI eDMA handle pointer.
countNumber of bytes transferred so far by the non-blocking transaction.
static void FLEXIO_SPI_SlaveTransferCreateHandleEDMA ( FLEXIO_SPI_Type base,
flexio_spi_slave_edma_handle_t handle,
flexio_spi_slave_edma_transfer_callback_t  callback,
void *  userData,
edma_handle_t txHandle,
edma_handle_t rxHandle 
)
inlinestatic

This function initializes the FlexIO SPI slave eDMA handle.

Parameters
basePointer to FLEXIO_SPI_Type structure.
handlePointer to flexio_spi_slave_edma_handle_t structure to store the transfer state.
callbackSPI callback, NULL means no callback.
userDatacallback function parameter.
txHandleUser requested eDMA handle for FlexIO SPI TX eDMA transfer.
rxHandleUser requested eDMA handle for FlexIO SPI RX eDMA transfer.
status_t FLEXIO_SPI_SlaveTransferEDMA ( FLEXIO_SPI_Type base,
flexio_spi_slave_edma_handle_t handle,
flexio_spi_transfer_t xfer 
)
Note
This interface returns immediately after transfer initiates. Call FLEXIO_SPI_SlaveGetTransferCountEDMA to poll the transfer status and check whether the FlexIO SPI transfer is finished.
Parameters
basePointer to FLEXIO_SPI_Type structure.
handlePointer to flexio_spi_slave_edma_handle_t structure to store the transfer state.
xferPointer to FlexIO SPI transfer structure.
Return values
kStatus_SuccessSuccessfully start a transfer.
kStatus_InvalidArgumentInput argument is invalid.
kStatus_FLEXIO_SPI_BusyFlexIO SPI is not idle, is running another transfer.
static void FLEXIO_SPI_SlaveTransferAbortEDMA ( FLEXIO_SPI_Type base,
flexio_spi_slave_edma_handle_t handle 
)
inlinestatic
Parameters
basePointer to FLEXIO_SPI_Type structure.
handlePointer to flexio_spi_slave_edma_handle_t structure to store the transfer state.
static status_t FLEXIO_SPI_SlaveTransferGetCountEDMA ( FLEXIO_SPI_Type base,
flexio_spi_slave_edma_handle_t handle,
size_t *  count 
)
inlinestatic
Parameters
basePointer to FLEXIO_SPI_Type structure.
handleFlexIO SPI eDMA handle pointer.
countNumber of bytes transferred so far by the non-blocking transaction.