![]() |
MCUXpresso SDK API Reference Manual
Rev 2.16.000
NXP Semiconductors
|
The QSCI_DMA module provide a method for QSCI transfer operation based on DMA.
Data Structures | |
struct | qsci_dma_transfer_handle_t |
QSCI dma transfer handle. More... | |
Typedefs | |
typedef void(* | qsci_dma_transfer_callback_t )(qsci_dma_transfer_handle_t *psHandle) |
QSCI dma transfer callback function definition. More... | |
Driver version | |
#define | FSL_QSCI_DMA_DRIVER_VERSION (MAKE_VERSION(2, 0, 1)) |
QSCI DMA driver version. More... | |
DMA transactional | |
void | QSCI_TransferCreateHandleDMA (QSCI_Type *base, qsci_dma_transfer_handle_t *psHandle, qsci_dma_transfer_callback_t pfCallback, void *pUserData, DMA_Type *dmaBase, dma_channel_t dmaTxChannel, dma_channel_t dmaRxChannel) |
Initializes the QSCI dma handle. More... | |
status_t | QSCI_TransferSendDMA (qsci_dma_transfer_handle_t *psHandle, qsci_transfer_t *psTransfer) |
Initiate data transmit using DMA. More... | |
status_t | QSCI_TransferReceiveDMA (qsci_dma_transfer_handle_t *psHandle, qsci_transfer_t *psTransfer) |
Initiate data receive using DMA. More... | |
void | QSCI_TransferAbortSendDMA (qsci_dma_transfer_handle_t *psHandle) |
Aborts the data transmit process using DMA. More... | |
void | QSCI_TransferAbortReceiveDMA (qsci_dma_transfer_handle_t *psHandle) |
Aborts the data receive process using DMA. More... | |
status_t | QSCI_TransferGetReceivedCountDMA (qsci_dma_transfer_handle_t *psHandle, uint32_t *pu32Count) |
Gets the number of received bytes. More... | |
status_t | QSCI_TransferGetSendCountDMA (qsci_dma_transfer_handle_t *psHandle, uint32_t *pu32Count) |
Gets the number of bytes written to the QSCI TX register. More... | |
struct _qsci_dma_transfer_handle |
Forward declaration of the qsci dma handle typedef.
This struct address should be sizeof(dma_channel_tcd_t) aligned.
Data Fields | |
QSCI_Type * | base |
Pointer to the QSCI base that belongs to this handle. More... | |
qsci_dma_transfer_callback_t | pfCallback |
Callback function. More... | |
uint32_t | u32RxDataSizeAll |
Size of the data to receive. More... | |
uint32_t | u32TxDataSizeAll |
Size of the data to send out. More... | |
dma_handle_t | sTxDmaHandle |
The DMA TX channel used. More... | |
dma_handle_t | sRxDmaHandle |
The DMA RX channel used. More... | |
volatile uint8_t | u8TxState |
TX transfer state. More... | |
volatile uint8_t | u8RxState |
RX transfer state. | |
status_t | busStatus |
QSCI bus status. More... | |
void * | pUserData |
User configurable pointer to any data, function, structure etc that user wish to use in the callback | |
QSCI_Type* qsci_dma_transfer_handle_t::base |
qsci_dma_transfer_callback_t qsci_dma_transfer_handle_t::pfCallback |
uint32_t qsci_dma_transfer_handle_t::u32RxDataSizeAll |
uint32_t qsci_dma_transfer_handle_t::u32TxDataSizeAll |
dma_handle_t qsci_dma_transfer_handle_t::sTxDmaHandle |
dma_handle_t qsci_dma_transfer_handle_t::sRxDmaHandle |
volatile uint8_t qsci_dma_transfer_handle_t::u8TxState |
status_t qsci_dma_transfer_handle_t::busStatus |
#define FSL_QSCI_DMA_DRIVER_VERSION (MAKE_VERSION(2, 0, 1)) |
typedef void(* qsci_dma_transfer_callback_t)(qsci_dma_transfer_handle_t *psHandle) |
Defines the interface of user callback function used in QSCI dma transfer using transactional APIs. The callback function shall be defined and declared in application level by user. Before starting QSCI transmiting or receiving by calling QSCI_TransferSendDMA or QSCI_TransferReceiveDMA, call QSCI_TransferCreateHandleDMA to install the user callback. When the transmiting or receiving ends, user callback will be invoked by driver.
psHandle | Transfer handle that contains bus status, user data. |
void QSCI_TransferCreateHandleDMA | ( | QSCI_Type * | base, |
qsci_dma_transfer_handle_t * | psHandle, | ||
qsci_dma_transfer_callback_t | pfCallback, | ||
void * | pUserData, | ||
DMA_Type * | dmaBase, | ||
dma_channel_t | dmaTxChannel, | ||
dma_channel_t | dmaRxChannel | ||
) |
This function initializes the QSCI dma handle which can be used for other QSCI transactional APIs. Usually, for a specified QSCI instance, call this API once to get the initialized handle.
base | QSCI peripheral base address. |
psHandle | Pointer to qsci_dma_transfer_handle_t structure. |
pfCallback | Callback function. |
pUserData | User data. |
dmaBase | DMA base address. |
dmaTxChannel | DMA channel for TX transfer. |
dmaRxChannel | DMA channel for RX transfer. |
status_t QSCI_TransferSendDMA | ( | qsci_dma_transfer_handle_t * | psHandle, |
qsci_transfer_t * | psTransfer | ||
) |
This function initiates a data transmit process using DMA. This is a non-blocking function, which returns right away. When all the data is sent, the send callback function is called.
psHandle | QSCI handle pointer. |
psTransfer | QSCI DMA transfer structure. See qsci_transfer_t. |
kStatus_Success | if succeed, others failed. |
kStatus_QSCI_TxBusy | Previous transfer on going. |
kStatus_InvalidArgument | Invalid argument. |
status_t QSCI_TransferReceiveDMA | ( | qsci_dma_transfer_handle_t * | psHandle, |
qsci_transfer_t * | psTransfer | ||
) |
This function initiates a data receive process using DMA. This is a non-blocking function, which returns right away. When all the data is received, the receive callback function is called.
psHandle | Pointer to qsci_dma_transfer_handle_t structure. |
psTransfer | QSCI DMA transfer structure, see qsci_transfer_t. |
kStatus_Success | if succeed, others fail. |
kStatus_QSCI_RxBusy | Previous transfer ongoing. |
kStatus_InvalidArgument | Invalid argument. |
void QSCI_TransferAbortSendDMA | ( | qsci_dma_transfer_handle_t * | psHandle | ) |
psHandle | Pointer to qsci_dma_transfer_handle_t structure. |
void QSCI_TransferAbortReceiveDMA | ( | qsci_dma_transfer_handle_t * | psHandle | ) |
psHandle | Pointer to qsci_dma_transfer_handle_t structure. |
status_t QSCI_TransferGetReceivedCountDMA | ( | qsci_dma_transfer_handle_t * | psHandle, |
uint32_t * | pu32Count | ||
) |
This function gets the number of received bytes.
psHandle | QSCI handle pointer. |
pu32Count | Receive bytes count. |
kStatus_NoTransferInProgress | No receive in progress. |
kStatus_Success | Get successfully through the parameter count ; |
status_t QSCI_TransferGetSendCountDMA | ( | qsci_dma_transfer_handle_t * | psHandle, |
uint32_t * | pu32Count | ||
) |
This function gets the number of bytes written to the QSCI TX register by DMA.
psHandle | QSCI handle pointer. |
pu32Count | Send bytes count. |
kStatus_NoTransferInProgress | No send in progress. |
kStatus_Success | Get successfully through the parameter count ; |