pub type R = crate::R<OPTSR_PRGrs>;
pub type W = crate::W<OPTSR_PRGrs>;
pub type BOR_LEV_R = crate::FieldReader;
pub type BOR_LEV_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type IWDG_SW_R = crate::BitReader;
pub type IWDG_SW_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type IWDG2_SW_R = crate::BitReader;
pub type IWDG2_SW_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type NRST_STOP_D1_R = crate::BitReader;
pub type NRST_STOP_D1_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type NRST_STDY_D1_R = crate::BitReader;
pub type NRST_STDY_D1_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type RDP_R = crate::FieldReader;
pub type RDP_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
pub type IWDG_FZ_STOP_R = crate::BitReader;
pub type IWDG_FZ_STOP_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type IWDG_FZ_SDBY_R = crate::BitReader;
pub type IWDG_FZ_SDBY_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type ST_RAM_SIZE_R = crate::FieldReader;
pub type ST_RAM_SIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type SECURITY_R = crate::BitReader;
pub type SECURITY_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type BOOT_CM4_R = crate::BitReader;
pub type BOOT_CM4_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type BOOT_CM7_R = crate::BitReader;
pub type BOOT_CM7_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type NRST_STOP_D2_R = crate::BitReader;
pub type NRST_STOP_D2_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type NRST_STBY_D2_R = crate::BitReader;
pub type NRST_STBY_D2_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type IO_HSLV_R = crate::BitReader;
pub type IO_HSLV_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type SWAP_BANK_OPT_R = crate::BitReader;
pub type SWAP_BANK_OPT_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn bor_lev(&self) -> BOR_LEV_R {
BOR_LEV_R::new(((self.bits >> 2) & 3) as u8)
}
#[inline(always)]
pub fn iwdg_sw(&self) -> IWDG_SW_R {
IWDG_SW_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn iwdg2_sw(&self) -> IWDG2_SW_R {
IWDG2_SW_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn nrst_stop_d1(&self) -> NRST_STOP_D1_R {
NRST_STOP_D1_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn nrst_stdy_d1(&self) -> NRST_STDY_D1_R {
NRST_STDY_D1_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn rdp(&self) -> RDP_R {
RDP_R::new(((self.bits >> 8) & 0xff) as u8)
}
#[inline(always)]
pub fn iwdg_fz_stop(&self) -> IWDG_FZ_STOP_R {
IWDG_FZ_STOP_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn iwdg_fz_sdby(&self) -> IWDG_FZ_SDBY_R {
IWDG_FZ_SDBY_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn st_ram_size(&self) -> ST_RAM_SIZE_R {
ST_RAM_SIZE_R::new(((self.bits >> 19) & 3) as u8)
}
#[inline(always)]
pub fn security(&self) -> SECURITY_R {
SECURITY_R::new(((self.bits >> 21) & 1) != 0)
}
#[inline(always)]
pub fn boot_cm4(&self) -> BOOT_CM4_R {
BOOT_CM4_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn boot_cm7(&self) -> BOOT_CM7_R {
BOOT_CM7_R::new(((self.bits >> 23) & 1) != 0)
}
#[inline(always)]
pub fn nrst_stop_d2(&self) -> NRST_STOP_D2_R {
NRST_STOP_D2_R::new(((self.bits >> 24) & 1) != 0)
}
#[inline(always)]
pub fn nrst_stby_d2(&self) -> NRST_STBY_D2_R {
NRST_STBY_D2_R::new(((self.bits >> 25) & 1) != 0)
}
#[inline(always)]
pub fn io_hslv(&self) -> IO_HSLV_R {
IO_HSLV_R::new(((self.bits >> 29) & 1) != 0)
}
#[inline(always)]
pub fn swap_bank_opt(&self) -> SWAP_BANK_OPT_R {
SWAP_BANK_OPT_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("OPTSR_PRG")
.field("swap_bank_opt", &self.swap_bank_opt())
.field("io_hslv", &self.io_hslv())
.field("nrst_stby_d2", &self.nrst_stby_d2())
.field("nrst_stop_d2", &self.nrst_stop_d2())
.field("boot_cm7", &self.boot_cm7())
.field("boot_cm4", &self.boot_cm4())
.field("security", &self.security())
.field("st_ram_size", &self.st_ram_size())
.field("iwdg_fz_sdby", &self.iwdg_fz_sdby())
.field("iwdg_fz_stop", &self.iwdg_fz_stop())
.field("rdp", &self.rdp())
.field("nrst_stdy_d1", &self.nrst_stdy_d1())
.field("nrst_stop_d1", &self.nrst_stop_d1())
.field("iwdg2_sw", &self.iwdg2_sw())
.field("iwdg_sw", &self.iwdg_sw())
.field("bor_lev", &self.bor_lev())
.finish()
}
}
impl W {
#[inline(always)]
pub fn bor_lev(&mut self) -> BOR_LEV_W<OPTSR_PRGrs> {
BOR_LEV_W::new(self, 2)
}
#[inline(always)]
pub fn iwdg_sw(&mut self) -> IWDG_SW_W<OPTSR_PRGrs> {
IWDG_SW_W::new(self, 4)
}
#[inline(always)]
pub fn iwdg2_sw(&mut self) -> IWDG2_SW_W<OPTSR_PRGrs> {
IWDG2_SW_W::new(self, 5)
}
#[inline(always)]
pub fn nrst_stop_d1(&mut self) -> NRST_STOP_D1_W<OPTSR_PRGrs> {
NRST_STOP_D1_W::new(self, 6)
}
#[inline(always)]
pub fn nrst_stdy_d1(&mut self) -> NRST_STDY_D1_W<OPTSR_PRGrs> {
NRST_STDY_D1_W::new(self, 7)
}
#[inline(always)]
pub fn rdp(&mut self) -> RDP_W<OPTSR_PRGrs> {
RDP_W::new(self, 8)
}
#[inline(always)]
pub fn iwdg_fz_stop(&mut self) -> IWDG_FZ_STOP_W<OPTSR_PRGrs> {
IWDG_FZ_STOP_W::new(self, 17)
}
#[inline(always)]
pub fn iwdg_fz_sdby(&mut self) -> IWDG_FZ_SDBY_W<OPTSR_PRGrs> {
IWDG_FZ_SDBY_W::new(self, 18)
}
#[inline(always)]
pub fn st_ram_size(&mut self) -> ST_RAM_SIZE_W<OPTSR_PRGrs> {
ST_RAM_SIZE_W::new(self, 19)
}
#[inline(always)]
pub fn security(&mut self) -> SECURITY_W<OPTSR_PRGrs> {
SECURITY_W::new(self, 21)
}
#[inline(always)]
pub fn boot_cm4(&mut self) -> BOOT_CM4_W<OPTSR_PRGrs> {
BOOT_CM4_W::new(self, 22)
}
#[inline(always)]
pub fn boot_cm7(&mut self) -> BOOT_CM7_W<OPTSR_PRGrs> {
BOOT_CM7_W::new(self, 23)
}
#[inline(always)]
pub fn nrst_stop_d2(&mut self) -> NRST_STOP_D2_W<OPTSR_PRGrs> {
NRST_STOP_D2_W::new(self, 24)
}
#[inline(always)]
pub fn nrst_stby_d2(&mut self) -> NRST_STBY_D2_W<OPTSR_PRGrs> {
NRST_STBY_D2_W::new(self, 25)
}
#[inline(always)]
pub fn io_hslv(&mut self) -> IO_HSLV_W<OPTSR_PRGrs> {
IO_HSLV_W::new(self, 29)
}
#[inline(always)]
pub fn swap_bank_opt(&mut self) -> SWAP_BANK_OPT_W<OPTSR_PRGrs> {
SWAP_BANK_OPT_W::new(self, 31)
}
}
pub struct OPTSR_PRGrs;
impl crate::RegisterSpec for OPTSR_PRGrs {
type Ux = u32;
}
impl crate::Readable for OPTSR_PRGrs {}
impl crate::Writable for OPTSR_PRGrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for OPTSR_PRGrs {}