MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
QSPI_EDMA: EDMA based QSPI Driver

Read Guidance

The QSPI_EDMA module provide a method for QSPI transfer operation based on EDMA.

Data Structures

struct  qspi_slave_edma_handle_t
 QUEUEDSPI master EDMA transfer handle structure used for transactional API. More...
 

Typedefs

typedef void(* qspi_edma_transfer_callback_t )(qspi_master_edma_handle_t *psHandle, status_t eCompletionStatus, void *pUserData)
 Completion callback function pointer type. More...
 

Functions

void QSPI_MasterTransferCreateHandleEDMA (QSPI_Type *base, qspi_master_edma_handle_t *psHandle, qspi_edma_transfer_callback_t pfCallback, void *pUserData, DMA_Type *psEdmaBase, edma_channel_t eEdmaTxChannel, edma_channel_t eEdmaRxChannel)
 Initialize the QUEUEDSPI master EDMA handle. More...
 
status_t QSPI_MasterTransferEDMA (qspi_master_edma_handle_t *psHandle, qspi_transfer_t *psXfer)
 EDMA method of QUEUEDSPI master transfer. More...
 
status_t QSPI_MasterTransferGetCountEDMA (qspi_master_edma_handle_t *psHandle, uint16_t *pu16Count)
 Get the master EDMA transfer count. More...
 
void QSPI_MasterTransferAbortEDMA (qspi_master_edma_handle_t *psHandle)
 Abort a transfer that uses EDMA for master. More...
 
void QSPI_SlaveTransferCreateHandleEDMA (QSPI_Type *base, qspi_slave_edma_handle_t *psHandle, qspi_edma_transfer_callback_t pfCallback, void *pUserData, DMA_Type *psEdmaBase, edma_channel_t eEdmaTxChannel, edma_channel_t eEdmaRxChannel)
 Initialize the QUEUEDSPI slave EDMA handle. More...
 
status_t QSPI_SlaveTransferEDMA (qspi_slave_edma_handle_t *handle, qspi_transfer_t *psXfer)
 EDMA method of QUEUEDSPI slave transfer. More...
 
status_t QSPI_SlaveTransferGetCountEDMA (qspi_slave_edma_handle_t *handle, uint16_t *pu16Count)
 Get the slave EDMA transfer count. More...
 
void QSPI_SlaveTransferAbortEDMA (qspi_slave_edma_handle_t *handle)
 Abort a transfer that uses EDMA for slave. More...
 

Driver version

#define FSL_QSPI_EDMA_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))
 QUEUEDSPI EDMA driver version.
 

Data Structure Documentation

struct _qspi_master_edma_handle

Forward declaration of the _qspi_master_edma_handle typedefs.

Data Fields

QSPI_Type * base
 Base address of the QSPI Peripheral.
 
volatile uint8_t u8State
 QUEUEDSPI transfer state , defined in _qspi_transfer_state. More...
 
uint16_t u16TotalByteCount
 A number of transfer bytes. More...
 
qspi_data_width_t eDataWidth
 The desired number of bits per frame. More...
 
uint16_t u16TxDummyData
 Used if txData is NULL. More...
 
uint16_t u16RxDummyData
 Used if rxData is NULL. More...
 
edma_handle_t sTxHandle
 edma_handle_t handle point used for transmitting data. More...
 
edma_handle_t sRxHandle
 edma_handle_t handle point used for receiving data. More...
 
bool bIsTxInProgress
 Indicates whether the transmit is in progress. More...
 
bool bIsRxInProgress
 Indicates whether the receive is in progress. More...
 
qspi_edma_transfer_callback_t pfCallback
 Completion callback. More...
 
void * pUserData
 Callback user data. More...
 
volatile bool bIsPcsActiveAfterTransfer
 Indicates whether the PCS signal is active after the last frame transfer, This is not used in slave transfer. More...
 

Field Documentation

volatile uint8_t qspi_slave_edma_handle_t::u8State
uint16_t qspi_slave_edma_handle_t::u16TotalByteCount
qspi_data_width_t qspi_slave_edma_handle_t::eDataWidth
uint16_t qspi_slave_edma_handle_t::u16TxDummyData
uint16_t qspi_slave_edma_handle_t::u16RxDummyData
edma_handle_t qspi_slave_edma_handle_t::sTxHandle
edma_handle_t qspi_slave_edma_handle_t::sRxHandle
bool qspi_slave_edma_handle_t::bIsTxInProgress
bool qspi_slave_edma_handle_t::bIsRxInProgress
qspi_edma_transfer_callback_t qspi_slave_edma_handle_t::pfCallback
void* qspi_slave_edma_handle_t::pUserData
volatile bool qspi_slave_edma_handle_t::bIsPcsActiveAfterTransfer

