Skip to content

Commit

Permalink
boards: esp32: add i2s for non-gdma SoC boards
Browse files Browse the repository at this point in the history
Adds i2s support for boards based on:
- esp32
- esp32s2

Signed-off-by: Marcio Ribeiro <[email protected]>
  • Loading branch information
wmrsouza committed Feb 13, 2025
1 parent 420a26a commit 263a9e9
Show file tree
Hide file tree
Showing 40 changed files with 426 additions and 21 deletions.
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,34 @@
};
};

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
18 changes: 17 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,20 @@
};
};

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
18 changes: 17 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,20 @@
};
};

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
Loading

0 comments on commit 263a9e9

Please sign in to comment.