It's not clear to me whether this means the output over I2S will be 20-bit stereo, but that's my assumption. The waveform of the ADAU7002 in I2S mode is shown below:
There is no "I2S_DATA_BIT_WIDTH_20BIT", so I'm not sure how to configure I2S to properly acquire data. I am able to receive a stream of data, so I2S is at least functional and pinouts seem good, but it's not yet what I'd consider valid audio (I cannot make out any noise being made). I've configured the ESP32-S3 as follows:
Code: Select all
i2s_chan_config_t rx_chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG(I2S_NUM_AUTO, I2S_ROLE_MASTER);
ESP_ERROR_CHECK(i2s_new_channel(&rx_chan_cfg, NULL, &rx_chan));
i2s_std_clk_config_t clk_cfg = {
.clk_src = I2S_CLK_SRC_DEFAULT,
.sample_rate_hz = 16000,
.mclk_multiple = I2S_MCLK_MULTIPLE_512};
i2s_std_slot_config_t slot_cfg = {
.data_bit_width = I2S_DATA_BIT_WIDTH_24BIT,
.slot_bit_width = I2S_SLOT_BIT_WIDTH_AUTO,
.slot_mode = I2S_SLOT_MODE_STEREO,
.slot_mask = I2S_STD_SLOT_BOTH,
.ws_width = I2S_DATA_BIT_WIDTH_24BIT,
.ws_pol = false,
.bit_shift = true,
.left_align = false,
.big_endian = false,
.bit_order_lsb = false};
i2s_std_config_t rx_std_cfg = {
.clk_cfg = clk_cfg,
.slot_cfg = slot_cfg,
.gpio_cfg = {
.mclk = I2S_GPIO_UNUSED, // some codecs may require mclk signal, this example doesn't need it
.bclk = I2S_BCLK,
.ws = I2S_WS,
.dout = I2S_GPIO_UNUSED,
.din = I2S_DIN,
.invert_flags = {
.mclk_inv = false,
.bclk_inv = false,
.ws_inv = false,
},
},
};
rx_std_cfg.slot_cfg.slot_mask = I2S_STD_SLOT_BOTH;
ESP_ERROR_CHECK(i2s_channel_init_std_mode(rx_chan, &rx_std_cfg));
Right now I'm taking this data, in 2048 byte chunks, and placing them in a .wav file, pushed to an SD Card. Data capture seems to work great, and I'm pretty sure I have the wave file setup correctly. Now it's a matter of understanding how to configure the data acquisition such that it's aligned with the part, as I'm not sure that's correct.