12#include "fsl_common.h"
25#define FSL_SAI_DRIVER_VERSION (MAKE_VERSION(2, 3, 8))
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_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO)
141 kSAI_FIFORequestInterruptEnable = I2S_TCSR_FRIE_MASK,
149#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO)
150 kSAI_FIFORequestDMAEnable = I2S_TCSR_FRDE_MASK,
160#if defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO)
161 kSAI_FIFORequestFlag = I2S_TCSR_FRF_MASK,
174#if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING
179typedef enum _sai_fifo_packing
181 kSAI_FifoPackingDisabled = 0x0U,
182 kSAI_FifoPacking8bit = 0x2U,
183 kSAI_FifoPacking16bit = 0x3U
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
235typedef 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_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE
246typedef enum _sai_fifo_combine
248 kSAI_FifoCombineDisabled = 0U,
249 kSAI_FifoCombineModeEnabledOnRead,
250 kSAI_FifoCombineModeEnabledOnWrite,
251 kSAI_FifoCombineModeEnabledOnReadWrite,
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_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO)
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))
302typedef 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;
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_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE) || \
322 (defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING) || \
323 (defined(FSL_FEATURE_SAI_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO))
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
331typedef 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_COMBINE_MODE) && FSL_FEATURE_SAI_HAS_FIFO_COMBINE_MODE
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_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO)
345 uint8_t fifoWatermark;
368#if defined(FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE) && FSL_FEATURE_SAI_HAS_ON_DEMAND_MODE
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_HAS_FIFO) && (FSL_FEATURE_SAI_HAS_FIFO)
460#if defined(__cplusplus)
606 base->TCR2 |= I2S_TCR2_BCD_MASK;
610 base->TCR2 &= ~I2S_TCR2_BCD_MASK;
626 base->RCR2 |= I2S_RCR2_BCD_MASK;
630 base->RCR2 &= ~I2S_RCR2_BCD_MASK;
646 base->RCR4 |= I2S_RCR4_FSD_MASK;
650 base->RCR4 &= ~I2S_RCR4_FSD_MASK;
666 base->TCR4 |= I2S_TCR4_FSD_MASK;
670 base->TCR4 &= ~I2S_TCR4_FSD_MASK;
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))
724void 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);
876 uint32_t saiChannelMask);
890static inline uint32_t SAI_TxGetStatusFlag(
I2S_Type *base)
904static inline void SAI_TxClearStatusFlags(
I2S_Type *base, uint32_t mask)
906 base->TCSR = ((base->TCSR & 0xFFE3FFFFU) | mask);
915static inline uint32_t SAI_RxGetStatusFlag(
I2S_Type *base)
929static inline void SAI_RxClearStatusFlags(
I2S_Type *base, uint32_t mask)
931 base->RCSR = ((base->RCSR & 0xFFE3FFFFU) | mask);
1026#if defined(FSL_FEATURE_SAI_HAS_FIFO_PACKING) && FSL_FEATURE_SAI_HAS_FIFO_PACKING
1033void SAI_TxSetFIFOPacking(
I2S_Type *base, sai_fifo_packing_t pack);
1041void SAI_RxSetFIFOPacking(
I2S_Type *base, sai_fifo_packing_t pack);
1044#if defined(FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR) && FSL_FEATURE_SAI_HAS_FIFO_FUNCTION_AFTER_ERROR
1054static inline void SAI_TxSetFIFOErrorContinue(
I2S_Type *base,
bool isEnabled)
1058 base->TCR4 |= I2S_TCR4_FCONT_MASK;
1062 base->TCR4 &= ~I2S_TCR4_FCONT_MASK;
1075static inline void SAI_RxSetFIFOErrorContinue(
I2S_Type *base,
bool isEnabled)
1079 base->RCR4 |= I2S_RCR4_FCONT_MASK;
1083 base->RCR4 &= ~I2S_RCR4_FCONT_MASK;
1107static inline void SAI_TxEnableInterrupts(
I2S_Type *base, uint32_t mask)
1109 base->TCSR = ((base->TCSR & 0xFFE3FFFFU) | mask);
1124static inline void SAI_RxEnableInterrupts(
I2S_Type *base, uint32_t mask)
1126 base->RCSR = ((base->RCSR & 0xFFE3FFFFU) | mask);
1141static inline void SAI_TxDisableInterrupts(
I2S_Type *base, uint32_t mask)
1143 base->TCSR = ((base->TCSR & 0xFFE3FFFFU) & (~mask));
1158static inline void SAI_RxDisableInterrupts(
I2S_Type *base, uint32_t mask)
1160 base->RCSR = ((base->RCSR & 0xFFE3FFFFU) & (~mask));
1179static inline void SAI_TxEnableDMA(
I2S_Type *base, uint32_t mask,
bool enable)
1183 base->TCSR = ((base->TCSR & 0xFFE3FFFFU) | mask);
1187 base->TCSR = ((base->TCSR & 0xFFE3FFFFU) & (~mask));
1200static inline void SAI_RxEnableDMA(
I2S_Type *base, uint32_t mask,
bool enable)
1204 base->RCSR = ((base->RCSR & 0xFFE3FFFFU) | mask);
1208 base->RCSR = ((base->RCSR & 0xFFE3FFFFU) & (~mask));
1221static inline uintptr_t SAI_TxGetDataRegisterAddress(
I2S_Type *base, uint32_t channel)
1223 return (uintptr_t)(&(base->TDR)[channel]);
1235static inline uintptr_t SAI_RxGetDataRegisterAddress(
I2S_Type *base, uint32_t channel)
1237 return (uintptr_t)(&(base->RDR)[channel]);
1262 uint32_t mclkSourceClockHz,
1263 uint32_t bclkSourceClockHz);
1280 uint32_t mclkSourceClockHz,
1281 uint32_t bclkSourceClockHz);
1309 I2S_Type *base, uint32_t channel, uint32_t channelMask, uint32_t bitWidth, uint8_t *buffer, uint32_t
size);
1318static inline void SAI_WriteData(
I2S_Type *base, uint32_t channel, uint32_t data)
1320 base->TDR[channel] = data;
1349 I2S_Type *base, uint32_t channel, uint32_t channelMask, uint32_t bitWidth, uint8_t *buffer, uint32_t
size);
1358static inline uint32_t SAI_ReadData(
I2S_Type *base, uint32_t channel)
1360 return base->RDR[channel];
1438 uint32_t mclkSourceClockHz,
1439 uint32_t bclkSourceClockHz);
1459 uint32_t mclkSourceClockHz,
1460 uint32_t bclkSourceClockHz);
1580#if defined(__cplusplus)
int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:225
#define MAKE_STATUS(group, code)
Construct a status code value from a group and code number.
Definition: fsl_common.h:47
@ kStatusGroup_SAI
Definition: fsl_common.h:102
_sai_sample_rate
Audio sample rate.
Definition: fsl_sai.h:209
enum _sai_clock_polarity sai_clock_polarity_t
SAI clock polarity, active high or low.
struct _sai_transfer_format sai_transfer_format_t
sai transfer format
void SAI_TxSetConfig(I2S_Type *base, sai_transceiver_t *config)
SAI transmitter configurations.
Definition: fsl_sai.c:1428
void SAI_RxSetBitClockRate(I2S_Type *base, uint32_t sourceClockHz, uint32_t sampleRate, uint32_t bitWidth, uint32_t channelNumbers)
Receiver bit clock rate configurations.
Definition: fsl_sai.c:1090
void SAI_ReadBlocking(I2S_Type *base, uint32_t channel, uint32_t bitWidth, uint8_t *buffer, uint32_t size)
Receives data using a blocking method.
Definition: fsl_sai.c:2273
void SAI_TxSetBitClockPolarity(I2S_Type *base, sai_clock_polarity_t polarity)
Set the Tx data order.
Definition: fsl_sai.c:952
void SAI_RxSetConfig(I2S_Type *base, sai_transceiver_t *config)
SAI receiver configurations.
Definition: fsl_sai.c:1562
_sai_transceiver_type
sai transceiver type
Definition: fsl_sai.h:257
void SAI_TxSetDataOrder(I2S_Type *base, sai_data_order_t order)
Set the Tx data order.
Definition: fsl_sai.c:924
struct _sai_serial_data sai_serial_data_t
sai serial data configurations
void SAI_RxSetSerialDataConfig(I2S_Type *base, sai_serial_data_t *config)
SAI receiver Serial data configurations.
Definition: fsl_sai.c:1406
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.
Definition: fsl_sai.c:1372
void SAI_RxSetBitclockConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_bit_clock_t *config)
Receiver Bit clock configurations.
Definition: fsl_sai.c:1163
void SAI_TxEnable(I2S_Type *base, bool enable)
Enables/disables the SAI Tx.
Definition: fsl_sai.c:800
void SAI_WriteBlocking(I2S_Type *base, uint32_t channel, uint32_t bitWidth, uint8_t *buffer, uint32_t size)
Sends data using a blocking method.
Definition: fsl_sai.c:2133
void SAI_TxSetFrameSyncConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_frame_sync_t *config)
SAI transmitter Frame sync configurations.
Definition: fsl_sai.c:1315
_sai_sync_mode
Synchronous or asynchronous mode.
Definition: fsl_sai.h:98
void SAI_TransferTxHandleIRQ(I2S_Type *base, sai_handle_t *handle)
Tx interrupt handler.
Definition: fsl_sai.c:2724
void SAI_TransferTerminateReceive(I2S_Type *base, sai_handle_t *handle)
Terminate all SAI receive.
Definition: fsl_sai.c:2703
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.
Definition: fsl_sai.c:1736
void SAI_TransferRxCreateHandle(I2S_Type *base, sai_handle_t *handle, sai_transfer_callback_t callback, void *userData)
Initializes the SAI Rx handle.
Definition: fsl_sai.c:2336
void SAI_RxSoftwareReset(I2S_Type *base, sai_reset_type_t resetType)
Do software reset or FIFO reset .
Definition: fsl_sai.c:884
void SAI_RxSetFormat(I2S_Type *base, sai_transfer_format_t *format, uint32_t mclkSourceClockHz, uint32_t bclkSourceClockHz)
Configures the SAI Rx audio format.
Definition: fsl_sai.c:1992
#define SAI_XFER_QUEUE_SIZE
SAI transfer queue size, user can refine it according to use case.
Definition: fsl_sai.h:204
_sai_protocol
Define the SAI bus type.
Definition: fsl_sai.h:55
enum _sai_transceiver_type sai_transceiver_type_t
sai transceiver type
enum _sai_data_order sai_data_order_t
SAI data order, MSB or LSB.
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.
Definition: fsl_sai.c:1714
void SAI_RxSetFrameSyncConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_frame_sync_t *config)
SAI receiver Frame sync configurations.
Definition: fsl_sai.c:1344
void SAI_TxSetChannelFIFOMask(I2S_Type *base, uint8_t mask)
Set the Tx channel FIFO enable mask.
Definition: fsl_sai.c:899
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.
Definition: fsl_sai.c:2372
enum _sai_sample_rate sai_sample_rate_t
Audio sample rate.
void SAI_TxReset(I2S_Type *base)
Resets the SAI Tx.
Definition: fsl_sai.c:755
void SAI_TransferTxCreateHandle(I2S_Type *base, sai_handle_t *handle, sai_transfer_callback_t callback, void *userData)
Initializes the SAI Tx handle.
Definition: fsl_sai.c:2305
void SAI_TxSetBitClockRate(I2S_Type *base, uint32_t sourceClockHz, uint32_t sampleRate, uint32_t bitWidth, uint32_t channelNumbers)
Transmitter bit clock rate configurations.
Definition: fsl_sai.c:1043
_sai_clock_polarity
SAI clock polarity, active high or low.
Definition: fsl_sai.h:89
void SAI_RxReset(I2S_Type *base)
Resets the SAI Rx.
Definition: fsl_sai.c:778
void SAI_TransferTxSetConfig(I2S_Type *base, sai_handle_t *handle, sai_transceiver_t *config)
SAI transmitter transfer configurations.
Definition: fsl_sai.c:1530
void SAI_RxSetChannelFIFOMask(I2S_Type *base, uint8_t mask)
Set the Rx channel FIFO enable mask.
Definition: fsl_sai.c:912
_sai_data_order
SAI data order, MSB or LSB.
Definition: fsl_sai.h:82
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.
Definition: fsl_sai.c:2226
enum _sai_sync_mode sai_sync_mode_t
Synchronous or asynchronous mode.
enum _sai_frame_sync_len sai_frame_sync_len_t
sai frame sync len
enum _sai_mclk_source sai_mclk_source_t
Mater clock source.
void SAI_RxSetBitClockPolarity(I2S_Type *base, sai_clock_polarity_t polarity)
Set the Rx data order.
Definition: fsl_sai.c:966
void SAI_TransferTerminateSend(I2S_Type *base, sai_handle_t *handle)
Terminate all SAI send.
Definition: fsl_sai.c:2679
void SAI_TransferAbortSend(I2S_Type *base, sai_handle_t *handle)
Aborts the current send.
Definition: fsl_sai.c:2619
enum _sai_bclk_source sai_bclk_source_t
Bit clock source.
enum _sai_protocol sai_protocol_t
Define the SAI bus type.
void SAI_RxSetDataOrder(I2S_Type *base, sai_data_order_t order)
Set the Rx data order.
Definition: fsl_sai.c:938
void SAI_TxSetBitclockConfig(I2S_Type *base, sai_master_slave_t masterSlave, sai_bit_clock_t *config)
Transmitter Bit clock configurations.
Definition: fsl_sai.c:1135
_sai_reset_type
The reset type.
Definition: fsl_sai.h:168
_sai_mclk_source
Mater clock source.
Definition: fsl_sai.h:110
void SAI_TransferAbortReceive(I2S_Type *base, sai_handle_t *handle)
Aborts the current IRQ receive.
Definition: fsl_sai.c:2649
void SAI_TransferRxHandleIRQ(I2S_Type *base, sai_handle_t *handle)
Tx interrupt handler.
Definition: fsl_sai.c:2801
_sai_mono_stereo
Mono or stereo audio format.
Definition: fsl_sai.h:74
_sai_master_slave
Master or slave mode.
Definition: fsl_sai.h:65
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.
Definition: fsl_sai.c:1806
_sai_frame_sync_len
sai frame sync len
Definition: fsl_sai.h:264
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.
Definition: fsl_sai.c:1773
struct _sai_transfer sai_transfer_t
SAI transfer structure.
void SAI_RxGetDefaultConfig(sai_config_t *config)
Sets the SAI Rx configuration structure to default values.
Definition: fsl_sai.c:731
status_t SAI_TransferGetSendCount(I2S_Type *base, sai_handle_t *handle, size_t *count)
Gets a set byte count.
Definition: fsl_sai.c:2563
struct _sai_frame_sync sai_frame_sync_t
sai frame sync configurations
void SAI_RxInit(I2S_Type *base, const sai_config_t *config)
Initializes the SAI Rx peripheral.
Definition: fsl_sai.c:528
struct _sai_config sai_config_t
SAI user configuration structure.
void SAI_TxGetDefaultConfig(sai_config_t *config)
Sets the SAI Tx configuration structure to default values.
Definition: fsl_sai.c:697
void SAI_Init(I2S_Type *base)
Initializes the SAI peripheral.
Definition: fsl_sai.c:643
status_t SAI_TransferReceiveNonBlocking(I2S_Type *base, sai_handle_t *handle, sai_transfer_t *xfer)
Performs an interrupt non-blocking receive transfer on SAI.
Definition: fsl_sai.c:2520
_sai_word_width
Audio word width.
Definition: fsl_sai.h:226
void(* sai_transfer_callback_t)(I2S_Type *base, sai_handle_t *handle, status_t status, void *userData)
SAI transfer callback prototype.
Definition: fsl_sai.h:423
void SAI_TransferRxSetConfig(I2S_Type *base, sai_handle_t *handle, sai_transceiver_t *config)
SAI receiver transfer configurations.
Definition: fsl_sai.c:1665
void SAI_RxSetFrameSyncPolarity(I2S_Type *base, sai_clock_polarity_t polarity)
Set the Rx data order.
Definition: fsl_sai.c:994
_sai_bclk_source
Bit clock source.
Definition: fsl_sai.h:120
struct _sai_transceiver sai_transceiver_t
sai transceiver configurations
void SAI_TxInit(I2S_Type *base, const sai_config_t *config)
Initializes the SAI Tx peripheral.
Definition: fsl_sai.c:404
enum _sai_mono_stereo sai_mono_stereo_t
Mono or stereo audio format.
void SAI_Deinit(I2S_Type *base)
De-initializes the SAI peripheral.
Definition: fsl_sai.c:671
enum _sai_word_width sai_word_width_t
Audio word width.
enum _sai_reset_type sai_reset_type_t
The reset type.
void SAI_TxSoftwareReset(I2S_Type *base, sai_reset_type_t resetType)
Do software reset or FIFO reset .
Definition: fsl_sai.c:865
void SAI_RxEnable(I2S_Type *base, bool enable)
Enables/disables the SAI Rx.
Definition: fsl_sai.c:830
void SAI_TxSetFormat(I2S_Type *base, sai_transfer_format_t *format, uint32_t mclkSourceClockHz, uint32_t bclkSourceClockHz)
Configures the SAI Tx audio format.
Definition: fsl_sai.c:1849
status_t SAI_TransferSendNonBlocking(I2S_Type *base, sai_handle_t *handle, sai_transfer_t *xfer)
Performs an interrupt non-blocking send transfer on SAI.
Definition: fsl_sai.c:2471
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.
Definition: fsl_sai.c:1698
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.
Definition: fsl_sai.c:2171
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.
Definition: fsl_sai.c:2422
status_t SAI_TransferGetReceiveCount(I2S_Type *base, sai_handle_t *handle, size_t *count)
Gets a received byte count.
Definition: fsl_sai.c:2591
void SAI_TxSetFrameSyncPolarity(I2S_Type *base, sai_clock_polarity_t polarity)
Set the Tx data order.
Definition: fsl_sai.c:980
enum _sai_master_slave sai_master_slave_t
Master or slave mode.
@ kSAI_SampleRate384KHz
Definition: fsl_sai.h:221
@ kSAI_SampleRate11025Hz
Definition: fsl_sai.h:211
@ kSAI_SampleRate8KHz
Definition: fsl_sai.h:210
@ kSAI_SampleRate96KHz
Definition: fsl_sai.h:219
@ kSAI_SampleRate48KHz
Definition: fsl_sai.h:218
@ kSAI_SampleRate16KHz
Definition: fsl_sai.h:213
@ kSAI_SampleRate22050Hz
Definition: fsl_sai.h:214
@ kSAI_SampleRate44100Hz
Definition: fsl_sai.h:217
@ kSAI_SampleRate32KHz
Definition: fsl_sai.h:216
@ kSAI_SampleRate12KHz
Definition: fsl_sai.h:212
@ kSAI_SampleRate24KHz
Definition: fsl_sai.h:215
@ kSAI_SampleRate192KHz
Definition: fsl_sai.h:220
@ kSAI_FIFOWarningFlag
Definition: fsl_sai.h:163
@ kSAI_FIFOErrorFlag
Definition: fsl_sai.h:159
@ kSAI_WordStartFlag
Definition: fsl_sai.h:157
@ kSAI_SyncErrorFlag
Definition: fsl_sai.h:158
@ kStatus_SAI_RxError
Definition: fsl_sai.h:34
@ kStatus_SAI_RxIdle
Definition: fsl_sai.h:37
@ kStatus_SAI_QueueFull
Definition: fsl_sai.h:35
@ kStatus_SAI_TxIdle
Definition: fsl_sai.h:36
@ kStatus_SAI_TxError
Definition: fsl_sai.h:33
@ kStatus_SAI_RxBusy
Definition: fsl_sai.h:32
@ kStatus_SAI_TxBusy
Definition: fsl_sai.h:31
@ kSAI_Transmitter
Definition: fsl_sai.h:258
@ kSAI_Receiver
Definition: fsl_sai.h:259
@ kSAI_Channel4Mask
Definition: fsl_sai.h:47
@ kSAI_Channel6Mask
Definition: fsl_sai.h:49
@ kSAI_Channel5Mask
Definition: fsl_sai.h:48
@ kSAI_Channel2Mask
Definition: fsl_sai.h:45
@ kSAI_Channel1Mask
Definition: fsl_sai.h:44
@ kSAI_Channel0Mask
Definition: fsl_sai.h:43
@ kSAI_Channel3Mask
Definition: fsl_sai.h:46
@ kSAI_Channel7Mask
Definition: fsl_sai.h:50
@ kSAI_ModeAsync
Definition: fsl_sai.h:99
@ kSAI_ModeSync
Definition: fsl_sai.h:100
@ kSAI_BusPCMA
Definition: fsl_sai.h:59
@ kSAI_BusLeftJustified
Definition: fsl_sai.h:56
@ kSAI_BusI2S
Definition: fsl_sai.h:58
@ kSAI_BusPCMB
Definition: fsl_sai.h:60
@ kSAI_BusRightJustified
Definition: fsl_sai.h:57
@ kSAI_FIFOWarningInterruptEnable
Definition: fsl_sai.h:138
@ kSAI_FIFOErrorInterruptEnable
Definition: fsl_sai.h:139
@ kSAI_SyncErrorInterruptEnable
Definition: fsl_sai.h:137
@ kSAI_WordStartInterruptEnable
Definition: fsl_sai.h:135
@ kSAI_SampleOnFallingEdge
Definition: fsl_sai.h:92
@ kSAI_PolarityActiveLow
Definition: fsl_sai.h:91
@ kSAI_SampleOnRisingEdge
Definition: fsl_sai.h:93
@ kSAI_PolarityActiveHigh
Definition: fsl_sai.h:90
@ kSAI_DataMSB
Definition: fsl_sai.h:84
@ kSAI_DataLSB
Definition: fsl_sai.h:83
@ kSAI_ResetTypeSoftware
Definition: fsl_sai.h:169
@ kSAI_ResetTypeFIFO
Definition: fsl_sai.h:170
@ kSAI_ResetAll
Definition: fsl_sai.h:171
@ kSAI_MclkSourceSelect3
Definition: fsl_sai.h:114
@ kSAI_MclkSourceSelect2
Definition: fsl_sai.h:113
@ kSAI_MclkSourceSysclk
Definition: fsl_sai.h:111
@ kSAI_MclkSourceSelect1
Definition: fsl_sai.h:112
@ kSAI_MonoLeft
Definition: fsl_sai.h:77
@ kSAI_MonoRight
Definition: fsl_sai.h:76
@ kSAI_Stereo
Definition: fsl_sai.h:75
@ kSAI_Bclk_Master_FrameSync_Slave
Definition: fsl_sai.h:68
@ kSAI_Master
Definition: fsl_sai.h:66
@ kSAI_Bclk_Slave_FrameSync_Master
Definition: fsl_sai.h:69
@ kSAI_Slave
Definition: fsl_sai.h:67
@ kSAI_FrameSyncLenOneBitClk
Definition: fsl_sai.h:265
@ kSAI_FrameSyncLenPerWordWidth
Definition: fsl_sai.h:266
@ kSAI_WordWidth16bits
Definition: fsl_sai.h:228
@ kSAI_WordWidth32bits
Definition: fsl_sai.h:230
@ kSAI_WordWidth24bits
Definition: fsl_sai.h:229
@ kSAI_WordWidth8bits
Definition: fsl_sai.h:227
@ kSAI_BclkSourceMclkOption1
Definition: fsl_sai.h:123
@ kSAI_BclkSourceMclkOption2
Definition: fsl_sai.h:124
@ kSAI_BclkSourceMclkOption3
Definition: fsl_sai.h:125
@ kSAI_BclkSourceOtherSai1
Definition: fsl_sai.h:129
@ kSAI_BclkSourceBusclk
Definition: fsl_sai.h:121
@ kSAI_BclkSourceMclkDiv
Definition: fsl_sai.h:127
@ kSAI_BclkSourceOtherSai0
Definition: fsl_sai.h:128
@ kSAI_FIFOWarningDMAEnable
Definition: fsl_sai.h:148
Definition: MIMXRT1052.h:23296
sai bit clock configurations
Definition: fsl_sai.h:352
sai_bclk_source_t bclkSource
Definition: fsl_sai.h:358
bool bclkSrcSwap
Definition: fsl_sai.h:353
sai_clock_polarity_t bclkPolarity
Definition: fsl_sai.h:357
bool bclkInputDelay
Definition: fsl_sai.h:354
SAI user configuration structure.
Definition: fsl_sai.h:189
sai_protocol_t protocol
Definition: fsl_sai.h:190
sai_bclk_source_t bclkSource
Definition: fsl_sai.h:198
sai_master_slave_t masterSlave
Definition: fsl_sai.h:199
sai_sync_mode_t syncMode
Definition: fsl_sai.h:191
sai frame sync configurations
Definition: fsl_sai.h:363
uint8_t frameSyncWidth
Definition: fsl_sai.h:364
sai_clock_polarity_t frameSyncPolarity
Definition: fsl_sai.h:372
bool frameSyncEarly
Definition: fsl_sai.h:365
SAI handle structure.
Definition: fsl_sai.h:427
void * userData
Definition: fsl_sai.h:432
sai_transfer_t saiQueue[SAI_XFER_QUEUE_SIZE]
Definition: fsl_sai.h:447
sai_transfer_callback_t callback
Definition: fsl_sai.h:431
I2S_Type * base
Definition: fsl_sai.h:428
uint8_t channel
Definition: fsl_sai.h:442
uint32_t state
Definition: fsl_sai.h:430
uint8_t bitWidth
Definition: fsl_sai.h:433
uint8_t channelNums
Definition: fsl_sai.h:445
size_t transferSize[SAI_XFER_QUEUE_SIZE]
Definition: fsl_sai.h:448
uint8_t channelMask
Definition: fsl_sai.h:443
uint8_t endChannel
Definition: fsl_sai.h:444
volatile uint8_t queueUser
Definition: fsl_sai.h:449
volatile uint8_t queueDriver
Definition: fsl_sai.h:450
sai serial data configurations
Definition: fsl_sai.h:378
uint8_t dataWord0Length
Definition: fsl_sai.h:384
uint8_t dataWordNum
Definition: fsl_sai.h:389
uint8_t dataWordNLength
Definition: fsl_sai.h:385
uint8_t dataFirstBitShifted
Definition: fsl_sai.h:388
sai_data_order_t dataOrder
Definition: fsl_sai.h:383
uint8_t dataWordLength
Definition: fsl_sai.h:386
uint32_t dataMaskedWord
Definition: fsl_sai.h:390
sai transceiver configurations
Definition: fsl_sai.h:395
uint8_t channelMask
Definition: fsl_sai.h:407
sai_master_slave_t masterSlave
Definition: fsl_sai.h:402
sai_frame_sync_t frameSync
Definition: fsl_sai.h:397
uint8_t endChannel
Definition: fsl_sai.h:408
sai_serial_data_t serialData
Definition: fsl_sai.h:396
uint8_t channelNums
Definition: fsl_sai.h:409
uint8_t startChannel
Definition: fsl_sai.h:406
sai_bit_clock_t bitClock
Definition: fsl_sai.h:398
sai_sync_mode_t syncMode
Definition: fsl_sai.h:404
SAI transfer structure.
Definition: fsl_sai.h:415
size_t dataSize
Definition: fsl_sai.h:417
uint8_t * data
Definition: fsl_sai.h:416
Definition: deflate.c:114
unsigned size
Definition: tte.h:1