LilyGo-T-OI-PLUS icon indicating copy to clipboard operation
LilyGo-T-OI-PLUS copied to clipboard

sd_card/sdspi example and WEMOS (LOLIN) micro sd-card shield v1.2

Open yshestakov opened this issue 3 years ago • 0 comments

There is the patch to make LilyGo-T-IO-PLUS board working with WEMOS sdcard shield

--- a/examples/storage/sd_card/sdspi/main/sd_card_example_main.c
+++ b/examples/storage/sd_card/sdspi/main/sd_card_example_main.c
@@ -27,17 +27,29 @@ static const char *TAG = "example";
 #define PIN_NUM_CS   13

 #elif CONFIG_IDF_TARGET_ESP32C3
+#if 0
 #define PIN_NUM_MISO 18
 #define PIN_NUM_MOSI 9
 #define PIN_NUM_CLK  8
 #define PIN_NUM_CS   19
+#else
+// LILYGO T-IO Plus  + LOLIN sdcard shield v1.2
+#define PIN_NUM_MISO 6  // D12
+#define PIN_NUM_MOSI 7  // D13
+#define PIN_NUM_CLK  5  // D14
+#define PIN_NUM_CS   8  // D4
+#endif

 #endif //CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2

-#if CONFIG_IDF_TARGET_ESP32S2 ||CONFIG_IDF_TARGET_ESP32C3
-#define SPI_DMA_CHAN    host.slot
+#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32C3
+  #if SOC_GDMA_SUPPORTED
+    #define SPI_DMA_CHAN    SPI_DMA_CH_AUTO
+  #else
+    #define SPI_DMA_CHAN    host.slot
+  #endif
 #else
-#define SPI_DMA_CHAN    1
+  #define SPI_DMA_CHAN    1
 #endif

yshestakov avatar Aug 23 '21 09:08 yshestakov