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 IWDG1_SW_R = crate::BitReader;
pub type IWDG1_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_STBY_D1_R = crate::BitReader;
pub type NRST_STBY_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 IO_HSLV_R = crate::BitReader;
pub type IO_HSLV_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 nrst_stop_d1(&self) -> NRST_STOP_D1_R {
NRST_STOP_D1_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn nrst_stby_d1(&self) -> NRST_STBY_D1_R {
NRST_STBY_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 io_hslv(&self) -> IO_HSLV_R {
IO_HSLV_R::new(((self.bits >> 29) & 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("nrst_stop_d1", &self.nrst_stop_d1())
.field("nrst_stby_d1", &self.nrst_stby_d1())
.field("rdp", &self.rdp())
.field("iwdg_fz_stop", &self.iwdg_fz_stop())
.field("iwdg_fz_sdby", &self.iwdg_fz_sdby())
.field("st_ram_size", &self.st_ram_size())
.field("security", &self.security())
.field("io_hslv", &self.io_hslv())
.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 iwdg1_sw(&mut self) -> IWDG1_SW_W<OPTSR_PRGrs> {
IWDG1_SW_W::new(self, 4)
}
#[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_stby_d1(&mut self) -> NRST_STBY_D1_W<OPTSR_PRGrs> {
NRST_STBY_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 io_hslv(&mut self) -> IO_HSLV_W<OPTSR_PRGrs> {
IO_HSLV_W::new(self, 29)
}
}
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 {}