embedded-hal-sdmmc 0.1.0-alpha.3

A Hardware Abstraction Layer (HAL) for embedded SD/SDIO/eMMC peripherals
Documentation
/// Represents the variants of the `bus width` configuration for the SD/MMC peripheral.
#[repr(u8)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum SdBusWidth {
    /// Represents the selection of a SD 1-bit bus width.
    _1bit = 0b00,
    /// Represents the selection of a SD 4-bit bus width.
    _4bit = 0b10,
}

impl SdBusWidth {
    /// Creates a new [SdBusWidth].
    pub const fn new() -> Self {
        Self::_1bit
    }
}

impl Default for SdBusWidth {
    fn default() -> Self {
        Self::new()
    }
}

/// Represents the variants of the `bus width` configuration for the MMC peripheral.
#[repr(u8)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum MmcBusWidth {
    /// Represents the selection of a MMC 4-bit bus width.
    Sdr1bit = 0b0000,
    /// Represents the selection of a MMC 4-bit bus width.
    Sdr4bit = 0b0001,
    /// Represents the selection of a MMC 8-bit bus width.
    Sdr8bit = 0b0010,
    /// Represents the selection of a SD 4-bit bus width.
    Ddr4bit = 0b0101,
    /// Represents the selection of a MMC 8-bit bus width.
    Ddr8bit = 0b0110,
}

impl MmcBusWidth {
    /// Creates a new [MmcBusWidth].
    pub const fn new() -> Self {
        Self::Sdr1bit
    }
}

impl Default for MmcBusWidth {
    fn default() -> Self {
        Self::new()
    }
}