1#[doc = r" Value read from the register"]
2pub struct R {
3 bits: u32,
4}
5#[doc = r" Value to write to the register"]
6pub struct W {
7 bits: u32,
8}
9impl super::CSR {
10 #[doc = r" Modifies the contents of the register"]
11 #[inline]
12 pub fn modify<F>(&self, f: F)
13 where
14 for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
15 {
16 let bits = self.register.get();
17 let r = R { bits: bits };
18 let mut w = W { bits: bits };
19 f(&r, &mut w);
20 self.register.set(w.bits);
21 }
22 #[doc = r" Reads the contents of the register"]
23 #[inline]
24 pub fn read(&self) -> R {
25 R {
26 bits: self.register.get(),
27 }
28 }
29 #[doc = r" Writes to the register"]
30 #[inline]
31 pub fn write<F>(&self, f: F)
32 where
33 F: FnOnce(&mut W) -> &mut W,
34 {
35 let mut w = W::reset_value();
36 f(&mut w);
37 self.register.set(w.bits);
38 }
39 #[doc = r" Writes the reset value to the register"]
40 #[inline]
41 pub fn reset(&self) {
42 self.write(|w| w)
43 }
44}
45#[doc = r" Value of the field"]
46pub struct LPWRSTFR {
47 bits: bool,
48}
49impl LPWRSTFR {
50 #[doc = r" Value of the field as raw bits"]
51 #[inline]
52 pub fn bit(&self) -> bool {
53 self.bits
54 }
55 #[doc = r" Returns `true` if the bit is clear (0)"]
56 #[inline]
57 pub fn bit_is_clear(&self) -> bool {
58 !self.bit()
59 }
60 #[doc = r" Returns `true` if the bit is set (1)"]
61 #[inline]
62 pub fn bit_is_set(&self) -> bool {
63 self.bit()
64 }
65}
66#[doc = r" Value of the field"]
67pub struct WWDGRSTFR {
68 bits: bool,
69}
70impl WWDGRSTFR {
71 #[doc = r" Value of the field as raw bits"]
72 #[inline]
73 pub fn bit(&self) -> bool {
74 self.bits
75 }
76 #[doc = r" Returns `true` if the bit is clear (0)"]
77 #[inline]
78 pub fn bit_is_clear(&self) -> bool {
79 !self.bit()
80 }
81 #[doc = r" Returns `true` if the bit is set (1)"]
82 #[inline]
83 pub fn bit_is_set(&self) -> bool {
84 self.bit()
85 }
86}
87#[doc = r" Value of the field"]
88pub struct IWDGRSTFR {
89 bits: bool,
90}
91impl IWDGRSTFR {
92 #[doc = r" Value of the field as raw bits"]
93 #[inline]
94 pub fn bit(&self) -> bool {
95 self.bits
96 }
97 #[doc = r" Returns `true` if the bit is clear (0)"]
98 #[inline]
99 pub fn bit_is_clear(&self) -> bool {
100 !self.bit()
101 }
102 #[doc = r" Returns `true` if the bit is set (1)"]
103 #[inline]
104 pub fn bit_is_set(&self) -> bool {
105 self.bit()
106 }
107}
108#[doc = r" Value of the field"]
109pub struct SFTRSTFR {
110 bits: bool,
111}
112impl SFTRSTFR {
113 #[doc = r" Value of the field as raw bits"]
114 #[inline]
115 pub fn bit(&self) -> bool {
116 self.bits
117 }
118 #[doc = r" Returns `true` if the bit is clear (0)"]
119 #[inline]
120 pub fn bit_is_clear(&self) -> bool {
121 !self.bit()
122 }
123 #[doc = r" Returns `true` if the bit is set (1)"]
124 #[inline]
125 pub fn bit_is_set(&self) -> bool {
126 self.bit()
127 }
128}
129#[doc = r" Value of the field"]
130pub struct BORRSTFR {
131 bits: bool,
132}
133impl BORRSTFR {
134 #[doc = r" Value of the field as raw bits"]
135 #[inline]
136 pub fn bit(&self) -> bool {
137 self.bits
138 }
139 #[doc = r" Returns `true` if the bit is clear (0)"]
140 #[inline]
141 pub fn bit_is_clear(&self) -> bool {
142 !self.bit()
143 }
144 #[doc = r" Returns `true` if the bit is set (1)"]
145 #[inline]
146 pub fn bit_is_set(&self) -> bool {
147 self.bit()
148 }
149}
150#[doc = r" Value of the field"]
151pub struct PINRSTFR {
152 bits: bool,
153}
154impl PINRSTFR {
155 #[doc = r" Value of the field as raw bits"]
156 #[inline]
157 pub fn bit(&self) -> bool {
158 self.bits
159 }
160 #[doc = r" Returns `true` if the bit is clear (0)"]
161 #[inline]
162 pub fn bit_is_clear(&self) -> bool {
163 !self.bit()
164 }
165 #[doc = r" Returns `true` if the bit is set (1)"]
166 #[inline]
167 pub fn bit_is_set(&self) -> bool {
168 self.bit()
169 }
170}
171#[doc = r" Value of the field"]
172pub struct OBLRSTFR {
173 bits: bool,
174}
175impl OBLRSTFR {
176 #[doc = r" Value of the field as raw bits"]
177 #[inline]
178 pub fn bit(&self) -> bool {
179 self.bits
180 }
181 #[doc = r" Returns `true` if the bit is clear (0)"]
182 #[inline]
183 pub fn bit_is_clear(&self) -> bool {
184 !self.bit()
185 }
186 #[doc = r" Returns `true` if the bit is set (1)"]
187 #[inline]
188 pub fn bit_is_set(&self) -> bool {
189 self.bit()
190 }
191}
192#[doc = r" Value of the field"]
193pub struct FIREWALLRSTFR {
194 bits: bool,
195}
196impl FIREWALLRSTFR {
197 #[doc = r" Value of the field as raw bits"]
198 #[inline]
199 pub fn bit(&self) -> bool {
200 self.bits
201 }
202 #[doc = r" Returns `true` if the bit is clear (0)"]
203 #[inline]
204 pub fn bit_is_clear(&self) -> bool {
205 !self.bit()
206 }
207 #[doc = r" Returns `true` if the bit is set (1)"]
208 #[inline]
209 pub fn bit_is_set(&self) -> bool {
210 self.bit()
211 }
212}
213#[doc = r" Value of the field"]
214pub struct RMVFR {
215 bits: bool,
216}
217impl RMVFR {
218 #[doc = r" Value of the field as raw bits"]
219 #[inline]
220 pub fn bit(&self) -> bool {
221 self.bits
222 }
223 #[doc = r" Returns `true` if the bit is clear (0)"]
224 #[inline]
225 pub fn bit_is_clear(&self) -> bool {
226 !self.bit()
227 }
228 #[doc = r" Returns `true` if the bit is set (1)"]
229 #[inline]
230 pub fn bit_is_set(&self) -> bool {
231 self.bit()
232 }
233}
234#[doc = r" Value of the field"]
235pub struct MSISRANGER {
236 bits: u8,
237}
238impl MSISRANGER {
239 #[doc = r" Value of the field as raw bits"]
240 #[inline]
241 pub fn bits(&self) -> u8 {
242 self.bits
243 }
244}
245#[doc = r" Value of the field"]
246pub struct LSIRDYR {
247 bits: bool,
248}
249impl LSIRDYR {
250 #[doc = r" Value of the field as raw bits"]
251 #[inline]
252 pub fn bit(&self) -> bool {
253 self.bits
254 }
255 #[doc = r" Returns `true` if the bit is clear (0)"]
256 #[inline]
257 pub fn bit_is_clear(&self) -> bool {
258 !self.bit()
259 }
260 #[doc = r" Returns `true` if the bit is set (1)"]
261 #[inline]
262 pub fn bit_is_set(&self) -> bool {
263 self.bit()
264 }
265}
266#[doc = r" Value of the field"]
267pub struct LSIONR {
268 bits: bool,
269}
270impl LSIONR {
271 #[doc = r" Value of the field as raw bits"]
272 #[inline]
273 pub fn bit(&self) -> bool {
274 self.bits
275 }
276 #[doc = r" Returns `true` if the bit is clear (0)"]
277 #[inline]
278 pub fn bit_is_clear(&self) -> bool {
279 !self.bit()
280 }
281 #[doc = r" Returns `true` if the bit is set (1)"]
282 #[inline]
283 pub fn bit_is_set(&self) -> bool {
284 self.bit()
285 }
286}
287#[doc = r" Proxy"]
288pub struct _RMVFW<'a> {
289 w: &'a mut W,
290}
291impl<'a> _RMVFW<'a> {
292 #[doc = r" Sets the field bit"]
293 pub fn set_bit(self) -> &'a mut W {
294 self.bit(true)
295 }
296 #[doc = r" Clears the field bit"]
297 pub fn clear_bit(self) -> &'a mut W {
298 self.bit(false)
299 }
300 #[doc = r" Writes raw bits to the field"]
301 #[inline]
302 pub fn bit(self, value: bool) -> &'a mut W {
303 const MASK: bool = true;
304 const OFFSET: u8 = 23;
305 self.w.bits &= !((MASK as u32) << OFFSET);
306 self.w.bits |= ((value & MASK) as u32) << OFFSET;
307 self.w
308 }
309}
310#[doc = r" Proxy"]
311pub struct _MSISRANGEW<'a> {
312 w: &'a mut W,
313}
314impl<'a> _MSISRANGEW<'a> {
315 #[doc = r" Writes raw bits to the field"]
316 #[inline]
317 pub unsafe fn bits(self, value: u8) -> &'a mut W {
318 const MASK: u8 = 15;
319 const OFFSET: u8 = 8;
320 self.w.bits &= !((MASK as u32) << OFFSET);
321 self.w.bits |= ((value & MASK) as u32) << OFFSET;
322 self.w
323 }
324}
325#[doc = r" Proxy"]
326pub struct _LSIONW<'a> {
327 w: &'a mut W,
328}
329impl<'a> _LSIONW<'a> {
330 #[doc = r" Sets the field bit"]
331 pub fn set_bit(self) -> &'a mut W {
332 self.bit(true)
333 }
334 #[doc = r" Clears the field bit"]
335 pub fn clear_bit(self) -> &'a mut W {
336 self.bit(false)
337 }
338 #[doc = r" Writes raw bits to the field"]
339 #[inline]
340 pub fn bit(self, value: bool) -> &'a mut W {
341 const MASK: bool = true;
342 const OFFSET: u8 = 0;
343 self.w.bits &= !((MASK as u32) << OFFSET);
344 self.w.bits |= ((value & MASK) as u32) << OFFSET;
345 self.w
346 }
347}
348impl R {
349 #[doc = r" Value of the register as raw bits"]
350 #[inline]
351 pub fn bits(&self) -> u32 {
352 self.bits
353 }
354 #[doc = "Bit 31 - Low-power reset flag"]
355 #[inline]
356 pub fn lpwrstf(&self) -> LPWRSTFR {
357 let bits = {
358 const MASK: bool = true;
359 const OFFSET: u8 = 31;
360 ((self.bits >> OFFSET) & MASK as u32) != 0
361 };
362 LPWRSTFR { bits }
363 }
364 #[doc = "Bit 30 - Window watchdog reset flag"]
365 #[inline]
366 pub fn wwdgrstf(&self) -> WWDGRSTFR {
367 let bits = {
368 const MASK: bool = true;
369 const OFFSET: u8 = 30;
370 ((self.bits >> OFFSET) & MASK as u32) != 0
371 };
372 WWDGRSTFR { bits }
373 }
374 #[doc = "Bit 29 - Independent window watchdog reset flag"]
375 #[inline]
376 pub fn iwdgrstf(&self) -> IWDGRSTFR {
377 let bits = {
378 const MASK: bool = true;
379 const OFFSET: u8 = 29;
380 ((self.bits >> OFFSET) & MASK as u32) != 0
381 };
382 IWDGRSTFR { bits }
383 }
384 #[doc = "Bit 28 - Software reset flag"]
385 #[inline]
386 pub fn sftrstf(&self) -> SFTRSTFR {
387 let bits = {
388 const MASK: bool = true;
389 const OFFSET: u8 = 28;
390 ((self.bits >> OFFSET) & MASK as u32) != 0
391 };
392 SFTRSTFR { bits }
393 }
394 #[doc = "Bit 27 - BOR flag"]
395 #[inline]
396 pub fn borrstf(&self) -> BORRSTFR {
397 let bits = {
398 const MASK: bool = true;
399 const OFFSET: u8 = 27;
400 ((self.bits >> OFFSET) & MASK as u32) != 0
401 };
402 BORRSTFR { bits }
403 }
404 #[doc = "Bit 26 - Pin reset flag"]
405 #[inline]
406 pub fn pinrstf(&self) -> PINRSTFR {
407 let bits = {
408 const MASK: bool = true;
409 const OFFSET: u8 = 26;
410 ((self.bits >> OFFSET) & MASK as u32) != 0
411 };
412 PINRSTFR { bits }
413 }
414 #[doc = "Bit 25 - Option byte loader reset flag"]
415 #[inline]
416 pub fn oblrstf(&self) -> OBLRSTFR {
417 let bits = {
418 const MASK: bool = true;
419 const OFFSET: u8 = 25;
420 ((self.bits >> OFFSET) & MASK as u32) != 0
421 };
422 OBLRSTFR { bits }
423 }
424 #[doc = "Bit 24 - Firewall reset flag"]
425 #[inline]
426 pub fn firewallrstf(&self) -> FIREWALLRSTFR {
427 let bits = {
428 const MASK: bool = true;
429 const OFFSET: u8 = 24;
430 ((self.bits >> OFFSET) & MASK as u32) != 0
431 };
432 FIREWALLRSTFR { bits }
433 }
434 #[doc = "Bit 23 - Remove reset flag"]
435 #[inline]
436 pub fn rmvf(&self) -> RMVFR {
437 let bits = {
438 const MASK: bool = true;
439 const OFFSET: u8 = 23;
440 ((self.bits >> OFFSET) & MASK as u32) != 0
441 };
442 RMVFR { bits }
443 }
444 #[doc = "Bits 8:11 - SI range after Standby mode"]
445 #[inline]
446 pub fn msisrange(&self) -> MSISRANGER {
447 let bits = {
448 const MASK: u8 = 15;
449 const OFFSET: u8 = 8;
450 ((self.bits >> OFFSET) & MASK as u32) as u8
451 };
452 MSISRANGER { bits }
453 }
454 #[doc = "Bit 1 - LSI oscillator ready"]
455 #[inline]
456 pub fn lsirdy(&self) -> LSIRDYR {
457 let bits = {
458 const MASK: bool = true;
459 const OFFSET: u8 = 1;
460 ((self.bits >> OFFSET) & MASK as u32) != 0
461 };
462 LSIRDYR { bits }
463 }
464 #[doc = "Bit 0 - LSI oscillator enable"]
465 #[inline]
466 pub fn lsion(&self) -> LSIONR {
467 let bits = {
468 const MASK: bool = true;
469 const OFFSET: u8 = 0;
470 ((self.bits >> OFFSET) & MASK as u32) != 0
471 };
472 LSIONR { bits }
473 }
474}
475impl W {
476 #[doc = r" Reset value of the register"]
477 #[inline]
478 pub fn reset_value() -> W {
479 W { bits: 201328128 }
480 }
481 #[doc = r" Writes raw bits to the register"]
482 #[inline]
483 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
484 self.bits = bits;
485 self
486 }
487 #[doc = "Bit 23 - Remove reset flag"]
488 #[inline]
489 pub fn rmvf(&mut self) -> _RMVFW {
490 _RMVFW { w: self }
491 }
492 #[doc = "Bits 8:11 - SI range after Standby mode"]
493 #[inline]
494 pub fn msisrange(&mut self) -> _MSISRANGEW {
495 _MSISRANGEW { w: self }
496 }
497 #[doc = "Bit 0 - LSI oscillator enable"]
498 #[inline]
499 pub fn lsion(&mut self) -> _LSIONW {
500 _LSIONW { w: self }
501 }
502}