pub struct SdCardDriver<T> { /* private fields */ }Expand description
A high-level SD-Card driver.
This driver is used to interface with an SD-Card by wrapping one of the two SD Host drivers:
- SD-SPI Host driver (
SdSpiHostDriver) - SD-MMC Host driver (
SdMmcHostDriver) - on MCUs that do have an SD-MMC peripheral (ESP32, ESP32S3 and ESP32P4)
The interface allows reading, writing and erasing sectors, as well as reading and writing arbitrary-length bytes.
Currently, all interaction with the SD-Card driver is via the native, unsafe sys::sdmmc_* functions.
Implementations§
Source§impl<T> SdCardDriver<T>
impl<T> SdCardDriver<T>
Sourcepub fn card(&self) -> &sdmmc_card_t
pub fn card(&self) -> &sdmmc_card_t
Get a reference to the SD-Card native structure.
Source§impl<'d, T> SdCardDriver<SdSpiHostDriver<'d, T>>where
T: Borrow<SpiDriver<'d>>,
impl<'d, T> SdCardDriver<SdSpiHostDriver<'d, T>>where
T: Borrow<SpiDriver<'d>>,
Sourcepub fn new_spi(
host: SdSpiHostDriver<'d, T>,
configuration: &Configuration,
) -> Result<Self, EspError>
pub fn new_spi( host: SdSpiHostDriver<'d, T>, configuration: &Configuration, ) -> Result<Self, EspError>
Create a new SD-Card driver using the SD-SPI host driver instantiated with one of the SPI peripherals