stm32l4x2_pac/rtc/
alrmar.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::ALRMAR {
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 MSK4R {
47 bits: bool,
48}
49impl MSK4R {
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 WDSELR {
68 bits: bool,
69}
70impl WDSELR {
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 DTR {
89 bits: u8,
90}
91impl DTR {
92 #[doc = r" Value of the field as raw bits"]
93 #[inline]
94 pub fn bits(&self) -> u8 {
95 self.bits
96 }
97}
98#[doc = r" Value of the field"]
99pub struct DUR {
100 bits: u8,
101}
102impl DUR {
103 #[doc = r" Value of the field as raw bits"]
104 #[inline]
105 pub fn bits(&self) -> u8 {
106 self.bits
107 }
108}
109#[doc = r" Value of the field"]
110pub struct MSK3R {
111 bits: bool,
112}
113impl MSK3R {
114 #[doc = r" Value of the field as raw bits"]
115 #[inline]
116 pub fn bit(&self) -> bool {
117 self.bits
118 }
119 #[doc = r" Returns `true` if the bit is clear (0)"]
120 #[inline]
121 pub fn bit_is_clear(&self) -> bool {
122 !self.bit()
123 }
124 #[doc = r" Returns `true` if the bit is set (1)"]
125 #[inline]
126 pub fn bit_is_set(&self) -> bool {
127 self.bit()
128 }
129}
130#[doc = r" Value of the field"]
131pub struct PMR {
132 bits: bool,
133}
134impl PMR {
135 #[doc = r" Value of the field as raw bits"]
136 #[inline]
137 pub fn bit(&self) -> bool {
138 self.bits
139 }
140 #[doc = r" Returns `true` if the bit is clear (0)"]
141 #[inline]
142 pub fn bit_is_clear(&self) -> bool {
143 !self.bit()
144 }
145 #[doc = r" Returns `true` if the bit is set (1)"]
146 #[inline]
147 pub fn bit_is_set(&self) -> bool {
148 self.bit()
149 }
150}
151#[doc = r" Value of the field"]
152pub struct HTR {
153 bits: u8,
154}
155impl HTR {
156 #[doc = r" Value of the field as raw bits"]
157 #[inline]
158 pub fn bits(&self) -> u8 {
159 self.bits
160 }
161}
162#[doc = r" Value of the field"]
163pub struct HUR {
164 bits: u8,
165}
166impl HUR {
167 #[doc = r" Value of the field as raw bits"]
168 #[inline]
169 pub fn bits(&self) -> u8 {
170 self.bits
171 }
172}
173#[doc = r" Value of the field"]
174pub struct MSK2R {
175 bits: bool,
176}
177impl MSK2R {
178 #[doc = r" Value of the field as raw bits"]
179 #[inline]
180 pub fn bit(&self) -> bool {
181 self.bits
182 }
183 #[doc = r" Returns `true` if the bit is clear (0)"]
184 #[inline]
185 pub fn bit_is_clear(&self) -> bool {
186 !self.bit()
187 }
188 #[doc = r" Returns `true` if the bit is set (1)"]
189 #[inline]
190 pub fn bit_is_set(&self) -> bool {
191 self.bit()
192 }
193}
194#[doc = r" Value of the field"]
195pub struct MNTR {
196 bits: u8,
197}
198impl MNTR {
199 #[doc = r" Value of the field as raw bits"]
200 #[inline]
201 pub fn bits(&self) -> u8 {
202 self.bits
203 }
204}
205#[doc = r" Value of the field"]
206pub struct MNUR {
207 bits: u8,
208}
209impl MNUR {
210 #[doc = r" Value of the field as raw bits"]
211 #[inline]
212 pub fn bits(&self) -> u8 {
213 self.bits
214 }
215}
216#[doc = r" Value of the field"]
217pub struct MSK1R {
218 bits: bool,
219}
220impl MSK1R {
221 #[doc = r" Value of the field as raw bits"]
222 #[inline]
223 pub fn bit(&self) -> bool {
224 self.bits
225 }
226 #[doc = r" Returns `true` if the bit is clear (0)"]
227 #[inline]
228 pub fn bit_is_clear(&self) -> bool {
229 !self.bit()
230 }
231 #[doc = r" Returns `true` if the bit is set (1)"]
232 #[inline]
233 pub fn bit_is_set(&self) -> bool {
234 self.bit()
235 }
236}
237#[doc = r" Value of the field"]
238pub struct STR {
239 bits: u8,
240}
241impl STR {
242 #[doc = r" Value of the field as raw bits"]
243 #[inline]
244 pub fn bits(&self) -> u8 {
245 self.bits
246 }
247}
248#[doc = r" Value of the field"]
249pub struct SUR {
250 bits: u8,
251}
252impl SUR {
253 #[doc = r" Value of the field as raw bits"]
254 #[inline]
255 pub fn bits(&self) -> u8 {
256 self.bits
257 }
258}
259#[doc = r" Proxy"]
260pub struct _MSK4W<'a> {
261 w: &'a mut W,
262}
263impl<'a> _MSK4W<'a> {
264 #[doc = r" Sets the field bit"]
265 pub fn set_bit(self) -> &'a mut W {
266 self.bit(true)
267 }
268 #[doc = r" Clears the field bit"]
269 pub fn clear_bit(self) -> &'a mut W {
270 self.bit(false)
271 }
272 #[doc = r" Writes raw bits to the field"]
273 #[inline]
274 pub fn bit(self, value: bool) -> &'a mut W {
275 const MASK: bool = true;
276 const OFFSET: u8 = 31;
277 self.w.bits &= !((MASK as u32) << OFFSET);
278 self.w.bits |= ((value & MASK) as u32) << OFFSET;
279 self.w
280 }
281}
282#[doc = r" Proxy"]
283pub struct _WDSELW<'a> {
284 w: &'a mut W,
285}
286impl<'a> _WDSELW<'a> {
287 #[doc = r" Sets the field bit"]
288 pub fn set_bit(self) -> &'a mut W {
289 self.bit(true)
290 }
291 #[doc = r" Clears the field bit"]
292 pub fn clear_bit(self) -> &'a mut W {
293 self.bit(false)
294 }
295 #[doc = r" Writes raw bits to the field"]
296 #[inline]
297 pub fn bit(self, value: bool) -> &'a mut W {
298 const MASK: bool = true;
299 const OFFSET: u8 = 30;
300 self.w.bits &= !((MASK as u32) << OFFSET);
301 self.w.bits |= ((value & MASK) as u32) << OFFSET;
302 self.w
303 }
304}
305#[doc = r" Proxy"]
306pub struct _DTW<'a> {
307 w: &'a mut W,
308}
309impl<'a> _DTW<'a> {
310 #[doc = r" Writes raw bits to the field"]
311 #[inline]
312 pub unsafe fn bits(self, value: u8) -> &'a mut W {
313 const MASK: u8 = 3;
314 const OFFSET: u8 = 28;
315 self.w.bits &= !((MASK as u32) << OFFSET);
316 self.w.bits |= ((value & MASK) as u32) << OFFSET;
317 self.w
318 }
319}
320#[doc = r" Proxy"]
321pub struct _DUW<'a> {
322 w: &'a mut W,
323}
324impl<'a> _DUW<'a> {
325 #[doc = r" Writes raw bits to the field"]
326 #[inline]
327 pub unsafe fn bits(self, value: u8) -> &'a mut W {
328 const MASK: u8 = 15;
329 const OFFSET: u8 = 24;
330 self.w.bits &= !((MASK as u32) << OFFSET);
331 self.w.bits |= ((value & MASK) as u32) << OFFSET;
332 self.w
333 }
334}
335#[doc = r" Proxy"]
336pub struct _MSK3W<'a> {
337 w: &'a mut W,
338}
339impl<'a> _MSK3W<'a> {
340 #[doc = r" Sets the field bit"]
341 pub fn set_bit(self) -> &'a mut W {
342 self.bit(true)
343 }
344 #[doc = r" Clears the field bit"]
345 pub fn clear_bit(self) -> &'a mut W {
346 self.bit(false)
347 }
348 #[doc = r" Writes raw bits to the field"]
349 #[inline]
350 pub fn bit(self, value: bool) -> &'a mut W {
351 const MASK: bool = true;
352 const OFFSET: u8 = 23;
353 self.w.bits &= !((MASK as u32) << OFFSET);
354 self.w.bits |= ((value & MASK) as u32) << OFFSET;
355 self.w
356 }
357}
358#[doc = r" Proxy"]
359pub struct _PMW<'a> {
360 w: &'a mut W,
361}
362impl<'a> _PMW<'a> {
363 #[doc = r" Sets the field bit"]
364 pub fn set_bit(self) -> &'a mut W {
365 self.bit(true)
366 }
367 #[doc = r" Clears the field bit"]
368 pub fn clear_bit(self) -> &'a mut W {
369 self.bit(false)
370 }
371 #[doc = r" Writes raw bits to the field"]
372 #[inline]
373 pub fn bit(self, value: bool) -> &'a mut W {
374 const MASK: bool = true;
375 const OFFSET: u8 = 22;
376 self.w.bits &= !((MASK as u32) << OFFSET);
377 self.w.bits |= ((value & MASK) as u32) << OFFSET;
378 self.w
379 }
380}
381#[doc = r" Proxy"]
382pub struct _HTW<'a> {
383 w: &'a mut W,
384}
385impl<'a> _HTW<'a> {
386 #[doc = r" Writes raw bits to the field"]
387 #[inline]
388 pub unsafe fn bits(self, value: u8) -> &'a mut W {
389 const MASK: u8 = 3;
390 const OFFSET: u8 = 20;
391 self.w.bits &= !((MASK as u32) << OFFSET);
392 self.w.bits |= ((value & MASK) as u32) << OFFSET;
393 self.w
394 }
395}
396#[doc = r" Proxy"]
397pub struct _HUW<'a> {
398 w: &'a mut W,
399}
400impl<'a> _HUW<'a> {
401 #[doc = r" Writes raw bits to the field"]
402 #[inline]
403 pub unsafe fn bits(self, value: u8) -> &'a mut W {
404 const MASK: u8 = 15;
405 const OFFSET: u8 = 16;
406 self.w.bits &= !((MASK as u32) << OFFSET);
407 self.w.bits |= ((value & MASK) as u32) << OFFSET;
408 self.w
409 }
410}
411#[doc = r" Proxy"]
412pub struct _MSK2W<'a> {
413 w: &'a mut W,
414}
415impl<'a> _MSK2W<'a> {
416 #[doc = r" Sets the field bit"]
417 pub fn set_bit(self) -> &'a mut W {
418 self.bit(true)
419 }
420 #[doc = r" Clears the field bit"]
421 pub fn clear_bit(self) -> &'a mut W {
422 self.bit(false)
423 }
424 #[doc = r" Writes raw bits to the field"]
425 #[inline]
426 pub fn bit(self, value: bool) -> &'a mut W {
427 const MASK: bool = true;
428 const OFFSET: u8 = 15;
429 self.w.bits &= !((MASK as u32) << OFFSET);
430 self.w.bits |= ((value & MASK) as u32) << OFFSET;
431 self.w
432 }
433}
434#[doc = r" Proxy"]
435pub struct _MNTW<'a> {
436 w: &'a mut W,
437}
438impl<'a> _MNTW<'a> {
439 #[doc = r" Writes raw bits to the field"]
440 #[inline]
441 pub unsafe fn bits(self, value: u8) -> &'a mut W {
442 const MASK: u8 = 7;
443 const OFFSET: u8 = 12;
444 self.w.bits &= !((MASK as u32) << OFFSET);
445 self.w.bits |= ((value & MASK) as u32) << OFFSET;
446 self.w
447 }
448}
449#[doc = r" Proxy"]
450pub struct _MNUW<'a> {
451 w: &'a mut W,
452}
453impl<'a> _MNUW<'a> {
454 #[doc = r" Writes raw bits to the field"]
455 #[inline]
456 pub unsafe fn bits(self, value: u8) -> &'a mut W {
457 const MASK: u8 = 15;
458 const OFFSET: u8 = 8;
459 self.w.bits &= !((MASK as u32) << OFFSET);
460 self.w.bits |= ((value & MASK) as u32) << OFFSET;
461 self.w
462 }
463}
464#[doc = r" Proxy"]
465pub struct _MSK1W<'a> {
466 w: &'a mut W,
467}
468impl<'a> _MSK1W<'a> {
469 #[doc = r" Sets the field bit"]
470 pub fn set_bit(self) -> &'a mut W {
471 self.bit(true)
472 }
473 #[doc = r" Clears the field bit"]
474 pub fn clear_bit(self) -> &'a mut W {
475 self.bit(false)
476 }
477 #[doc = r" Writes raw bits to the field"]
478 #[inline]
479 pub fn bit(self, value: bool) -> &'a mut W {
480 const MASK: bool = true;
481 const OFFSET: u8 = 7;
482 self.w.bits &= !((MASK as u32) << OFFSET);
483 self.w.bits |= ((value & MASK) as u32) << OFFSET;
484 self.w
485 }
486}
487#[doc = r" Proxy"]
488pub struct _STW<'a> {
489 w: &'a mut W,
490}
491impl<'a> _STW<'a> {
492 #[doc = r" Writes raw bits to the field"]
493 #[inline]
494 pub unsafe fn bits(self, value: u8) -> &'a mut W {
495 const MASK: u8 = 7;
496 const OFFSET: u8 = 4;
497 self.w.bits &= !((MASK as u32) << OFFSET);
498 self.w.bits |= ((value & MASK) as u32) << OFFSET;
499 self.w
500 }
501}
502#[doc = r" Proxy"]
503pub struct _SUW<'a> {
504 w: &'a mut W,
505}
506impl<'a> _SUW<'a> {
507 #[doc = r" Writes raw bits to the field"]
508 #[inline]
509 pub unsafe fn bits(self, value: u8) -> &'a mut W {
510 const MASK: u8 = 15;
511 const OFFSET: u8 = 0;
512 self.w.bits &= !((MASK as u32) << OFFSET);
513 self.w.bits |= ((value & MASK) as u32) << OFFSET;
514 self.w
515 }
516}
517impl R {
518 #[doc = r" Value of the register as raw bits"]
519 #[inline]
520 pub fn bits(&self) -> u32 {
521 self.bits
522 }
523 #[doc = "Bit 31 - Alarm A date mask"]
524 #[inline]
525 pub fn msk4(&self) -> MSK4R {
526 let bits = {
527 const MASK: bool = true;
528 const OFFSET: u8 = 31;
529 ((self.bits >> OFFSET) & MASK as u32) != 0
530 };
531 MSK4R { bits }
532 }
533 #[doc = "Bit 30 - Week day selection"]
534 #[inline]
535 pub fn wdsel(&self) -> WDSELR {
536 let bits = {
537 const MASK: bool = true;
538 const OFFSET: u8 = 30;
539 ((self.bits >> OFFSET) & MASK as u32) != 0
540 };
541 WDSELR { bits }
542 }
543 #[doc = "Bits 28:29 - Date tens in BCD format"]
544 #[inline]
545 pub fn dt(&self) -> DTR {
546 let bits = {
547 const MASK: u8 = 3;
548 const OFFSET: u8 = 28;
549 ((self.bits >> OFFSET) & MASK as u32) as u8
550 };
551 DTR { bits }
552 }
553 #[doc = "Bits 24:27 - Date units or day in BCD format"]
554 #[inline]
555 pub fn du(&self) -> DUR {
556 let bits = {
557 const MASK: u8 = 15;
558 const OFFSET: u8 = 24;
559 ((self.bits >> OFFSET) & MASK as u32) as u8
560 };
561 DUR { bits }
562 }
563 #[doc = "Bit 23 - Alarm A hours mask"]
564 #[inline]
565 pub fn msk3(&self) -> MSK3R {
566 let bits = {
567 const MASK: bool = true;
568 const OFFSET: u8 = 23;
569 ((self.bits >> OFFSET) & MASK as u32) != 0
570 };
571 MSK3R { bits }
572 }
573 #[doc = "Bit 22 - AM/PM notation"]
574 #[inline]
575 pub fn pm(&self) -> PMR {
576 let bits = {
577 const MASK: bool = true;
578 const OFFSET: u8 = 22;
579 ((self.bits >> OFFSET) & MASK as u32) != 0
580 };
581 PMR { bits }
582 }
583 #[doc = "Bits 20:21 - Hour tens in BCD format"]
584 #[inline]
585 pub fn ht(&self) -> HTR {
586 let bits = {
587 const MASK: u8 = 3;
588 const OFFSET: u8 = 20;
589 ((self.bits >> OFFSET) & MASK as u32) as u8
590 };
591 HTR { bits }
592 }
593 #[doc = "Bits 16:19 - Hour units in BCD format"]
594 #[inline]
595 pub fn hu(&self) -> HUR {
596 let bits = {
597 const MASK: u8 = 15;
598 const OFFSET: u8 = 16;
599 ((self.bits >> OFFSET) & MASK as u32) as u8
600 };
601 HUR { bits }
602 }
603 #[doc = "Bit 15 - Alarm A minutes mask"]
604 #[inline]
605 pub fn msk2(&self) -> MSK2R {
606 let bits = {
607 const MASK: bool = true;
608 const OFFSET: u8 = 15;
609 ((self.bits >> OFFSET) & MASK as u32) != 0
610 };
611 MSK2R { bits }
612 }
613 #[doc = "Bits 12:14 - Minute tens in BCD format"]
614 #[inline]
615 pub fn mnt(&self) -> MNTR {
616 let bits = {
617 const MASK: u8 = 7;
618 const OFFSET: u8 = 12;
619 ((self.bits >> OFFSET) & MASK as u32) as u8
620 };
621 MNTR { bits }
622 }
623 #[doc = "Bits 8:11 - Minute units in BCD format"]
624 #[inline]
625 pub fn mnu(&self) -> MNUR {
626 let bits = {
627 const MASK: u8 = 15;
628 const OFFSET: u8 = 8;
629 ((self.bits >> OFFSET) & MASK as u32) as u8
630 };
631 MNUR { bits }
632 }
633 #[doc = "Bit 7 - Alarm A seconds mask"]
634 #[inline]
635 pub fn msk1(&self) -> MSK1R {
636 let bits = {
637 const MASK: bool = true;
638 const OFFSET: u8 = 7;
639 ((self.bits >> OFFSET) & MASK as u32) != 0
640 };
641 MSK1R { bits }
642 }
643 #[doc = "Bits 4:6 - Second tens in BCD format"]
644 #[inline]
645 pub fn st(&self) -> STR {
646 let bits = {
647 const MASK: u8 = 7;
648 const OFFSET: u8 = 4;
649 ((self.bits >> OFFSET) & MASK as u32) as u8
650 };
651 STR { bits }
652 }
653 #[doc = "Bits 0:3 - Second units in BCD format"]
654 #[inline]
655 pub fn su(&self) -> SUR {
656 let bits = {
657 const MASK: u8 = 15;
658 const OFFSET: u8 = 0;
659 ((self.bits >> OFFSET) & MASK as u32) as u8
660 };
661 SUR { bits }
662 }
663}
664impl W {
665 #[doc = r" Reset value of the register"]
666 #[inline]
667 pub fn reset_value() -> W {
668 W { bits: 0 }
669 }
670 #[doc = r" Writes raw bits to the register"]
671 #[inline]
672 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
673 self.bits = bits;
674 self
675 }
676 #[doc = "Bit 31 - Alarm A date mask"]
677 #[inline]
678 pub fn msk4(&mut self) -> _MSK4W {
679 _MSK4W { w: self }
680 }
681 #[doc = "Bit 30 - Week day selection"]
682 #[inline]
683 pub fn wdsel(&mut self) -> _WDSELW {
684 _WDSELW { w: self }
685 }
686 #[doc = "Bits 28:29 - Date tens in BCD format"]
687 #[inline]
688 pub fn dt(&mut self) -> _DTW {
689 _DTW { w: self }
690 }
691 #[doc = "Bits 24:27 - Date units or day in BCD format"]
692 #[inline]
693 pub fn du(&mut self) -> _DUW {
694 _DUW { w: self }
695 }
696 #[doc = "Bit 23 - Alarm A hours mask"]
697 #[inline]
698 pub fn msk3(&mut self) -> _MSK3W {
699 _MSK3W { w: self }
700 }
701 #[doc = "Bit 22 - AM/PM notation"]
702 #[inline]
703 pub fn pm(&mut self) -> _PMW {
704 _PMW { w: self }
705 }
706 #[doc = "Bits 20:21 - Hour tens in BCD format"]
707 #[inline]
708 pub fn ht(&mut self) -> _HTW {
709 _HTW { w: self }
710 }
711 #[doc = "Bits 16:19 - Hour units in BCD format"]
712 #[inline]
713 pub fn hu(&mut self) -> _HUW {
714 _HUW { w: self }
715 }
716 #[doc = "Bit 15 - Alarm A minutes mask"]
717 #[inline]
718 pub fn msk2(&mut self) -> _MSK2W {
719 _MSK2W { w: self }
720 }
721 #[doc = "Bits 12:14 - Minute tens in BCD format"]
722 #[inline]
723 pub fn mnt(&mut self) -> _MNTW {
724 _MNTW { w: self }
725 }
726 #[doc = "Bits 8:11 - Minute units in BCD format"]
727 #[inline]
728 pub fn mnu(&mut self) -> _MNUW {
729 _MNUW { w: self }
730 }
731 #[doc = "Bit 7 - Alarm A seconds mask"]
732 #[inline]
733 pub fn msk1(&mut self) -> _MSK1W {
734 _MSK1W { w: self }
735 }
736 #[doc = "Bits 4:6 - Second tens in BCD format"]
737 #[inline]
738 pub fn st(&mut self) -> _STW {
739 _STW { w: self }
740 }
741 #[doc = "Bits 0:3 - Second units in BCD format"]
742 #[inline]
743 pub fn su(&mut self) -> _SUW {
744 _SUW { w: self }
745 }
746}