Invalid I2S example, but still compiles, but not...
Posted: Sun Jun 07, 2020 8:50 am
The examples/peripherals/i2s/main/i2s_example_main.c contains invalid code;
The enums are not supposed to be forced to invalid values, and it seems that when I put this in C++ code, the construct is simply rejected, no matter what. And I get;
In general, the I2S subsystem is substandard, overly complex, doesn't really support low-latency streaming (xQueue is slow) and way too poorly documented, at "hardware", "ll" and "hal" levels. Even some suspect code, for instance; why is `i2s_hal_enable_master_mode()` setting the RX to Slave??
Does a complete example exist, where an I2S ADC/encoder streams data to ESP32 which does some processing and streams the data out to same/different I2S DAC/encoder??
Code: Select all
i2s_config_t i2s_config = {
.mode = I2S_MODE_MASTER | I2S_MODE_TX, // Only TX
.sample_rate = SAMPLE_RATE,
.bits_per_sample = 16,
.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT, //2-channels
.communication_format = I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB,
.dma_buf_count = 6,
.dma_buf_len = 60,
.use_apll = false,
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1 //Interrupt level 1
Code: Select all
error: invalid conversion from 'int' to 'i2s_mode_t'
Does a complete example exist, where an I2S ADC/encoder streams data to ESP32 which does some processing and streams the data out to same/different I2S DAC/encoder??