use crate::lib_bool_enum;
use crate::result::Result;
lib_bool_enum! {
/// Represents the `READ_BL_PARTIAL` field of the `CSD` register.
EraseBlockEnable {
/// Indicates that the host can erase units of `SECTOR_SIZE`.
Disabled = false,
/// Indicates that the host can erase units of `512` bytes.
Enabled = true,
}
}
impl EraseBlockEnable {
/// Converts an inner representation into a [EraseBlockEnable].
pub const fn from_inner(val: bool) -> Self {
Self::from_bool(val)
}
/// Attempts to convert an inner representation into a [EraseBlockEnable].
pub const fn try_from_inner(val: bool) -> Result<Self> {
Ok(Self::from_bool(val))
}
/// Converts a [EraseBlockEnable] into an inner representation.
pub const fn into_inner(self) -> bool {
self.into_bool()
}
}