Classes | |
struct | sai_edma_handle |
SAI DMA transfer handle, users should not touch the content of the handle. More... | |
Driver version | |
typedef struct sai_edma_handle | sai_edma_handle_t |
typedef void(* | sai_edma_callback_t) (I2S_Type *base, sai_edma_handle_t *handle, status_t status, void *userData) |
SAI eDMA transfer callback function for finish and error. More... | |
#define | FSL_SAI_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 3, 1)) |
eDMA Transactional | |
void | SAI_TransferTxCreateHandleEDMA (I2S_Type *base, sai_edma_handle_t *handle, sai_edma_callback_t callback, void *userData, edma_handle_t *txDmaHandle) |
Initializes the SAI eDMA handle. More... | |
void | SAI_TransferRxCreateHandleEDMA (I2S_Type *base, sai_edma_handle_t *handle, sai_edma_callback_t callback, void *userData, edma_handle_t *rxDmaHandle) |
Initializes the SAI Rx eDMA handle. More... | |
void | SAI_TransferTxSetFormatEDMA (I2S_Type *base, sai_edma_handle_t *handle, sai_transfer_format_t *format, uint32_t mclkSourceClockHz, uint32_t bclkSourceClockHz) |
Configures the SAI Tx audio format. More... | |
void | SAI_TransferRxSetFormatEDMA (I2S_Type *base, sai_edma_handle_t *handle, sai_transfer_format_t *format, uint32_t mclkSourceClockHz, uint32_t bclkSourceClockHz) |
Configures the SAI Rx audio format. More... | |
void | SAI_TransferTxSetConfigEDMA (I2S_Type *base, sai_edma_handle_t *handle, sai_transceiver_t *saiConfig) |
Configures the SAI Tx. More... | |
void | SAI_TransferRxSetConfigEDMA (I2S_Type *base, sai_edma_handle_t *handle, sai_transceiver_t *saiConfig) |
Configures the SAI Rx. More... | |
status_t | SAI_TransferSendEDMA (I2S_Type *base, sai_edma_handle_t *handle, sai_transfer_t *xfer) |
Performs a non-blocking SAI transfer using DMA. More... | |
status_t | SAI_TransferReceiveEDMA (I2S_Type *base, sai_edma_handle_t *handle, sai_transfer_t *xfer) |
Performs a non-blocking SAI receive using eDMA. More... | |
void | SAI_TransferTerminateSendEDMA (I2S_Type *base, sai_edma_handle_t *handle) |
Terminate all SAI send. More... | |
void | SAI_TransferTerminateReceiveEDMA (I2S_Type *base, sai_edma_handle_t *handle) |
Terminate all SAI receive. More... | |
void | SAI_TransferAbortSendEDMA (I2S_Type *base, sai_edma_handle_t *handle) |
Aborts a SAI transfer using eDMA. More... | |
void | SAI_TransferAbortReceiveEDMA (I2S_Type *base, sai_edma_handle_t *handle) |
Aborts a SAI receive using eDMA. More... | |
status_t | SAI_TransferGetSendCountEDMA (I2S_Type *base, sai_edma_handle_t *handle, size_t *count) |
Gets byte count sent by SAI. More... | |
status_t | SAI_TransferGetReceiveCountEDMA (I2S_Type *base, sai_edma_handle_t *handle, size_t *count) |
Gets byte count received by SAI. More... | |
#define FSL_SAI_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 3, 1)) |
Version 2.3.1
Definition at line 25 of file fsl_sai_edma.h.
typedef void(* sai_edma_callback_t) (I2S_Type *base, sai_edma_handle_t *handle, status_t status, void *userData) |
SAI eDMA transfer callback function for finish and error.
Definition at line 31 of file fsl_sai_edma.h.
typedef struct sai_edma_handle sai_edma_handle_t |
Definition at line 28 of file fsl_sai_edma.h.
void SAI_TransferAbortReceiveEDMA | ( | I2S_Type * | base, |
sai_edma_handle_t * | handle | ||
) |
Aborts a SAI receive using eDMA.
This function only aborts the current transfer slots, the other transfer slots' information still kept in the handler. If users want to terminate all transfer slots, just call SAI_TransferTerminateReceiveEDMA.
base | SAI base pointer |
handle | SAI eDMA handle pointer. |
brief Aborts a SAI receive using eDMA.
This function only aborts the current transfer slots, the other transfer slots' information still kept in the handler. If users want to terminate all transfer slots, just call SAI_TransferTerminateReceiveEDMA.
param base SAI base pointer. param handle SAI eDMA handle pointer.
Definition at line 570 of file fsl_sai_edma.c.
void SAI_TransferAbortSendEDMA | ( | I2S_Type * | base, |
sai_edma_handle_t * | handle | ||
) |
Aborts a SAI transfer using eDMA.
This function only aborts the current transfer slots, the other transfer slots' information still kept in the handler. If users want to terminate all transfer slots, just call SAI_TransferTerminateSendEDMA.
base | SAI base pointer. |
handle | SAI eDMA handle pointer. |
brief Aborts a SAI transfer using eDMA.
This function only aborts the current transfer slots, the other transfer slots' information still kept in the handler. If users want to terminate all transfer slots, just call SAI_TransferTerminateSendEDMA.
param base SAI base pointer. param handle SAI eDMA handle pointer.
Definition at line 530 of file fsl_sai_edma.c.
status_t SAI_TransferGetReceiveCountEDMA | ( | I2S_Type * | base, |
sai_edma_handle_t * | handle, | ||
size_t * | count | ||
) |
Gets byte count received by SAI.
base | SAI base pointer |
handle | SAI eDMA handle pointer. |
count | Bytes count received by SAI. |
kStatus_Success | Succeed get the transfer count. |
kStatus_NoTransferInProgress | There is no non-blocking transaction in progress. |
brief Gets byte count received by SAI.
param base SAI base pointer param handle SAI eDMA handle pointer. param count Bytes count received by SAI. retval kStatus_Success Succeed get the transfer count. retval kStatus_NoTransferInProgress There is no non-blocking transaction in progress.
Definition at line 689 of file fsl_sai_edma.c.
status_t SAI_TransferGetSendCountEDMA | ( | I2S_Type * | base, |
sai_edma_handle_t * | handle, | ||
size_t * | count | ||
) |
Gets byte count sent by SAI.
base | SAI base pointer. |
handle | SAI eDMA handle pointer. |
count | Bytes count sent by SAI. |
kStatus_Success | Succeed get the transfer count. |
kStatus_NoTransferInProgress | There is no non-blocking transaction in progress. |
brief Gets byte count sent by SAI.
param base SAI base pointer. param handle SAI eDMA handle pointer. param count Bytes count sent by SAI. retval kStatus_Success Succeed get the transfer count. retval kStatus_NoTransferInProgress There is no non-blocking transaction in progress.
Definition at line 660 of file fsl_sai_edma.c.
status_t SAI_TransferReceiveEDMA | ( | I2S_Type * | base, |
sai_edma_handle_t * | handle, | ||
sai_transfer_t * | xfer | ||
) |
Performs a non-blocking SAI receive using eDMA.
base | SAI base pointer |
handle | SAI eDMA handle pointer. |
xfer | Pointer to DMA transfer structure. |
kStatus_Success | Start a SAI eDMA receive successfully. |
kStatus_InvalidArgument | The input argument is invalid. |
kStatus_RxBusy | SAI is busy receiving data. |
brief Performs a non-blocking SAI receive using eDMA.
note This interface returns immediately after the transfer initiates. Call the SAI_GetReceiveRemainingBytes to poll the transfer status and check whether the SAI transfer is finished.
param base SAI base pointer param handle SAI eDMA handle pointer. param xfer Pointer to DMA transfer structure. retval kStatus_Success Start a SAI eDMA receive successfully. retval kStatus_InvalidArgument The input argument is invalid. retval kStatus_RxBusy SAI is busy receiving data.
Definition at line 467 of file fsl_sai_edma.c.
void SAI_TransferRxCreateHandleEDMA | ( | I2S_Type * | base, |
sai_edma_handle_t * | handle, | ||
sai_edma_callback_t | callback, | ||
void * | userData, | ||
edma_handle_t * | rxDmaHandle | ||
) |
Initializes the SAI Rx eDMA handle.
This function initializes the SAI slave DMA handle, which can be used for other SAI master transactional APIs. Usually, for a specified SAI instance, call this API once to get the initialized handle.
base | SAI base pointer. |
handle | SAI eDMA handle pointer. |
base | SAI peripheral base address. |
callback | Pointer to user callback function. |
userData | User parameter passed to the callback function. |
rxDmaHandle | eDMA handle pointer, this handle shall be static allocated by users. |
brief Initializes the SAI Rx eDMA handle.
This function initializes the SAI slave DMA handle, which can be used for other SAI master transactional APIs. Usually, for a specified SAI instance, call this API once to get the initialized handle.
param base SAI base pointer. param handle SAI eDMA handle pointer. param base SAI peripheral base address. param callback Pointer to user callback function. param userData User parameter passed to the callback function. param dmaHandle eDMA handle pointer, this handle shall be static allocated by users.
Definition at line 190 of file fsl_sai_edma.c.
void SAI_TransferRxSetConfigEDMA | ( | I2S_Type * | base, |
sai_edma_handle_t * | handle, | ||
sai_transceiver_t * | saiConfig | ||
) |
Configures the SAI Rx.
base | SAI base pointer. |
handle | SAI eDMA handle pointer. |
saiConfig | sai configurations. |
Definition at line 358 of file fsl_sai_edma.c.
void SAI_TransferRxSetFormatEDMA | ( | I2S_Type * | base, |
sai_edma_handle_t * | handle, | ||
sai_transfer_format_t * | format, | ||
uint32_t | mclkSourceClockHz, | ||
uint32_t | bclkSourceClockHz | ||
) |
Configures the SAI Rx audio format.
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 | SAI base pointer. |
handle | SAI eDMA handle pointer. |
format | Pointer to SAI audio data format structure. |
mclkSourceClockHz | SAI master clock source frequency in Hz. |
bclkSourceClockHz | SAI bit clock source frequency in Hz. If a bit clock source is the master clock, this value should equal to masterClockHz in format. |
kStatus_Success | Audio format set successfully. |
kStatus_InvalidArgument | The input argument is invalid. |
brief Configures the SAI Rx audio format.
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.
param base SAI base pointer. param handle SAI eDMA handle pointer. param format Pointer to SAI audio data format structure. param mclkSourceClockHz SAI master clock source frequency in Hz. param bclkSourceClockHz SAI bit clock source frequency in Hz. If a bit clock source is the master clock, this value should equal to masterClockHz in format. retval kStatus_Success Audio format set successfully. retval kStatus_InvalidArgument The input argument is invalid.
Definition at line 317 of file fsl_sai_edma.c.
status_t SAI_TransferSendEDMA | ( | I2S_Type * | base, |
sai_edma_handle_t * | handle, | ||
sai_transfer_t * | xfer | ||
) |
Performs a non-blocking SAI transfer using DMA.
base | SAI base pointer. |
handle | SAI eDMA handle pointer. |
xfer | Pointer to the DMA transfer structure. |
kStatus_Success | Start a SAI eDMA send successfully. |
kStatus_InvalidArgument | The input argument is invalid. |
kStatus_TxBusy | SAI is busy sending data. |
brief Performs a non-blocking SAI transfer using DMA.
note This interface returns immediately after the transfer initiates. Call SAI_GetTransferStatus to poll the transfer status and check whether the SAI transfer is finished.
param base SAI base pointer. param handle SAI eDMA handle pointer. param xfer Pointer to the DMA transfer structure. retval kStatus_Success Start a SAI eDMA send successfully. retval kStatus_InvalidArgument The input argument is invalid. retval kStatus_TxBusy SAI is busy sending data.
Definition at line 400 of file fsl_sai_edma.c.
void SAI_TransferTerminateReceiveEDMA | ( | I2S_Type * | base, |
sai_edma_handle_t * | handle | ||
) |
Terminate all SAI receive.
This function will clear all transfer slots buffered in the sai queue. If users only want to abort the current transfer slot, please call SAI_TransferAbortReceiveEDMA.
base | SAI base pointer. |
handle | SAI eDMA handle pointer. |
brief Terminate all SAI receive.
This function will clear all transfer slots buffered in the sai queue. If users only want to abort the current transfer slot, please call SAI_TransferAbortReceiveEDMA.
param base SAI base pointer. param handle SAI eDMA handle pointer.
Definition at line 635 of file fsl_sai_edma.c.
void SAI_TransferTerminateSendEDMA | ( | I2S_Type * | base, |
sai_edma_handle_t * | handle | ||
) |
Terminate all SAI send.
This function will clear all transfer slots buffered in the sai queue. If users only want to abort the current transfer slot, please call SAI_TransferAbortSendEDMA.
base | SAI base pointer. |
handle | SAI eDMA handle pointer. |
brief Terminate all SAI send.
This function will clear all transfer slots buffered in the sai queue. If users only want to abort the current transfer slot, please call SAI_TransferAbortSendEDMA.
param base SAI base pointer. param handle SAI eDMA handle pointer.
Definition at line 610 of file fsl_sai_edma.c.
void SAI_TransferTxCreateHandleEDMA | ( | I2S_Type * | base, |
sai_edma_handle_t * | handle, | ||
sai_edma_callback_t | callback, | ||
void * | userData, | ||
edma_handle_t * | txDmaHandle | ||
) |
Initializes the SAI eDMA handle.
This function initializes the SAI master DMA handle, which can be used for other SAI master transactional APIs. Usually, for a specified SAI instance, call this API once to get the initialized handle.
base | SAI base pointer. |
handle | SAI eDMA handle pointer. |
base | SAI peripheral base address. |
callback | Pointer to user callback function. |
userData | User parameter passed to the callback function. |
txDmaHandle | eDMA handle pointer, this handle shall be static allocated by users. |
brief Initializes the SAI eDMA handle.
This function initializes the SAI master DMA handle, which can be used for other SAI master transactional APIs. Usually, for a specified SAI instance, call this API once to get the initialized handle.
param base SAI base pointer. param handle SAI eDMA handle pointer. param base SAI peripheral base address. param callback Pointer to user callback function. param userData User parameter passed to the callback function. param dmaHandle eDMA handle pointer, this handle shall be static allocated by users.
Definition at line 149 of file fsl_sai_edma.c.
void SAI_TransferTxSetConfigEDMA | ( | I2S_Type * | base, |
sai_edma_handle_t * | handle, | ||
sai_transceiver_t * | saiConfig | ||
) |
Configures the SAI Tx.
base | SAI base pointer. |
handle | SAI eDMA handle pointer. |
saiConfig | sai configurations. |
Definition at line 274 of file fsl_sai_edma.c.
void SAI_TransferTxSetFormatEDMA | ( | I2S_Type * | base, |
sai_edma_handle_t * | handle, | ||
sai_transfer_format_t * | format, | ||
uint32_t | mclkSourceClockHz, | ||
uint32_t | bclkSourceClockHz | ||
) |
Configures the SAI Tx audio format.
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 | SAI base pointer. |
handle | SAI eDMA handle pointer. |
format | Pointer to SAI audio data format structure. |
mclkSourceClockHz | SAI master clock source frequency in Hz. |
bclkSourceClockHz | SAI bit clock source frequency in Hz. If bit clock source is master clock, this value should equals to masterClockHz in format. |
kStatus_Success | Audio format set successfully. |
kStatus_InvalidArgument | The input argument is invalid. |
brief Configures the SAI Tx audio format.
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.
param base SAI base pointer. param handle SAI eDMA handle pointer. param format Pointer to SAI audio data format structure. param mclkSourceClockHz SAI master clock source frequency in Hz. param bclkSourceClockHz SAI bit clock source frequency in Hz. If bit clock source is master clock, this value should equals to masterClockHz in format. retval kStatus_Success Audio format set successfully. retval kStatus_InvalidArgument The input argument is invalid.
Definition at line 233 of file fsl_sai_edma.c.