pub type R = crate::R<OPTRrs>;
pub type W = crate::W<OPTRrs>;
pub type RDP_R = crate::FieldReader;
pub type RDP_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
pub type BOR_LEV_R = crate::FieldReader;
pub type BOR_LEV_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
pub type N_RST_STOP_R = crate::BitReader;
pub type N_RST_STOP_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type N_RST_STDBY_R = crate::BitReader;
pub type N_RST_STDBY_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type IDWG_SW_R = crate::BitReader;
pub type IDWG_SW_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type IWDG_STOP_R = crate::BitReader;
pub type IWDG_STOP_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type IWDG_STDBY_R = crate::BitReader;
pub type IWDG_STDBY_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type WWDG_SW_R = crate::BitReader;
pub type WWDG_SW_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type BFB2_R = crate::BitReader;
pub type BFB2_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type DUALBANK_R = crate::BitReader;
pub type DUALBANK_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type N_BOOT1_R = crate::BitReader;
pub type N_BOOT1_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type SRAM2_PE_R = crate::BitReader;
pub type SRAM2_PE_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type SRAM2_RST_R = crate::BitReader;
pub type SRAM2_RST_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type N_SWBOOT0_R = crate::BitReader;
pub type N_SWBOOT0_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type N_BOOT0_R = crate::BitReader;
pub type N_BOOT0_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn rdp(&self) -> RDP_R {
RDP_R::new((self.bits & 0xff) as u8)
}
#[inline(always)]
pub fn bor_lev(&self) -> BOR_LEV_R {
BOR_LEV_R::new(((self.bits >> 8) & 7) as u8)
}
#[inline(always)]
pub fn n_rst_stop(&self) -> N_RST_STOP_R {
N_RST_STOP_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn n_rst_stdby(&self) -> N_RST_STDBY_R {
N_RST_STDBY_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn idwg_sw(&self) -> IDWG_SW_R {
IDWG_SW_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn iwdg_stop(&self) -> IWDG_STOP_R {
IWDG_STOP_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn iwdg_stdby(&self) -> IWDG_STDBY_R {
IWDG_STDBY_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn wwdg_sw(&self) -> WWDG_SW_R {
WWDG_SW_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn bfb2(&self) -> BFB2_R {
BFB2_R::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn dualbank(&self) -> DUALBANK_R {
DUALBANK_R::new(((self.bits >> 21) & 1) != 0)
}
#[inline(always)]
pub fn n_boot1(&self) -> N_BOOT1_R {
N_BOOT1_R::new(((self.bits >> 23) & 1) != 0)
}
#[inline(always)]
pub fn sram2_pe(&self) -> SRAM2_PE_R {
SRAM2_PE_R::new(((self.bits >> 24) & 1) != 0)
}
#[inline(always)]
pub fn sram2_rst(&self) -> SRAM2_RST_R {
SRAM2_RST_R::new(((self.bits >> 25) & 1) != 0)
}
#[inline(always)]
pub fn n_swboot0(&self) -> N_SWBOOT0_R {
N_SWBOOT0_R::new(((self.bits >> 26) & 1) != 0)
}
#[inline(always)]
pub fn n_boot0(&self) -> N_BOOT0_R {
N_BOOT0_R::new(((self.bits >> 27) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("OPTR")
.field("rdp", &self.rdp())
.field("bor_lev", &self.bor_lev())
.field("n_rst_stop", &self.n_rst_stop())
.field("n_rst_stdby", &self.n_rst_stdby())
.field("idwg_sw", &self.idwg_sw())
.field("iwdg_stop", &self.iwdg_stop())
.field("iwdg_stdby", &self.iwdg_stdby())
.field("wwdg_sw", &self.wwdg_sw())
.field("bfb2", &self.bfb2())
.field("dualbank", &self.dualbank())
.field("n_boot1", &self.n_boot1())
.field("sram2_pe", &self.sram2_pe())
.field("sram2_rst", &self.sram2_rst())
.field("n_swboot0", &self.n_swboot0())
.field("n_boot0", &self.n_boot0())
.finish()
}
}
impl W {
#[inline(always)]
pub fn rdp(&mut self) -> RDP_W<OPTRrs> {
RDP_W::new(self, 0)
}
#[inline(always)]
pub fn bor_lev(&mut self) -> BOR_LEV_W<OPTRrs> {
BOR_LEV_W::new(self, 8)
}
#[inline(always)]
pub fn n_rst_stop(&mut self) -> N_RST_STOP_W<OPTRrs> {
N_RST_STOP_W::new(self, 12)
}
#[inline(always)]
pub fn n_rst_stdby(&mut self) -> N_RST_STDBY_W<OPTRrs> {
N_RST_STDBY_W::new(self, 13)
}
#[inline(always)]
pub fn idwg_sw(&mut self) -> IDWG_SW_W<OPTRrs> {
IDWG_SW_W::new(self, 16)
}
#[inline(always)]
pub fn iwdg_stop(&mut self) -> IWDG_STOP_W<OPTRrs> {
IWDG_STOP_W::new(self, 17)
}
#[inline(always)]
pub fn iwdg_stdby(&mut self) -> IWDG_STDBY_W<OPTRrs> {
IWDG_STDBY_W::new(self, 18)
}
#[inline(always)]
pub fn wwdg_sw(&mut self) -> WWDG_SW_W<OPTRrs> {
WWDG_SW_W::new(self, 19)
}
#[inline(always)]
pub fn bfb2(&mut self) -> BFB2_W<OPTRrs> {
BFB2_W::new(self, 20)
}
#[inline(always)]
pub fn dualbank(&mut self) -> DUALBANK_W<OPTRrs> {
DUALBANK_W::new(self, 21)
}
#[inline(always)]
pub fn n_boot1(&mut self) -> N_BOOT1_W<OPTRrs> {
N_BOOT1_W::new(self, 23)
}
#[inline(always)]
pub fn sram2_pe(&mut self) -> SRAM2_PE_W<OPTRrs> {
SRAM2_PE_W::new(self, 24)
}
#[inline(always)]
pub fn sram2_rst(&mut self) -> SRAM2_RST_W<OPTRrs> {
SRAM2_RST_W::new(self, 25)
}
#[inline(always)]
pub fn n_swboot0(&mut self) -> N_SWBOOT0_W<OPTRrs> {
N_SWBOOT0_W::new(self, 26)
}
#[inline(always)]
pub fn n_boot0(&mut self) -> N_BOOT0_W<OPTRrs> {
N_BOOT0_W::new(self, 27)
}
}
pub struct OPTRrs;
impl crate::RegisterSpec for OPTRrs {
type Ux = u32;
}
impl crate::Readable for OPTRrs {}
impl crate::Writable for OPTRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for OPTRrs {
const RESET_VALUE: u32 = 0xf000_0000;
}