sdmmc-core 0.5.0

SD/MMC core data structures and algorithms
Documentation
use crate::lib_bool_enum;

use super::{ExtCsd, ExtCsdIndex};

lib_bool_enum! {
    /// Represents the `CMDQ_MODE_EN` field in the [ExtCsd] register.
    CommandQueueModeEnable {
        /// Command queueing is disabled.
        Disabled = false,
        /// Command queueing is enabled.
        Enabled = true,
    }
}

impl ExtCsd {
    /// Gets the `CMDQ_MODE_EN` field in the [ExtCsd] register.
    pub const fn cmdq_mode_en(&self) -> CommandQueueModeEnable {
        CommandQueueModeEnable::from_bool((self.0[ExtCsdIndex::CmdqModeEn.into_inner()] & 0b1) != 0)
    }

    /// Sets the `CMDQ_MODE_EN` field in the [ExtCsd] register.
    pub fn set_cmdq_mode_en(&mut self, val: CommandQueueModeEnable) {
        self.0[ExtCsdIndex::CmdqModeEn.into_inner()] = val.into();
    }
}