Skip to content

Commit

Permalink
boards: lilygo: ttgo_lora32: enable SDHC support
Browse files Browse the repository at this point in the history
enable support for the SDHC controller to use the micro SD card slot

Signed-off-by: Lothar Felten <[email protected]>
  • Loading branch information
lfelten committed Oct 3, 2024
1 parent a6ed05e commit 91b86a0
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 2 deletions.
2 changes: 1 addition & 1 deletion boards/lilygo/ttgo_lora32/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ of the Lilygo TTGO LoRa32 board.
| SX1276/SX1278 | LoRa radio frontend chip, connected via SPI. |
| | Use SX1276 for 433MHz and SX1276 for 868/915/923MHz. |
+------------------+-------------------------------------------------------------------------+
| TF card slot | TF card slot wired to the SD interface of the MCU. |
| TF card slot | TF card slot wired to the SDHC interface of the MCU. |
+------------------+-------------------------------------------------------------------------+


Expand Down
20 changes: 19 additions & 1 deletion boards/lilygo/ttgo_lora32/ttgo_lora32-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@
};
};

spim2_default: spim2_default {
group1 {
pinmux = <SPIM2_MISO_GPIO12>,
<SPIM2_SCLK_GPIO14>,
<SPIM2_CSEL_GPIO15>;
};
group2 {
pinmux = <SPIM2_MOSI_GPIO13>;
output-low;
};
};

spim3_default: spim3_default {
group1 {
pinmux = <SPIM3_MISO_GPIO19>,
Expand All @@ -41,5 +53,11 @@
output-high;
};
};

sdhc0_default: sdhc0_default {
group1 {
pinmux = <SDHC0_CD_GPIO34>;
bias-pull-up;
output-high;
};
};
};
26 changes: 26 additions & 0 deletions boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu.dts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
uart-0 = &uart0;
i2c-0 = &i2c0;
watchdog0 = &wdt0;
sdhc0 = &sdhc1;
lora0 = &lora0;
};

Expand All @@ -28,6 +29,7 @@
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
zephyr,display = &ssd1306_128x64;
zephyr,sdhc = &sdhc1;
};

leds {
Expand Down Expand Up @@ -121,6 +123,30 @@
status = "okay";
};

&sdhc {
sdhc1: sdhc@1 {
status = "okay";

pinctrl-0 = <&sdhc0_default>;
pinctrl-names = "default";
power-delay-ms = <100>;
max-bus-freq = <52000000>;
bus-width = <4>;

clk-pin = <14>;
cmd-pin = <15>;
d0-pin = <2>;
d1-pin = <4>;
d2-pin = <12>;
d3-pin = <13>;

mmc {
compatible = "zephyr,sdmmc-disk";
status = "okay";
};
};
};

&flash0 {
status = "okay";
partitions {
Expand Down
1 change: 1 addition & 0 deletions boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ supported:
- display
- lora
- nvs
- sdhc
testing:
ignore_tags:
- net
Expand Down

0 comments on commit 91b86a0

Please sign in to comment.