MCUXpresso SDK API Reference Manual  Rev 2.16.000
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
QSPI_DMA: DMA based QSPI Driver

Overview

The QSPI_DMA module provide a method for QSPI transfer operation based on DMA.

Data Structures

struct  qspi_slave_dma_handle_t
 QUEUEDSPI master DMA transfer handle structure used for transactional API. More...
 

Typedefs

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

Functions

void QSPI_MasterTransferCreateHandleDMA (QSPI_Type *base, qspi_master_dma_handle_t *psHandle, qspi_dma_transfer_callback_t pfCallback, void *pUserData, DMA_Type *psDmaBase, dma_channel_t eDmaTxChannel, dma_channel_t eDmaRxChannel)
 Initialize the QUEUEDSPI master DMA handle. More...
 
status_t QSPI_MasterTransferDMA (qspi_master_dma_handle_t *psHandle, qspi_transfer_t *psXfer)
 DMA method of QUEUEDSPI master transfer. More...
 
status_t QSPI_MasterTransferGetCountDMA (qspi_master_dma_handle_t *psHandle, uint16_t *pu16Count)
 Get the master DMA transfer count. More...
 
void QSPI_MasterTransferAbortDMA (qspi_master_dma_handle_t *psHandle)
 Abort a transfer that uses DMA for master. More...
 
void QSPI_SlaveTransferCreateHandleDMA (QSPI_Type *base, qspi_slave_dma_handle_t *psHandle, qspi_dma_transfer_callback_t pfCallback, void *pUserData, DMA_Type *psDmaBase, dma_channel_t eDmaTxChannel, dma_channel_t eDmaRxChannel)
 Initialize the QUEUEDSPI slave DMA handle. More...
 
status_t QSPI_SlaveTransferDMA (qspi_slave_dma_handle_t *psHandle, qspi_transfer_t *psXfer)
 DMA method of QUEUEDSPI slave transfer. More...
 
status_t QSPI_SlaveTransferGetCountDMA (qspi_slave_dma_handle_t *psHandle, uint16_t *pu16Count)
 Get the slave DMA transfer count. More...
 
void QSPI_SlaveTransferAbortDMA (qspi_slave_dma_handle_t *psHandle)
 Abort a transfer that uses DMA for slave. More...
 

Driver version

#define FSL_QSPI_DMA_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))
 QSPI DMA driver version. More...
 

Data Structure Documentation

struct _qspi_master_dma_handle

Forward declaration of the _qspi_master_dma_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...
 
dma_handle_t sTxHandle
 dma_handle_t handle point used for transmitting data. More...
 
dma_handle_t sRxHandle
 dma_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_dma_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_dma_handle_t::u8State
uint16_t qspi_slave_dma_handle_t::u16TotalByteCount
qspi_data_width_t qspi_slave_dma_handle_t::eDataWidth
uint16_t qspi_slave_dma_handle_t::u16TxDummyData
uint16_t qspi_slave_dma_handle_t::u16RxDummyData
dma_handle_t qspi_slave_dma_handle_t::sTxHandle
dma_handle_t qspi_slave_dma_handle_t::sRxHandle
bool qspi_slave_dma_handle_t::bIsTxInProgress
bool qspi_slave_dma_handle_t::bIsRxInProgress
qspi_dma_transfer_callback_t qspi_slave_dma_handle_t::pfCallback
void* qspi_slave_dma_handle_t::pUserData
volatile bool qspi_slave_dma_handle_t::bIsPcsActiveAfterTransfer

Macro Definition Documentation

#define FSL_QSPI_DMA_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))

Typedef Documentation

typedef void(* qspi_dma_transfer_callback_t)(qspi_master_dma_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_MasterTransferCreateHandleDMA ( QSPI_Type *  base,
qspi_master_dma_handle_t *  psHandle,
qspi_dma_transfer_callback_t  pfCallback,
void *  pUserData,
DMA_Type *  psDmaBase,
dma_channel_t  eDmaTxChannel,
dma_channel_t  eDmaRxChannel 
)

This function initializes the QUEUEDSPI DMA master handle which can be used for QUEUEDSPI DMA 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_dma_handle_t.
pfCallbackQUEUEDSPI callback.
pUserDatacallback function parameter.
psDmaBasebase address for the DMA
eDmaTxChannelChannel of the DMA used for QSPI Tx
eDmaRxChannelChannel of the DMA used for QSPI Rx
status_t QSPI_MasterTransferDMA ( qspi_master_dma_handle_t *  psHandle,
qspi_transfer_t psXfer 
)

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

Note
: The transfer data size should be even, if the transfer data width is larger than 8.
Parameters
psHandlepointer to qspi_master_dma_handle_t structure which stores the transfer state.
psXferpointer to qspi_transfer_t structure.
Returns
status of status_t.
status_t QSPI_MasterTransferGetCountDMA ( qspi_master_dma_handle_t *  psHandle,
uint16_t *  pu16Count 
)
Parameters
psHandlePointer to the qspi_master_dma_handle_t structure which stores the transfer state.
pu16CountThe number of bytes transferred by using the DMA transaction.
Returns
status of status_t.
void QSPI_MasterTransferAbortDMA ( qspi_master_dma_handle_t *  psHandle)
Parameters
psHandlePointer to the qspi_master_dma_handle_t structure which stores the transfer state.
void QSPI_SlaveTransferCreateHandleDMA ( QSPI_Type *  base,
qspi_slave_dma_handle_t *  psHandle,
qspi_dma_transfer_callback_t  pfCallback,
void *  pUserData,
DMA_Type *  psDmaBase,
dma_channel_t  eDmaTxChannel,
dma_channel_t  eDmaRxChannel 
)

This function initializes the QUEUEDSPI DMA 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
baseQUEUEDSPI peripheral base address.
psHandleQUEUEDSPI handle pointer to qspi_slave_dma_handle_t.
pfCallbackQUEUEDSPI callback.
pUserDatacallback function parameter.
psDmaBasebase address for the DMA
eDmaTxChannelChannel of the DMA used for QSPI Tx
eDmaRxChannelChannel of the DMA used for QSPI Rx
status_t QSPI_SlaveTransferDMA ( qspi_slave_dma_handle_t *  psHandle,
qspi_transfer_t psXfer 
)

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

Note
: The transfer data size should be even if the transfer data width is larger than 8.
Parameters
psHandlepointer to qspi_slave_dma_handle_t structure which stores the transfer state.
psXferpointer to qspi_transfer_t structure.
Returns
status of status_t.
status_t QSPI_SlaveTransferGetCountDMA ( qspi_slave_dma_handle_t *  psHandle,
uint16_t *  pu16Count 
)
Parameters
psHandlePointer to the qspi_slave_dma_handle_t structure which stores the transfer state.
pu16CountThe number of bytes transferred by using the DMA transaction.
Returns
status of status_t.
void QSPI_SlaveTransferAbortDMA ( qspi_slave_dma_handle_t *  psHandle)
Parameters
psHandlePointer to the qspi_slave_dma_handle_t structure which stores the transfer state.