Merge branch 'feature/support_i2s_on_c6' into 'master'

i2s: support on esp32c6

Closes IDF-5317 and IDF-5912

See merge request espressif/esp-idf!21080
This commit is contained in:
Kevin (Lao Kaiyao) 2022-11-17 12:11:26 +08:00
commit 58b5dc43b9
24 changed files with 41 additions and 42 deletions

View File

@ -1926,7 +1926,7 @@ esp_err_t i2s_platform_release_occupation(int id)
}
/**
* @brief This function will be called during start up, to check that pulse_cnt driver is not running along with the legacy i2s driver
* @brief This function will be called during start up, to check that the new i2s driver is not running along with the legacy i2s driver
*/
static __attribute__((constructor)) void check_i2s_driver_conflict(void)
{

View File

@ -8,6 +8,7 @@ from pytest_embedded import Dut
@pytest.mark.esp32
@pytest.mark.esp32s2
@pytest.mark.esp32c3
@pytest.mark.esp32c6
@pytest.mark.esp32s3
@pytest.mark.generic
@pytest.mark.parametrize(

View File

@ -24,6 +24,7 @@ def run_multi_device_case(master: Dut, slave: Dut, case_name: str) -> None:
@pytest.mark.esp32s3
@pytest.mark.esp32c3
@pytest.mark.esp32c6
@pytest.mark.generic_multi_device
@pytest.mark.parametrize('count', [
2,

View File

@ -8,6 +8,7 @@ from pytest_embedded import Dut
@pytest.mark.esp32
@pytest.mark.esp32s2
@pytest.mark.esp32c3
@pytest.mark.esp32c6
@pytest.mark.esp32s3
@pytest.mark.generic
@pytest.mark.parametrize(

View File

@ -44,7 +44,7 @@ extern "C" {
#define SLAVE_WS_IO 15
#define DATA_IN_IO 19
#define DATA_OUT_IO 18
#elif CONFIG_IDF_TARGET_ESP32H4 || CONFIG_IDF_TARGET_ESP32C6
#else
#define MASTER_MCK_IO 0
#define MASTER_BCK_IO 4
#define MASTER_WS_IO 5

View File

@ -120,7 +120,6 @@ api-reference/peripherals/usb_device
api-reference/peripherals/sdspi_host
api-reference/peripherals/dac
api-reference/peripherals/spi_slave
api-reference/peripherals/i2s
api-reference/peripherals/gptimer
api-reference/peripherals/pcnt
api-reference/peripherals/touch_element

View File

@ -1,7 +1,7 @@
Inter-IC Sound (I2S)
====================
{IDF_TARGET_I2S_NUM:default="two", esp32s2="one", esp32c3="one"}
{IDF_TARGET_I2S_NUM:default="one", esp32="two", esp32s3="two"}
Introduction
------------
@ -109,6 +109,7 @@ Overview of All Modes
ESP32 I2S 0/1 I2S 0 I2S 0 none I2S 0 I2S 0
ESP32S2 I2S 0 none none none none I2S 0
ESP32C3 I2S 0 I2S 0 none I2S 0 none none
ESP32C6 I2S 0 I2S 0 none I2S 0 none none
ESP32S3 I2S 0/1 I2S 0 I2S 0 I2S 0/1 none none
========= ======== ======== ======== ======== ======== ==========
@ -177,7 +178,7 @@ Standard mode always has left and right two sound channels which are called 'slo
.. wavedrom:: /../_static/diagrams/i2s/tdm_pcm_long.json
.. only:: SOC_I2S_SUPPORTS_LDC_CAMERA
.. only:: SOC_I2S_SUPPORTS_LCD_CAMERA
LCD/Camera Mode
^^^^^^^^^^^^^^^

View File

@ -43,9 +43,6 @@ examples/peripherals/i2s/i2s_adc_dac:
examples/peripherals/i2s/i2s_basic/i2s_pdm:
disable:
- if: SOC_I2S_SUPPORTS_PDM != 1
- if: IDF_TARGET == "esp32c6"
temporary: true
reason: target esp32c6 is not supported yet
examples/peripherals/i2s/i2s_basic/i2s_std:
disable:
@ -58,16 +55,10 @@ examples/peripherals/i2s/i2s_basic/i2s_tdm:
examples/peripherals/i2s/i2s_codec/i2s_es7210_tdm:
disable:
- if: SOC_I2S_SUPPORTS_TDM != 1
- if: IDF_TARGET == "esp32c6"
temporary: true
reason: target esp32c6 is not supported yet
examples/peripherals/i2s/i2s_codec/i2s_es8311:
disable:
- if: SOC_I2S_SUPPORTED != 1
- if: IDF_TARGET == "esp32c6"
temporary: true
reason: target esp32c6 is not supported yet
examples/peripherals/i2s/i2s_recorder:
enable:

View File

@ -1,5 +1,5 @@
| Supported Targets | ESP32 | ESP32-C3 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- |
| Supported Targets | ESP32 | ESP32-C3 | ESP32-C6 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- |
# I2S Basic PDM Mode Example
@ -13,7 +13,7 @@ This example is going to show how to use the PDM TX and RX mode.
#### General
* A development board with any one of ESP32, ESP32-C3 or ESP32-S3 SoC
* A development board with any supported Espressif SOC chip (see `Supported Targets` table above)
* A USB cable for power supply and programming
#### PDM RX

View File

@ -8,13 +8,13 @@ menu "I2S PDM Example Configuration"
config EXAMPLE_PDM_TX
bool "PDM TX"
depends on SOC_I2S_SUPPORTS_PDM_TX
help
PDM TX example will play 'twinkle twinkle little star' in three tones.
config EXAMPLE_PDM_RX
bool "PDM RX"
# ESP32-C3 not support PDM RX for now, its hardware does not fully supported PDM RX mode
depends on !IDF_TARGET_ESP32C3
depends on SOC_I2S_SUPPORTS_PDM_RX
help
PDM RX example will show the received data from a PDM microphone.
endchoice

View File

@ -98,7 +98,7 @@ void i2s_example_pdm_tx_task(void *args)
}
}
cnt++;
/* If finished played, switch the tone level */
/* If finished playing, switch the tone level */
if (cnt == sizeof(song)) {
cnt = 0;
tone_select++;

View File

@ -8,6 +8,7 @@ from pytest_embedded import Dut
@pytest.mark.esp32
@pytest.mark.esp32s3
@pytest.mark.esp32c3
@pytest.mark.esp32c6
@pytest.mark.generic
@pytest.mark.parametrize(
'config',

View File

@ -11,12 +11,12 @@ This example is going to show how to use the standard mode in simplex mode or fu
### Hardware Required
* A development board with any one of ESP32, ESP32-S2, ESP32-C3 or ESP32-S3 SoC
* A development board with any supported Espressif SOC chip (see `Supported Targets` table above)
* A USB cable for power supply and programming
### Configure the Project
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.
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` directly, 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.

View File

@ -144,7 +144,7 @@ static void i2s_example_init_std_simplex(void)
* The default configuration can be generated by the helper macro,
* it only requires the I2S controller id and I2S role
* The tx and rx channels here are registered on different I2S controller,
* only ESP32-C3, ESP32-S3 and ESP32-H4 allow to register two separate tx & rx channels on a same controller */
* Except ESP32 and ESP32-S2, others allow to register two separate tx & rx channels on a same controller */
i2s_chan_config_t tx_chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG(I2S_NUM_AUTO, I2S_ROLE_MASTER);
ESP_ERROR_CHECK(i2s_new_channel(&tx_chan_cfg, &tx_chan, NULL));
i2s_chan_config_t rx_chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG(I2S_NUM_AUTO, I2S_ROLE_MASTER);

View File

@ -9,6 +9,7 @@ from pytest_embedded import Dut
@pytest.mark.esp32s2
@pytest.mark.esp32s3
@pytest.mark.esp32c3
@pytest.mark.esp32c6
@pytest.mark.generic
def test_i2s_basic_example(dut: Dut) -> None:

View File

@ -11,7 +11,7 @@ This example is going to show how to use the TDM mode in simplex mode or full-du
### Hardware Required
* A development board with any one of ESP32-C3 or ESP32-S3 SoC
* A development board with any supported Espressif SOC chip (see `Supported Targets` table above)
* A USB cable for power supply and programming
### Configure the Project

View File

@ -120,8 +120,8 @@ static void i2s_example_init_tdm_duplex(void)
},
},
};
/* While there are more than two slots activated, receiving data might be wrong if the mclk multiple is too samll
* The driver will increasing the multiple automatically to ensure the bclk_div bigger than 2.
/* While there are more than two slots activated, receiving data might be wrong if the mclk multiple is too small
* The driver will increasing the multiple automatically to ensure the bclk_div is greater than 2.
* Modify the mclk_multiple to 512 directly here to avoid the warning */
tdm_cfg.clk_cfg.mclk_multiple = I2S_MCLK_MULTIPLE_512;
@ -184,8 +184,8 @@ static void i2s_example_init_tdm_simplex(void)
},
},
};
/* While there are more than two slots activated, receiving data might be wrong if the mclk multiple is too samll
* The driver will increasing the multiple automatically to ensure the bclk_div bigger than 2.
/* While there are more than two slots activated, receiving data might be wrong if the mclk multiple is too small
* The driver will increasing the multiple automatically to ensure the bclk_div is greater than 2.
* Modify the mclk_multiple to 512 directly here to avoid the warning */
rx_tdm_cfg.clk_cfg.mclk_multiple = I2S_MCLK_MULTIPLE_512;
ESP_ERROR_CHECK(i2s_channel_init_tdm_mode(rx_chan, &rx_tdm_cfg));

View File

@ -7,6 +7,7 @@ from pytest_embedded import Dut
@pytest.mark.esp32s3
@pytest.mark.esp32c3
@pytest.mark.esp32c6
@pytest.mark.generic
def test_i2s_tdm_example(dut: Dut) -> None:

View File

@ -1,5 +1,5 @@
| Supported Targets | ESP32-C3 | ESP32-S3 |
| ----------------- | -------- | -------- |
| Supported Targets | ESP32-C3 | ESP32-C6 | ESP32-S3 |
| ----------------- | -------- | -------- | -------- |
# I2S TDM Example -- ES7210 4-Ch ADC Codec

View File

@ -30,7 +30,7 @@
#define EXAMPLE_SD_SPI_MOSI_IO (17)
#define EXAMPLE_SD_SPI_MISO_IO (16)
#define EXAMPLE_SD_SPI_CS_IO (15)
#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6
#else
#define EXAMPLE_I2C_NUM (0)
#define EXAMPLE_I2C_SDA_IO (3)
#define EXAMPLE_I2C_SCL_IO (2)

View File

@ -6,6 +6,7 @@ from pytest_embedded import Dut
@pytest.mark.esp32s3
@pytest.mark.esp32c3
@pytest.mark.esp32c6
@pytest.mark.generic
def test_i2s_es7210_tdm_example(dut: Dut) -> None:
dut.expect_exact('example: Create I2S receive channel')

View File

@ -1,5 +1,5 @@
| Supported Targets | ESP32 | ESP32-C3 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- |
| Supported Targets | ESP32 | ESP32-C3 | ESP32-C6 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- | -------- |
# I2S ES8311 Example
@ -25,7 +25,7 @@ For more details, see [ES8311 datasheet](http://www.everest-semi.com/pdf/ES8311%
### Hardware Required
* An ESP development board that support I2S.
* A development board with any supported Espressif SOC chip (see `Supported Targets` table above)
* A USB cable for power supply and programming.
* A board with ES8311 codec, mic and earphone interface(e.g. ESP-LyraT-8311A extension board).

View File

@ -15,12 +15,12 @@
/* I2C port and GPIOs */
#define I2C_NUM (0)
#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32H4
#define I2C_SCL_IO (GPIO_NUM_6)
#define I2C_SDA_IO (GPIO_NUM_7)
#else
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
#define I2C_SCL_IO (GPIO_NUM_16)
#define I2C_SDA_IO (GPIO_NUM_17)
#else
#define I2C_SCL_IO (GPIO_NUM_6)
#define I2C_SDA_IO (GPIO_NUM_7)
#endif
/* I2S port and GPIOs */
@ -28,12 +28,12 @@
#define I2S_MCK_IO (GPIO_NUM_0)
#define I2S_BCK_IO (GPIO_NUM_4)
#define I2S_WS_IO (GPIO_NUM_5)
#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32H4
#define I2S_DO_IO (GPIO_NUM_2)
#define I2S_DI_IO (GPIO_NUM_3)
#else
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
#define I2S_DO_IO (GPIO_NUM_18)
#define I2S_DI_IO (GPIO_NUM_19)
#else
#define I2S_DO_IO (GPIO_NUM_2)
#define I2S_DI_IO (GPIO_NUM_3)
#endif
/* Example configurations */
#define EXAMPLE_RECV_BUF_SIZE (2400)

View File

@ -9,6 +9,7 @@ from pytest_embedded import Dut
@pytest.mark.esp32s2
@pytest.mark.esp32s3
@pytest.mark.esp32c3
@pytest.mark.esp32c6
@pytest.mark.generic
def test_i2s_es8311_example_generic(dut: Dut) -> None:
dut.expect('i2s es8311 codec example start')