Typedef Documentation

typedef void(* qspi_edma_transfer_callback_t)(qspi_master_edma_handle_t *psHandle, status_t eCompletionStatus, void *pUserData)
Parameters
baseQUEUEDSPI peripheral base address.
psHandlePointer to the handle for the QUEUEDSPI master.
eCompletionStatusSuccess or error code describing whether the transfer completed.
pUserDataArbitrary pointer-dataSized value passed from the application.

Function Documentation

void QSPI_MasterTransferCreateHandleEDMA ( QSPI_Type *  base,
qspi_master_edma_handle_t *  psHandle,
qspi_edma_transfer_callback_t  pfCallback,
void *  pUserData,
DMA_Type *  psEdmaBase,
edma_channel_t  eEdmaTxChannel,
edma_channel_t  eEdmaRxChannel 
)

This function initializes the QUEUEDSPI EDMA master handle which can be used for QUEUEDSPI EDMA master transactional APIs. Usually, for a specified QUEUEDSPI instance, call this API once to get the initialized handle.

Parameters
baseQUEUEDSPI peripheral base address.
psHandleQUEUEDSPI handle pointer to qspi_master_edma_handle_t.
pfCallbackQUEUEDSPI callback.
pUserDatacallback function parameter.
psEdmaBasebase address for the EDMA
eEdmaTxChannelChannel of the EDMA used for QSPI Tx
eEdmaRxChannelChannel of the EDMA used for QSPI Rx
status_t QSPI_MasterTransferEDMA ( qspi_master_edma_handle_t *  psHandle,
qspi_transfer_t psXfer 
)

This function transfers data using EDMA. This is a non-blocking function, which returns right away. When all data is transferred, the callback function is called.

: The transfer data size should be even, if the transfer data width is larger than 8.

Parameters
psHandlepointer to qspi_master_edma_handle_t structure which stores the transfer state.
psXferpointer to qspi_transfer_t structure.
Returns
status of status_t.
status_t QSPI_MasterTransferGetCountEDMA ( qspi_master_edma_handle_t *  psHandle,
uint16_t *  pu16Count 
)
Parameters
psHandlePointer to the qspi_master_edma_handle_t structure which stores the transfer state.
pu16CountThe number of bytes transferred by using the EDMA transaction.
Returns
status of status_t.
void QSPI_MasterTransferAbortEDMA ( qspi_master_edma_handle_t *  psHandle)
Parameters
psHandlePointer to the qspi_master_edma_handle_t structure which stores the transfer state.
void QSPI_SlaveTransferCreateHandleEDMA ( QSPI_Type *  base,
qspi_slave_edma_handle_t *  psHandle,
qspi_edma_transfer_callback_t  pfCallback,
void *  pUserData,
DMA_Type *  psEdmaBase,
edma_channel_t  eEdmaTxChannel,
edma_channel_t  eEdmaRxChannel 
)

This function initializes the QUEUEDSPI EDMA handle which can be used for other QUEUEDSPI transactional APIs. Usually, for a specified QUEUEDSPI instance, call this API once to get the initialized handle.

Parameters
psHandleQUEUEDSPI handle pointer to qspi_slave_edma_handle_t.
pfCallbackQUEUEDSPI callback.
pUserDatacallback function parameter.
psEdmaBasebase address for the EDMA
eEdmaTxChannelChannel of the EDMA used for QSPI Tx
eEdmaRxChannelChannel of the EDMA used for QSPI Rx
status_t QSPI_SlaveTransferEDMA ( qspi_slave_edma_handle_t *  handle,
qspi_transfer_t psXfer 
)

This function transfers data using EDMA. This is a non-blocking function, which returns right away. When all data is transferred, the callback function is called.

: The transfer data size should be even if the transfer data width is larger than 8.

Parameters
psHandlepointer to qspi_slave_edma_handle_t structure which stores the transfer state.
psXferpointer to qspi_transfer_t structure.
Returns
status of status_t.
status_t QSPI_SlaveTransferGetCountEDMA ( qspi_slave_edma_handle_t *  handle,
uint16_t *  pu16Count 
)
Parameters
baseQUEUEDSPI peripheral base address.
psHandlePointer to the qspi_slave_edma_handle_t structure which stores the transfer state.
pu16CountThe number of bytes transferred by using the EDMA transaction.
Returns
status of status_t.
void QSPI_SlaveTransferAbortEDMA ( qspi_slave_edma_handle_t *  handle)
Parameters
psHandlePointer to the qspi_slave_edma_handle_t structure which stores the transfer state.