stm32wb_pac/rtc/
isr.rs

1#[doc = "Reader of register ISR"]
2pub type R = crate::R<u32, super::ISR>;
3#[doc = "Writer for register ISR"]
4pub type W = crate::W<u32, super::ISR>;
5#[doc = "Register ISR `reset()`'s with value 0x07"]
6impl crate::ResetValue for super::ISR {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0x07
11    }
12}
13#[doc = "Reader of field `ALRAWF`"]
14pub type ALRAWF_R = crate::R<bool, bool>;
15#[doc = "Reader of field `ALRBWF`"]
16pub type ALRBWF_R = crate::R<bool, bool>;
17#[doc = "Reader of field `WUTWF`"]
18pub type WUTWF_R = crate::R<bool, bool>;
19#[doc = "Reader of field `SHPF`"]
20pub type SHPF_R = crate::R<bool, bool>;
21#[doc = "Write proxy for field `SHPF`"]
22pub struct SHPF_W<'a> {
23    w: &'a mut W,
24}
25impl<'a> SHPF_W<'a> {
26    #[doc = r"Sets the field bit"]
27    #[inline(always)]
28    pub fn set_bit(self) -> &'a mut W {
29        self.bit(true)
30    }
31    #[doc = r"Clears the field bit"]
32    #[inline(always)]
33    pub fn clear_bit(self) -> &'a mut W {
34        self.bit(false)
35    }
36    #[doc = r"Writes raw bits to the field"]
37    #[inline(always)]
38    pub fn bit(self, value: bool) -> &'a mut W {
39        self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
40        self.w
41    }
42}
43#[doc = "Reader of field `INITS`"]
44pub type INITS_R = crate::R<bool, bool>;
45#[doc = "Reader of field `RSF`"]
46pub type RSF_R = crate::R<bool, bool>;
47#[doc = "Write proxy for field `RSF`"]
48pub struct RSF_W<'a> {
49    w: &'a mut W,
50}
51impl<'a> RSF_W<'a> {
52    #[doc = r"Sets the field bit"]
53    #[inline(always)]
54    pub fn set_bit(self) -> &'a mut W {
55        self.bit(true)
56    }
57    #[doc = r"Clears the field bit"]
58    #[inline(always)]
59    pub fn clear_bit(self) -> &'a mut W {
60        self.bit(false)
61    }
62    #[doc = r"Writes raw bits to the field"]
63    #[inline(always)]
64    pub fn bit(self, value: bool) -> &'a mut W {
65        self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5);
66        self.w
67    }
68}
69#[doc = "Reader of field `INITF`"]
70pub type INITF_R = crate::R<bool, bool>;
71#[doc = "Reader of field `INIT`"]
72pub type INIT_R = crate::R<bool, bool>;
73#[doc = "Write proxy for field `INIT`"]
74pub struct INIT_W<'a> {
75    w: &'a mut W,
76}
77impl<'a> INIT_W<'a> {
78    #[doc = r"Sets the field bit"]
79    #[inline(always)]
80    pub fn set_bit(self) -> &'a mut W {
81        self.bit(true)
82    }
83    #[doc = r"Clears the field bit"]
84    #[inline(always)]
85    pub fn clear_bit(self) -> &'a mut W {
86        self.bit(false)
87    }
88    #[doc = r"Writes raw bits to the field"]
89    #[inline(always)]
90    pub fn bit(self, value: bool) -> &'a mut W {
91        self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7);
92        self.w
93    }
94}
95#[doc = "Reader of field `ALRAF`"]
96pub type ALRAF_R = crate::R<bool, bool>;
97#[doc = "Write proxy for field `ALRAF`"]
98pub struct ALRAF_W<'a> {
99    w: &'a mut W,
100}
101impl<'a> ALRAF_W<'a> {
102    #[doc = r"Sets the field bit"]
103    #[inline(always)]
104    pub fn set_bit(self) -> &'a mut W {
105        self.bit(true)
106    }
107    #[doc = r"Clears the field bit"]
108    #[inline(always)]
109    pub fn clear_bit(self) -> &'a mut W {
110        self.bit(false)
111    }
112    #[doc = r"Writes raw bits to the field"]
113    #[inline(always)]
114    pub fn bit(self, value: bool) -> &'a mut W {
115        self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8);
116        self.w
117    }
118}
119#[doc = "Reader of field `ALRBF`"]
120pub type ALRBF_R = crate::R<bool, bool>;
121#[doc = "Write proxy for field `ALRBF`"]
122pub struct ALRBF_W<'a> {
123    w: &'a mut W,
124}
125impl<'a> ALRBF_W<'a> {
126    #[doc = r"Sets the field bit"]
127    #[inline(always)]
128    pub fn set_bit(self) -> &'a mut W {
129        self.bit(true)
130    }
131    #[doc = r"Clears the field bit"]
132    #[inline(always)]
133    pub fn clear_bit(self) -> &'a mut W {
134        self.bit(false)
135    }
136    #[doc = r"Writes raw bits to the field"]
137    #[inline(always)]
138    pub fn bit(self, value: bool) -> &'a mut W {
139        self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9);
140        self.w
141    }
142}
143#[doc = "Reader of field `WUTF`"]
144pub type WUTF_R = crate::R<bool, bool>;
145#[doc = "Write proxy for field `WUTF`"]
146pub struct WUTF_W<'a> {
147    w: &'a mut W,
148}
149impl<'a> WUTF_W<'a> {
150    #[doc = r"Sets the field bit"]
151    #[inline(always)]
152    pub fn set_bit(self) -> &'a mut W {
153        self.bit(true)
154    }
155    #[doc = r"Clears the field bit"]
156    #[inline(always)]
157    pub fn clear_bit(self) -> &'a mut W {
158        self.bit(false)
159    }
160    #[doc = r"Writes raw bits to the field"]
161    #[inline(always)]
162    pub fn bit(self, value: bool) -> &'a mut W {
163        self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10);
164        self.w
165    }
166}
167#[doc = "Reader of field `TSF`"]
168pub type TSF_R = crate::R<bool, bool>;
169#[doc = "Write proxy for field `TSF`"]
170pub struct TSF_W<'a> {
171    w: &'a mut W,
172}
173impl<'a> TSF_W<'a> {
174    #[doc = r"Sets the field bit"]
175    #[inline(always)]
176    pub fn set_bit(self) -> &'a mut W {
177        self.bit(true)
178    }
179    #[doc = r"Clears the field bit"]
180    #[inline(always)]
181    pub fn clear_bit(self) -> &'a mut W {
182        self.bit(false)
183    }
184    #[doc = r"Writes raw bits to the field"]
185    #[inline(always)]
186    pub fn bit(self, value: bool) -> &'a mut W {
187        self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11);
188        self.w
189    }
190}
191#[doc = "Reader of field `TSOVF`"]
192pub type TSOVF_R = crate::R<bool, bool>;
193#[doc = "Write proxy for field `TSOVF`"]
194pub struct TSOVF_W<'a> {
195    w: &'a mut W,
196}
197impl<'a> TSOVF_W<'a> {
198    #[doc = r"Sets the field bit"]
199    #[inline(always)]
200    pub fn set_bit(self) -> &'a mut W {
201        self.bit(true)
202    }
203    #[doc = r"Clears the field bit"]
204    #[inline(always)]
205    pub fn clear_bit(self) -> &'a mut W {
206        self.bit(false)
207    }
208    #[doc = r"Writes raw bits to the field"]
209    #[inline(always)]
210    pub fn bit(self, value: bool) -> &'a mut W {
211        self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12);
212        self.w
213    }
214}
215#[doc = "Reader of field `TAMP1F`"]
216pub type TAMP1F_R = crate::R<bool, bool>;
217#[doc = "Write proxy for field `TAMP1F`"]
218pub struct TAMP1F_W<'a> {
219    w: &'a mut W,
220}
221impl<'a> TAMP1F_W<'a> {
222    #[doc = r"Sets the field bit"]
223    #[inline(always)]
224    pub fn set_bit(self) -> &'a mut W {
225        self.bit(true)
226    }
227    #[doc = r"Clears the field bit"]
228    #[inline(always)]
229    pub fn clear_bit(self) -> &'a mut W {
230        self.bit(false)
231    }
232    #[doc = r"Writes raw bits to the field"]
233    #[inline(always)]
234    pub fn bit(self, value: bool) -> &'a mut W {
235        self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13);
236        self.w
237    }
238}
239#[doc = "Reader of field `TAMP2F`"]
240pub type TAMP2F_R = crate::R<bool, bool>;
241#[doc = "Write proxy for field `TAMP2F`"]
242pub struct TAMP2F_W<'a> {
243    w: &'a mut W,
244}
245impl<'a> TAMP2F_W<'a> {
246    #[doc = r"Sets the field bit"]
247    #[inline(always)]
248    pub fn set_bit(self) -> &'a mut W {
249        self.bit(true)
250    }
251    #[doc = r"Clears the field bit"]
252    #[inline(always)]
253    pub fn clear_bit(self) -> &'a mut W {
254        self.bit(false)
255    }
256    #[doc = r"Writes raw bits to the field"]
257    #[inline(always)]
258    pub fn bit(self, value: bool) -> &'a mut W {
259        self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14);
260        self.w
261    }
262}
263#[doc = "Reader of field `TAMP3F`"]
264pub type TAMP3F_R = crate::R<bool, bool>;
265#[doc = "Write proxy for field `TAMP3F`"]
266pub struct TAMP3F_W<'a> {
267    w: &'a mut W,
268}
269impl<'a> TAMP3F_W<'a> {
270    #[doc = r"Sets the field bit"]
271    #[inline(always)]
272    pub fn set_bit(self) -> &'a mut W {
273        self.bit(true)
274    }
275    #[doc = r"Clears the field bit"]
276    #[inline(always)]
277    pub fn clear_bit(self) -> &'a mut W {
278        self.bit(false)
279    }
280    #[doc = r"Writes raw bits to the field"]
281    #[inline(always)]
282    pub fn bit(self, value: bool) -> &'a mut W {
283        self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15);
284        self.w
285    }
286}
287#[doc = "Reader of field `RECALPF`"]
288pub type RECALPF_R = crate::R<bool, bool>;
289#[doc = "Reader of field `ITSF`"]
290pub type ITSF_R = crate::R<bool, bool>;
291#[doc = "Write proxy for field `ITSF`"]
292pub struct ITSF_W<'a> {
293    w: &'a mut W,
294}
295impl<'a> ITSF_W<'a> {
296    #[doc = r"Sets the field bit"]
297    #[inline(always)]
298    pub fn set_bit(self) -> &'a mut W {
299        self.bit(true)
300    }
301    #[doc = r"Clears the field bit"]
302    #[inline(always)]
303    pub fn clear_bit(self) -> &'a mut W {
304        self.bit(false)
305    }
306    #[doc = r"Writes raw bits to the field"]
307    #[inline(always)]
308    pub fn bit(self, value: bool) -> &'a mut W {
309        self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17);
310        self.w
311    }
312}
313impl R {
314    #[doc = "Bit 0 - Alarm A write flag"]
315    #[inline(always)]
316    pub fn alrawf(&self) -> ALRAWF_R {
317        ALRAWF_R::new((self.bits & 0x01) != 0)
318    }
319    #[doc = "Bit 1 - Alarm B write flag"]
320    #[inline(always)]
321    pub fn alrbwf(&self) -> ALRBWF_R {
322        ALRBWF_R::new(((self.bits >> 1) & 0x01) != 0)
323    }
324    #[doc = "Bit 2 - Wakeup timer write flag"]
325    #[inline(always)]
326    pub fn wutwf(&self) -> WUTWF_R {
327        WUTWF_R::new(((self.bits >> 2) & 0x01) != 0)
328    }
329    #[doc = "Bit 3 - Shift operation pending"]
330    #[inline(always)]
331    pub fn shpf(&self) -> SHPF_R {
332        SHPF_R::new(((self.bits >> 3) & 0x01) != 0)
333    }
334    #[doc = "Bit 4 - Initialization status flag"]
335    #[inline(always)]
336    pub fn inits(&self) -> INITS_R {
337        INITS_R::new(((self.bits >> 4) & 0x01) != 0)
338    }
339    #[doc = "Bit 5 - Registers synchronization flag"]
340    #[inline(always)]
341    pub fn rsf(&self) -> RSF_R {
342        RSF_R::new(((self.bits >> 5) & 0x01) != 0)
343    }
344    #[doc = "Bit 6 - Initialization flag"]
345    #[inline(always)]
346    pub fn initf(&self) -> INITF_R {
347        INITF_R::new(((self.bits >> 6) & 0x01) != 0)
348    }
349    #[doc = "Bit 7 - Initialization mode"]
350    #[inline(always)]
351    pub fn init(&self) -> INIT_R {
352        INIT_R::new(((self.bits >> 7) & 0x01) != 0)
353    }
354    #[doc = "Bit 8 - Alarm A flag"]
355    #[inline(always)]
356    pub fn alraf(&self) -> ALRAF_R {
357        ALRAF_R::new(((self.bits >> 8) & 0x01) != 0)
358    }
359    #[doc = "Bit 9 - Alarm B flag"]
360    #[inline(always)]
361    pub fn alrbf(&self) -> ALRBF_R {
362        ALRBF_R::new(((self.bits >> 9) & 0x01) != 0)
363    }
364    #[doc = "Bit 10 - Wakeup timer flag"]
365    #[inline(always)]
366    pub fn wutf(&self) -> WUTF_R {
367        WUTF_R::new(((self.bits >> 10) & 0x01) != 0)
368    }
369    #[doc = "Bit 11 - Time-stamp flag"]
370    #[inline(always)]
371    pub fn tsf(&self) -> TSF_R {
372        TSF_R::new(((self.bits >> 11) & 0x01) != 0)
373    }
374    #[doc = "Bit 12 - Time-stamp overflow flag"]
375    #[inline(always)]
376    pub fn tsovf(&self) -> TSOVF_R {
377        TSOVF_R::new(((self.bits >> 12) & 0x01) != 0)
378    }
379    #[doc = "Bit 13 - Tamper detection flag"]
380    #[inline(always)]
381    pub fn tamp1f(&self) -> TAMP1F_R {
382        TAMP1F_R::new(((self.bits >> 13) & 0x01) != 0)
383    }
384    #[doc = "Bit 14 - RTC_TAMP2 detection flag"]
385    #[inline(always)]
386    pub fn tamp2f(&self) -> TAMP2F_R {
387        TAMP2F_R::new(((self.bits >> 14) & 0x01) != 0)
388    }
389    #[doc = "Bit 15 - RTC_TAMP3 detection flag"]
390    #[inline(always)]
391    pub fn tamp3f(&self) -> TAMP3F_R {
392        TAMP3F_R::new(((self.bits >> 15) & 0x01) != 0)
393    }
394    #[doc = "Bit 16 - Recalibration pending Flag"]
395    #[inline(always)]
396    pub fn recalpf(&self) -> RECALPF_R {
397        RECALPF_R::new(((self.bits >> 16) & 0x01) != 0)
398    }
399    #[doc = "Bit 17 - INTERNAL TIME-STAMP FLAG"]
400    #[inline(always)]
401    pub fn itsf(&self) -> ITSF_R {
402        ITSF_R::new(((self.bits >> 17) & 0x01) != 0)
403    }
404}
405impl W {
406    #[doc = "Bit 3 - Shift operation pending"]
407    #[inline(always)]
408    pub fn shpf(&mut self) -> SHPF_W {
409        SHPF_W { w: self }
410    }
411    #[doc = "Bit 5 - Registers synchronization flag"]
412    #[inline(always)]
413    pub fn rsf(&mut self) -> RSF_W {
414        RSF_W { w: self }
415    }
416    #[doc = "Bit 7 - Initialization mode"]
417    #[inline(always)]
418    pub fn init(&mut self) -> INIT_W {
419        INIT_W { w: self }
420    }
421    #[doc = "Bit 8 - Alarm A flag"]
422    #[inline(always)]
423    pub fn alraf(&mut self) -> ALRAF_W {
424        ALRAF_W { w: self }
425    }
426    #[doc = "Bit 9 - Alarm B flag"]
427    #[inline(always)]
428    pub fn alrbf(&mut self) -> ALRBF_W {
429        ALRBF_W { w: self }
430    }
431    #[doc = "Bit 10 - Wakeup timer flag"]
432    #[inline(always)]
433    pub fn wutf(&mut self) -> WUTF_W {
434        WUTF_W { w: self }
435    }
436    #[doc = "Bit 11 - Time-stamp flag"]
437    #[inline(always)]
438    pub fn tsf(&mut self) -> TSF_W {
439        TSF_W { w: self }
440    }
441    #[doc = "Bit 12 - Time-stamp overflow flag"]
442    #[inline(always)]
443    pub fn tsovf(&mut self) -> TSOVF_W {
444        TSOVF_W { w: self }
445    }
446    #[doc = "Bit 13 - Tamper detection flag"]
447    #[inline(always)]
448    pub fn tamp1f(&mut self) -> TAMP1F_W {
449        TAMP1F_W { w: self }
450    }
451    #[doc = "Bit 14 - RTC_TAMP2 detection flag"]
452    #[inline(always)]
453    pub fn tamp2f(&mut self) -> TAMP2F_W {
454        TAMP2F_W { w: self }
455    }
456    #[doc = "Bit 15 - RTC_TAMP3 detection flag"]
457    #[inline(always)]
458    pub fn tamp3f(&mut self) -> TAMP3F_W {
459        TAMP3F_W { w: self }
460    }
461    #[doc = "Bit 17 - INTERNAL TIME-STAMP FLAG"]
462    #[inline(always)]
463    pub fn itsf(&mut self) -> ITSF_W {
464        ITSF_W { w: self }
465    }
466}