pub type R = crate::R<DRrs>;
pub type W = crate::W<DRrs>;
pub type DU_R = crate::FieldReader;
pub type DU_W<'a, REG> = crate::FieldWriter<'a, REG, 4, u8, crate::Safe>;
pub type DT_R = crate::FieldReader;
pub type DT_W<'a, REG> = crate::FieldWriter<'a, REG, 2, u8, crate::Safe>;
pub type MU_R = crate::FieldReader;
pub type MU_W<'a, REG> = crate::FieldWriter<'a, REG, 4, u8, crate::Safe>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MT {
Zero = 0,
One = 1,
}
impl From<MT> for bool {
#[inline(always)]
fn from(variant: MT) -> Self {
variant as u8 != 0
}
}
pub type MT_R = crate::BitReader<MT>;
impl MT_R {
#[inline(always)]
pub const fn variant(&self) -> MT {
match self.bits {
false => MT::Zero,
true => MT::One,
}
}
#[inline(always)]
pub fn is_zero(&self) -> bool {
*self == MT::Zero
}
#[inline(always)]
pub fn is_one(&self) -> bool {
*self == MT::One
}
}
pub type MT_W<'a, REG> = crate::BitWriter<'a, REG, MT>;
impl<'a, REG> MT_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn zero(self) -> &'a mut crate::W<REG> {
self.variant(MT::Zero)
}
#[inline(always)]
pub fn one(self) -> &'a mut crate::W<REG> {
self.variant(MT::One)
}
}
pub type WDU_R = crate::FieldReader;
pub type WDU_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
pub type YU_R = crate::FieldReader;
pub type YU_W<'a, REG> = crate::FieldWriter<'a, REG, 4, u8, crate::Safe>;
pub type YT_R = crate::FieldReader;
pub type YT_W<'a, REG> = crate::FieldWriter<'a, REG, 4, u8, crate::Safe>;
impl R {
#[inline(always)]
pub fn du(&self) -> DU_R {
DU_R::new((self.bits & 0x0f) as u8)
}
#[inline(always)]
pub fn dt(&self) -> DT_R {
DT_R::new(((self.bits >> 4) & 3) as u8)
}
#[inline(always)]
pub fn mu(&self) -> MU_R {
MU_R::new(((self.bits >> 8) & 0x0f) as u8)
}
#[inline(always)]
pub fn mt(&self) -> MT_R {
MT_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn wdu(&self) -> WDU_R {
WDU_R::new(((self.bits >> 13) & 7) as u8)
}
#[inline(always)]
pub fn yu(&self) -> YU_R {
YU_R::new(((self.bits >> 16) & 0x0f) as u8)
}
#[inline(always)]
pub fn yt(&self) -> YT_R {
YT_R::new(((self.bits >> 20) & 0x0f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("DR")
.field("yt", &self.yt())
.field("yu", &self.yu())
.field("wdu", &self.wdu())
.field("mt", &self.mt())
.field("mu", &self.mu())
.field("dt", &self.dt())
.field("du", &self.du())
.finish()
}
}
impl W {
#[inline(always)]
pub fn du(&mut self) -> DU_W<DRrs> {
DU_W::new(self, 0)
}
#[inline(always)]
pub fn dt(&mut self) -> DT_W<DRrs> {
DT_W::new(self, 4)
}
#[inline(always)]
pub fn mu(&mut self) -> MU_W<DRrs> {
MU_W::new(self, 8)
}
#[inline(always)]
pub fn mt(&mut self) -> MT_W<DRrs> {
MT_W::new(self, 12)
}
#[inline(always)]
pub fn wdu(&mut self) -> WDU_W<DRrs> {
WDU_W::new(self, 13)
}
#[inline(always)]
pub fn yu(&mut self) -> YU_W<DRrs> {
YU_W::new(self, 16)
}
#[inline(always)]
pub fn yt(&mut self) -> YT_W<DRrs> {
YT_W::new(self, 20)
}
}
pub struct DRrs;
impl crate::RegisterSpec for DRrs {
type Ux = u32;
}
impl crate::Readable for DRrs {}
impl crate::Writable for DRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for DRrs {
const RESET_VALUE: u32 = 0x2101;
}