@@ -188,7 +188,11 @@ STATIC mp_obj_t machine_sdcard_make_new(const mp_obj_type_t *type, size_t n_args
188188 }
189189
190190 if (is_spi ) {
191+ #if CONFIG_IDF_TARGET_ESP32S3
192+ self -> host .slot = slot_num ? SPI3_HOST : SPI2_HOST ;
193+ #else
191194 self -> host .slot = slot_num ? HSPI_HOST : VSPI_HOST ;
195+ #endif
192196 }
193197
194198 DEBUG_printf (" Calling host.init()" );
@@ -198,6 +202,20 @@ STATIC mp_obj_t machine_sdcard_make_new(const mp_obj_type_t *type, size_t n_args
198202
199203 if (is_spi ) {
200204 // SPI interface
205+ #if CONFIG_IDF_TARGET_ESP32S3
206+ STATIC const sdspi_slot_config_t slot_defaults [2 ] = {
207+ {
208+ .gpio_miso = GPIO_NUM_36 ,
209+ .gpio_mosi = GPIO_NUM_35 ,
210+ .gpio_sck = GPIO_NUM_37 ,
211+ .gpio_cs = GPIO_NUM_34 ,
212+ .gpio_cd = SDSPI_SLOT_NO_CD ,
213+ .gpio_wp = SDSPI_SLOT_NO_WP ,
214+ .dma_channel = 2
215+ },
216+ SDSPI_SLOT_CONFIG_DEFAULT ()
217+ };
218+ #else
201219 STATIC const sdspi_slot_config_t slot_defaults [2 ] = {
202220 {
203221 .gpio_miso = GPIO_NUM_19 ,
@@ -210,6 +228,7 @@ STATIC mp_obj_t machine_sdcard_make_new(const mp_obj_type_t *type, size_t n_args
210228 },
211229 SDSPI_SLOT_CONFIG_DEFAULT ()
212230 };
231+ #endif
213232
214233 DEBUG_printf (" Setting up SPI slot configuration" );
215234 sdspi_slot_config_t slot_config = slot_defaults [slot_num ];
0 commit comments