Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i2s support for esp32 and esp32s2 #83710

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions boards/espressif/esp32_devkitc_wroom/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ Current Zephyr's ESP32-DevKitC-WROOM board supports the following features:
+------------+------------+-------------------------------------+
| PCNT | on-chip | qdec |
+------------+------------+-------------------------------------+
| I2S | on-chip | i2s |
+------------+------------+-------------------------------------+
| SPI DMA | on-chip | spi |
+------------+------------+-------------------------------------+
| TWAI | on-chip | can |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd.
* Copyright (c) 2022-2025 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -74,5 +74,35 @@
output-high;
};
};

i2s0_default: i2s0_default {
group1 {
pinmux = <I2S0_O_WS_GPIO5>,
<I2S0_O_BCK_GPIO6>,
<I2S0_O_SD_GPIO7>,
<I2S0_I_WS_GPIO15>,
<I2S0_I_BCK_GPIO16>;
output-enable;
};
group2 {
pinmux = <I2S0_I_SD_GPIO17>;
input-enable;
};
};

i2s1_default: i2s1_default {
group1 {
pinmux = <I2S1_O_WS_GPIO8>,
<I2S1_O_BCK_GPIO3>,
<I2S1_O_SD_GPIO9>,
<I2S1_I_WS_GPIO10>,
<I2S1_I_BCK_GPIO11>;
output-enable;
};
group2 {
pinmux = <I2S1_I_SD_GPIO12>;
input-enable;
};
};
};

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
* Copyright (c) 2023-2025 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -89,6 +89,18 @@
pinctrl-names = "default";
};

&i2s0 {
pinctrl-0 = <&i2s0_default>;
pinctrl-names = "default";
status = "disabled";
};

&i2s1 {
pinctrl-0 = <&i2s1_default>;
pinctrl-names = "default";
status = "disabled";
};

&spi2 {
#address-cells = <1>;
#size-cells = <0>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ supported:
- dac
- gpio
- i2c
- i2s
- watchdog
- uart
- nvs
Expand Down
2 changes: 2 additions & 0 deletions boards/espressif/esp32_devkitc_wrover/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ Current Zephyr's ESP32-DevKitC-WROVER board supports the following features:
+------------+------------+-------------------------------------+
| PCNT | on-chip | qdec |
+------------+------------+-------------------------------------+
| I2S | on-chip | i2s |
+------------+------------+-------------------------------------+
| SPI DMA | on-chip | spi |
+------------+------------+-------------------------------------+
| TWAI | on-chip | can |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd.
* Copyright (c) 2022-2025 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -74,4 +74,34 @@
output-high;
};
};

i2s0_default: i2s0_default {
group1 {
pinmux = <I2S0_O_WS_GPIO5>,
<I2S0_O_BCK_GPIO6>,
<I2S0_O_SD_GPIO7>,
<I2S0_I_WS_GPIO15>,
<I2S0_I_BCK_GPIO16>;
output-enable;
};
group2 {
pinmux = <I2S0_I_SD_GPIO17>;
input-enable;
};
};

i2s1_default: i2s1_default {
group1 {
pinmux = <I2S1_O_WS_GPIO8>,
<I2S1_O_BCK_GPIO3>,
<I2S1_O_SD_GPIO9>,
<I2S1_I_WS_GPIO10>,
<I2S1_I_BCK_GPIO11>;
output-enable;
};
group2 {
pinmux = <I2S1_I_SD_GPIO12>;
input-enable;
};
};
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
* Copyright (c) 2023-2025 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -89,6 +89,18 @@
pinctrl-names = "default";
};

&i2s0 {
pinctrl-0 = <&i2s0_default>;
pinctrl-names = "default";
status = "disabled";
};

&i2s1 {
pinctrl-0 = <&i2s1_default>;
pinctrl-names = "default";
status = "disabled";
};

&spi2 {
#address-cells = <1>;
#size-cells = <0>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ supported:
- dac
- gpio
- i2c
- i2s
- watchdog
- uart
- nvs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Grant Ramsay <[email protected]>
* Copyright (c) 2022-2025 Grant Ramsay <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -40,4 +40,33 @@
};
};

i2s0_default: i2s0_default {
group1 {
pinmux = <I2S0_O_WS_GPIO5>,
<I2S0_O_BCK_GPIO6>,
<I2S0_O_SD_GPIO7>,
<I2S0_I_WS_GPIO15>,
<I2S0_I_BCK_GPIO16>;
output-enable;
};
group2 {
pinmux = <I2S0_I_SD_GPIO17>;
input-enable;
};
};

i2s1_default: i2s1_default {
group1 {
pinmux = <I2S1_O_WS_GPIO8>,
<I2S1_O_BCK_GPIO3>,
<I2S1_O_SD_GPIO9>,
<I2S1_I_WS_GPIO10>,
<I2S1_I_BCK_GPIO11>;
output-enable;
};
group2 {
pinmux = <I2S1_I_SD_GPIO12>;
input-enable;
};
};
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Grant Ramsay <[email protected]>
* Copyright (c) 2022-2025 Grant Ramsay <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -43,6 +43,18 @@
status = "okay";
};

