stm32g0_staging/stm32g0c1/flash/
cr.rs1pub type R = crate::R<CRrs>;
3pub type W = crate::W<CRrs>;
5pub type PG_R = crate::BitReader;
7pub type PG_W<'a, REG> = crate::BitWriter<'a, REG>;
9pub type PER_R = crate::BitReader;
11pub type PER_W<'a, REG> = crate::BitWriter<'a, REG>;
13pub type MER1_R = crate::BitReader;
15pub type MER1_W<'a, REG> = crate::BitWriter<'a, REG>;
17pub type PNB_R = crate::FieldReader<u16>;
19pub type PNB_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>;
21pub type STRT_R = crate::BitReader;
23pub type STRT_W<'a, REG> = crate::BitWriter<'a, REG>;
25pub type OPTSTRT_R = crate::BitReader;
27pub type OPTSTRT_W<'a, REG> = crate::BitWriter<'a, REG>;
29pub type FSTPG_R = crate::BitReader;
31pub type FSTPG_W<'a, REG> = crate::BitWriter<'a, REG>;
33pub type EOPIE_R = crate::BitReader;
35pub type EOPIE_W<'a, REG> = crate::BitWriter<'a, REG>;
37pub type ERRIE_R = crate::BitReader;
39pub type ERRIE_W<'a, REG> = crate::BitWriter<'a, REG>;
41pub type RDERRIE_R = crate::BitReader;
43pub type RDERRIE_W<'a, REG> = crate::BitWriter<'a, REG>;
45pub type OBL_LAUNCH_R = crate::BitReader;
47pub type OBL_LAUNCH_W<'a, REG> = crate::BitWriter<'a, REG>;
49pub type SEC_PROT_R = crate::BitReader;
51pub type SEC_PROT_W<'a, REG> = crate::BitWriter<'a, REG>;
53pub type SEC_PROT2_R = crate::BitReader;
55pub type SEC_PROT2_W<'a, REG> = crate::BitWriter<'a, REG>;
57pub type OPTLOCK_R = crate::BitReader;
59pub type OPTLOCK_W<'a, REG> = crate::BitWriter<'a, REG>;
61pub type LOCK_R = crate::BitReader;
63pub type LOCK_W<'a, REG> = crate::BitWriter<'a, REG>;
65impl R {
66 #[inline(always)]
68 pub fn pg(&self) -> PG_R {
69 PG_R::new((self.bits & 1) != 0)
70 }
71 #[inline(always)]
73 pub fn per(&self) -> PER_R {
74 PER_R::new(((self.bits >> 1) & 1) != 0)
75 }
76 #[inline(always)]
78 pub fn mer1(&self) -> MER1_R {
79 MER1_R::new(((self.bits >> 2) & 1) != 0)
80 }
81 #[inline(always)]
83 pub fn pnb(&self) -> PNB_R {
84 PNB_R::new(((self.bits >> 3) & 0x03ff) as u16)
85 }
86 #[inline(always)]
88 pub fn strt(&self) -> STRT_R {
89 STRT_R::new(((self.bits >> 16) & 1) != 0)
90 }
91 #[inline(always)]
93 pub fn optstrt(&self) -> OPTSTRT_R {
94 OPTSTRT_R::new(((self.bits >> 17) & 1) != 0)
95 }
96 #[inline(always)]
98 pub fn fstpg(&self) -> FSTPG_R {
99 FSTPG_R::new(((self.bits >> 18) & 1) != 0)
100 }
101 #[inline(always)]
103 pub fn eopie(&self) -> EOPIE_R {
104 EOPIE_R::new(((self.bits >> 24) & 1) != 0)
105 }
106 #[inline(always)]
108 pub fn errie(&self) -> ERRIE_R {
109 ERRIE_R::new(((self.bits >> 25) & 1) != 0)
110 }
111 #[inline(always)]
113 pub fn rderrie(&self) -> RDERRIE_R {
114 RDERRIE_R::new(((self.bits >> 26) & 1) != 0)
115 }
116 #[inline(always)]
118 pub fn obl_launch(&self) -> OBL_LAUNCH_R {
119 OBL_LAUNCH_R::new(((self.bits >> 27) & 1) != 0)
120 }
121 #[inline(always)]
123 pub fn sec_prot(&self) -> SEC_PROT_R {
124 SEC_PROT_R::new(((self.bits >> 28) & 1) != 0)
125 }
126 #[inline(always)]
128 pub fn sec_prot2(&self) -> SEC_PROT2_R {
129 SEC_PROT2_R::new(((self.bits >> 29) & 1) != 0)
130 }
131 #[inline(always)]
133 pub fn optlock(&self) -> OPTLOCK_R {
134 OPTLOCK_R::new(((self.bits >> 30) & 1) != 0)
135 }
136 #[inline(always)]
138 pub fn lock(&self) -> LOCK_R {
139 LOCK_R::new(((self.bits >> 31) & 1) != 0)
140 }
141}
142impl core::fmt::Debug for R {
143 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
144 f.debug_struct("CR")
145 .field("pg", &self.pg())
146 .field("per", &self.per())
147 .field("mer1", &self.mer1())
148 .field("pnb", &self.pnb())
149 .field("strt", &self.strt())
150 .field("optstrt", &self.optstrt())
151 .field("fstpg", &self.fstpg())
152 .field("eopie", &self.eopie())
153 .field("errie", &self.errie())
154 .field("rderrie", &self.rderrie())
155 .field("obl_launch", &self.obl_launch())
156 .field("sec_prot", &self.sec_prot())
157 .field("sec_prot2", &self.sec_prot2())
158 .field("optlock", &self.optlock())
159 .field("lock", &self.lock())
160 .finish()
161 }
162}
163impl W {
164 #[inline(always)]
166 pub fn pg(&mut self) -> PG_W<CRrs> {
167 PG_W::new(self, 0)
168 }
169 #[inline(always)]
171 pub fn per(&mut self) -> PER_W<CRrs> {
172 PER_W::new(self, 1)
173 }
174 #[inline(always)]
176 pub fn mer1(&mut self) -> MER1_W<CRrs> {
177 MER1_W::new(self, 2)
178 }
179 #[inline(always)]
181 pub fn pnb(&mut self) -> PNB_W<CRrs> {
182 PNB_W::new(self, 3)
183 }
184 #[inline(always)]
186 pub fn strt(&mut self) -> STRT_W<CRrs> {
187 STRT_W::new(self, 16)
188 }
189 #[inline(always)]
191 pub fn optstrt(&mut self) -> OPTSTRT_W<CRrs> {
192 OPTSTRT_W::new(self, 17)
193 }
194 #[inline(always)]
196 pub fn fstpg(&mut self) -> FSTPG_W<CRrs> {
197 FSTPG_W::new(self, 18)
198 }
199 #[inline(always)]
201 pub fn eopie(&mut self) -> EOPIE_W<CRrs> {
202 EOPIE_W::new(self, 24)
203 }
204 #[inline(always)]
206 pub fn errie(&mut self) -> ERRIE_W<CRrs> {
207 ERRIE_W::new(self, 25)
208 }
209 #[inline(always)]
211 pub fn rderrie(&mut self) -> RDERRIE_W<CRrs> {
212 RDERRIE_W::new(self, 26)
213 }
214 #[inline(always)]
216 pub fn obl_launch(&mut self) -> OBL_LAUNCH_W<CRrs> {
217 OBL_LAUNCH_W::new(self, 27)
218 }
219 #[inline(always)]
221 pub fn sec_prot(&mut self) -> SEC_PROT_W<CRrs> {
222 SEC_PROT_W::new(self, 28)
223 }
224 #[inline(always)]
226 pub fn sec_prot2(&mut self) -> SEC_PROT2_W<CRrs> {
227 SEC_PROT2_W::new(self, 29)
228 }
229 #[inline(always)]
231 pub fn optlock(&mut self) -> OPTLOCK_W<CRrs> {
232 OPTLOCK_W::new(self, 30)
233 }
234 #[inline(always)]
236 pub fn lock(&mut self) -> LOCK_W<CRrs> {
237 LOCK_W::new(self, 31)
238 }
239}
240pub struct CRrs;
246impl crate::RegisterSpec for CRrs {
247 type Ux = u32;
248}
249impl crate::Readable for CRrs {}
251impl crate::Writable for CRrs {
253 type Safety = crate::Unsafe;
254 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
255 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
256}
257impl crate::Resettable for CRrs {
259 const RESET_VALUE: u32 = 0xc000_0000;
260}