pub type R = crate::R<OTP_CONFIGrs>;
pub type W = crate::W<OTP_CONFIGrs>;
pub type PWRUP_R = crate::BitReader;
pub type PWRUP_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type FRC_R = crate::FieldReader;
pub type FRC_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type PRGWIDTH_R = crate::FieldReader;
pub type PRGWIDTH_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type TREAD_R = crate::FieldReader;
pub type TREAD_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
impl R {
#[inline(always)]
pub fn pwrup(&self) -> PWRUP_R {
PWRUP_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn frc(&self) -> FRC_R {
FRC_R::new(((self.bits >> 1) & 3) as u8)
}
#[inline(always)]
pub fn prgwidth(&self) -> PRGWIDTH_R {
PRGWIDTH_R::new(((self.bits >> 3) & 0x0f) as u8)
}
#[inline(always)]
pub fn tread(&self) -> TREAD_R {
TREAD_R::new(((self.bits >> 7) & 3) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("OTP_CONFIG")
.field("pwrup", &self.pwrup())
.field("frc", &self.frc())
.field("prgwidth", &self.prgwidth())
.field("tread", &self.tread())
.finish()
}
}
impl W {
#[inline(always)]
pub fn pwrup(&mut self) -> PWRUP_W<OTP_CONFIGrs> {
PWRUP_W::new(self, 0)
}
#[inline(always)]
pub fn frc(&mut self) -> FRC_W<OTP_CONFIGrs> {
FRC_W::new(self, 1)
}
#[inline(always)]
pub fn prgwidth(&mut self) -> PRGWIDTH_W<OTP_CONFIGrs> {
PRGWIDTH_W::new(self, 3)
}
#[inline(always)]
pub fn tread(&mut self) -> TREAD_W<OTP_CONFIGrs> {
TREAD_W::new(self, 7)
}
}
pub struct OTP_CONFIGrs;
impl crate::RegisterSpec for OTP_CONFIGrs {
type Ux = u32;
}
impl crate::Readable for OTP_CONFIGrs {}
impl crate::Writable for OTP_CONFIGrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for OTP_CONFIGrs {
const RESET_VALUE: u32 = 0x0e;
}