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:
@@ -1,5 +1,5 @@
|
||||
| Supported Targets | ESP32 | ESP32-S2 | ESP32-C3 | ESP32-S3 | ESP32-H2 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- |
|
||||
| Supported Targets | ESP32 | ESP32-C3 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- |
|
||||
|
||||
# I2S Basic Standard Mode Example
|
||||
|
||||
@@ -16,7 +16,7 @@ This example is going to show how to use the standard mode in simplex mode or fu
|
||||
|
||||
### Configure the Project
|
||||
|
||||
There are simplex mode and duplex mode can be chosen in this example, setting `EXAMPLE_I2S_DUPLEX_MODE` to `0` will adopt the simplex mode, otherwise it will adopt the full-duplex mode.
|
||||
There are simplex mode and duplex mode can be chosen in this example, you can choose the mode in the menuconfig or just setting `EXAMPLE_I2S_DUPLEX_MODE` derectly, when `EXAMPLE_I2S_DUPLEX_MODE` is `0` the example will adopt the simplex mode, otherwise it will adopt the full-duplex mode.
|
||||
|
||||
Note that ESP32-S2 simplex mode is not available because this example requires both TX & RX channels, however, ESP32-S2 has only one I2S controller and the simplex TX & RX channels can't coexist in a same controller. By the way, the simplex TX & RX channels can't coexist on ESP32 as well, but ESP32 has two I2S controllers so the simplex TX & RX channels can be registered on the different I2S controllers.
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user