pub type R = crate::R<CRELrs>;
pub type W = crate::W<CRELrs>;
pub type DAY_R = crate::FieldReader;
pub type DAY_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
pub type MON_R = crate::FieldReader;
pub type MON_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
pub type YEAR_R = crate::FieldReader;
pub type YEAR_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type SUBSTEP_R = crate::FieldReader;
pub type SUBSTEP_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type STEP_R = crate::FieldReader;
pub type STEP_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type REL_R = crate::FieldReader;
pub type REL_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
impl R {
#[inline(always)]
pub fn day(&self) -> DAY_R {
DAY_R::new((self.bits & 0xff) as u8)
}
#[inline(always)]
pub fn mon(&self) -> MON_R {
MON_R::new(((self.bits >> 8) & 0xff) as u8)
}
#[inline(always)]
pub fn year(&self) -> YEAR_R {
YEAR_R::new(((self.bits >> 16) & 0x0f) as u8)
}
#[inline(always)]
pub fn substep(&self) -> SUBSTEP_R {
SUBSTEP_R::new(((self.bits >> 20) & 0x0f) as u8)
}
#[inline(always)]
pub fn step(&self) -> STEP_R {
STEP_R::new(((self.bits >> 24) & 0x0f) as u8)
}
#[inline(always)]
pub fn rel(&self) -> REL_R {
REL_R::new(((self.bits >> 28) & 0x0f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CREL")
.field("day", &self.day())
.field("mon", &self.mon())
.field("year", &self.year())
.field("substep", &self.substep())
.field("step", &self.step())
.field("rel", &self.rel())
.finish()
}
}
impl W {
#[inline(always)]
pub fn day(&mut self) -> DAY_W<CRELrs> {
DAY_W::new(self, 0)
}
#[inline(always)]
pub fn mon(&mut self) -> MON_W<CRELrs> {
MON_W::new(self, 8)
}
#[inline(always)]
pub fn year(&mut self) -> YEAR_W<CRELrs> {
YEAR_W::new(self, 16)
}
#[inline(always)]
pub fn substep(&mut self) -> SUBSTEP_W<CRELrs> {
SUBSTEP_W::new(self, 20)
}
#[inline(always)]
pub fn step(&mut self) -> STEP_W<CRELrs> {
STEP_W::new(self, 24)
}
#[inline(always)]
pub fn rel(&mut self) -> REL_W<CRELrs> {
REL_W::new(self, 28)
}
}
pub struct CRELrs;
impl crate::RegisterSpec for CRELrs {
type Ux = u32;
}
impl crate::Readable for CRELrs {}
impl crate::Writable for CRELrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CRELrs {}