sdio
A no-std library for interfacing with SD cards, EMMC, and/or SDIO cards, using the MMCBus trait. Current targeted
support is stm32 and esp peripherals. Other chips can support SD/SDIO functionality by implementing this trait.
A struct within this crate implements block_device_driver::BlockDevice, which allows no-std file systems to write
cards that are attached to peripherals that implement MMCBus. Currently known file systems that implement support
for this include embedded-fatfs and exfat-slim.
An embassy project
This crate is part of the embassy project, designed to improve cross-platform support for native SD/SDIO
peripherals. It is also intended to be a replacement for the now-abandoned sdio-host project, with a standard
implementation of common logic across all devices based on the SDIO standard.
/// ---------------------------------------------------------------------------
/// MmcBus Trait
/// ---------------------------------------------------------------------------
///
/// This is the lowest-level hardware abstraction for SD/MMC/SDIO host
/// controllers. It corresponds to the Linux `mmc_host_ops` interface.
///
/// It exposes:
/// • Command-only operations
/// • Block-mode read/write
/// • Byte-mode read/write
/// • Bus configuration (clock, width)
///
/// Everything else (card initialization, SDIO function drivers, block devices)
/// is built on top of this trait.
///
/// Methods should not return until DAT0 goes high if the associated reponse
/// has `BUSY` set to `true`. Implementations may comply with this requirement
/// by polling the card for status until an `Ok` result is received, or by awaiting
/// DAT0 with hardware support.
///