pub type R = crate::R<OBKCRrs>;
pub type W = crate::W<OBKCRrs>;
pub type OBKINDEX_R = crate::FieldReader;
pub type OBKINDEX_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
pub type NEXTKL_R = crate::FieldReader;
pub type NEXTKL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type OBKSIZE_R = crate::FieldReader;
pub type OBKSIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type KEYPROG_R = crate::BitReader;
pub type KEYPROG_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type KEYSTART_R = crate::BitReader;
pub type KEYSTART_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn obkindex(&self) -> OBKINDEX_R {
OBKINDEX_R::new((self.bits & 0x1f) as u8)
}
#[inline(always)]
pub fn nextkl(&self) -> NEXTKL_R {
NEXTKL_R::new(((self.bits >> 8) & 3) as u8)
}
#[inline(always)]
pub fn obksize(&self) -> OBKSIZE_R {
OBKSIZE_R::new(((self.bits >> 10) & 3) as u8)
}
#[inline(always)]
pub fn keyprog(&self) -> KEYPROG_R {
KEYPROG_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn keystart(&self) -> KEYSTART_R {
KEYSTART_R::new(((self.bits >> 15) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("OBKCR")
.field("obkindex", &self.obkindex())
.field("nextkl", &self.nextkl())
.field("obksize", &self.obksize())
.field("keyprog", &self.keyprog())
.field("keystart", &self.keystart())
.finish()
}
}
impl W {
#[inline(always)]
pub fn obkindex(&mut self) -> OBKINDEX_W<OBKCRrs> {
OBKINDEX_W::new(self, 0)
}
#[inline(always)]
pub fn nextkl(&mut self) -> NEXTKL_W<OBKCRrs> {
NEXTKL_W::new(self, 8)
}
#[inline(always)]
pub fn obksize(&mut self) -> OBKSIZE_W<OBKCRrs> {
OBKSIZE_W::new(self, 10)
}
#[inline(always)]
pub fn keyprog(&mut self) -> KEYPROG_W<OBKCRrs> {
KEYPROG_W::new(self, 14)
}
#[inline(always)]
pub fn keystart(&mut self) -> KEYSTART_W<OBKCRrs> {
KEYSTART_W::new(self, 15)
}
}
pub struct OBKCRrs;
impl crate::RegisterSpec for OBKCRrs {
type Ux = u32;
}
impl crate::Readable for OBKCRrs {}
impl crate::Writable for OBKCRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for OBKCRrs {
const RESET_VALUE: u32 = 0x0c00;
}