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 `FILE_FORMAT_GRP` field of the `CSD` register.
    FileFormatGroup {
        /// Indicates that the `FILE_FORMAT` field values are defined by `FILE_FORMAT`.
        FileFormat = false,
        /// Indicates that the `FILE_FORMAT` field values are reserved for future use.
        Reserved = true,
    }
}

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

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

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