diff --git a/boards/lilygo/ttgo_lora32/doc/index.rst b/boards/lilygo/ttgo_lora32/doc/index.rst index c7a04423e905ecb..5ac9abb30dd78e7 100644 --- a/boards/lilygo/ttgo_lora32/doc/index.rst +++ b/boards/lilygo/ttgo_lora32/doc/index.rst @@ -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. | +------------------+-------------------------------------------------------------------------+ diff --git a/boards/lilygo/ttgo_lora32/ttgo_lora32-pinctrl.dtsi b/boards/lilygo/ttgo_lora32/ttgo_lora32-pinctrl.dtsi index 5f043ddb945d676..eaa6e45b26920f7 100644 --- a/boards/lilygo/ttgo_lora32/ttgo_lora32-pinctrl.dtsi +++ b/boards/lilygo/ttgo_lora32/ttgo_lora32-pinctrl.dtsi @@ -21,6 +21,18 @@ }; }; + spim2_default: spim2_default { + group1 { + pinmux = , + , + ; + }; + group2 { + pinmux = ; + output-low; + }; + }; + spim3_default: spim3_default { group1 { pinmux = , @@ -41,5 +53,11 @@ output-high; }; }; - + sdhc0_default: sdhc0_default { + group1 { + pinmux = ; + bias-pull-up; + output-high; + }; + }; }; diff --git a/boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu.dts b/boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu.dts index d8dfad087e3e97c..9d4da1c1fca26ea 100644 --- a/boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu.dts +++ b/boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu.dts @@ -18,6 +18,7 @@ uart-0 = &uart0; i2c-0 = &i2c0; watchdog0 = &wdt0; + sdhc0 = &sdhc1; lora0 = &lora0; }; @@ -28,6 +29,7 @@ zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; zephyr,display = &ssd1306_128x64; + zephyr,sdhc = &sdhc1; }; leds { @@ -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 { diff --git a/boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu.yaml b/boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu.yaml index f4d0e25cc59d2df..d16b056dd1166d5 100644 --- a/boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu.yaml +++ b/boards/lilygo/ttgo_lora32/ttgo_lora32_esp32_procpu.yaml @@ -14,6 +14,7 @@ supported: - display - lora - nvs + - sdhc testing: ignore_tags: - net