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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
Expand Up @@ -74,5 +74,37 @@
output-high;
};
};

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;
};
};

i2s1_default: i2s1_default {
group1 {
pinmux = <I2S1_MCLK_GPIO18>,
<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
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
Expand Up @@ -74,4 +74,36 @@
output-high;
};
};

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;
};
};

i2s1_default: i2s1_default {
group1 {
pinmux = <I2S1_MCLK_GPIO18>,
<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
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
Expand Up @@ -40,4 +40,36 @@
};
};

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;
};
};

i2s1_default: i2s1_default {
group1 {
pinmux = <I2S1_MCLK_GPIO18>,
<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;
};
};

};
12 changes: 12 additions & 0 deletions boards/espressif/esp32_ethernet_kit/esp32_ethernet_kit_procpu.dts
Original file line number Diff line number Diff line change
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
16 changes: 16 additions & 0 deletions boards/espressif/esp32s2_devkitc/esp32s2_devkitc-pinctrl.dtsi
Original file line number Diff line number Diff line change
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;
};
};

};
6 changes: 6 additions & 0 deletions boards/espressif/esp32s2_devkitc/esp32s2_devkitc.dts
Original file line number Diff line number Diff line change
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
16 changes: 16 additions & 0 deletions boards/espressif/esp32s2_saola/esp32s2_saola-pinctrl.dtsi
Original file line number Diff line number Diff line change
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;
};
};

};
6 changes: 6 additions & 0 deletions boards/espressif/esp32s2_saola/esp32s2_saola.dts
Original file line number Diff line number Diff line change
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
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;
};
};

};
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@
pinctrl-names = "default";
};

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

&trng0 {
status = "okay";
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ toolchain:
supported:
- gpio
- i2c
- i2s
- watchdog
- uart
- pinmux
Expand Down
32 changes: 32 additions & 0 deletions boards/lilygo/ttgo_lora32/ttgo_lora32-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,38 @@
pinmux = <SDHC0_CD_GPIO34>;
bias-pull-up;
output-high;

Check failure on line 50 in boards/lilygo/ttgo_lora32/ttgo_lora32-pinctrl.dtsi

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

TRAILING_WHITESPACE

boards/lilygo/ttgo_lora32/ttgo_lora32-pinctrl.dtsi:50 trailing whitespace

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;
};
};

i2s1_default: i2s1_default {
group1 {
pinmux = <I2S1_MCLK_GPIO18>,
<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;
};
}; };
};
};
Loading
Loading