RTEMS 6.1-rc6
Loading...
Searching...
No Matches
Data Structures
SAI SDMA Driver

Data Structures

struct  _sai_sdma_handle
 SAI DMA transfer handle, users should not touch the content of the handle. More...
 

Driver version

typedef struct _sai_sdma_handle sai_sdma_handle_t
 
typedef void(* sai_sdma_callback_t) (I2S_Type *base, sai_sdma_handle_t *handle, status_t status, void *userData)
 SAI SDMA transfer callback function for finish and error.
 
#define FSL_SAI_SDMA_DRIVER_VERSION   (MAKE_VERSION(2, 5, 3))
 

SDMA Transactional

void SAI_TransferTxCreateHandleSDMA (I2S_Type *base, sai_sdma_handle_t *handle, sai_sdma_callback_t callback, void *userData, sdma_handle_t *dmaHandle, uint32_t eventSource)
 Initializes the SAI SDMA handle.
 
void SAI_TransferRxCreateHandleSDMA (I2S_Type *base, sai_sdma_handle_t *handle, sai_sdma_callback_t callback, void *userData, sdma_handle_t *dmaHandle, uint32_t eventSource)
 Initializes the SAI Rx SDMA handle.
 
void SAI_TransferTxSetFormatSDMA (I2S_Type *base, sai_sdma_handle_t *handle, sai_transfer_format_t *format, uint32_t mclkSourceClockHz, uint32_t bclkSourceClockHz)
 Configures the SAI Tx audio format.
 
void SAI_TransferRxSetFormatSDMA (I2S_Type *base, sai_sdma_handle_t *handle, sai_transfer_format_t *format, uint32_t mclkSourceClockHz, uint32_t bclkSourceClockHz)
 Configures the SAI Rx audio format.
 
status_t SAI_TransferSendSDMA (I2S_Type *base, sai_sdma_handle_t *handle, sai_transfer_t *xfer)
 Performs a non-blocking SAI transfer using DMA.
 
status_t SAI_TransferReceiveSDMA (I2S_Type *base, sai_sdma_handle_t *handle, sai_transfer_t *xfer)
 Performs a non-blocking SAI receive using SDMA.
 
void SAI_TransferAbortSendSDMA (I2S_Type *base, sai_sdma_handle_t *handle)
 Aborts a SAI transfer using SDMA.
 
void SAI_TransferAbortReceiveSDMA (I2S_Type *base, sai_sdma_handle_t *handle)
 Aborts a SAI receive using SDMA.
 
void SAI_TransferTerminateReceiveSDMA (I2S_Type *base, sai_sdma_handle_t *handle)
 Terminate all the SAI sdma receive transfer.
 
void SAI_TransferTerminateSendSDMA (I2S_Type *base, sai_sdma_handle_t *handle)
 Terminate all the SAI sdma send transfer.
 
void SAI_TransferRxSetConfigSDMA (I2S_Type *base, sai_sdma_handle_t *handle, sai_transceiver_t *saiConfig)
 
void SAI_TransferTxSetConfigSDMA (I2S_Type *base, sai_sdma_handle_t *handle, sai_transceiver_t *saiConfig)
 

Detailed Description

Macro Definition Documentation

◆ FSL_SAI_SDMA_DRIVER_VERSION

#define FSL_SAI_SDMA_DRIVER_VERSION   (MAKE_VERSION(2, 5, 3))

Version 2.5.3

Function Documentation

◆ SAI_TransferAbortReceiveSDMA()

void SAI_TransferAbortReceiveSDMA ( I2S_Type base,
sai_sdma_handle_t handle 
)

Aborts a SAI receive using SDMA.

Parameters
baseSAI base pointer
handleSAI SDMA handle pointer.

◆ SAI_TransferAbortSendSDMA()

void SAI_TransferAbortSendSDMA ( I2S_Type base,
sai_sdma_handle_t handle 
)

Aborts a SAI transfer using SDMA.

Parameters
baseSAI base pointer.
handleSAI SDMA handle pointer.

◆ SAI_TransferReceiveSDMA()

status_t SAI_TransferReceiveSDMA ( I2S_Type base,
sai_sdma_handle_t handle,
sai_transfer_t xfer 
)

Performs a non-blocking SAI receive using SDMA.

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.
Parameters
baseSAI base pointer
handleSAI SDMA handle pointer.
xferPointer to DMA transfer structure.
Return values
kStatus_SuccessStart a SAI SDMA receive successfully.
kStatus_InvalidArgumentThe input argument is invalid.
kStatus_RxBusySAI is busy receiving data.

