use crate::result::{Error, Result};
use crate::{lib_bitfield, lib_enum};
lib_enum! {
/// Represents the selection variants for the `EXT_CSD` command set.
MmcCommandSet: u8 {
default: StandardMmc,
error: Error,
/// Selects the Standard MMC command set.
StandardMmc = 0,
/// Selects the MMCA allocated command set 1.
Mmca1 = 1,
/// Selects the MMCA allocated command set 2.
Mmca2 = 2,
/// Selects the MMCA allocated command set 3.
Mmca3 = 3,
/// Selects the MMCA allocated command set 4.
Mmca4 = 4,
}
}
impl MmcCommandSet {
/// Attempts to convert an inner representation into a [MmcCommandSet].
pub const fn try_from_inner(val: u8) -> Result<Self> {
Self::from_raw(val)
}
/// Converts a [MmcCommandSet] into an inner representation.
pub const fn into_inner(self) -> u8 {
self.into_raw()
}
}