pub type R = crate::R<CFGRrs>;
pub type W = crate::W<CFGRrs>;
pub type SEL_R = crate::FieldReader;
pub type SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type UNIT_R = crate::FieldReader;
pub type UNIT_W<'a, REG> = crate::FieldWriter<'a, REG, 7>;
pub type LNG_R = crate::FieldReader<u16>;
pub type LNGF_R = crate::BitReader;
impl R {
#[inline(always)]
pub fn sel(&self) -> SEL_R {
SEL_R::new((self.bits & 0x0f) as u8)
}
#[inline(always)]
pub fn unit(&self) -> UNIT_R {
UNIT_R::new(((self.bits >> 8) & 0x7f) as u8)
}
#[inline(always)]
pub fn lng(&self) -> LNG_R {
LNG_R::new(((self.bits >> 16) & 0x0fff) as u16)
}
#[inline(always)]
pub fn lngf(&self) -> LNGF_R {
LNGF_R::new(((self.bits >> 31) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CFGR")
.field("sel", &self.sel())
.field("unit", &self.unit())
.field("lng", &self.lng())
.field("lngf", &self.lngf())
.finish()
}
}
impl W {
#[inline(always)]
pub fn sel(&mut self) -> SEL_W<CFGRrs> {
SEL_W::new(self, 0)
}
#[inline(always)]
pub fn unit(&mut self) -> UNIT_W<CFGRrs> {
UNIT_W::new(self, 8)
}
}
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 {}