pub type R = crate::R<CMDrs>;
pub type W = crate::W<CMDrs>;
pub type CMDINDEX_R = crate::FieldReader;
pub type CMDINDEX_W<'a, REG> = crate::FieldWriter<'a, REG, 6, u8, crate::Safe>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum WAITRESP {
NoResponse = 0,
ShortResponse = 1,
NoResponse2 = 2,
LongResponse = 3,
}
impl From<WAITRESP> for u8 {
#[inline(always)]
fn from(variant: WAITRESP) -> Self {
variant as _
}
}
impl crate::FieldSpec for WAITRESP {
type Ux = u8;
}
impl crate::IsEnum for WAITRESP {}
pub type WAITRESP_R = crate::FieldReader<WAITRESP>;
impl WAITRESP_R {
#[inline(always)]
pub const fn variant(&self) -> WAITRESP {
match self.bits {
0 => WAITRESP::NoResponse,
1 => WAITRESP::ShortResponse,
2 => WAITRESP::NoResponse2,
3 => WAITRESP::LongResponse,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_no_response(&self) -> bool {
*self == WAITRESP::NoResponse
}
#[inline(always)]
pub fn is_short_response(&self) -> bool {
*self == WAITRESP::ShortResponse
}
#[inline(always)]
pub fn is_no_response2(&self) -> bool {
*self == WAITRESP::NoResponse2
}
#[inline(always)]
pub fn is_long_response(&self) -> bool {
*self == WAITRESP::LongResponse
}
}
pub type WAITRESP_W<'a, REG> = crate::FieldWriter<'a, REG, 2, WAITRESP, crate::Safe>;
impl<'a, REG> WAITRESP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn no_response(self) -> &'a mut crate::W<REG> {
self.variant(WAITRESP::NoResponse)
}
#[inline(always)]
pub fn short_response(self) -> &'a mut crate::W<REG> {
self.variant(WAITRESP::ShortResponse)
}
#[inline(always)]
pub fn no_response2(self) -> &'a mut crate::W<REG> {
self.variant(WAITRESP::NoResponse2)
}
#[inline(always)]
pub fn long_response(self) -> &'a mut crate::W<REG> {
self.variant(WAITRESP::LongResponse)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WAITINT {
Disabled = 0,
Enabled = 1,
}
impl From<WAITINT> for bool {
#[inline(always)]
fn from(variant: WAITINT) -> Self {
variant as u8 != 0
}
}
pub type WAITINT_R = crate::BitReader<WAITINT>;
impl WAITINT_R {
#[inline(always)]
pub const fn variant(&self) -> WAITINT {
match self.bits {
false => WAITINT::Disabled,
true => WAITINT::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == WAITINT::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == WAITINT::Enabled
}
}
pub type WAITINT_W<'a, REG> = crate::BitWriter<'a, REG, WAITINT>;
impl<'a, REG> WAITINT_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(WAITINT::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(WAITINT::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WAITPEND {
Disabled = 0,
Enabled = 1,
}
impl From<WAITPEND> for bool {
#[inline(always)]
fn from(variant: WAITPEND) -> Self {
variant as u8 != 0
}
}
pub type WAITPEND_R = crate::BitReader<WAITPEND>;
impl WAITPEND_R {
#[inline(always)]
pub const fn variant(&self) -> WAITPEND {
match self.bits {
false => WAITPEND::Disabled,
true => WAITPEND::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == WAITPEND::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == WAITPEND::Enabled
}
}
pub type WAITPEND_W<'a, REG> = crate::BitWriter<'a, REG, WAITPEND>;
impl<'a, REG> WAITPEND_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(WAITPEND::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(WAITPEND::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CPSMEN {
Disabled = 0,
Enabled = 1,
}
impl From<CPSMEN> for bool {
#[inline(always)]
fn from(variant: CPSMEN) -> Self {
variant as u8 != 0
}
}
pub type CPSMEN_R = crate::BitReader<CPSMEN>;
impl CPSMEN_R {
#[inline(always)]
pub const fn variant(&self) -> CPSMEN {
match self.bits {
false => CPSMEN::Disabled,
true => CPSMEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CPSMEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CPSMEN::Enabled
}
}
pub type CPSMEN_W<'a, REG> = crate::BitWriter<'a, REG, CPSMEN>;
impl<'a, REG> CPSMEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CPSMEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(CPSMEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SDIOSUSPEND {
Disabled = 0,
Enabled = 1,
}
impl From<SDIOSUSPEND> for bool {
#[inline(always)]
fn from(variant: SDIOSUSPEND) -> Self {
variant as u8 != 0
}
}
pub type SDIOSUSPEND_R = crate::BitReader<SDIOSUSPEND>;
impl SDIOSUSPEND_R {
#[inline(always)]
pub const fn variant(&self) -> SDIOSUSPEND {
match self.bits {
false => SDIOSUSPEND::Disabled,
true => SDIOSUSPEND::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SDIOSUSPEND::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SDIOSUSPEND::Enabled
}
}
pub type SDIOSUSPEND_W<'a, REG> = crate::BitWriter<'a, REG, SDIOSUSPEND>;
impl<'a, REG> SDIOSUSPEND_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(SDIOSUSPEND::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(SDIOSUSPEND::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ENCMDCOMPL {
Disabled = 0,
Enabled = 1,
}
impl From<ENCMDCOMPL> for bool {
#[inline(always)]
fn from(variant: ENCMDCOMPL) -> Self {
variant as u8 != 0
}
}
pub type ENCMDCOMPL_R = crate::BitReader<ENCMDCOMPL>;
impl ENCMDCOMPL_R {
#[inline(always)]
pub const fn variant(&self) -> ENCMDCOMPL {
match self.bits {
false => ENCMDCOMPL::Disabled,
true => ENCMDCOMPL::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ENCMDCOMPL::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ENCMDCOMPL::Enabled
}
}
pub type ENCMDCOMPL_W<'a, REG> = crate::BitWriter<'a, REG, ENCMDCOMPL>;
impl<'a, REG> ENCMDCOMPL_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(ENCMDCOMPL::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(ENCMDCOMPL::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum N_IEN {
Disabled = 0,
Enabled = 1,
}
impl From<N_IEN> for bool {
#[inline(always)]
fn from(variant: N_IEN) -> Self {
variant as u8 != 0
}
}
pub type N_IEN_R = crate::BitReader<N_IEN>;
impl N_IEN_R {
#[inline(always)]
pub const fn variant(&self) -> N_IEN {
match self.bits {
false => N_IEN::Disabled,
true => N_IEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == N_IEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == N_IEN::Enabled
}
}
pub type N_IEN_W<'a, REG> = crate::BitWriter<'a, REG, N_IEN>;
impl<'a, REG> N_IEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(N_IEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(N_IEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CE_ATACMD {
Disabled = 0,
Enabled = 1,
}
impl From<CE_ATACMD> for bool {
#[inline(always)]
fn from(variant: CE_ATACMD) -> Self {
variant as u8 != 0
}
}
pub type CE_ATACMD_R = crate::BitReader<CE_ATACMD>;
impl CE_ATACMD_R {
#[inline(always)]
pub const fn variant(&self) -> CE_ATACMD {
match self.bits {
false => CE_ATACMD::Disabled,
true => CE_ATACMD::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CE_ATACMD::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CE_ATACMD::Enabled
}
}
pub type CE_ATACMD_W<'a, REG> = crate::BitWriter<'a, REG, CE_ATACMD>;
impl<'a, REG> CE_ATACMD_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CE_ATACMD::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(CE_ATACMD::Enabled)
}
}
impl R {
#[inline(always)]
pub fn cmdindex(&self) -> CMDINDEX_R {
CMDINDEX_R::new((self.bits & 0x3f) as u8)
}
#[inline(always)]
pub fn waitresp(&self) -> WAITRESP_R {
WAITRESP_R::new(((self.bits >> 6) & 3) as u8)
}
#[inline(always)]
pub fn waitint(&self) -> WAITINT_R {
WAITINT_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn waitpend(&self) -> WAITPEND_R {
WAITPEND_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn cpsmen(&self) -> CPSMEN_R {
CPSMEN_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn sdiosuspend(&self) -> SDIOSUSPEND_R {
SDIOSUSPEND_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn encmdcompl(&self) -> ENCMDCOMPL_R {
ENCMDCOMPL_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn n_ien(&self) -> N_IEN_R {
N_IEN_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn ce_atacmd(&self) -> CE_ATACMD_R {
CE_ATACMD_R::new(((self.bits >> 14) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CMD")
.field("ce_atacmd", &self.ce_atacmd())
.field("n_ien", &self.n_ien())
.field("encmdcompl", &self.encmdcompl())
.field("sdiosuspend", &self.sdiosuspend())
.field("cpsmen", &self.cpsmen())
.field("waitpend", &self.waitpend())
.field("waitint", &self.waitint())
.field("waitresp", &self.waitresp())
.field("cmdindex", &self.cmdindex())
.finish()
}
}
impl W {
#[inline(always)]
#[must_use]
pub fn cmdindex(&mut self) -> CMDINDEX_W<CMDrs> {
CMDINDEX_W::new(self, 0)
}
#[inline(always)]
#[must_use]
pub fn waitresp(&mut self) -> WAITRESP_W<CMDrs> {
WAITRESP_W::new(self, 6)
}
#[inline(always)]
#[must_use]
pub fn waitint(&mut self) -> WAITINT_W<CMDrs> {
WAITINT_W::new(self, 8)
}
#[inline(always)]
#[must_use]
pub fn waitpend(&mut self) -> WAITPEND_W<CMDrs> {
WAITPEND_W::new(self, 9)
}
#[inline(always)]
#[must_use]
pub fn cpsmen(&mut self) -> CPSMEN_W<CMDrs> {
CPSMEN_W::new(self, 10)
}
#[inline(always)]
#[must_use]
pub fn sdiosuspend(&mut self) -> SDIOSUSPEND_W<CMDrs> {
SDIOSUSPEND_W::new(self, 11)
}
#[inline(always)]
#[must_use]
pub fn encmdcompl(&mut self) -> ENCMDCOMPL_W<CMDrs> {
ENCMDCOMPL_W::new(self, 12)
}
#[inline(always)]
#[must_use]
pub fn n_ien(&mut self) -> N_IEN_W<CMDrs> {
N_IEN_W::new(self, 13)
}
#[inline(always)]
#[must_use]
pub fn ce_atacmd(&mut self) -> CE_ATACMD_W<CMDrs> {
CE_ATACMD_W::new(self, 14)
}
}
pub struct CMDrs;
impl crate::RegisterSpec for CMDrs {
type Ux = u32;
}
impl crate::Readable for CMDrs {}
impl crate::Writable for CMDrs {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
impl crate::Resettable for CMDrs {
const RESET_VALUE: u32 = 0;
}