stm32f1_staging/stm32f107/fsmc/
pcr2.rspub type R = crate::R<PCR2rs>;
pub type W = crate::W<PCR2rs>;
pub type PWAITEN_R = crate::BitReader;
pub type PWAITEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type PBKEN_R = crate::BitReader;
pub type PBKEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type PTYP_R = crate::BitReader;
pub type PTYP_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type PWID_R = crate::FieldReader;
pub type PWID_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
pub type ECCEN_R = crate::BitReader;
pub type ECCEN_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type TCLR_R = crate::FieldReader;
pub type TCLR_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type TAR_R = crate::FieldReader;
pub type TAR_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type ECCPS_R = crate::FieldReader;
pub type ECCPS_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
impl R {
#[inline(always)]
pub fn pwaiten(&self) -> PWAITEN_R {
PWAITEN_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn pbken(&self) -> PBKEN_R {
PBKEN_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn ptyp(&self) -> PTYP_R {
PTYP_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn pwid(&self) -> PWID_R {
PWID_R::new(((self.bits >> 4) & 3) as u8)
}
#[inline(always)]
pub fn eccen(&self) -> ECCEN_R {
ECCEN_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn tclr(&self) -> TCLR_R {
TCLR_R::new(((self.bits >> 9) & 0x0f) as u8)
}
#[inline(always)]
pub fn tar(&self) -> TAR_R {
TAR_R::new(((self.bits >> 13) & 0x0f) as u8)
}
#[inline(always)]
pub fn eccps(&self) -> ECCPS_R {
ECCPS_R::new(((self.bits >> 17) & 7) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("PCR2")
.field("eccps", &self.eccps())
.field("tar", &self.tar())
.field("tclr", &self.tclr())
.field("eccen", &self.eccen())
.field("pwid", &self.pwid())
.field("ptyp", &self.ptyp())
.field("pbken", &self.pbken())
.field("pwaiten", &self.pwaiten())
.finish()
}
}
impl W {
#[inline(always)]
#[must_use]
pub fn pwaiten(&mut self) -> PWAITEN_W<PCR2rs> {
PWAITEN_W::new(self, 1)
}
#[inline(always)]
#[must_use]
pub fn pbken(&mut self) -> PBKEN_W<PCR2rs> {
PBKEN_W::new(self, 2)
}
#[inline(always)]
#[must_use]
pub fn ptyp(&mut self) -> PTYP_W<PCR2rs> {
PTYP_W::new(self, 3)
}
#[inline(always)]
#[must_use]
pub fn pwid(&mut self) -> PWID_W<PCR2rs> {
PWID_W::new(self, 4)
}
#[inline(always)]
#[must_use]
pub fn eccen(&mut self) -> ECCEN_W<PCR2rs> {
ECCEN_W::new(self, 6)
}
#[inline(always)]
#[must_use]
pub fn tclr(&mut self) -> TCLR_W<PCR2rs> {
TCLR_W::new(self, 9)
}
#[inline(always)]
#[must_use]
pub fn tar(&mut self) -> TAR_W<PCR2rs> {
TAR_W::new(self, 13)
}
#[inline(always)]
#[must_use]
pub fn eccps(&mut self) -> ECCPS_W<PCR2rs> {
ECCPS_W::new(self, 17)
}
}
pub struct PCR2rs;
impl crate::RegisterSpec for PCR2rs {
type Ux = u32;
}
impl crate::Readable for PCR2rs {}
impl crate::Writable for PCR2rs {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
impl crate::Resettable for PCR2rs {
const RESET_VALUE: u32 = 0x18;
}