pub type R = crate::R<DATErs>;
pub type W = crate::W<DATErs>;
pub type DayomuR = crate::FieldReader;
pub type DayomuW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type DayomtR = crate::FieldReader;
pub type DayomtW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type MonthuR = crate::FieldReader;
pub type MonthuW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type MonthtR = crate::BitReader;
pub type MonthtW<'a, REG> = crate::BitWriter<'a, REG>;
pub type YearuR = crate::FieldReader;
pub type YearuW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type YeartR = crate::FieldReader;
pub type YeartW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type DayowR = crate::FieldReader;
pub type DayowW<'a, REG> = crate::FieldWriter<'a, REG, 3>;
impl R {
#[inline(always)]
pub fn dayomu(&self) -> DayomuR {
DayomuR::new((self.bits & 0x0f) as u8)
}
#[inline(always)]
pub fn dayomt(&self) -> DayomtR {
DayomtR::new(((self.bits >> 4) & 3) as u8)
}
#[inline(always)]
pub fn monthu(&self) -> MonthuR {
MonthuR::new(((self.bits >> 8) & 0x0f) as u8)
}
#[inline(always)]
pub fn montht(&self) -> MonthtR {
MonthtR::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn yearu(&self) -> YearuR {
YearuR::new(((self.bits >> 16) & 0x0f) as u8)
}
#[inline(always)]
pub fn yeart(&self) -> YeartR {
YeartR::new(((self.bits >> 20) & 0x0f) as u8)
}
#[inline(always)]
pub fn dayow(&self) -> DayowR {
DayowR::new(((self.bits >> 24) & 7) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("DATE")
.field("dayomu", &self.dayomu())
.field("dayomt", &self.dayomt())
.field("monthu", &self.monthu())
.field("montht", &self.montht())
.field("yearu", &self.yearu())
.field("yeart", &self.yeart())
.field("dayow", &self.dayow())
.finish()
}
}
impl W {
#[inline(always)]
pub fn dayomu(&mut self) -> DayomuW<'_, DATErs> {
DayomuW::new(self, 0)
}
#[inline(always)]
pub fn dayomt(&mut self) -> DayomtW<'_, DATErs> {
DayomtW::new(self, 4)
}
#[inline(always)]
pub fn monthu(&mut self) -> MonthuW<'_, DATErs> {
MonthuW::new(self, 8)
}
#[inline(always)]
pub fn montht(&mut self) -> MonthtW<'_, DATErs> {
MonthtW::new(self, 12)
}
#[inline(always)]
pub fn yearu(&mut self) -> YearuW<'_, DATErs> {
YearuW::new(self, 16)
}
#[inline(always)]
pub fn yeart(&mut self) -> YeartW<'_, DATErs> {
YeartW::new(self, 20)
}
#[inline(always)]
pub fn dayow(&mut self) -> DayowW<'_, DATErs> {
DayowW::new(self, 24)
}
}
pub struct DATErs;
impl crate::RegisterSpec for DATErs {
type Ux = u32;
}
impl crate::Readable for DATErs {}
impl crate::Writable for DATErs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for DATErs {}