pub type R = crate::R<SDCR2rs>;
pub type W = crate::W<SDCR2rs>;
pub use super::sdcr1::CAS;
pub use super::sdcr1::CAS_R;
pub use super::sdcr1::CAS_W;
pub use super::sdcr1::MWID;
pub use super::sdcr1::MWID_R;
pub use super::sdcr1::MWID_W;
pub use super::sdcr1::NB;
pub use super::sdcr1::NB_R;
pub use super::sdcr1::NB_W;
pub use super::sdcr1::NC;
pub use super::sdcr1::NC_R;
pub use super::sdcr1::NC_W;
pub use super::sdcr1::NR;
pub use super::sdcr1::NR_R;
pub use super::sdcr1::NR_W;
pub use super::sdcr1::SDCLK;
pub use super::sdcr1::SDCLK_R;
pub use super::sdcr1::SDCLK_W;
pub use super::sdcr1::WP;
pub use super::sdcr1::WP_R;
pub use super::sdcr1::WP_W;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RBURST {
Disabled = 0,
Enabled = 1,
}
impl From<RBURST> for bool {
#[inline(always)]
fn from(variant: RBURST) -> Self {
variant as u8 != 0
}
}
pub type RBURST_R = crate::BitReader<RBURST>;
impl RBURST_R {
#[inline(always)]
pub const fn variant(&self) -> RBURST {
match self.bits {
false => RBURST::Disabled,
true => RBURST::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == RBURST::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == RBURST::Enabled
}
}
pub type RBURST_W<'a, REG> = crate::BitWriter<'a, REG, RBURST>;
impl<'a, REG> RBURST_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(RBURST::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(RBURST::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum RPIPE {
NoDelay = 0,
Clocks1 = 1,
Clocks2 = 2,
}
impl From<RPIPE> for u8 {
#[inline(always)]
fn from(variant: RPIPE) -> Self {
variant as _
}
}
impl crate::FieldSpec for RPIPE {
type Ux = u8;
}
impl crate::IsEnum for RPIPE {}
pub type RPIPE_R = crate::FieldReader<RPIPE>;
impl RPIPE_R {
#[inline(always)]
pub const fn variant(&self) -> Option<RPIPE> {
match self.bits {
0 => Some(RPIPE::NoDelay),
1 => Some(RPIPE::Clocks1),
2 => Some(RPIPE::Clocks2),
_ => None,
}
}
#[inline(always)]
pub fn is_no_delay(&self) -> bool {
*self == RPIPE::NoDelay
}
#[inline(always)]
pub fn is_clocks1(&self) -> bool {
*self == RPIPE::Clocks1
}
#[inline(always)]
pub fn is_clocks2(&self) -> bool {
*self == RPIPE::Clocks2
}
}
pub type RPIPE_W<'a, REG> = crate::FieldWriter<'a, REG, 2, RPIPE>;
impl<'a, REG> RPIPE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn no_delay(self) -> &'a mut crate::W<REG> {
self.variant(RPIPE::NoDelay)
}
#[inline(always)]
pub fn clocks1(self) -> &'a mut crate::W<REG> {
self.variant(RPIPE::Clocks1)
}
#[inline(always)]
pub fn clocks2(self) -> &'a mut crate::W<REG> {
self.variant(RPIPE::Clocks2)
}
}
impl R {
#[inline(always)]
pub fn nc(&self) -> NC_R {
NC_R::new((self.bits & 3) as u8)
}
#[inline(always)]
pub fn nr(&self) -> NR_R {
NR_R::new(((self.bits >> 2) & 3) as u8)
}
#[inline(always)]
pub fn mwid(&self) -> MWID_R {
MWID_R::new(((self.bits >> 4) & 3) as u8)
}
#[inline(always)]
pub fn nb(&self) -> NB_R {
NB_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn cas(&self) -> CAS_R {
CAS_R::new(((self.bits >> 7) & 3) as u8)
}
#[inline(always)]
pub fn wp(&self) -> WP_R {
WP_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn sdclk(&self) -> SDCLK_R {
SDCLK_R::new(((self.bits >> 10) & 3) as u8)
}
#[inline(always)]
pub fn rburst(&self) -> RBURST_R {
RBURST_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn rpipe(&self) -> RPIPE_R {
RPIPE_R::new(((self.bits >> 13) & 3) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SDCR2")
.field("nc", &self.nc())
.field("nr", &self.nr())
.field("mwid", &self.mwid())
.field("nb", &self.nb())
.field("cas", &self.cas())
.field("wp", &self.wp())
.field("sdclk", &self.sdclk())
.field("rburst", &self.rburst())
.field("rpipe", &self.rpipe())
.finish()
}
}
impl W {
#[inline(always)]
pub fn nc(&mut self) -> NC_W<SDCR2rs> {
NC_W::new(self, 0)
}
#[inline(always)]
pub fn nr(&mut self) -> NR_W<SDCR2rs> {
NR_W::new(self, 2)
}
#[inline(always)]
pub fn mwid(&mut self) -> MWID_W<SDCR2rs> {
MWID_W::new(self, 4)
}
#[inline(always)]
pub fn nb(&mut self) -> NB_W<SDCR2rs> {
NB_W::new(self, 6)
}
#[inline(always)]
pub fn cas(&mut self) -> CAS_W<SDCR2rs> {
CAS_W::new(self, 7)
}
#[inline(always)]
pub fn wp(&mut self) -> WP_W<SDCR2rs> {
WP_W::new(self, 9)
}
#[inline(always)]
pub fn sdclk(&mut self) -> SDCLK_W<SDCR2rs> {
SDCLK_W::new(self, 10)
}
#[inline(always)]
pub fn rburst(&mut self) -> RBURST_W<SDCR2rs> {
RBURST_W::new(self, 12)
}
#[inline(always)]
pub fn rpipe(&mut self) -> RPIPE_W<SDCR2rs> {
RPIPE_W::new(self, 13)
}
}
pub struct SDCR2rs;
impl crate::RegisterSpec for SDCR2rs {
type Ux = u32;
}
impl crate::Readable for SDCR2rs {}
impl crate::Writable for SDCR2rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for SDCR2rs {
const RESET_VALUE: u32 = 0x02d0;
}