@@ -64,7 +64,6 @@ void ESP3DCommands::ESP220(int cmd_params_pos, ESP3DMessage* msg) {
6464 bool isFirst = true ;
6565 bool hasPin = false ;
6666#if defined(SD_DEVICE) && SD_DEVICE != ESP_SDIO
67-
6867 // SD CS
6968 tmpstr = String (ESP_SD_CS_PIN == -1 ? SS : ESP_SD_CS_PIN);
7069 if (!dispatchIdValue (json, " SD CS" , tmpstr.c_str (), target, requestId,
@@ -100,6 +99,57 @@ void ESP3DCommands::ESP220(int cmd_params_pos, ESP3DMessage* msg) {
10099 isFirst)) {
101100 return ;
102101 }
102+
103+ #endif // defined(SD_DEVICE) && SD_DEVICE != ESP_SDIO
104+ #if defined(SD_DEVICE) && SD_DEVICE == ESP_SDIO
105+ // ====================== SDIO / SDMMC pins (ESP32 + S3) ======================
106+ // CLK
107+ tmpstr = String (ESP_SDIO_CLK_PIN == -1 ? 14 : ESP_SDIO_CLK_PIN);
108+ if (!dispatchIdValue (json, " SD CLK" , tmpstr.c_str (), target, requestId, isFirst)) {
109+ return ;
110+ }
111+ isFirst = false ;
112+ hasPin = true ;
113+
114+ // CMD
115+ tmpstr = String (ESP_SDIO_CMD_PIN == -1 ? 15 : ESP_SDIO_CMD_PIN);
116+ if (!dispatchIdValue (json, " SD CMD" , tmpstr.c_str (), target, requestId, isFirst)) {
117+ return ;
118+ }
119+
120+ // D0
121+ tmpstr = String (ESP_SDIO_D0_PIN == -1 ? 2 : ESP_SDIO_D0_PIN);
122+ if (!dispatchIdValue (json, " SD D0" , tmpstr.c_str (), target, requestId, isFirst)) {
123+ return ;
124+ }
125+
126+ // D1
127+ tmpstr = String (ESP_SDIO_D1_PIN == -1 ? 4 : ESP_SDIO_D1_PIN);
128+ if (!dispatchIdValue (json, " SD D1" , tmpstr.c_str (), target, requestId, isFirst)) {
129+ return ;
130+ }
131+
132+ // D2
133+ tmpstr = String (ESP_SDIO_D2_PIN == -1 ? 12 : ESP_SDIO_D2_PIN);
134+ if (!dispatchIdValue (json, " SD D2" , tmpstr.c_str (), target, requestId, isFirst)) {
135+ return ;
136+ }
137+
138+ // D3
139+ tmpstr = String (ESP_SDIO_D3_PIN == -1 ? 13 : ESP_SDIO_D3_PIN);
140+ if (!dispatchIdValue (json, " SD D3" , tmpstr.c_str (), target, requestId, isFirst)) {
141+ return ;
142+ }
143+
144+ // Bit mode (1-bit ou 4-bit)
145+ #if defined(SDIO_BIT_MODE)
146+ tmpstr = (SDIO_BIT_MODE == SD_ONE_BIT_MODE) ? " 1-bit" : " 4-bit" ;
147+ if (!dispatchIdValue (json, " SDIO MODE" , tmpstr.c_str (), target, requestId, isFirst)) {
148+ return ;
149+ }
150+ #endif
151+ #endif // SD_DEVICE == ESP_SDIO
152+ #if defined(SD_DEVICE)
103153#if ESP_SD_DETECT_PIN != -1
104154 // SD DETECT STATE
105155 tmpstr = String (ESP_SD_DETECT_VALUE);
@@ -108,7 +158,7 @@ void ESP3DCommands::ESP220(int cmd_params_pos, ESP3DMessage* msg) {
108158 return ;
109159 }
110160#endif // ESP_SD_DETECT_PIN !=-1
111- #endif // defined( SD_DEVICE) && SD_DEVICE != ESP_SDIO
161+ #endif // SD_DEVICE
112162#if SD_DEVICE_CONNECTION == ESP_SHARED_SD && defined(ESP_FLAG_SHARED_SD_PIN)
113163 // SD SWITCH
114164 tmpstr = String (ESP_FLAG_SHARED_SD_PIN);
0 commit comments