stm32f1_staging/stm32f107/fsmc/
pcr4.rs1pub type R = crate::R<PCR4rs>;
3pub type W = crate::W<PCR4rs>;
5pub type PWAITEN_R = crate::BitReader;
7pub type PWAITEN_W<'a, REG> = crate::BitWriter<'a, REG>;
9pub type PBKEN_R = crate::BitReader;
11pub type PBKEN_W<'a, REG> = crate::BitWriter<'a, REG>;
13pub type PTYP_R = crate::BitReader;
15pub type PTYP_W<'a, REG> = crate::BitWriter<'a, REG>;
17pub type PWID_R = crate::FieldReader;
19pub type PWID_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
21pub type ECCEN_R = crate::BitReader;
23pub type ECCEN_W<'a, REG> = crate::BitWriter<'a, REG>;
25pub type TCLR_R = crate::FieldReader;
27pub type TCLR_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
29pub type TAR_R = crate::FieldReader;
31pub type TAR_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
33pub type ECCPS_R = crate::FieldReader;
35pub type ECCPS_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
37impl R {
38 #[inline(always)]
40 pub fn pwaiten(&self) -> PWAITEN_R {
41 PWAITEN_R::new(((self.bits >> 1) & 1) != 0)
42 }
43 #[inline(always)]
45 pub fn pbken(&self) -> PBKEN_R {
46 PBKEN_R::new(((self.bits >> 2) & 1) != 0)
47 }
48 #[inline(always)]
50 pub fn ptyp(&self) -> PTYP_R {
51 PTYP_R::new(((self.bits >> 3) & 1) != 0)
52 }
53 #[inline(always)]
55 pub fn pwid(&self) -> PWID_R {
56 PWID_R::new(((self.bits >> 4) & 3) as u8)
57 }
58 #[inline(always)]
60 pub fn eccen(&self) -> ECCEN_R {
61 ECCEN_R::new(((self.bits >> 6) & 1) != 0)
62 }
63 #[inline(always)]
65 pub fn tclr(&self) -> TCLR_R {
66 TCLR_R::new(((self.bits >> 9) & 0x0f) as u8)
67 }
68 #[inline(always)]
70 pub fn tar(&self) -> TAR_R {
71 TAR_R::new(((self.bits >> 13) & 0x0f) as u8)
72 }
73 #[inline(always)]
75 pub fn eccps(&self) -> ECCPS_R {
76 ECCPS_R::new(((self.bits >> 17) & 7) as u8)
77 }
78}
79impl core::fmt::Debug for R {
80 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
81 f.debug_struct("PCR4")
82 .field("eccps", &self.eccps())
83 .field("tar", &self.tar())
84 .field("tclr", &self.tclr())
85 .field("eccen", &self.eccen())
86 .field("pwid", &self.pwid())
87 .field("ptyp", &self.ptyp())
88 .field("pbken", &self.pbken())
89 .field("pwaiten", &self.pwaiten())
90 .finish()
91 }
92}
93impl W {
94 #[inline(always)]
96 pub fn pwaiten(&mut self) -> PWAITEN_W<PCR4rs> {
97 PWAITEN_W::new(self, 1)
98 }
99 #[inline(always)]
101 pub fn pbken(&mut self) -> PBKEN_W<PCR4rs> {
102 PBKEN_W::new(self, 2)
103 }
104 #[inline(always)]
106 pub fn ptyp(&mut self) -> PTYP_W<PCR4rs> {
107 PTYP_W::new(self, 3)
108 }
109 #[inline(always)]
111 pub fn pwid(&mut self) -> PWID_W<PCR4rs> {
112 PWID_W::new(self, 4)
113 }
114 #[inline(always)]
116 pub fn eccen(&mut self) -> ECCEN_W<PCR4rs> {
117 ECCEN_W::new(self, 6)
118 }
119 #[inline(always)]
121 pub fn tclr(&mut self) -> TCLR_W<PCR4rs> {
122 TCLR_W::new(self, 9)
123 }
124 #[inline(always)]
126 pub fn tar(&mut self) -> TAR_W<PCR4rs> {
127 TAR_W::new(self, 13)
128 }
129 #[inline(always)]
131 pub fn eccps(&mut self) -> ECCPS_W<PCR4rs> {
132 ECCPS_W::new(self, 17)
133 }
134}
135pub struct PCR4rs;
141impl crate::RegisterSpec for PCR4rs {
142 type Ux = u32;
143}
144impl crate::Readable for PCR4rs {}
146impl crate::Writable for PCR4rs {
148 type Safety = crate::Unsafe;
149}
150impl crate::Resettable for PCR4rs {
152 const RESET_VALUE: u32 = 0x18;
153}