- void i2s_install() {
- const i2s_config_t i2s_config = {
- .mode = i2s_mode_t(I2S_MODE_MASTER | I2S_MODE_RX | I2S_MODE_PDM),
- .sample_rate = SAMPLE_RATE,
- .bits_per_sample = i2s_bits_per_sample_t(BITS_PER_SAMPLE),
- .channel_format = i2s_channel_fmt_t(I2S_CHANNEL_FMT_ONLY_LEFT),
- .communication_format = i2s_comm_format_t(I2S_COMM_FORMAT_I2S),
- .intr_alloc_flags = ESP_INTR_FLAG_LEVEL1,
- .dma_buf_count = 32,
- .dma_buf_len = BUFFER_LEN,
- .use_apll = false,
- };
- i2s_driver_install(I2S_PORT, &i2s_config, 0, NULL);
- esp_err_t status = i2s_set_clk(I2S_PORT, SAMPLE_RATE, BITS_PER_SAMPLE, I2S_CHANNEL_MONO);
- }
Can you suggest some code to test my application, maybe I'm doing something wrong?