&i2s0 {
pinctrl-0 = <&i2s0_default>;
pinctrl-names = "default";
status = "disabled";
};

&i2s1 {
pinctrl-0 = <&i2s1_default>;
pinctrl-names = "default";
status = "disabled";
};

&spi2 {
#address-cells = <1>;
#size-cells = <0>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ supported:
- uart
- nvs
- pwm
- i2s
vendor: espressif
2 changes: 2 additions & 0 deletions boards/espressif/esp32s2_devkitc/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ Current Zephyr's ESP32-S2-devkitc board supports the following features:
+------------+------------+-------------------------------------+
| PCNT | on-chip | qdec |
+------------+------------+-------------------------------------+
| I2S | on-chip | i2s |
+------------+------------+-------------------------------------+
| SPI DMA | on-chip | spi |
+------------+------------+-------------------------------------+
| ADC | on-chip | adc |
Expand Down
17 changes: 16 additions & 1 deletion boards/espressif/esp32s2_devkitc/esp32s2_devkitc-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
* Copyright (c) 2024-2025 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -65,4 +65,19 @@
};
};

i2s0_default: i2s0_default {
group1 {
pinmux = <I2S0_MCLK_GPIO4>,
<I2S0_O_WS_GPIO5>,
<I2S0_O_BCK_GPIO6>,
<I2S0_O_SD_GPIO7>,
<I2S0_I_WS_GPIO15>,
<I2S0_I_BCK_GPIO16>;
output-enable;
};
group2 {
pinmux = <I2S0_I_SD_GPIO17>;
input-enable;
};
};
};
8 changes: 7 additions & 1 deletion boards/espressif/esp32s2_devkitc/esp32s2_devkitc.dts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
* Copyright (c) 2024-2025 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -96,6 +96,12 @@
pinctrl-names = "default";
};

&i2s0 {
pinctrl-0 = <&i2s0_default>;
pinctrl-names = "default";
status = "disabled";
};

&trng0 {
status = "okay";
};
Expand Down
1 change: 1 addition & 0 deletions boards/espressif/esp32s2_devkitc/esp32s2_devkitc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ supported:
- dac
- gpio
- i2c
- i2s
- watchdog
- uart
- nvs
Expand Down
2 changes: 2 additions & 0 deletions boards/espressif/esp32s2_saola/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ Current Zephyr's ESP32-S2-Saola board supports the following features:
+------------+------------+-------------------------------------+
| PCNT | on-chip | qdec |
+------------+------------+-------------------------------------+
| I2S | on-chip | i2s |
+------------+------------+-------------------------------------+
| SPI DMA | on-chip | spi |
+------------+------------+-------------------------------------+
| ADC | on-chip | adc |
Expand Down
17 changes: 16 additions & 1 deletion boards/espressif/esp32s2_saola/esp32s2_saola-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd.
* Copyright (c) 2022-2025 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -65,4 +65,19 @@
};
};

i2s0_default: i2s0_default {
group1 {
pinmux = <I2S0_MCLK_GPIO4>,
<I2S0_O_WS_GPIO5>,
<I2S0_O_BCK_GPIO6>,
<I2S0_O_SD_GPIO7>,
<I2S0_I_WS_GPIO15>,
<I2S0_I_BCK_GPIO16>;
output-enable;
};
group2 {
pinmux = <I2S0_I_SD_GPIO17>;
input-enable;
};
};
};
8 changes: 7 additions & 1 deletion boards/espressif/esp32s2_saola/esp32s2_saola.dts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd.
* Copyright (c) 2021-2025 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -96,6 +96,12 @@
pinctrl-names = "default";
};

&i2s0 {
pinctrl-0 = <&i2s0_default>;
pinctrl-names = "default";
status = "disabled";
};

&trng0 {
status = "okay";
};
Expand Down
1 change: 1 addition & 0 deletions boards/espressif/esp32s2_saola/esp32s2_saola.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ supported:
- dac
- gpio
- i2c
- i2s
- watchdog
- uart
- nvs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2022 Felipe Neves.
* Copyright (c) 2025 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -65,4 +66,19 @@
};
};

i2s0_default: i2s0_default {
group1 {
pinmux = <I2S0_MCLK_GPIO4>,
<I2S0_O_WS_GPIO5>,
<I2S0_O_BCK_GPIO6>,
<I2S0_O_SD_GPIO7>,
<I2S0_I_WS_GPIO15>,
<I2S0_I_BCK_GPIO16>;
output-enable;
};
group2 {
pinmux = <I2S0_I_SD_GPIO17>;
input-enable;
};
};
};
Loading
Loading