sdmmc-core 0.5.0

SD/MMC core data structures and algorithms
Documentation
use crate::lib_bool_enum;
use crate::result::Result;

lib_bool_enum! {
    /// Represents the `ENHANCED_STROBE` sub-field of the `BUS_WIDTH` field.
    EnhancedStrobe {
        /// Indicates strobe is only supported during `Data Out` and `CRC` response.
        DataOutCrc = false,
        /// Indicates strobe is supported during `Data Out`, `CRC`, and `CMD` response.
        DataOutCrcCmd = true,
    }
}

impl EnhancedStrobe {
    /// Converts an inner representation into a [EnhancedStrobe].
    pub const fn from_inner(val: bool) -> Self {
        Self::from_bool(val)
    }

    /// Attempts to convert an inner representation into a [EnhancedStrobe].
    pub const fn try_from_inner(val: bool) -> Result<Self> {
        Ok(Self::from_bool(val))
    }

    /// Converts a [EnhancedStrobe] into an inner representation.
    pub const fn into_inner(self) -> bool {
        self.into_bool()
    }
}