stm32l4x2_pac/syscfg/
cfgr1.rs1#[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::CFGR1 {
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 FPU_IER {
47 bits: u8,
48}
49impl FPU_IER {
50 #[doc = r" Value of the field as raw bits"]
51 #[inline]
52 pub fn bits(&self) -> u8 {
53 self.bits
54 }
55}
56#[doc = r" Value of the field"]
57pub struct I2C3_FMPR {
58 bits: bool,
59}
60impl I2C3_FMPR {
61 #[doc = r" Value of the field as raw bits"]
62 #[inline]
63 pub fn bit(&self) -> bool {
64 self.bits
65 }
66 #[doc = r" Returns `true` if the bit is clear (0)"]
67 #[inline]
68 pub fn bit_is_clear(&self) -> bool {
69 !self.bit()
70 }
71 #[doc = r" Returns `true` if the bit is set (1)"]
72 #[inline]
73 pub fn bit_is_set(&self) -> bool {
74 self.bit()
75 }
76}
77#[doc = r" Value of the field"]
78pub struct I2C2_FMPR {
79 bits: bool,
80}
81impl I2C2_FMPR {
82 #[doc = r" Value of the field as raw bits"]
83 #[inline]
84 pub fn bit(&self) -> bool {
85 self.bits
86 }
87 #[doc = r" Returns `true` if the bit is clear (0)"]
88 #[inline]
89 pub fn bit_is_clear(&self) -> bool {
90 !self.bit()
91 }
92 #[doc = r" Returns `true` if the bit is set (1)"]
93 #[inline]
94 pub fn bit_is_set(&self) -> bool {
95 self.bit()
96 }
97}
98#[doc = r" Value of the field"]
99pub struct I2C1_FMPR {
100 bits: bool,
101}
102impl I2C1_FMPR {
103 #[doc = r" Value of the field as raw bits"]
104 #[inline]
105 pub fn bit(&self) -> bool {
106 self.bits
107 }
108 #[doc = r" Returns `true` if the bit is clear (0)"]
109 #[inline]
110 pub fn bit_is_clear(&self) -> bool {
111 !self.bit()
112 }
113 #[doc = r" Returns `true` if the bit is set (1)"]
114 #[inline]
115 pub fn bit_is_set(&self) -> bool {
116 self.bit()
117 }
118}
119#[doc = r" Value of the field"]
120pub struct I2C_PB9_FMPR {
121 bits: bool,
122}
123impl I2C_PB9_FMPR {
124 #[doc = r" Value of the field as raw bits"]
125 #[inline]
126 pub fn bit(&self) -> bool {
127 self.bits
128 }
129 #[doc = r" Returns `true` if the bit is clear (0)"]
130 #[inline]
131 pub fn bit_is_clear(&self) -> bool {
132 !self.bit()
133 }
134 #[doc = r" Returns `true` if the bit is set (1)"]
135 #[inline]
136 pub fn bit_is_set(&self) -> bool {
137 self.bit()
138 }
139}
140#[doc = r" Value of the field"]
141pub struct I2C_PB8_FMPR {
142 bits: bool,
143}
144impl I2C_PB8_FMPR {
145 #[doc = r" Value of the field as raw bits"]
146 #[inline]
147 pub fn bit(&self) -> bool {
148 self.bits
149 }
150 #[doc = r" Returns `true` if the bit is clear (0)"]
151 #[inline]
152 pub fn bit_is_clear(&self) -> bool {
153 !self.bit()
154 }
155 #[doc = r" Returns `true` if the bit is set (1)"]
156 #[inline]
157 pub fn bit_is_set(&self) -> bool {
158 self.bit()
159 }
160}
161#[doc = r" Value of the field"]
162pub struct I2C_PB7_FMPR {
163 bits: bool,
164}
165impl I2C_PB7_FMPR {
166 #[doc = r" Value of the field as raw bits"]
167 #[inline]
168 pub fn bit(&self) -> bool {
169 self.bits
170 }
171 #[doc = r" Returns `true` if the bit is clear (0)"]
172 #[inline]
173 pub fn bit_is_clear(&self) -> bool {
174 !self.bit()
175 }
176 #[doc = r" Returns `true` if the bit is set (1)"]
177 #[inline]
178 pub fn bit_is_set(&self) -> bool {
179 self.bit()
180 }
181}
182#[doc = r" Value of the field"]
183pub struct I2C_PB6_FMPR {
184 bits: bool,
185}
186impl I2C_PB6_FMPR {
187 #[doc = r" Value of the field as raw bits"]
188 #[inline]
189 pub fn bit(&self) -> bool {
190 self.bits
191 }
192 #[doc = r" Returns `true` if the bit is clear (0)"]
193 #[inline]
194 pub fn bit_is_clear(&self) -> bool {
195 !self.bit()
196 }
197 #[doc = r" Returns `true` if the bit is set (1)"]
198 #[inline]
199 pub fn bit_is_set(&self) -> bool {
200 self.bit()
201 }
202}
203#[doc = r" Value of the field"]
204pub struct BOOSTENR {
205 bits: bool,
206}
207impl BOOSTENR {
208 #[doc = r" Value of the field as raw bits"]
209 #[inline]
210 pub fn bit(&self) -> bool {
211 self.bits
212 }
213 #[doc = r" Returns `true` if the bit is clear (0)"]
214 #[inline]
215 pub fn bit_is_clear(&self) -> bool {
216 !self.bit()
217 }
218 #[doc = r" Returns `true` if the bit is set (1)"]
219 #[inline]
220 pub fn bit_is_set(&self) -> bool {
221 self.bit()
222 }
223}
224#[doc = r" Value of the field"]
225pub struct FWDISR {
226 bits: bool,
227}
228impl FWDISR {
229 #[doc = r" Value of the field as raw bits"]
230 #[inline]
231 pub fn bit(&self) -> bool {
232 self.bits
233 }
234 #[doc = r" Returns `true` if the bit is clear (0)"]
235 #[inline]
236 pub fn bit_is_clear(&self) -> bool {
237 !self.bit()
238 }
239 #[doc = r" Returns `true` if the bit is set (1)"]
240 #[inline]
241 pub fn bit_is_set(&self) -> bool {
242 self.bit()
243 }
244}
245#[doc = r" Proxy"]
246pub struct _FPU_IEW<'a> {
247 w: &'a mut W,
248}
249impl<'a> _FPU_IEW<'a> {
250 #[doc = r" Writes raw bits to the field"]
251 #[inline]
252 pub unsafe fn bits(self, value: u8) -> &'a mut W {
253 const MASK: u8 = 63;
254 const OFFSET: u8 = 26;
255 self.w.bits &= !((MASK as u32) << OFFSET);
256 self.w.bits |= ((value & MASK) as u32) << OFFSET;
257 self.w
258 }
259}
260#[doc = r" Proxy"]
261pub struct _I2C3_FMPW<'a> {
262 w: &'a mut W,
263}
264impl<'a> _I2C3_FMPW<'a> {
265 #[doc = r" Sets the field bit"]
266 pub fn set_bit(self) -> &'a mut W {
267 self.bit(true)
268 }
269 #[doc = r" Clears the field bit"]
270 pub fn clear_bit(self) -> &'a mut W {
271 self.bit(false)
272 }
273 #[doc = r" Writes raw bits to the field"]
274 #[inline]
275 pub fn bit(self, value: bool) -> &'a mut W {
276 const MASK: bool = true;
277 const OFFSET: u8 = 22;
278 self.w.bits &= !((MASK as u32) << OFFSET);
279 self.w.bits |= ((value & MASK) as u32) << OFFSET;
280 self.w
281 }
282}
283#[doc = r" Proxy"]
284pub struct _I2C2_FMPW<'a> {
285 w: &'a mut W,
286}
287impl<'a> _I2C2_FMPW<'a> {
288 #[doc = r" Sets the field bit"]
289 pub fn set_bit(self) -> &'a mut W {
290 self.bit(true)
291 }
292 #[doc = r" Clears the field bit"]
293 pub fn clear_bit(self) -> &'a mut W {
294 self.bit(false)
295 }
296 #[doc = r" Writes raw bits to the field"]
297 #[inline]
298 pub fn bit(self, value: bool) -> &'a mut W {
299 const MASK: bool = true;
300 const OFFSET: u8 = 21;
301 self.w.bits &= !((MASK as u32) << OFFSET);
302 self.w.bits |= ((value & MASK) as u32) << OFFSET;
303 self.w
304 }
305}
306#[doc = r" Proxy"]
307pub struct _I2C1_FMPW<'a> {
308 w: &'a mut W,
309}
310impl<'a> _I2C1_FMPW<'a> {
311 #[doc = r" Sets the field bit"]
312 pub fn set_bit(self) -> &'a mut W {
313 self.bit(true)
314 }
315 #[doc = r" Clears the field bit"]
316 pub fn clear_bit(self) -> &'a mut W {
317 self.bit(false)
318 }
319 #[doc = r" Writes raw bits to the field"]
320 #[inline]
321 pub fn bit(self, value: bool) -> &'a mut W {
322 const MASK: bool = true;
323 const OFFSET: u8 = 20;
324 self.w.bits &= !((MASK as u32) << OFFSET);
325 self.w.bits |= ((value & MASK) as u32) << OFFSET;
326 self.w
327 }
328}
329#[doc = r" Proxy"]
330pub struct _I2C_PB9_FMPW<'a> {
331 w: &'a mut W,
332}
333impl<'a> _I2C_PB9_FMPW<'a> {
334 #[doc = r" Sets the field bit"]
335 pub fn set_bit(self) -> &'a mut W {
336 self.bit(true)
337 }
338 #[doc = r" Clears the field bit"]
339 pub fn clear_bit(self) -> &'a mut W {
340 self.bit(false)
341 }
342 #[doc = r" Writes raw bits to the field"]
343 #[inline]
344 pub fn bit(self, value: bool) -> &'a mut W {
345 const MASK: bool = true;
346 const OFFSET: u8 = 19;
347 self.w.bits &= !((MASK as u32) << OFFSET);
348 self.w.bits |= ((value & MASK) as u32) << OFFSET;
349 self.w
350 }
351}
352#[doc = r" Proxy"]
353pub struct _I2C_PB8_FMPW<'a> {
354 w: &'a mut W,
355}
356impl<'a> _I2C_PB8_FMPW<'a> {
357 #[doc = r" Sets the field bit"]
358 pub fn set_bit(self) -> &'a mut W {
359 self.bit(true)
360 }
361 #[doc = r" Clears the field bit"]
362 pub fn clear_bit(self) -> &'a mut W {
363 self.bit(false)
364 }
365 #[doc = r" Writes raw bits to the field"]
366 #[inline]
367 pub fn bit(self, value: bool) -> &'a mut W {
368 const MASK: bool = true;
369 const OFFSET: u8 = 18;
370 self.w.bits &= !((MASK as u32) << OFFSET);
371 self.w.bits |= ((value & MASK) as u32) << OFFSET;
372 self.w
373 }
374}
375#[doc = r" Proxy"]
376pub struct _I2C_PB7_FMPW<'a> {
377 w: &'a mut W,
378}
379impl<'a> _I2C_PB7_FMPW<'a> {
380 #[doc = r" Sets the field bit"]
381 pub fn set_bit(self) -> &'a mut W {
382 self.bit(true)
383 }
384 #[doc = r" Clears the field bit"]
385 pub fn clear_bit(self) -> &'a mut W {
386 self.bit(false)
387 }
388 #[doc = r" Writes raw bits to the field"]
389 #[inline]
390 pub fn bit(self, value: bool) -> &'a mut W {
391 const MASK: bool = true;
392 const OFFSET: u8 = 17;
393 self.w.bits &= !((MASK as u32) << OFFSET);
394 self.w.bits |= ((value & MASK) as u32) << OFFSET;
395 self.w
396 }
397}
398#[doc = r" Proxy"]
399pub struct _I2C_PB6_FMPW<'a> {
400 w: &'a mut W,
401}
402impl<'a> _I2C_PB6_FMPW<'a> {
403 #[doc = r" Sets the field bit"]
404 pub fn set_bit(self) -> &'a mut W {
405 self.bit(true)
406 }
407 #[doc = r" Clears the field bit"]
408 pub fn clear_bit(self) -> &'a mut W {
409 self.bit(false)
410 }
411 #[doc = r" Writes raw bits to the field"]
412 #[inline]
413 pub fn bit(self, value: bool) -> &'a mut W {
414 const MASK: bool = true;
415 const OFFSET: u8 = 16;
416 self.w.bits &= !((MASK as u32) << OFFSET);
417 self.w.bits |= ((value & MASK) as u32) << OFFSET;
418 self.w
419 }
420}
421#[doc = r" Proxy"]
422pub struct _BOOSTENW<'a> {
423 w: &'a mut W,
424}
425impl<'a> _BOOSTENW<'a> {
426 #[doc = r" Sets the field bit"]
427 pub fn set_bit(self) -> &'a mut W {
428 self.bit(true)
429 }
430 #[doc = r" Clears the field bit"]
431 pub fn clear_bit(self) -> &'a mut W {
432 self.bit(false)
433 }
434 #[doc = r" Writes raw bits to the field"]
435 #[inline]
436 pub fn bit(self, value: bool) -> &'a mut W {
437 const MASK: bool = true;
438 const OFFSET: u8 = 8;
439 self.w.bits &= !((MASK as u32) << OFFSET);
440 self.w.bits |= ((value & MASK) as u32) << OFFSET;
441 self.w
442 }
443}
444#[doc = r" Proxy"]
445pub struct _FWDISW<'a> {
446 w: &'a mut W,
447}
448impl<'a> _FWDISW<'a> {
449 #[doc = r" Sets the field bit"]
450 pub fn set_bit(self) -> &'a mut W {
451 self.bit(true)
452 }
453 #[doc = r" Clears the field bit"]
454 pub fn clear_bit(self) -> &'a mut W {
455 self.bit(false)
456 }
457 #[doc = r" Writes raw bits to the field"]
458 #[inline]
459 pub fn bit(self, value: bool) -> &'a mut W {
460 const MASK: bool = true;
461 const OFFSET: u8 = 0;
462 self.w.bits &= !((MASK as u32) << OFFSET);
463 self.w.bits |= ((value & MASK) as u32) << OFFSET;
464 self.w
465 }
466}
467impl R {
468 #[doc = r" Value of the register as raw bits"]
469 #[inline]
470 pub fn bits(&self) -> u32 {
471 self.bits
472 }
473 #[doc = "Bits 26:31 - Floating Point Unit interrupts enable bits"]
474 #[inline]
475 pub fn fpu_ie(&self) -> FPU_IER {
476 let bits = {
477 const MASK: u8 = 63;
478 const OFFSET: u8 = 26;
479 ((self.bits >> OFFSET) & MASK as u32) as u8
480 };
481 FPU_IER { bits }
482 }
483 #[doc = "Bit 22 - I2C3 Fast-mode Plus driving capability activation"]
484 #[inline]
485 pub fn i2c3_fmp(&self) -> I2C3_FMPR {
486 let bits = {
487 const MASK: bool = true;
488 const OFFSET: u8 = 22;
489 ((self.bits >> OFFSET) & MASK as u32) != 0
490 };
491 I2C3_FMPR { bits }
492 }
493 #[doc = "Bit 21 - I2C2 Fast-mode Plus driving capability activation"]
494 #[inline]
495 pub fn i2c2_fmp(&self) -> I2C2_FMPR {
496 let bits = {
497 const MASK: bool = true;
498 const OFFSET: u8 = 21;
499 ((self.bits >> OFFSET) & MASK as u32) != 0
500 };
501 I2C2_FMPR { bits }
502 }
503 #[doc = "Bit 20 - I2C1 Fast-mode Plus driving capability activation"]
504 #[inline]
505 pub fn i2c1_fmp(&self) -> I2C1_FMPR {
506 let bits = {
507 const MASK: bool = true;
508 const OFFSET: u8 = 20;
509 ((self.bits >> OFFSET) & MASK as u32) != 0
510 };
511 I2C1_FMPR { bits }
512 }
513 #[doc = "Bit 19 - Fast-mode Plus (Fm+) driving capability activation on PB9"]
514 #[inline]
515 pub fn i2c_pb9_fmp(&self) -> I2C_PB9_FMPR {
516 let bits = {
517 const MASK: bool = true;
518 const OFFSET: u8 = 19;
519 ((self.bits >> OFFSET) & MASK as u32) != 0
520 };
521 I2C_PB9_FMPR { bits }
522 }
523 #[doc = "Bit 18 - Fast-mode Plus (Fm+) driving capability activation on PB8"]
524 #[inline]
525 pub fn i2c_pb8_fmp(&self) -> I2C_PB8_FMPR {
526 let bits = {
527 const MASK: bool = true;
528 const OFFSET: u8 = 18;
529 ((self.bits >> OFFSET) & MASK as u32) != 0
530 };
531 I2C_PB8_FMPR { bits }
532 }
533 #[doc = "Bit 17 - Fast-mode Plus (Fm+) driving capability activation on PB7"]
534 #[inline]
535 pub fn i2c_pb7_fmp(&self) -> I2C_PB7_FMPR {
536 let bits = {
537 const MASK: bool = true;
538 const OFFSET: u8 = 17;
539 ((self.bits >> OFFSET) & MASK as u32) != 0
540 };
541 I2C_PB7_FMPR { bits }
542 }
543 #[doc = "Bit 16 - Fast-mode Plus (Fm+) driving capability activation on PB6"]
544 #[inline]
545 pub fn i2c_pb6_fmp(&self) -> I2C_PB6_FMPR {
546 let bits = {
547 const MASK: bool = true;
548 const OFFSET: u8 = 16;
549 ((self.bits >> OFFSET) & MASK as u32) != 0
550 };
551 I2C_PB6_FMPR { bits }
552 }
553 #[doc = "Bit 8 - I/O analog switch voltage booster enable"]
554 #[inline]
555 pub fn boosten(&self) -> BOOSTENR {
556 let bits = {
557 const MASK: bool = true;
558 const OFFSET: u8 = 8;
559 ((self.bits >> OFFSET) & MASK as u32) != 0
560 };
561 BOOSTENR { bits }
562 }
563 #[doc = "Bit 0 - Firewall disable"]
564 #[inline]
565 pub fn fwdis(&self) -> FWDISR {
566 let bits = {
567 const MASK: bool = true;
568 const OFFSET: u8 = 0;
569 ((self.bits >> OFFSET) & MASK as u32) != 0
570 };
571 FWDISR { bits }
572 }
573}
574impl W {
575 #[doc = r" Reset value of the register"]
576 #[inline]
577 pub fn reset_value() -> W {
578 W { bits: 2080374785 }
579 }
580 #[doc = r" Writes raw bits to the register"]
581 #[inline]
582 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
583 self.bits = bits;
584 self
585 }
586 #[doc = "Bits 26:31 - Floating Point Unit interrupts enable bits"]
587 #[inline]
588 pub fn fpu_ie(&mut self) -> _FPU_IEW {
589 _FPU_IEW { w: self }
590 }
591 #[doc = "Bit 22 - I2C3 Fast-mode Plus driving capability activation"]
592 #[inline]
593 pub fn i2c3_fmp(&mut self) -> _I2C3_FMPW {
594 _I2C3_FMPW { w: self }
595 }
596 #[doc = "Bit 21 - I2C2 Fast-mode Plus driving capability activation"]
597 #[inline]
598 pub fn i2c2_fmp(&mut self) -> _I2C2_FMPW {
599 _I2C2_FMPW { w: self }
600 }
601 #[doc = "Bit 20 - I2C1 Fast-mode Plus driving capability activation"]
602 #[inline]
603 pub fn i2c1_fmp(&mut self) -> _I2C1_FMPW {
604 _I2C1_FMPW { w: self }
605 }
606 #[doc = "Bit 19 - Fast-mode Plus (Fm+) driving capability activation on PB9"]
607 #[inline]
608 pub fn i2c_pb9_fmp(&mut self) -> _I2C_PB9_FMPW {
609 _I2C_PB9_FMPW { w: self }
610 }
611 #[doc = "Bit 18 - Fast-mode Plus (Fm+) driving capability activation on PB8"]
612 #[inline]
613 pub fn i2c_pb8_fmp(&mut self) -> _I2C_PB8_FMPW {
614 _I2C_PB8_FMPW { w: self }
615 }
616 #[doc = "Bit 17 - Fast-mode Plus (Fm+) driving capability activation on PB7"]
617 #[inline]
618 pub fn i2c_pb7_fmp(&mut self) -> _I2C_PB7_FMPW {
619 _I2C_PB7_FMPW { w: self }
620 }
621 #[doc = "Bit 16 - Fast-mode Plus (Fm+) driving capability activation on PB6"]
622 #[inline]
623 pub fn i2c_pb6_fmp(&mut self) -> _I2C_PB6_FMPW {
624 _I2C_PB6_FMPW { w: self }
625 }
626 #[doc = "Bit 8 - I/O analog switch voltage booster enable"]
627 #[inline]
628 pub fn boosten(&mut self) -> _BOOSTENW {
629 _BOOSTENW { w: self }
630 }
631 #[doc = "Bit 0 - Firewall disable"]
632 #[inline]
633 pub fn fwdis(&mut self) -> _FWDISW {
634 _FWDISW { w: self }
635 }
636}