MMC cards are not yet supported due to missing functionality in the IDF driver.
MMC cards are not yet supported on HS1/HS2 interfaces due to missing functionality in the IDF driver. Use the SD SPI mode on HSPI/VSPI instead.
## SD Card connection
## SD Card connection
The SD card is operated in SDMMC mode, thus the card has to be wired to the ESP pins of the HS1_* or HS2_* interfaces. There are several naming schemes used on different adapters - the following list shows alternative terms:
!!! caution
The adapter does not require level shifters since SD and ESP are supposed to be powered with the same voltage. If your specific model contains level shifters then make sure that both sides can be operated at 3V3.
If the SD card is operated in SDMMC mode, then the card has to be wired to the ESP pins of the HS1_* or HS2_* interfaces. There are several naming schemes used on different adapters - the following list shows alternative terms:
| SD mode name | SPI mode name | ESP32 HS1 I/F | ESP32 HS2 I/F |
| SD mode name | SPI mode name | ESP32 HS1 I/F | ESP32 HS2 I/F |
| :--- | :--- | :--- | :--- |
| :--- | :--- | :--- | :--- |
...
@@ -32,11 +40,24 @@ Connections to `CLK`, `CMD`, and `DAT0` are mandatory and enable basic operation
...
@@ -32,11 +40,24 @@ Connections to `CLK`, `CMD`, and `DAT0` are mandatory and enable basic operation
Connecting DAT0 to GPIO2 can block firmware flashing depending on the electrical configuration at this pin. Disconnect GPIO2 from the card adapter during flashing if unsure.
Connecting DAT0 to GPIO2 can block firmware flashing depending on the electrical configuration at this pin. Disconnect GPIO2 from the card adapter during flashing if unsure.
!!! caution
### SD SPI Mode
The adapter does not require level shifters since SD and ESP are supposed to be powered with the same voltage. If your specific model contains level shifters then make sure that both sides can be operated at 3V3.
In SD SPI mode the SD or MMC card is operated by the SPI host interfaces (HSPI or VSPI). Both hosts can be assigned to any GPIO pins.
@@ -17,7 +17,7 @@ The host signals can be mapped to any suitable GPIO pins.
...
@@ -17,7 +17,7 @@ The host signals can be mapped to any suitable GPIO pins.
Initializes a bus in master mode and returns a bus master object.
Initializes a bus in master mode and returns a bus master object.
#### Syntax
#### Syntax
`spi.master(host, config[, dma])`
`spi.master(host[, config[, dma]])`
#### Parameters
#### Parameters
-`host` id, one of
-`host` id, one of
...
@@ -34,6 +34,10 @@ Initializes a bus in master mode and returns a bus master object.
...
@@ -34,6 +34,10 @@ Initializes a bus in master mode and returns a bus master object.
Enabling DMA allows sending and receiving an unlimited amount of bytes but has restrictions in halfduplex mode (see [`spi.master:device()`](#spimasterdevice)).
Enabling DMA allows sending and receiving an unlimited amount of bytes but has restrictions in halfduplex mode (see [`spi.master:device()`](#spimasterdevice)).
Disabling DMA limits a transaction to 32 bytes max.
Disabling DMA limits a transaction to 32 bytes max.
!!! not
Omitting the `config` table returns an SPI bus master object without further initialization. This enables sharing the same SPI host with `sdmmc` in SD-SPI mode. First call `sdmmc.init(sdmmc.VSPI, ...)`, then `spi.master(spi.VSPI)`.