// In order to keep compatibility, remain the old definitions and introduce new definitions,
I2S_COMM_FORMAT_STAND_I2S=0X01,/*!< I2S communication I2S Philips standard, data launch at second BCK*/
I2S_COMM_FORMAT_STAND_MSB=0X03,/*!< I2S communication MSB alignment standard, data launch at first BCK*/
I2S_COMM_FORMAT_STAND_PCM_SHORT=0x04,/*!< PCM Short standard*/
I2S_COMM_FORMAT_STAND_PCM_LONG=0x0C,/*!< PCM Long standard*/
I2S_COMM_FORMAT_STAND_MAX,/*!< standard max*/
//old definition will be removed in the future.
I2S_COMM_FORMAT_I2S__attribute__((deprecated))=0x01,/*!< I2S communication format I2S, correspond to `I2S_COMM_FORMAT_STAND_I2S`*/
I2S_COMM_FORMAT_I2S_MSB__attribute__((deprecated))=0x01,/*!< I2S format MSB, (I2S_COMM_FORMAT_I2S |I2S_COMM_FORMAT_I2S_MSB) correspond to `I2S_COMM_FORMAT_STAND_I2S`*/
I2S_COMM_FORMAT_I2S_LSB__attribute__((deprecated))=0x02,/*!< I2S format LSB, (I2S_COMM_FORMAT_I2S |I2S_COMM_FORMAT_I2S_LSB) correspond to `I2S_COMM_FORMAT_STAND_MSB`*/
I2S_COMM_FORMAT_PCM__attribute__((deprecated))=0x04,/*!< I2S communication format PCM, correspond to `I2S_COMM_FORMAT_STAND_PCM_SHORT`*/
I2S_COMM_FORMAT_PCM_SHORT__attribute__((deprecated))=0x04,/*!< PCM Short, (I2S_COMM_FORMAT_PCM | I2S_COMM_FORMAT_PCM_SHORT) correspond to `I2S_COMM_FORMAT_STAND_PCM_SHORT`*/
I2S_COMM_FORMAT_PCM_LONG__attribute__((deprecated))=0x08,/*!< PCM Long, (I2S_COMM_FORMAT_PCM | I2S_COMM_FORMAT_PCM_LONG) correspond to `I2S_COMM_FORMAT_STAND_PCM_LONG`*/
I2S_MODE_DAC_BUILT_IN=16,/*!< Output I2S data to built-in DAC, no matter the data format is 16bit or 32 bit, the DAC module will only take the 8bits from MSB*/
I2S_MODE_ADC_BUILT_IN=32,/*!< Input I2S data from built-in ADC, each data can be 12-bit width at most*/
i2s_bits_per_sample_tbits_per_sample;/*!< I2S bits per sample*/
i2s_channel_fmt_tchannel_format;/*!< I2S channel format */
i2s_comm_format_tcommunication_format;/*!< I2S communication format */
intintr_alloc_flags;/*!< Flags used to allocate the interrupt. One or multiple (ORred) ESP_INTR_FLAG_* values. See esp_intr_alloc.h for more info */
intdma_buf_count;/*!< I2S DMA Buffer Count */
intdma_buf_len;/*!< I2S DMA Buffer Length */
booluse_apll;/*!< I2S using APLL as main I2S clock, enable it to get accurate clock */
booltx_desc_auto_clear;/*!< I2S auto clear tx descriptor if there is underflow condition (helps in avoiding noise in case of data unavailability) */
intfixed_mclk;/*!< I2S using fixed MCLK output. If use_apll = true and fixed_mclk > 0, then the clock output for i2s is fixed and equal to the fixed_mclk value.*/
}i2s_config_t;
/**
*@briefI2Seventtypes
*
*/
typedefenum{
I2S_EVENT_DMA_ERROR,
I2S_EVENT_TX_DONE,/*!< I2S DMA finish sent 1 buffer*/
I2S_EVENT_RX_DONE,/*!< I2S DMA finish received 1 buffer*/