-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Add i2s support for esp32 and esp32s2 #83710
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
fec3d8c
drivers: i2s: esp32: code and data refactoring
wmrsouza 77bd5e6
drivers: i2s: esp32: add support for non-gdma SoCs
wmrsouza 873b7ab
boards: esp32: add i2s for non-gdma SoC boards
wmrsouza 68d86d1
samples: i2s: add esp32 board overlay files
wmrsouza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ supported: | |
- dac | ||
- gpio | ||
- i2c | ||
- i2s | ||
- watchdog | ||
- uart | ||
- nvs | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ supported: | |
- dac | ||
- gpio | ||
- i2c | ||
- i2s | ||
- watchdog | ||
- uart | ||
- nvs | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
*/ | ||
|
@@ -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; | ||
}; | ||
}; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
*/ | ||
|
@@ -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>; | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,5 @@ supported: | |
- uart | ||
- nvs | ||
- pwm | ||
- i2s | ||
vendor: espressif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ supported: | |
- dac | ||
- gpio | ||
- i2c | ||
- i2s | ||
- watchdog | ||
- uart | ||
- nvs | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ supported: | |
- dac | ||
- gpio | ||
- i2c | ||
- i2s | ||
- watchdog | ||
- uart | ||
- nvs | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these the right flags? (usually used for loopback)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think they are correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the input pins be placed in group2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact no. In this configuration they are output pins connected to the input/rx path. In other configuration they could be driven by output sources, but in this conf they will provide output signals.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still find it odd the use of the flag, but it shouldn't harm as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#define I2S0_I_BCK_GPIO16 ESP32_PINMUX(16, ESP_I2S0I_BCK_IN, ESP_I2S0I_BCK_OUT)
#define I2S0_I_WS_GPIO15 ESP32_PINMUX(15, ESP_I2S0I_WS_IN, ESP_I2S0I_WS_OUT)
I think that, since the macros I2S0_I_WS_GPIO15 and I2S0_I_BCK_GPIO16 can be use as both input and output, the direction flag is necessary.