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 ESP32 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.
Definitions
- sdio: A transport protocol that allows streaming data to wifi, bluetooth, and other similar devices.
- sdio card: A device that implements the sdio protocol.
- sd: A protocol that allows reading from and writing to a device blocks of data that are usually 512 bytes in size.
- sd card: A removable card that implements a verison of the sd protocol.
- emmc card: A fixed card that implements a version of the sd protocol.
An embassy project
This crate is part of the embassy project, designed to improve cross-platform support for native SD/SDIO host
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.
///
/// If hardware support is available, methods should not return until DAT0 goes high
/// if the associated reponse has `BUSY` set to `true`.