pub type R = crate::R<CFGRrs>;
pub type W = crate::W<CFGRrs>;
pub type SW_R = crate::FieldReader;
pub type SW_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type SWS_R = crate::FieldReader;
pub type HPRE_R = crate::FieldReader;
pub type HPRE_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type PPRE1_R = crate::FieldReader;
pub type PPRE1_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
pub type PPRE2_R = crate::FieldReader;
pub type PPRE2_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
pub type STOPWUCK_R = crate::BitReader;
pub type STOPWUCK_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type MCOSEL_R = crate::FieldReader;
pub type MCOSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
pub type MCOPRE_R = crate::FieldReader;
impl R {
#[inline(always)]
pub fn sw(&self) -> SW_R {
SW_R::new((self.bits & 3) as u8)
}
#[inline(always)]
pub fn sws(&self) -> SWS_R {
SWS_R::new(((self.bits >> 2) & 3) as u8)
}
#[inline(always)]
pub fn hpre(&self) -> HPRE_R {
HPRE_R::new(((self.bits >> 4) & 0x0f) as u8)
}
#[inline(always)]
pub fn ppre1(&self) -> PPRE1_R {
PPRE1_R::new(((self.bits >> 8) & 7) as u8)
}
#[inline(always)]
pub fn ppre2(&self) -> PPRE2_R {
PPRE2_R::new(((self.bits >> 11) & 7) as u8)
}
#[inline(always)]
pub fn stopwuck(&self) -> STOPWUCK_R {
STOPWUCK_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn mcosel(&self) -> MCOSEL_R {
MCOSEL_R::new(((self.bits >> 24) & 7) as u8)
}
#[inline(always)]
pub fn mcopre(&self) -> MCOPRE_R {
MCOPRE_R::new(((self.bits >> 28) & 7) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CFGR")
.field("mcopre", &self.mcopre())
.field("mcosel", &self.mcosel())
.field("stopwuck", &self.stopwuck())
.field("ppre2", &self.ppre2())
.field("ppre1", &self.ppre1())
.field("hpre", &self.hpre())
.field("sws", &self.sws())
.field("sw", &self.sw())
.finish()
}
}
impl W {
#[inline(always)]
pub fn sw(&mut self) -> SW_W<CFGRrs> {
SW_W::new(self, 0)
}
#[inline(always)]
pub fn hpre(&mut self) -> HPRE_W<CFGRrs> {
HPRE_W::new(self, 4)
}
#[inline(always)]
pub fn ppre1(&mut self) -> PPRE1_W<CFGRrs> {
PPRE1_W::new(self, 8)
}
#[inline(always)]
pub fn ppre2(&mut self) -> PPRE2_W<CFGRrs> {
PPRE2_W::new(self, 11)
}
#[inline(always)]
pub fn stopwuck(&mut self) -> STOPWUCK_W<CFGRrs> {
STOPWUCK_W::new(self, 15)
}
#[inline(always)]
pub fn mcosel(&mut self) -> MCOSEL_W<CFGRrs> {
MCOSEL_W::new(self, 24)
}
}
pub struct CFGRrs;
impl crate::RegisterSpec for CFGRrs {
type Ux = u32;
}
impl crate::Readable for CFGRrs {}
impl crate::Writable for CFGRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CFGRrs {}