Go to the documentation of this file.
25 #define FSL_SAI_DRIVER_VERSION (MAKE_VERSION(2, 3, 1))
101 #if defined(FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI) && (FSL_FEATURE_SAI_HAS_SYNC_WITH_ANOTHER_SAI)
102 kSAI_ModeSyncWithOtherTx,
103 kSAI_ModeSyncWithOtherRx
107 #if !(defined(FSL_FEATURE_SAI_HAS_NO_MCR_MICS) && (FSL_FEATURE_SAI_HAS_NO_MCR_MICS))
140 #if defined(FSL_FEATURE_SAI_FIFO_COUNT) && (FSL_FEATURE_SAI_FIFO_COUNT > 1)
149 #if defined(FSL_FEATURE_SAI_FIFO_COUNT) && (FSL_FEATURE_SAI_FIFO_COUNT > 1)
160 #if defined(FSL_FEATURE_SAI_FIFO_COUNT) && (FSL_FEATURE_SAI_FIFO_COUNT > 1)
174 #if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING
179 typedef enum _sai_fifo_packing
181 kSAI_FifoPackingDisabled = 0x0U,
182 kSAI_FifoPacking8bit = 0x2U,
183 kSAI_FifoPacking16bit = 0x3U
184 } sai_fifo_packing_t;
192 #if defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR)
193 bool mclkOutputEnable;
194 #if !(defined(FSL_FEATURE_SAI_HAS_NO_MCR_MICS) && (FSL_FEATURE_SAI_HAS_NO_MCR_MICS))
202 #ifndef SAI_XFER_QUEUE_SIZE
204 #define SAI_XFER_QUEUE_SIZE (4U)
233 #if defined(FSL_FEATURE_SAI_HAS_CHANNEL_MODE) && FSL_FEATURE_SAI_HAS_CHANNEL_MODE
235 typedef enum _sai_data_pin_state
237 kSAI_DataPinStateTriState =
239 kSAI_DataPinStateOutputZero = 1U,
241 } sai_data_pin_state_t;
244 #if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_COMBINE) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_COMBINE
246 typedef enum _sai_fifo_combine
248 kSAI_FifoCombineDisabled = 0U,
249 kSAI_FifoCombineModeEnabledOnRead,
250 kSAI_FifoCombineModeEnabledOnWrite,
251 kSAI_FifoCombineModeEnabledOnReadWrite,
252 } sai_fifo_combine_t;
275 #if defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER)
276 uint32_t masterClockHz;
278 #if defined(FSL_FEATURE_SAI_FIFO_COUNT) && (FSL_FEATURE_SAI_FIFO_COUNT > 1)
299 #if (defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR)) || \
300 (defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER))
302 typedef struct _sai_master_clock
304 #if defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR)
305 bool mclkOutputEnable;
306 #if !(defined(FSL_FEATURE_SAI_HAS_NO_MCR_MICS) && (FSL_FEATURE_SAI_HAS_NO_MCR_MICS))
311 #if (defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR)) || \
312 (defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER))
314 uint32_t mclkSourceClkHz;
316 } sai_master_clock_t;
320 #if (defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) || \
321 (defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_COMBINE) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_COMBINE) || \
322 (defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING) || \
323 (defined(FSL_FEATURE_SAI_FIFO_COUNT) && (FSL_FEATURE_SAI_FIFO_COUNT > 1))
324 #define FSL_SAI_HAS_FIFO_EXTEND_FEATURE 1
326 #define FSL_SAI_HAS_FIFO_EXTEND_FEATURE 0
329 #if FSL_SAI_HAS_FIFO_EXTEND_FEATURE
331 typedef struct _sai_fifo
333 #if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR
334 bool fifoContinueOneError;
337 #if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_COMBINE) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_COMBINE
338 sai_fifo_combine_t fifoCombine;
341 #if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING
342 sai_fifo_packing_t fifoPacking;
344 #if defined(FSL_FEATURE_SAI_FIFO_COUNT) && (FSL_FEATURE_SAI_FIFO_COUNT > 1)
345 uint8_t fifoWatermark;
368 #if defined(FSL_FEATURE_SAI_HAS_FRAME_SYNC_ON_DEMAND) && FSL_FEATURE_SAI_HAS_FRAME_SYNC_ON_DEMAND
369 bool frameSyncGenerateOnDemand;
379 #if defined(FSL_FEATURE_SAI_HAS_CHANNEL_MODE) && FSL_FEATURE_SAI_HAS_CHANNEL_MODE
380 sai_data_pin_state_t dataMode;
399 #if FSL_SAI_HAS_FIFO_EXTEND_FEATURE
451 #if defined(FSL_FEATURE_SAI_FIFO_COUNT) && (FSL_FEATURE_SAI_FIFO_COUNT > 1)
460 #if defined(__cplusplus)
684 I2S_Type *base, uint32_t sourceClockHz, uint32_t sampleRate, uint32_t bitWidth, uint32_t channelNumbers);
696 I2S_Type *base, uint32_t sourceClockHz, uint32_t sampleRate, uint32_t bitWidth, uint32_t channelNumbers);
716 #if (defined(FSL_FEATURE_SAI_HAS_MCR) && (FSL_FEATURE_SAI_HAS_MCR)) || \
717 (defined(FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER) && (FSL_FEATURE_SAI_HAS_MCLKDIV_REGISTER))
724 void SAI_SetMasterClockConfig(
I2S_Type *base, sai_master_clock_t *
config);
727 #if FSL_SAI_HAS_FIFO_EXTEND_FEATURE
806 uint32_t saiChannelMask);
819 uint32_t saiChannelMask);
832 uint32_t saiChannelMask);
846 uint32_t dataWordNum,
847 uint32_t saiChannelMask);
862 uint32_t saiChannelMask);
892 base->
TCSR = ((base->
TCSR & 0xFFE3FFFFU) | mask);
917 base->
RCSR = ((base->
RCSR & 0xFFE3FFFFU) | mask);
1012 #if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING
1019 void SAI_TxSetFIFOPacking(
I2S_Type *base, sai_fifo_packing_t pack);
1027 void SAI_RxSetFIFOPacking(
I2S_Type *base, sai_fifo_packing_t pack);
1030 #if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR
1040 static inline void SAI_TxSetFIFOErrorContinue(
I2S_Type *base,
bool isEnabled)
1061 static inline void SAI_RxSetFIFOErrorContinue(
I2S_Type *base,
bool isEnabled)
1095 base->
TCSR = ((base->
TCSR & 0xFFE3FFFFU) | mask);
1112 base->
RCSR = ((base->
RCSR & 0xFFE3FFFFU) | mask);
1129 base->
TCSR = ((base->
TCSR & 0xFFE3FFFFU) & (~mask));
1146 base->
RCSR = ((base->
RCSR & 0xFFE3FFFFU) & (~mask));
1169 base->
TCSR = ((base->
TCSR & 0xFFE3FFFFU) | mask);
1173 base->
TCSR = ((base->
TCSR & 0xFFE3FFFFU) & (~mask));
1190 base->
RCSR = ((base->
RCSR & 0xFFE3FFFFU) | mask);
1194 base->
RCSR = ((base->
RCSR & 0xFFE3FFFFU) & (~mask));
1209 return (uint32_t)(&(base->
TDR)[channel]);
1223 return (uint32_t)(&(base->
RDR)[channel]);
1248 uint32_t mclkSourceClockHz,
1249 uint32_t bclkSourceClockHz);
1266 uint32_t mclkSourceClockHz,
1267 uint32_t bclkSourceClockHz);
1295 I2S_Type *base, uint32_t channel, uint32_t channelMask, uint32_t bitWidth, uint8_t *buffer, uint32_t size);
1306 base->
TDR[channel] = data;
1335 I2S_Type *base, uint32_t channel, uint32_t channelMask, uint32_t bitWidth, uint8_t *buffer, uint32_t size);
1346 return base->
RDR[channel];
1424 uint32_t mclkSourceClockHz,
1425 uint32_t bclkSourceClockHz);
1445 uint32_t mclkSourceClockHz,
1446 uint32_t bclkSourceClockHz);
1566 #if defined(__cplusplus)
static void SAI_TxSetBitClockDirection(I2S_Type *base, sai_master_slave_t masterSlave)
Set Rx bit clock direction.
void SAI_RxGetDefaultConfig(sai_config_t *config)
Sets the SAI Rx configuration structure to default values.
enum _sai_master_slave sai_master_slave_t
Master or slave mode.
void SAI_TxSetBitclockConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_bit_clock_t *config)
Transmitter Bit clock configurations.
@ kSAI_FIFOWarningDMAEnable
#define I2S_RCR4_FCONT_MASK
void SAI_TransferTerminateReceive(I2S_Type *base, sai_handle_t *handle)
Terminate all SAI receive.
size_t transferSize[SAI_XFER_QUEUE_SIZE]
static uint32_t SAI_ReadData(I2S_Type *base, uint32_t channel)
Reads data from the SAI FIFO.
enum _sai_protocol sai_protocol_t
Define the SAI bus type.
void SAI_TransferTxCreateHandle(I2S_Type *base, sai_handle_t *handle, sai_transfer_callback_t callback, void *userData)
Initializes the SAI Tx handle.
#define I2S_TCSR_FEIE_MASK
#define I2S_RCR2_BCD_MASK
enum _sai_mclk_source sai_mclk_source_t
Mater clock source.
uint8_t dataFirstBitShifted
status_t SAI_TransferRxSetFormat(I2S_Type *base, sai_handle_t *handle, sai_transfer_format_t *format, uint32_t mclkSourceClockHz, uint32_t bclkSourceClockHz)
Configures the SAI Rx audio format.
enum _sai_mono_stereo sai_mono_stereo_t
Mono or stereo audio format.
sai frame sync configurations
void SAI_TxSoftwareReset(I2S_Type *base, sai_reset_type_t type)
Do software reset or FIFO reset .
#define I2S_TCSR_FWIE_MASK
#define I2S_TCSR_FRF_MASK
status_t SAI_TransferTxSetFormat(I2S_Type *base, sai_handle_t *handle, sai_transfer_format_t *format, uint32_t mclkSourceClockHz, uint32_t bclkSourceClockHz)
Configures the SAI Tx audio format.
#define I2S_TCSR_FWF_MASK
void SAI_TxSetChannelFIFOMask(I2S_Type *base, uint8_t mask)
Set the Tx channel FIFO enable mask.
@ kSAI_BclkSourceOtherSai1
volatile uint8_t queueDriver
struct _sai_serial_data sai_serial_data_t
sai serial data configurations
enum _sai_data_order sai_data_order_t
SAI data order, MSB or LSB.
enum _sai_sync_mode sai_sync_mode_t
Synchronous or asynchronous mode.
enum _sai_word_width sai_word_width_t
Audio word width.
status_t SAI_TransferGetReceiveCount(I2S_Type *base, sai_handle_t *handle, size_t *count)
Gets a received byte count.
void SAI_RxSetBitclockConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_bit_clock_t *config)
Receiver Bit clock configurations.
void SAI_RxSetSerialDataConfig(I2S_Type *base, sai_serial_data_t *config)
SAI receiver Serial data configurations.
void SAI_RxSetFrameSyncPolarity(I2S_Type *base, sai_clock_polarity_t polarity)
Set the Rx data order.
_sai_frame_sync_len
sai frame sync len
void SAI_GetTDMConfig(sai_transceiver_t *config, sai_frame_sync_len_t frameSyncWidth, sai_word_width_t bitWidth, uint32_t dataWordNum, uint32_t saiChannelMask)
Get TDM mode configurations.
void SAI_RxEnable(I2S_Type *base, bool enable)
Enables/disables the SAI Rx.
static void SAI_RxEnableDMA(I2S_Type *base, uint32_t mask, bool enable)
Enables/disables the SAI Rx DMA requests.
void SAI_WriteMultiChannelBlocking(I2S_Type *base, uint32_t channel, uint32_t channelMask, uint32_t bitWidth, uint8_t *buffer, uint32_t size)
Sends data to multi channel using a blocking method.
status_t SAI_TransferGetSendCount(I2S_Type *base, sai_handle_t *handle, size_t *count)
Gets a set byte count.
#define I2S_TCR2_BCD_MASK
sai_clock_polarity_t frameSyncPolarity
enum _sai_clock_polarity sai_clock_polarity_t
SAI clock polarity, active high or low.
sai_transfer_callback_t callback
struct _sai_frame_sync sai_frame_sync_t
sai frame sync configurations
sai_master_slave_t masterSlave
void SAI_TxSetBitClockRate(I2S_Type *base, uint32_t sourceClockHz, uint32_t sampleRate, uint32_t bitWidth, uint32_t channelNumbers)
Transmitter bit clock rate configurations.
static uint32_t SAI_RxGetStatusFlag(I2S_Type *base)
Gets the SAI Tx status flag state.
void SAI_TxSetFrameSyncPolarity(I2S_Type *base, sai_clock_polarity_t polarity)
Set the Tx data order.
@ kSAI_BclkSourceOtherSai0
static uint32_t SAI_TxGetDataRegisterAddress(I2S_Type *base, uint32_t channel)
Gets the SAI Tx data register address.
_sai_protocol
Define the SAI bus type.
void SAI_RxSetFormat(I2S_Type *base, sai_transfer_format_t *format, uint32_t mclkSourceClockHz, uint32_t bclkSourceClockHz)
Configures the SAI Rx audio format.
_sai_transceiver_type
sai transceiver type
sai serial data configurations
@ kSAI_PolarityActiveHigh
enum _sai_sample_rate sai_sample_rate_t
Audio sample rate.
sai_frame_sync_t frameSync
status_t SAI_TransferReceiveNonBlocking(I2S_Type *base, sai_handle_t *handle, sai_transfer_t *xfer)
Performs an interrupt non-blocking receive transfer on SAI.
struct _sai_config sai_config_t
SAI user configuration structure.
#define MAKE_STATUS(group, code)
Construct a status code value from a group and code number.
struct _sai_transceiver sai_transceiver_t
sai transceiver configurations
#define I2S_TCSR_SEIE_MASK
void SAI_TransferAbortSend(I2S_Type *base, sai_handle_t *handle)
Aborts the current send.
_sai_bclk_source
Bit clock source.
#define SAI_XFER_QUEUE_SIZE
SAI transfer queue size, user can refine it according to use case.
void SAI_TransferRxHandleIRQ(I2S_Type *base, sai_handle_t *handle)
Tx interrupt handler.
void SAI_TxInit(I2S_Type *base, const sai_config_t *config)
Initializes the SAI Tx peripheral.
sai_master_slave_t masterSlave
_sai_mono_stereo
Mono or stereo audio format.
void SAI_TransferRxSetConfig(I2S_Type *base, sai_handle_t *handle, sai_transceiver_t *config)
SAI receiver transfer configurations.
sai_transfer_t saiQueue[SAI_XFER_QUEUE_SIZE]
#define I2S_TCSR_FRDE_MASK
enum _sai_reset_type sai_reset_type_t
The reset type.
void SAI_RxSetFrameSyncConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_frame_sync_t *config)
SAI receiver Frame sync configurations.
@ kSAI_FrameSyncLenOneBitClk
static void SAI_RxDisableInterrupts(I2S_Type *base, uint32_t mask)
Disables the SAI Rx interrupt requests.
void SAI_TransferTerminateSend(I2S_Type *base, sai_handle_t *handle)
Terminate all SAI send.
sai_bclk_source_t bclkSource
_sai_sync_mode
Synchronous or asynchronous mode.
@ kSAI_BclkSourceMclkOption3
@ kSAI_Bclk_Master_FrameSync_Slave
static void SAI_WriteData(I2S_Type *base, uint32_t channel, uint32_t data)
Writes data into SAI FIFO.
enum _sai_frame_sync_len sai_frame_sync_len_t
sai frame sync len
#define I2S_TCSR_FEF_MASK
@ kSAI_Bclk_Slave_FrameSync_Master
static void SAI_TxEnableInterrupts(I2S_Type *base, uint32_t mask)
Enables the SAI Tx interrupt requests.
void SAI_GetRightJustifiedConfig(sai_transceiver_t *config, sai_word_width_t bitWidth, sai_mono_stereo_t mode, uint32_t saiChannelMask)
Get right justified mode configurations.
#define I2S_TCSR_WSIE_MASK
static void SAI_RxClearStatusFlags(I2S_Type *base, uint32_t mask)
Clears the SAI Rx status flag state.
void SAI_Deinit(I2S_Type *base)
De-initializes the SAI peripheral.
#define I2S_TCSR_WSF_MASK
void SAI_GetLeftJustifiedConfig(sai_transceiver_t *config, sai_word_width_t bitWidth, sai_mono_stereo_t mode, uint32_t saiChannelMask)
Get left justified mode configurations.
#define I2S_TCSR_SEF_MASK
sai transceiver configurations
void SAI_TransferTxHandleIRQ(I2S_Type *base, sai_handle_t *handle)
Tx interrupt handler.
sai_bclk_source_t bclkSource
static void SAI_RxSetBitClockDirection(I2S_Type *base, sai_master_slave_t masterSlave)
Set Rx bit clock direction.
_sai_data_order
SAI data order, MSB or LSB.
void SAI_WriteBlocking(I2S_Type *base, uint32_t channel, uint32_t bitWidth, uint8_t *buffer, uint32_t size)
Sends data using a blocking method.
static void SAI_RxSetFrameSyncDirection(I2S_Type *base, sai_master_slave_t masterSlave)
Set Rx frame sync direction.
void SAI_TransferRxCreateHandle(I2S_Type *base, sai_handle_t *handle, sai_transfer_callback_t callback, void *userData)
Initializes the SAI Rx handle.
void SAI_TransferAbortReceive(I2S_Type *base, sai_handle_t *handle)
Aborts the current IRQ receive.
struct _sai_transfer_format sai_transfer_format_t
sai transfer format
void SAI_ReadBlocking(I2S_Type *base, uint32_t channel, uint32_t bitWidth, uint8_t *buffer, uint32_t size)
Receives data using a blocking method.
void SAI_RxReset(I2S_Type *base)
Resets the SAI Rx.
enum _sai_bclk_source sai_bclk_source_t
Bit clock source.
_sai_mclk_source
Mater clock source.
SAI user configuration structure.
void SAI_RxSetConfig(I2S_Type *base, sai_transceiver_t *config)
SAI receiver configurations.
struct _sai_bit_clock sai_bit_clock_t
sai bit clock configurations
void SAI_TxSetSerialDataConfig(I2S_Type *base, sai_serial_data_t *config)
SAI transmitter Serial data configurations.
void SAI_TransferTxSetConfig(I2S_Type *base, sai_handle_t *handle, sai_transceiver_t *config)
SAI transmitter transfer configurations.
static void SAI_TxDisableInterrupts(I2S_Type *base, uint32_t mask)
Disables the SAI Tx interrupt requests.
#define I2S_RCR4_FSD_MASK
#define I2S_TCSR_FRIE_MASK
_sai_word_width
Audio word width.
void SAI_TxSetBitClockPolarity(I2S_Type *base, sai_clock_polarity_t polarity)
Set the Tx data order.
@ kSAI_SyncErrorInterruptEnable
void SAI_TxSetFrameSyncConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_frame_sync_t *config)
SAI transmitter Frame sync configurations.
sai_serial_data_t serialData
_sai_master_slave
Master or slave mode.
static void SAI_RxEnableInterrupts(I2S_Type *base, uint32_t mask)
Enables the SAI Rx interrupt requests.
#define I2S_TCSR_FWDE_MASK
sai_data_order_t dataOrder
static void SAI_TxEnableDMA(I2S_Type *base, uint32_t mask, bool enable)
Enables/disables the SAI Tx DMA requests.
void SAI_RxInit(I2S_Type *base, const sai_config_t *config)
Initializes the SAI Rx peripheral.
@ kSAI_FIFOWarningInterruptEnable
static uint32_t SAI_RxGetDataRegisterAddress(I2S_Type *base, uint32_t channel)
Gets the SAI Rx data register address.
#define I2S_TCR4_FCONT_MASK
_sai_sample_rate
Audio sample rate.
void SAI_GetDSPConfig(sai_transceiver_t *config, sai_frame_sync_len_t frameSyncWidth, sai_word_width_t bitWidth, sai_mono_stereo_t mode, uint32_t saiChannelMask)
Get DSP mode configurations.
@ kSAI_BclkSourceMclkOption2
void SAI_RxSetDataOrder(I2S_Type *base, sai_data_order_t order)
Set the Rx data order.
static uint32_t SAI_TxGetStatusFlag(I2S_Type *base)
Gets the SAI Tx status flag state.
struct _sai_transfer sai_transfer_t
SAI transfer structure.
sai bit clock configurations
void SAI_TxSetConfig(I2S_Type *base, sai_transceiver_t *config)
SAI transmitter configurations.
void SAI_RxSoftwareReset(I2S_Type *base, sai_reset_type_t type)
Do software reset or FIFO reset .
void SAI_RxSetBitClockRate(I2S_Type *base, uint32_t sourceClockHz, uint32_t sampleRate, uint32_t bitWidth, uint32_t channelNumbers)
Receiver bit clock rate configurations.
static void SAI_TxClearStatusFlags(I2S_Type *base, uint32_t mask)
Clears the SAI Tx status flag state.
volatile uint8_t queueUser
enum _sai_transceiver_type sai_transceiver_type_t
sai transceiver type
static sai_transceiver_t config
void SAI_TxReset(I2S_Type *base)
Resets the SAI Tx.
@ kSAI_SampleOnFallingEdge
void SAI_RxSetChannelFIFOMask(I2S_Type *base, uint8_t mask)
Set the Rx channel FIFO enable mask.
void SAI_TxSetDataOrder(I2S_Type *base, sai_data_order_t order)
Set the Tx data order.
void(* sai_transfer_callback_t)(I2S_Type *base, sai_handle_t *handle, status_t status, void *userData)
SAI transfer callback prototype.
int32_t status_t
Type used for all status and error return values.
@ kSAI_FrameSyncLenPerWordWidth
void SAI_TxSetFormat(I2S_Type *base, sai_transfer_format_t *format, uint32_t mclkSourceClockHz, uint32_t bclkSourceClockHz)
Configures the SAI Tx audio format.
sai_clock_polarity_t bclkPolarity
@ kSAI_BclkSourceMclkOption1
_sai_clock_polarity
SAI clock polarity, active high or low.
void SAI_RxSetBitClockPolarity(I2S_Type *base, sai_clock_polarity_t polarity)
Set the Rx data order.
@ kSAI_WordStartInterruptEnable
#define I2S_TCR4_FSD_MASK
void SAI_GetClassicI2SConfig(sai_transceiver_t *config, sai_word_width_t bitWidth, sai_mono_stereo_t mode, uint32_t saiChannelMask)
Get classic I2S mode configurations.
void SAI_Init(I2S_Type *base)
Initializes the SAI peripheral.
void SAI_TxEnable(I2S_Type *base, bool enable)
Enables/disables the SAI Tx.
static void SAI_TxSetFrameSyncDirection(I2S_Type *base, sai_master_slave_t masterSlave)
Set Tx frame sync direction.
@ kSAI_SampleOnRisingEdge
status_t SAI_TransferSendNonBlocking(I2S_Type *base, sai_handle_t *handle, sai_transfer_t *xfer)
Performs an interrupt non-blocking send transfer on SAI.
void SAI_ReadMultiChannelBlocking(I2S_Type *base, uint32_t channel, uint32_t channelMask, uint32_t bitWidth, uint8_t *buffer, uint32_t size)
Receives multi channel data using a blocking method.
void SAI_TxGetDefaultConfig(sai_config_t *config)
Sets the SAI Tx configuration structure to default values.
@ kSAI_FIFOErrorInterruptEnable
_sai_reset_type
The reset type.