MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
Data Structures | |
struct | esai_edma_handle_t |
ESAI DMA transfer handle, users should not touch the content of the handle. More... | |
Typedefs | |
typedef void(* | esai_edma_callback_t )(ESAI_Type *base, esai_edma_handle_t *handle, status_t status, void *userData) |
ESAI eDMA transfer callback function for finish and error. | |
eDMA Transactional | |
void | ESAI_TransferTxCreateHandleEDMA (ESAI_Type *base, esai_edma_handle_t *handle, esai_edma_callback_t callback, void *userData, edma_handle_t *dmaHandle) |
Initializes the ESAI eDMA handle. More... | |
void | ESAI_TransferRxCreateHandleEDMA (ESAI_Type *base, esai_edma_handle_t *handle, esai_edma_callback_t callback, void *userData, edma_handle_t *dmaHandle) |
Initializes the ESAI Rx eDMA handle. More... | |
void | ESAI_TransferTxSetFormatEDMA (ESAI_Type *base, esai_edma_handle_t *handle, esai_format_t *format, uint32_t hckClockHz, uint32_t hclkSourceClockHz) |
Configures the ESAI Tx audio format. More... | |
void | ESAI_TransferRxSetFormatEDMA (ESAI_Type *base, esai_edma_handle_t *handle, esai_format_t *format, uint32_t hckClockHz, uint32_t hclkSourceClockHz) |
Configures the ESAI Rx audio format. More... | |
status_t | ESAI_TransferSendEDMA (ESAI_Type *base, esai_edma_handle_t *handle, esai_transfer_t *xfer) |
Performs a non-blocking ESAI transfer using DMA. More... | |
status_t | ESAI_TransferReceiveEDMA (ESAI_Type *base, esai_edma_handle_t *handle, esai_transfer_t *xfer) |
Performs a non-blocking ESAI receive using eDMA. More... | |
void | ESAI_TransferAbortSendEDMA (ESAI_Type *base, esai_edma_handle_t *handle) |
Aborts a ESAI transfer using eDMA. More... | |
void | ESAI_TransferAbortReceiveEDMA (ESAI_Type *base, esai_edma_handle_t *handle) |
Aborts a ESAI receive using eDMA. More... | |
status_t | ESAI_TransferGetSendCountEDMA (ESAI_Type *base, esai_edma_handle_t *handle, size_t *count) |
Gets byte count sent by ESAI. More... | |
status_t | ESAI_TransferGetReceiveCountEDMA (ESAI_Type *base, esai_edma_handle_t *handle, size_t *count) |
Gets byte count received by ESAI. More... | |
struct _esai_edma_handle |
Data Fields | |
edma_handle_t * | dmaHandle |
DMA handler for ESAI send. | |
uint8_t | nbytes |
eDMA minor byte transfer count initially configured. More... | |
uint8_t | bitWidth |
Bit width for transfer, 8/16/24/32 bits. | |
uint8_t | slotLen |
Slot length of the audio data. | |
uint8_t | count |
The transfer data count in a DMA request. | |
uint8_t | sectionMap |
Section enabled for transfer. | |
uint32_t | state |
Internal state for ESAI eDMA transfer. | |
esai_edma_callback_t | callback |
Callback for users while transfer finish or error occurs. | |
void * | userData |
User callback parameter. | |
edma_tcd_t | tcd [ESAI_XFER_QUEUE_SIZE+1U] |
TCD pool for eDMA transfer. More... | |
esai_transfer_t | esaiQueue [ESAI_XFER_QUEUE_SIZE] |
Transfer queue storing queued transfer. More... | |
size_t | transferSize [ESAI_XFER_QUEUE_SIZE] |
Data bytes need to transfer. | |
volatile uint8_t | queueUser |
Index for user to queue transfer. More... | |
volatile uint8_t | queueDriver |
Index for driver to get the transfer data and size. | |
uint8_t esai_edma_handle_t::nbytes |
edma_tcd_t esai_edma_handle_t::tcd[ESAI_XFER_QUEUE_SIZE+1U] |
esai_transfer_t esai_edma_handle_t::esaiQueue[ESAI_XFER_QUEUE_SIZE] |
volatile uint8_t esai_edma_handle_t::queueUser |
void ESAI_TransferTxCreateHandleEDMA | ( | ESAI_Type * | base, |
esai_edma_handle_t * | handle, | ||
esai_edma_callback_t | callback, | ||
void * | userData, | ||
edma_handle_t * | dmaHandle | ||
) |
This function initializes the ESAI master DMA handle, which can be used for other ESAI master transactional APIs. Usually, for a specified ESAI instance, call this API once to get the initialized handle.
base | ESAI base pointer. |
handle | ESAI eDMA handle pointer. |
base | ESAI peripheral base address. |
callback | Pointer to user callback function. |
userData | User parameter passed to the callback function. |
dmaHandle | eDMA handle pointer, this handle shall be static allocated by users. |
void ESAI_TransferRxCreateHandleEDMA | ( | ESAI_Type * | base, |
esai_edma_handle_t * | handle, | ||
esai_edma_callback_t | callback, | ||
void * | userData, | ||
edma_handle_t * | dmaHandle | ||
) |
This function initializes the ESAI slave DMA handle, which can be used for other ESAI master transactional APIs. Usually, for a specified ESAI instance, call this API once to get the initialized handle.
base | ESAI base pointer. |
handle | ESAI eDMA handle pointer. |
base | ESAI peripheral base address. |
callback | Pointer to user callback function. |
userData | User parameter passed to the callback function. |
dmaHandle | eDMA handle pointer, this handle shall be static allocated by users. |
void ESAI_TransferTxSetFormatEDMA | ( | ESAI_Type * | base, |
esai_edma_handle_t * | handle, | ||
esai_format_t * | format, | ||
uint32_t | hckClockHz, | ||
uint32_t | hclkSourceClockHz | ||
) |
The audio format can be changed at run-time. This function configures the sample rate and audio data format to be transferred. This function also sets the eDMA parameter according to formatting requirements.
base | ESAI base pointer. |
handle | ESAI eDMA handle pointer. |
format | Pointer to ESAI audio data format structure. |
hckClockHz | HCK clock frequency in Hz. |
hclkSourceClockHz | HCK clock source frequency in Hz. |
kStatus_Success | Audio format set successfully. |
kStatus_InvalidArgument | The input argument is invalid. |
void ESAI_TransferRxSetFormatEDMA | ( | ESAI_Type * | base, |
esai_edma_handle_t * | handle, | ||
esai_format_t * | format, | ||
uint32_t | hckClockHz, | ||
uint32_t | hclkSourceClockHz | ||
) |
The audio format can be changed at run-time. This function configures the sample rate and audio data format to be transferred. This function also sets the eDMA parameter according to formatting requirements.
base | ESAI base pointer. |
handle | ESAI eDMA handle pointer. |
format | Pointer to ESAI audio data format structure. |
hckClockHz | HCK clock frequency in Hz. |
hclkSourceClockHz | HCK clock source frequency in Hz. |
kStatus_Success | Audio format set successfully. |
kStatus_InvalidArgument | The input argument is invalid. |
status_t ESAI_TransferSendEDMA | ( | ESAI_Type * | base, |
esai_edma_handle_t * | handle, | ||
esai_transfer_t * | xfer | ||
) |
base | ESAI base pointer. |
handle | ESAI eDMA handle pointer. |
xfer | Pointer to the DMA transfer structure. |
kStatus_Success | Start a ESAI eDMA send successfully. |
kStatus_InvalidArgument | The input argument is invalid. |
kStatus_TxBusy | ESAI is busy sending data. |
status_t ESAI_TransferReceiveEDMA | ( | ESAI_Type * | base, |
esai_edma_handle_t * | handle, | ||
esai_transfer_t * | xfer | ||
) |
base | ESAI base pointer |
handle | ESAI eDMA handle pointer. |
xfer | Pointer to DMA transfer structure. |
kStatus_Success | Start a ESAI eDMA receive successfully. |
kStatus_InvalidArgument | The input argument is invalid. |
kStatus_RxBusy | ESAI is busy receiving data. |
void ESAI_TransferAbortSendEDMA | ( | ESAI_Type * | base, |
esai_edma_handle_t * | handle | ||
) |
base | ESAI base pointer. |
handle | ESAI eDMA handle pointer. |
void ESAI_TransferAbortReceiveEDMA | ( | ESAI_Type * | base, |
esai_edma_handle_t * | handle | ||
) |
base | ESAI base pointer |
handle | ESAI eDMA handle pointer. |
status_t ESAI_TransferGetSendCountEDMA | ( | ESAI_Type * | base, |
esai_edma_handle_t * | handle, | ||
size_t * | count | ||
) |
base | ESAI base pointer. |
handle | ESAI eDMA handle pointer. |
count | Bytes count sent by ESAI. |
kStatus_Success | Succeed get the transfer count. |
kStatus_NoTransferInProgress | There is no non-blocking transaction in progress. |
status_t ESAI_TransferGetReceiveCountEDMA | ( | ESAI_Type * | base, |
esai_edma_handle_t * | handle, | ||
size_t * | count | ||
) |
base | ESAI base pointer |
handle | ESAI eDMA handle pointer. |
count | Bytes count received by ESAI. |
kStatus_Success | Succeed get the transfer count. |
kStatus_NoTransferInProgress | There is no non-blocking transaction in progress. |