Audio System + Drivers (#562)

This commit is contained in:
Shadowtrance
2026-07-14 16:34:29 +10:00
committed by GitHub
parent fa4a6e255c
commit 955416dac8
137 changed files with 8847 additions and 387 deletions
@@ -21,3 +21,5 @@ display.dpi=143
cdn.infoMessage=To put the device into bootloader mode: <br/>1. Press the trackball and then the reset button at the same time,<br/>2. Let go of the reset button, then the trackball.<br/><br/>When this website reports that flashing is finished, you likely have to press the reset button.
lvgl.colorDepth=16
sdkconfig.CONFIG_CODEC_DUMMY_SUPPORT=y
@@ -3,4 +3,7 @@ dependencies:
- Drivers/st7789-module
- Drivers/gt911-module
- Drivers/lilygo-module
- Drivers/es7210-module
- Drivers/dummy-i2s-amp-module
- Drivers/audio-stream-module
dts: lilygo,tdeck-plus.dts
@@ -16,6 +16,8 @@
#include <bindings/gt911.h>
#include <bindings/st7789.h>
#include <bindings/es7210.h>
#include <bindings/dummy_i2s_amp.h>
#include <lilygo/bindings/tdeck_keyboard.h>
#include <lilygo/bindings/tdeck_keyboard_backlight.h>
@@ -64,6 +66,34 @@
pin-click = <&gpio0 0 GPIO_FLAG_NONE>;
};
// i2s0 and i2s1 are declared before i2c0 so i2s1 has started before the es7210 codec (below) references it.
// Speaker I2S (MAX98357A amplifier)
i2s0 {
compatible = "espressif,esp32-i2s";
port = <I2S_NUM_0>;
pin-bclk = <&gpio0 7 GPIO_FLAG_NONE>;
pin-ws = <&gpio0 5 GPIO_FLAG_NONE>;
pin-data-out = <&gpio0 6 GPIO_FLAG_NONE>;
};
// Microphone I2S (ES7210), separate port from the speaker
i2s1 {
compatible = "espressif,esp32-i2s";
port = <I2S_NUM_1>;
pin-bclk = <&gpio0 47 GPIO_FLAG_NONE>;
pin-ws = <&gpio0 21 GPIO_FLAG_NONE>;
pin-data-in = <&gpio0 14 GPIO_FLAG_NONE>;
pin-mclk = <&gpio0 48 GPIO_FLAG_NONE>;
};
// MAX98357A class-D speaker amplifier. No I2C. Per schematic, SD_MODE/GAIN_SLOT is
// tied via fixed resistors (R21/R22), not driven by an MCU GPIO -- the amp is always
// enabled when powered, so no enable-gpio is wired here.
speaker0 {
compatible = "maxim,max98357a";
i2s = <&i2s0>;
};
i2c_internal: i2c0 {
compatible = "espressif,esp32-i2c";
port = <I2C_NUM_0>;
@@ -90,14 +120,18 @@
compatible = "lilygo,tdeck-keyboard-backlight";
reg = <0x55>;
};
};
i2s0 {
compatible = "espressif,esp32-i2s";
port = <I2S_NUM_0>;
pin-bclk = <&gpio0 7 GPIO_FLAG_NONE>;
pin-ws = <&gpio0 5 GPIO_FLAG_NONE>;
pin-data-out = <&gpio0 6 GPIO_FLAG_NONE>;
// ES7210 microphone ADC. Per schematic all 4 MSM381A3729H9CP mic capsules are
// populated (MIC1-4), and AD0/AD1 are unconnected (default low -> address 0x40).
// Stock LilyGO firmware drives MIC1/MIC2 at 0dB and MIC3/MIC4 at 37.5dB gain --
// the es7210 driver here applies a single gain to all active mics, so per-pair
// gain differentiation is not yet replicated.
es7210 {
compatible = "everest,es7210";
reg = <0x40>;
i2s = <&i2s1>;
mic-mask = <15>;
};
};
display_backlight {