pub type R = crate::R<OPTCRrs>;
pub type W = crate::W<OPTCRrs>;
pub type OPTLOCK_R = crate::BitReader;
pub type OPTLOCK_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type OPTSTART_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type MER_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type PG_OTP_R = crate::BitReader;
pub type PG_OTP_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type OPTCHANGEERRIE_R = crate::BitReader;
pub type OPTCHANGEERRIE_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type SWAP_BANK_R = crate::BitReader;
impl R {
#[inline(always)]
pub fn optlock(&self) -> OPTLOCK_R {
OPTLOCK_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn pg_otp(&self) -> PG_OTP_R {
PG_OTP_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn optchangeerrie(&self) -> OPTCHANGEERRIE_R {
OPTCHANGEERRIE_R::new(((self.bits >> 30) & 1) != 0)
}
#[inline(always)]
pub fn swap_bank(&self) -> SWAP_BANK_R {
SWAP_BANK_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("OPTCR")
.field("optlock", &self.optlock())
.field("pg_otp", &self.pg_otp())
.field("optchangeerrie", &self.optchangeerrie())
.field("swap_bank", &self.swap_bank())
.finish()
}
}
impl W {
#[inline(always)]
pub fn optlock(&mut self) -> OPTLOCK_W<OPTCRrs> {
OPTLOCK_W::new(self, 0)
}
#[inline(always)]
pub fn optstart(&mut self) -> OPTSTART_W<OPTCRrs> {
OPTSTART_W::new(self, 1)
}
#[inline(always)]
pub fn mer(&mut self) -> MER_W<OPTCRrs> {
MER_W::new(self, 4)
}
#[inline(always)]
pub fn pg_otp(&mut self) -> PG_OTP_W<OPTCRrs> {
PG_OTP_W::new(self, 5)
}
#[inline(always)]
pub fn optchangeerrie(&mut self) -> OPTCHANGEERRIE_W<OPTCRrs> {
OPTCHANGEERRIE_W::new(self, 30)
}
}
pub struct OPTCRrs;
impl crate::RegisterSpec for OPTCRrs {
type Ux = u32;
}
impl crate::Readable for OPTCRrs {}
impl crate::Writable for OPTCRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for OPTCRrs {
const RESET_VALUE: u32 = 0x01;
}