pub type R = crate::R<R1CFGRrs>;
pub type W = crate::W<R1CFGRrs>;
pub type REG_EN_R = crate::BitReader;
pub type REG_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type CONFIGLOCK_R = crate::BitReader;
pub type CONFIGLOCK_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type KEYLOCK_R = crate::BitReader;
pub type KEYLOCK_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type MODE_R = crate::FieldReader;
pub type MODE_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type KEYCRC_R = crate::FieldReader;
pub type REGX_VERSION_R = crate::FieldReader<u16>;
pub type REGX_VERSION_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
impl R {
#[inline(always)]
pub fn reg_en(&self) -> REG_EN_R {
REG_EN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn configlock(&self) -> CONFIGLOCK_R {
CONFIGLOCK_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn keylock(&self) -> KEYLOCK_R {
KEYLOCK_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn mode(&self) -> MODE_R {
MODE_R::new(((self.bits >> 4) & 3) as u8)
}
#[inline(always)]
pub fn keycrc(&self) -> KEYCRC_R {
KEYCRC_R::new(((self.bits >> 8) & 0xff) as u8)
}
#[inline(always)]
pub fn regx_version(&self) -> REGX_VERSION_R {
REGX_VERSION_R::new(((self.bits >> 16) & 0xffff) as u16)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("R1CFGR")
.field("reg_en", &self.reg_en())
.field("configlock", &self.configlock())
.field("keylock", &self.keylock())
.field("mode", &self.mode())
.field("keycrc", &self.keycrc())
.field("regx_version", &self.regx_version())
.finish()
}
}
impl W {
#[inline(always)]
pub fn reg_en(&mut self) -> REG_EN_W<R1CFGRrs> {
REG_EN_W::new(self, 0)
}
#[inline(always)]
pub fn configlock(&mut self) -> CONFIGLOCK_W<R1CFGRrs> {
CONFIGLOCK_W::new(self, 1)
}
#[inline(always)]
pub fn keylock(&mut self) -> KEYLOCK_W<R1CFGRrs> {
KEYLOCK_W::new(self, 2)
}
#[inline(always)]
pub fn mode(&mut self) -> MODE_W<R1CFGRrs> {
MODE_W::new(self, 4)
}
#[inline(always)]
pub fn regx_version(&mut self) -> REGX_VERSION_W<R1CFGRrs> {
REGX_VERSION_W::new(self, 16)
}
}
pub struct R1CFGRrs;
impl crate::RegisterSpec for R1CFGRrs {
type Ux = u32;
}
impl crate::Readable for R1CFGRrs {}
impl crate::Writable for R1CFGRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for R1CFGRrs {}