pub type R = crate::R<OPTSR_PRG_rs>;
pub type W = crate::W<OPTSR_PRG_rs>;
pub type BOR_LEV_R = crate::FieldReader;
pub type BOR_LEV_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type IWDG1_SW_R = crate::BitReader;
pub type IWDG1_SW_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type N_RST_STOP_R = crate::BitReader;
pub type N_RST_STOP_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type N_RST_STDY_R = crate::BitReader;
pub type N_RST_STDY_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 FZ_IWDG_STOP_R = crate::BitReader;
pub type FZ_IWDG_STOP_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type FZ_IWDG_SDBY_R = crate::BitReader;
pub type FZ_IWDG_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 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 iwdg1_sw(&self) -> IWDG1_SW_R {
IWDG1_SW_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn n_rst_stop(&self) -> N_RST_STOP_R {
N_RST_STOP_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn n_rst_stdy(&self) -> N_RST_STDY_R {
N_RST_STDY_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 fz_iwdg_stop(&self) -> FZ_IWDG_STOP_R {
FZ_IWDG_STOP_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn fz_iwdg_sdby(&self) -> FZ_IWDG_SDBY_R {
FZ_IWDG_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 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("bor_lev", &self.bor_lev())
.field("iwdg1_sw", &self.iwdg1_sw())
.field("n_rst_stop", &self.n_rst_stop())
.field("n_rst_stdy", &self.n_rst_stdy())
.field("rdp", &self.rdp())
.field("fz_iwdg_stop", &self.fz_iwdg_stop())
.field("fz_iwdg_sdby", &self.fz_iwdg_sdby())
.field("st_ram_size", &self.st_ram_size())
.field("security", &self.security())
.field("io_hslv", &self.io_hslv())
.field("swap_bank_opt", &self.swap_bank_opt())
.finish()
}
}
impl W {
#[inline(always)]
pub fn bor_lev(&mut self) -> BOR_LEV_W<OPTSR_PRG_rs> {
BOR_LEV_W::new(self, 2)
}
#[inline(always)]
pub fn iwdg1_sw(&mut self) -> IWDG1_SW_W<OPTSR_PRG_rs> {
IWDG1_SW_W::new(self, 4)
}
#[inline(always)]
pub fn n_rst_stop(&mut self) -> N_RST_STOP_W<OPTSR_PRG_rs> {
N_RST_STOP_W::new(self, 6)
}
#[inline(always)]
pub fn n_rst_stdy(&mut self) -> N_RST_STDY_W<OPTSR_PRG_rs> {
N_RST_STDY_W::new(self, 7)
}
#[inline(always)]
pub fn rdp(&mut self) -> RDP_W<OPTSR_PRG_rs> {
RDP_W::new(self, 8)
}
#[inline(always)]
pub fn fz_iwdg_stop(&mut self) -> FZ_IWDG_STOP_W<OPTSR_PRG_rs> {
FZ_IWDG_STOP_W::new(self, 17)
}
#[inline(always)]
pub fn fz_iwdg_sdby(&mut self) -> FZ_IWDG_SDBY_W<OPTSR_PRG_rs> {
FZ_IWDG_SDBY_W::new(self, 18)
}
#[inline(always)]
pub fn st_ram_size(&mut self) -> ST_RAM_SIZE_W<OPTSR_PRG_rs> {
ST_RAM_SIZE_W::new(self, 19)
}
#[inline(always)]
pub fn security(&mut self) -> SECURITY_W<OPTSR_PRG_rs> {
SECURITY_W::new(self, 21)
}
#[inline(always)]
pub fn io_hslv(&mut self) -> IO_HSLV_W<OPTSR_PRG_rs> {
IO_HSLV_W::new(self, 29)
}
#[inline(always)]
pub fn swap_bank_opt(&mut self) -> SWAP_BANK_OPT_W<OPTSR_PRG_rs> {
SWAP_BANK_OPT_W::new(self, 31)
}
}
pub struct OPTSR_PRG_rs;
impl crate::RegisterSpec for OPTSR_PRG_rs {
type Ux = u32;
}
impl crate::Readable for OPTSR_PRG_rs {}
impl crate::Writable for OPTSR_PRG_rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for OPTSR_PRG_rs {}