pub type R = crate::R<SDRTRrs>;
pub type W = crate::W<SDRTRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CRE {
Clear = 1,
}
impl From<CRE> for bool {
#[inline(always)]
fn from(variant: CRE) -> Self {
variant as u8 != 0
}
}
pub type CRE_W<'a, REG> = crate::BitWriter<'a, REG, CRE>;
impl<'a, REG> CRE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(CRE::Clear)
}
}
pub type COUNT_R = crate::FieldReader<u16>;
pub type COUNT_W<'a, REG> = crate::FieldWriter<'a, REG, 13, u16, crate::Safe>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum REIE {
Disabled = 0,
Enabled = 1,
}
impl From<REIE> for bool {
#[inline(always)]
fn from(variant: REIE) -> Self {
variant as u8 != 0
}
}
pub type REIE_R = crate::BitReader<REIE>;
impl REIE_R {
#[inline(always)]
pub const fn variant(&self) -> REIE {
match self.bits {
false => REIE::Disabled,
true => REIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == REIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == REIE::Enabled
}
}
pub type REIE_W<'a, REG> = crate::BitWriter<'a, REG, REIE>;
impl<'a, REG> REIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(REIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(REIE::Enabled)
}
}
impl R {
#[inline(always)]
pub fn count(&self) -> COUNT_R {
COUNT_R::new(((self.bits >> 1) & 0x1fff) as u16)
}
#[inline(always)]
pub fn reie(&self) -> REIE_R {
REIE_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("SDRTR")
.field("count", &self.count())
.field("reie", &self.reie())
.finish()
}
}
impl W {
#[inline(always)]
pub fn cre(&mut self) -> CRE_W<SDRTRrs> {
CRE_W::new(self, 0)
}
#[inline(always)]
pub fn count(&mut self) -> COUNT_W<SDRTRrs> {
COUNT_W::new(self, 1)
}
#[inline(always)]
pub fn reie(&mut self) -> REIE_W<SDRTRrs> {
REIE_W::new(self, 14)
}
}
pub struct SDRTRrs;
impl crate::RegisterSpec for SDRTRrs {
type Ux = u32;
}
impl crate::Readable for SDRTRrs {}
impl crate::Writable for SDRTRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for SDRTRrs {}