◆ SAI_TransferRxCreateHandleSDMA()

void SAI_TransferRxCreateHandleSDMA ( I2S_Type base,
sai_sdma_handle_t handle,
sai_sdma_callback_t  callback,
void *  userData,
sdma_handle_t *  dmaHandle,
uint32_t  eventSource 
)

Initializes the SAI Rx SDMA 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.

Parameters
baseSAI base pointer.
handleSAI SDMA handle pointer.
baseSAI peripheral base address.
callbackPointer to user callback function.
userDataUser parameter passed to the callback function.
dmaHandleSDMA handle pointer, this handle shall be static allocated by users.
eventSourceSAI event source number.

◆ SAI_TransferRxSetConfigSDMA()

void SAI_TransferRxSetConfigSDMA ( I2S_Type base,
sai_sdma_handle_t handle,
sai_transceiver_t saiConfig 
)

brief Configures the SAI RX.

param base SAI base pointer. param handle SAI SDMA handle pointer. param saiConig sai configurations.

◆ SAI_TransferRxSetFormatSDMA()

void SAI_TransferRxSetFormatSDMA ( I2S_Type base,
sai_sdma_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 SDMA parameter according to formatting requirements.

Parameters
baseSAI base pointer.
handleSAI SDMA handle pointer.
formatPointer to SAI audio data format structure.
mclkSourceClockHzSAI master clock source frequency in Hz.
bclkSourceClockHzSAI bit clock source frequency in Hz. If a bit clock source is the master clock, this value should equal to masterClockHz in format.
Return values
kStatus_SuccessAudio format set successfully.
kStatus_InvalidArgumentThe input argument is invalid.

◆ SAI_TransferSendSDMA()

status_t SAI_TransferSendSDMA ( I2S_Type base,
sai_sdma_handle_t handle,
sai_transfer_t xfer 
)

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.
Parameters
baseSAI base pointer.
handleSAI SDMA handle pointer.
xferPointer to the DMA transfer structure.
Return values
kStatus_SuccessStart a SAI SDMA send successfully.
kStatus_InvalidArgumentThe input argument is invalid.
kStatus_TxBusySAI is busy sending data.

◆ SAI_TransferTerminateReceiveSDMA()

void SAI_TransferTerminateReceiveSDMA ( I2S_Type base,
sai_sdma_handle_t handle 
)

Terminate all the SAI sdma receive transfer.

Parameters
baseSAI base pointer.
handleSAI SDMA handle pointer.

◆ SAI_TransferTerminateSendSDMA()

void SAI_TransferTerminateSendSDMA ( I2S_Type base,
sai_sdma_handle_t handle 
)

Terminate all the SAI sdma send transfer.

Parameters
baseSAI base pointer.
handleSAI SDMA handle pointer.

◆ SAI_TransferTxCreateHandleSDMA()

void SAI_TransferTxCreateHandleSDMA ( I2S_Type base,
sai_sdma_handle_t handle,
sai_sdma_callback_t  callback,
void *  userData,
sdma_handle_t *  dmaHandle,
uint32_t  eventSource 
)

Initializes the SAI SDMA 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.

Parameters
baseSAI base pointer.
handleSAI SDMA handle pointer.
baseSAI peripheral base address.
callbackPointer to user callback function.
userDataUser parameter passed to the callback function.
dmaHandleSDMA handle pointer, this handle shall be static allocated by users.
eventSourceSAI event source number.

◆ SAI_TransferTxSetConfigSDMA()

void SAI_TransferTxSetConfigSDMA ( I2S_Type base,
sai_sdma_handle_t handle,
sai_transceiver_t saiConfig 
)

brief Configures the SAI Tx.

param base SAI base pointer. param handle SAI SDMA handle pointer. param saiConig sai configurations.

◆ SAI_TransferTxSetFormatSDMA()

void SAI_TransferTxSetFormatSDMA ( I2S_Type base,
sai_sdma_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 SDMA parameter according to formatting requirements.

Parameters
baseSAI base pointer.
handleSAI SDMA handle pointer.
formatPointer to SAI audio data format structure.
mclkSourceClockHzSAI master clock source frequency in Hz.
bclkSourceClockHzSAI bit clock source frequency in Hz. If bit clock source is master clock, this value should equals to masterClockHz in format.
Return values
kStatus_SuccessAudio format set successfully.
kStatus_InvalidArgumentThe input argument is invalid.