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 `FLUSH` sub-field of the [FlushCache](super::FlushCache) field.
    Flush {
        /// Represents the reset value of the [Flush] sub-field.
        ResetValue = false,
        /// Triggers a cache flush to nonvolatile memory.
        Trigger = true,
    }
}

impl Flush {
    /// Converts an inner representation into a [Flush].
    pub const fn try_from_inner(val: bool) -> Result<Self> {
        Ok(Self::from_bool(val))
    }

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