pub type R = crate::R<OPTSR_CURrs>;
pub type W = crate::W<OPTSR_CURrs>;
pub type OPT_BUSY_R = crate::BitReader;
pub type OPT_BUSY_W<'a, REG> = crate::BitWriter<'a, REG>;
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 NRST_STOP_R = crate::BitReader;
pub type NRST_STOP_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type NRST_STDY_R = crate::BitReader;
pub type NRST_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 VDDMMC_HSLV_R = crate::BitReader;
pub type VDDMMC_HSLV_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type WDG_FZ_STOP_R = crate::BitReader;
pub type WDG_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 VDDIO_HSLV_R = crate::BitReader;
pub type VDDIO_HSLV_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type OPTCHANGEERR_R = crate::BitReader;
pub type OPTCHANGEERR_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 opt_busy(&self) -> OPT_BUSY_R {
OPT_BUSY_R::new((self.bits & 1) != 0)
}
#[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 nrst_stop(&self) -> NRST_STOP_R {
NRST_STOP_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn nrst_stdy(&self) -> NRST_STDY_R {
NRST_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 vddmmc_hslv(&self) -> VDDMMC_HSLV_R {
VDDMMC_HSLV_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn wdg_fz_stop(&self) -> WDG_FZ_STOP_R {
WDG_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 vddio_hslv(&self) -> VDDIO_HSLV_R {
VDDIO_HSLV_R::new(((self.bits >> 29) & 1) != 0)
}
#[inline(always)]
pub fn optchangeerr(&self) -> OPTCHANGEERR_R {
OPTCHANGEERR_R::new(((self.bits >> 30) & 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_CUR")
.field("opt_busy", &self.opt_busy())
.field("bor_lev", &self.bor_lev())
.field("iwdg_sw", &self.iwdg_sw())
.field("nrst_stop", &self.nrst_stop())
.field("nrst_stdy", &self.nrst_stdy())
.field("rdp", &self.rdp())
.field("vddmmc_hslv", &self.vddmmc_hslv())
.field("wdg_fz_stop", &self.wdg_fz_stop())
.field("iwdg_fz_sdby", &self.iwdg_fz_sdby())
.field("st_ram_size", &self.st_ram_size())
.field("security", &self.security())
.field("vddio_hslv", &self.vddio_hslv())
.field("optchangeerr", &self.optchangeerr())
.field("swap_bank_opt", &self.swap_bank_opt())
.finish()
}
}
impl W {
#[inline(always)]
pub fn opt_busy(&mut self) -> OPT_BUSY_W<OPTSR_CURrs> {
OPT_BUSY_W::new(self, 0)
}
#[inline(always)]
pub fn bor_lev(&mut self) -> BOR_LEV_W<OPTSR_CURrs> {
BOR_LEV_W::new(self, 2)
}
#[inline(always)]
pub fn iwdg_sw(&mut self) -> IWDG_SW_W<OPTSR_CURrs> {
IWDG_SW_W::new(self, 4)
}
#[inline(always)]
pub fn nrst_stop(&mut self) -> NRST_STOP_W<OPTSR_CURrs> {
NRST_STOP_W::new(self, 6)
}
#[inline(always)]
pub fn nrst_stdy(&mut self) -> NRST_STDY_W<OPTSR_CURrs> {
NRST_STDY_W::new(self, 7)
}
#[inline(always)]
pub fn rdp(&mut self) -> RDP_W<OPTSR_CURrs> {
RDP_W::new(self, 8)
}
#[inline(always)]
pub fn vddmmc_hslv(&mut self) -> VDDMMC_HSLV_W<OPTSR_CURrs> {
VDDMMC_HSLV_W::new(self, 16)
}
#[inline(always)]
pub fn wdg_fz_stop(&mut self) -> WDG_FZ_STOP_W<OPTSR_CURrs> {
WDG_FZ_STOP_W::new(self, 17)
}
#[inline(always)]
pub fn iwdg_fz_sdby(&mut self) -> IWDG_FZ_SDBY_W<OPTSR_CURrs> {
IWDG_FZ_SDBY_W::new(self, 18)
}
#[inline(always)]
pub fn st_ram_size(&mut self) -> ST_RAM_SIZE_W<OPTSR_CURrs> {
ST_RAM_SIZE_W::new(self, 19)
}
#[inline(always)]
pub fn security(&mut self) -> SECURITY_W<OPTSR_CURrs> {
SECURITY_W::new(self, 21)
}
#[inline(always)]
pub fn vddio_hslv(&mut self) -> VDDIO_HSLV_W<OPTSR_CURrs> {
VDDIO_HSLV_W::new(self, 29)
}
#[inline(always)]
pub fn optchangeerr(&mut self) -> OPTCHANGEERR_W<OPTSR_CURrs> {
OPTCHANGEERR_W::new(self, 30)
}
#[inline(always)]
pub fn swap_bank_opt(&mut self) -> SWAP_BANK_OPT_W<OPTSR_CURrs> {
SWAP_BANK_OPT_W::new(self, 31)
}
}
pub struct OPTSR_CURrs;
impl crate::RegisterSpec for OPTSR_CURrs {
type Ux = u32;
}
impl crate::Readable for OPTSR_CURrs {}
impl crate::Writable for OPTSR_CURrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for OPTSR_CURrs {}