i2s: add slot sequence table

Closes: https://github.com/espressif/esp-idf/issues/9208

When I2S is configured into different modes, the slot sequence varies.
This commit updates slot sequence tables and corresponding descriptions
in (both code and programming guide).
This commit is contained in:
laokaiyao
2022-07-05 11:22:27 +08:00
parent 92ea22fe81
commit edee3ee3cd
51 changed files with 795 additions and 292 deletions
@@ -0,0 +1,21 @@
menu "I2S STD Example Configuration"
choice DUPLEX_MODE
prompt "I2S STD duplex/simplex select"
default USE_DUPLEX
help
Select duplex mode or simplex mode for the example
config USE_DUPLEX
bool "Duplex TX and RX channels"
help
Allocate TX and RX channels on a same I2S controller in duplex mode, sharing the BCLK and WS signal
config USE_SIMPLEX
bool "Simplex TX and RX channels"
depends on !IDF_TARGET_ESP32S2
help
Allocate TX and RX channels in duplex mode, they are totally separate.
endchoice
endmenu
@@ -17,7 +17,7 @@
* Set 0 to allocate rx & tx channels in simplex mode, these two channels will be totally separated,
* Specifically, due to the hardware limitation, the simplex rx & tx channels can't be registered on the same controllers on ESP32 and ESP32-S2,
* and ESP32-S2 has only one I2S controller, so it can't allocate two simplex channels */
#define EXAMPLE_I2S_DUPLEX_MODE (1 || CONFIG_IDF_TARGET_ESP32S2)
#define EXAMPLE_I2S_DUPLEX_MODE CONFIG_USE_DUPLEX
#if CONFIG_IDF_TARGET_ESP32
#define EXAMPLE_STD_BCLK_IO1 GPIO_NUM_4 // I2S bit clock io number
@@ -187,7 +187,7 @@ static void i2s_example_init_std_simplex(void)
};
/* Default is only receiving left slot in mono mode,
* update to right here to show how to change the default configuration */
rx_std_cfg.slot_cfg.slot_mask = I2S_STD_SLOT_ONLY_RIGHT;
rx_std_cfg.slot_cfg.slot_mask = I2S_STD_SLOT_RIGHT;
ESP_ERROR_CHECK(i2s_channel_init_std_mode(rx_chan, &rx_std_cfg));
}
#endif