use crate::lib_bool_enum;
use crate::result::Result;
lib_bool_enum! {
/// Represents the `READ_BLK_MISALIGN` field of the `CSD` register.
ReadBlockMisalign {
/// Indicates that reads crossing physical block boundaries are not allowed.
Disabled = false,
/// Indicates that reads crossing physical block boundaries are allowed.
Enabled = true,
}
}
impl ReadBlockMisalign {
/// Converts an inner representation into a [ReadBlockMisalign].
pub const fn from_inner(val: bool) -> Self {
Self::from_bool(val)
}
/// Attempts to convert an inner representation into a [ReadBlockMisalign].
pub const fn try_from_inner(val: bool) -> Result<Self> {
Ok(Self::from_bool(val))
}
/// Converts a [ReadBlockMisalign] into an inner representation.
pub const fn into_inner(self) -> bool {
self.into_bool()
}
}