sdmmc-core 0.5.0

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

lib_bool_enum! {
    /// Represents the `BOOT_ACK` sub-field of the `PARTITION_CONFIG` field.
    BootAck {
        /// Indicates no boot acknowledge sent.
        Nack = false,
        /// Indicates boot acknowledge sent during boot.
        Ack = true,
    }
}

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

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

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