mimxrt685s_pac/pmc/
flags.rs

1#[doc = "Register `FLAGS` reader"]
2pub type R = crate::R<FlagsSpec>;
3#[doc = "Register `FLAGS` writer"]
4pub type W = crate::W<FlagsSpec>;
5#[doc = "vddcore POR Flag\n\nValue on reset: 1"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum Porcoref {
9    #[doc = "0: vddcore POR was not tripped since the last cleared."]
10    Porcoref0 = 0,
11    #[doc = "1: POR triggered by the vddcore POR monitor. Write 1 to clear"]
12    Porcoref1 = 1,
13}
14impl From<Porcoref> for bool {
15    #[inline(always)]
16    fn from(variant: Porcoref) -> Self {
17        variant as u8 != 0
18    }
19}
20#[doc = "Field `PORCOREF` reader - vddcore POR Flag"]
21pub type PorcorefR = crate::BitReader<Porcoref>;
22impl PorcorefR {
23    #[doc = "Get enumerated values variant"]
24    #[inline(always)]
25    pub const fn variant(&self) -> Porcoref {
26        match self.bits {
27            false => Porcoref::Porcoref0,
28            true => Porcoref::Porcoref1,
29        }
30    }
31    #[doc = "vddcore POR was not tripped since the last cleared."]
32    #[inline(always)]
33    pub fn is_porcoref_0(&self) -> bool {
34        *self == Porcoref::Porcoref0
35    }
36    #[doc = "POR triggered by the vddcore POR monitor. Write 1 to clear"]
37    #[inline(always)]
38    pub fn is_porcoref_1(&self) -> bool {
39        *self == Porcoref::Porcoref1
40    }
41}
42#[doc = "Field `PORCOREF` writer - vddcore POR Flag"]
43pub type PorcorefW<'a, REG> = crate::BitWriter<'a, REG, Porcoref>;
44impl<'a, REG> PorcorefW<'a, REG>
45where
46    REG: crate::Writable + crate::RegisterSpec,
47{
48    #[doc = "vddcore POR was not tripped since the last cleared."]
49    #[inline(always)]
50    pub fn porcoref_0(self) -> &'a mut crate::W<REG> {
51        self.variant(Porcoref::Porcoref0)
52    }
53    #[doc = "POR triggered by the vddcore POR monitor. Write 1 to clear"]
54    #[inline(always)]
55    pub fn porcoref_1(self) -> &'a mut crate::W<REG> {
56        self.variant(Porcoref::Porcoref1)
57    }
58}
59#[doc = "vdd1v8 power on reset flag\n\nValue on reset: 1"]
60#[cfg_attr(feature = "defmt", derive(defmt::Format))]
61#[derive(Clone, Copy, Debug, PartialEq, Eq)]
62pub enum Por1v8f {
63    #[doc = "0: No vdd1v8 power on event detected since last cleared."]
64    Por1v8f0 = 0,
65    #[doc = "1: vdd1v8 power on detect caused a reset or deep pd wakeup. Write 1 to clear."]
66    Por1v8f1 = 1,
67}
68impl From<Por1v8f> for bool {
69    #[inline(always)]
70    fn from(variant: Por1v8f) -> Self {
71        variant as u8 != 0
72    }
73}
74#[doc = "Field `POR1V8F` reader - vdd1v8 power on reset flag"]
75pub type Por1v8fR = crate::BitReader<Por1v8f>;
76impl Por1v8fR {
77    #[doc = "Get enumerated values variant"]
78    #[inline(always)]
79    pub const fn variant(&self) -> Por1v8f {
80        match self.bits {
81            false => Por1v8f::Por1v8f0,
82            true => Por1v8f::Por1v8f1,
83        }
84    }
85    #[doc = "No vdd1v8 power on event detected since last cleared."]
86    #[inline(always)]
87    pub fn is_por1v8f_0(&self) -> bool {
88        *self == Por1v8f::Por1v8f0
89    }
90    #[doc = "vdd1v8 power on detect caused a reset or deep pd wakeup. Write 1 to clear."]
91    #[inline(always)]
92    pub fn is_por1v8f_1(&self) -> bool {
93        *self == Por1v8f::Por1v8f1
94    }
95}
96#[doc = "Field `POR1V8F` writer - vdd1v8 power on reset flag"]
97pub type Por1v8fW<'a, REG> = crate::BitWriter<'a, REG, Por1v8f>;
98impl<'a, REG> Por1v8fW<'a, REG>
99where
100    REG: crate::Writable + crate::RegisterSpec,
101{
102    #[doc = "No vdd1v8 power on event detected since last cleared."]
103    #[inline(always)]
104    pub fn por1v8f_0(self) -> &'a mut crate::W<REG> {
105        self.variant(Por1v8f::Por1v8f0)
106    }
107    #[doc = "vdd1v8 power on detect caused a reset or deep pd wakeup. Write 1 to clear."]
108    #[inline(always)]
109    pub fn por1v8f_1(self) -> &'a mut crate::W<REG> {
110        self.variant(Por1v8f::Por1v8f1)
111    }
112}
113#[doc = "vdd_ao18 power on reset flag\n\nValue on reset: 1"]
114#[cfg_attr(feature = "defmt", derive(defmt::Format))]
115#[derive(Clone, Copy, Debug, PartialEq, Eq)]
116pub enum Porao18f {
117    #[doc = "0: No vdd_ao18 power on event detected since last cleared."]
118    Porao18f0 = 0,
119    #[doc = "1: vdd_ao18 power on detect caused a reset. Write 1 to clear."]
120    Porao18f1 = 1,
121}
122impl From<Porao18f> for bool {
123    #[inline(always)]
124    fn from(variant: Porao18f) -> Self {
125        variant as u8 != 0
126    }
127}
128#[doc = "Field `PORAO18F` reader - vdd_ao18 power on reset flag"]
129pub type Porao18fR = crate::BitReader<Porao18f>;
130impl Porao18fR {
131    #[doc = "Get enumerated values variant"]
132    #[inline(always)]
133    pub const fn variant(&self) -> Porao18f {
134        match self.bits {
135            false => Porao18f::Porao18f0,
136            true => Porao18f::Porao18f1,
137        }
138    }
139    #[doc = "No vdd_ao18 power on event detected since last cleared."]
140    #[inline(always)]
141    pub fn is_porao18f_0(&self) -> bool {
142        *self == Porao18f::Porao18f0
143    }
144    #[doc = "vdd_ao18 power on detect caused a reset. Write 1 to clear."]
145    #[inline(always)]
146    pub fn is_porao18f_1(&self) -> bool {
147        *self == Porao18f::Porao18f1
148    }
149}
150#[doc = "Field `PORAO18F` writer - vdd_ao18 power on reset flag"]
151pub type Porao18fW<'a, REG> = crate::BitWriter<'a, REG, Porao18f>;
152impl<'a, REG> Porao18fW<'a, REG>
153where
154    REG: crate::Writable + crate::RegisterSpec,
155{
156    #[doc = "No vdd_ao18 power on event detected since last cleared."]
157    #[inline(always)]
158    pub fn porao18f_0(self) -> &'a mut crate::W<REG> {
159        self.variant(Porao18f::Porao18f0)
160    }
161    #[doc = "vdd_ao18 power on detect caused a reset. Write 1 to clear."]
162    #[inline(always)]
163    pub fn porao18f_1(self) -> &'a mut crate::W<REG> {
164        self.variant(Porao18f::Porao18f1)
165    }
166}
167#[doc = "vddcore Low-Voltage Detector Flag This flag is set when a low voltage event was detected by the vddcore LVD monitor and it is enabled for interrupt or reset\n\nValue on reset: 1"]
168#[cfg_attr(feature = "defmt", derive(defmt::Format))]
169#[derive(Clone, Copy, Debug, PartialEq, Eq)]
170pub enum Lvdcoref {
171    #[doc = "0: vddcore LVD has not triggered an interrupt or reset since last clear"]
172    Lvdcoref0 = 0,
173    #[doc = "1: vddcore LVD triggered an interrupt or reset since last time this bit was cleared. Write 1 to clear"]
174    Lvdcoref1 = 1,
175}
176impl From<Lvdcoref> for bool {
177    #[inline(always)]
178    fn from(variant: Lvdcoref) -> Self {
179        variant as u8 != 0
180    }
181}
182#[doc = "Field `LVDCOREF` reader - vddcore Low-Voltage Detector Flag This flag is set when a low voltage event was detected by the vddcore LVD monitor and it is enabled for interrupt or reset"]
183pub type LvdcorefR = crate::BitReader<Lvdcoref>;
184impl LvdcorefR {
185    #[doc = "Get enumerated values variant"]
186    #[inline(always)]
187    pub const fn variant(&self) -> Lvdcoref {
188        match self.bits {
189            false => Lvdcoref::Lvdcoref0,
190            true => Lvdcoref::Lvdcoref1,
191        }
192    }
193    #[doc = "vddcore LVD has not triggered an interrupt or reset since last clear"]
194    #[inline(always)]
195    pub fn is_lvdcoref_0(&self) -> bool {
196        *self == Lvdcoref::Lvdcoref0
197    }
198    #[doc = "vddcore LVD triggered an interrupt or reset since last time this bit was cleared. Write 1 to clear"]
199    #[inline(always)]
200    pub fn is_lvdcoref_1(&self) -> bool {
201        *self == Lvdcoref::Lvdcoref1
202    }
203}
204#[doc = "Field `LVDCOREF` writer - vddcore Low-Voltage Detector Flag This flag is set when a low voltage event was detected by the vddcore LVD monitor and it is enabled for interrupt or reset"]
205pub type LvdcorefW<'a, REG> = crate::BitWriter<'a, REG, Lvdcoref>;
206impl<'a, REG> LvdcorefW<'a, REG>
207where
208    REG: crate::Writable + crate::RegisterSpec,
209{
210    #[doc = "vddcore LVD has not triggered an interrupt or reset since last clear"]
211    #[inline(always)]
212    pub fn lvdcoref_0(self) -> &'a mut crate::W<REG> {
213        self.variant(Lvdcoref::Lvdcoref0)
214    }
215    #[doc = "vddcore LVD triggered an interrupt or reset since last time this bit was cleared. Write 1 to clear"]
216    #[inline(always)]
217    pub fn lvdcoref_1(self) -> &'a mut crate::W<REG> {
218        self.variant(Lvdcoref::Lvdcoref1)
219    }
220}
221#[doc = "vddcore High-Voltage Detector Flag This flag is set when a high-voltage event was detected by the vddcore HVD monitor and it is enabled for interrupt or reset\n\nValue on reset: 0"]
222#[cfg_attr(feature = "defmt", derive(defmt::Format))]
223#[derive(Clone, Copy, Debug, PartialEq, Eq)]
224pub enum Hvdcoref {
225    #[doc = "0: vddcore HVD has not triggered an interrupt or reset since last clear"]
226    Hvdcoref0 = 0,
227    #[doc = "1: vddcore HVD triggered an interrupt or reset since last time this bit was cleared. Write 1 to clear"]
228    Hvdcoref1 = 1,
229}
230impl From<Hvdcoref> for bool {
231    #[inline(always)]
232    fn from(variant: Hvdcoref) -> Self {
233        variant as u8 != 0
234    }
235}
236#[doc = "Field `HVDCOREF` reader - vddcore High-Voltage Detector Flag This flag is set when a high-voltage event was detected by the vddcore HVD monitor and it is enabled for interrupt or reset"]
237pub type HvdcorefR = crate::BitReader<Hvdcoref>;
238impl HvdcorefR {
239    #[doc = "Get enumerated values variant"]
240    #[inline(always)]
241    pub const fn variant(&self) -> Hvdcoref {
242        match self.bits {
243            false => Hvdcoref::Hvdcoref0,
244            true => Hvdcoref::Hvdcoref1,
245        }
246    }
247    #[doc = "vddcore HVD has not triggered an interrupt or reset since last clear"]
248    #[inline(always)]
249    pub fn is_hvdcoref_0(&self) -> bool {
250        *self == Hvdcoref::Hvdcoref0
251    }
252    #[doc = "vddcore HVD triggered an interrupt or reset since last time this bit was cleared. Write 1 to clear"]
253    #[inline(always)]
254    pub fn is_hvdcoref_1(&self) -> bool {
255        *self == Hvdcoref::Hvdcoref1
256    }
257}
258#[doc = "Field `HVDCOREF` writer - vddcore High-Voltage Detector Flag This flag is set when a high-voltage event was detected by the vddcore HVD monitor and it is enabled for interrupt or reset"]
259pub type HvdcorefW<'a, REG> = crate::BitWriter<'a, REG, Hvdcoref>;
260impl<'a, REG> HvdcorefW<'a, REG>
261where
262    REG: crate::Writable + crate::RegisterSpec,
263{
264    #[doc = "vddcore HVD has not triggered an interrupt or reset since last clear"]
265    #[inline(always)]
266    pub fn hvdcoref_0(self) -> &'a mut crate::W<REG> {
267        self.variant(Hvdcoref::Hvdcoref0)
268    }
269    #[doc = "vddcore HVD triggered an interrupt or reset since last time this bit was cleared. Write 1 to clear"]
270    #[inline(always)]
271    pub fn hvdcoref_1(self) -> &'a mut crate::W<REG> {
272        self.variant(Hvdcoref::Hvdcoref1)
273    }
274}
275#[doc = "vdd1v8 High-Voltage Detector Flag This flag is set when a high-voltage event was detected by the vdd1v8 HVD monitor and it is enabled for interrupt or reset\n\nValue on reset: 0"]
276#[cfg_attr(feature = "defmt", derive(defmt::Format))]
277#[derive(Clone, Copy, Debug, PartialEq, Eq)]
278pub enum Hvd1v8f {
279    #[doc = "0: vdd1v8 HVD has not triggered an interrupt or reset since last clear"]
280    Hvd1v8f0 = 0,
281    #[doc = "1: vdd1v8 HVD triggered an interrupt or reset since last time this bit was cleared. Write 1 to clear"]
282    Hvd1v8f1 = 1,
283}
284impl From<Hvd1v8f> for bool {
285    #[inline(always)]
286    fn from(variant: Hvd1v8f) -> Self {
287        variant as u8 != 0
288    }
289}
290#[doc = "Field `HVD1V8F` reader - vdd1v8 High-Voltage Detector Flag This flag is set when a high-voltage event was detected by the vdd1v8 HVD monitor and it is enabled for interrupt or reset"]
291pub type Hvd1v8fR = crate::BitReader<Hvd1v8f>;
292impl Hvd1v8fR {
293    #[doc = "Get enumerated values variant"]
294    #[inline(always)]
295    pub const fn variant(&self) -> Hvd1v8f {
296        match self.bits {
297            false => Hvd1v8f::Hvd1v8f0,
298            true => Hvd1v8f::Hvd1v8f1,
299        }
300    }
301    #[doc = "vdd1v8 HVD has not triggered an interrupt or reset since last clear"]
302    #[inline(always)]
303    pub fn is_hvd1v8f_0(&self) -> bool {
304        *self == Hvd1v8f::Hvd1v8f0
305    }
306    #[doc = "vdd1v8 HVD triggered an interrupt or reset since last time this bit was cleared. Write 1 to clear"]
307    #[inline(always)]
308    pub fn is_hvd1v8f_1(&self) -> bool {
309        *self == Hvd1v8f::Hvd1v8f1
310    }
311}
312#[doc = "Field `HVD1V8F` writer - vdd1v8 High-Voltage Detector Flag This flag is set when a high-voltage event was detected by the vdd1v8 HVD monitor and it is enabled for interrupt or reset"]
313pub type Hvd1v8fW<'a, REG> = crate::BitWriter<'a, REG, Hvd1v8f>;
314impl<'a, REG> Hvd1v8fW<'a, REG>
315where
316    REG: crate::Writable + crate::RegisterSpec,
317{
318    #[doc = "vdd1v8 HVD has not triggered an interrupt or reset since last clear"]
319    #[inline(always)]
320    pub fn hvd1v8f_0(self) -> &'a mut crate::W<REG> {
321        self.variant(Hvd1v8f::Hvd1v8f0)
322    }
323    #[doc = "vdd1v8 HVD triggered an interrupt or reset since last time this bit was cleared. Write 1 to clear"]
324    #[inline(always)]
325    pub fn hvd1v8f_1(self) -> &'a mut crate::W<REG> {
326        self.variant(Hvd1v8f::Hvd1v8f1)
327    }
328}
329#[doc = "RTC Wakeup from deep powerdown mode flag.\n\nValue on reset: 0"]
330#[cfg_attr(feature = "defmt", derive(defmt::Format))]
331#[derive(Clone, Copy, Debug, PartialEq, Eq)]
332pub enum Rtcf {
333    #[doc = "0: No RTC wakeup detected since last time flag was cleared."]
334    Rtcf0 = 0,
335    #[doc = "1: RTC wakeup caused a deep powerdown wakeup. Write 1 to clear."]
336    Rtcf1 = 1,
337}
338impl From<Rtcf> for bool {
339    #[inline(always)]
340    fn from(variant: Rtcf) -> Self {
341        variant as u8 != 0
342    }
343}
344#[doc = "Field `RTCF` reader - RTC Wakeup from deep powerdown mode flag."]
345pub type RtcfR = crate::BitReader<Rtcf>;
346impl RtcfR {
347    #[doc = "Get enumerated values variant"]
348    #[inline(always)]
349    pub const fn variant(&self) -> Rtcf {
350        match self.bits {
351            false => Rtcf::Rtcf0,
352            true => Rtcf::Rtcf1,
353        }
354    }
355    #[doc = "No RTC wakeup detected since last time flag was cleared."]
356    #[inline(always)]
357    pub fn is_rtcf_0(&self) -> bool {
358        *self == Rtcf::Rtcf0
359    }
360    #[doc = "RTC wakeup caused a deep powerdown wakeup. Write 1 to clear."]
361    #[inline(always)]
362    pub fn is_rtcf_1(&self) -> bool {
363        *self == Rtcf::Rtcf1
364    }
365}
366#[doc = "Field `RTCF` writer - RTC Wakeup from deep powerdown mode flag."]
367pub type RtcfW<'a, REG> = crate::BitWriter<'a, REG, Rtcf>;
368impl<'a, REG> RtcfW<'a, REG>
369where
370    REG: crate::Writable + crate::RegisterSpec,
371{
372    #[doc = "No RTC wakeup detected since last time flag was cleared."]
373    #[inline(always)]
374    pub fn rtcf_0(self) -> &'a mut crate::W<REG> {
375        self.variant(Rtcf::Rtcf0)
376    }
377    #[doc = "RTC wakeup caused a deep powerdown wakeup. Write 1 to clear."]
378    #[inline(always)]
379    pub fn rtcf_1(self) -> &'a mut crate::W<REG> {
380        self.variant(Rtcf::Rtcf1)
381    }
382}
383#[doc = "PMC Auto Wakeup Interrupt flag.\n\nValue on reset: 0"]
384#[cfg_attr(feature = "defmt", derive(defmt::Format))]
385#[derive(Clone, Copy, Debug, PartialEq, Eq)]
386pub enum Autowkf {
387    #[doc = "0: No PMC Auto Wakeup Interrupt detected since last time cleared."]
388    Autowkf0 = 0,
389    #[doc = "1: PMC Auto wakeup caused a deep sleep wakeup and interrupt. Write 1 to clear."]
390    Autowkf1 = 1,
391}
392impl From<Autowkf> for bool {
393    #[inline(always)]
394    fn from(variant: Autowkf) -> Self {
395        variant as u8 != 0
396    }
397}
398#[doc = "Field `AUTOWKF` reader - PMC Auto Wakeup Interrupt flag."]
399pub type AutowkfR = crate::BitReader<Autowkf>;
400impl AutowkfR {
401    #[doc = "Get enumerated values variant"]
402    #[inline(always)]
403    pub const fn variant(&self) -> Autowkf {
404        match self.bits {
405            false => Autowkf::Autowkf0,
406            true => Autowkf::Autowkf1,
407        }
408    }
409    #[doc = "No PMC Auto Wakeup Interrupt detected since last time cleared."]
410    #[inline(always)]
411    pub fn is_autowkf_0(&self) -> bool {
412        *self == Autowkf::Autowkf0
413    }
414    #[doc = "PMC Auto wakeup caused a deep sleep wakeup and interrupt. Write 1 to clear."]
415    #[inline(always)]
416    pub fn is_autowkf_1(&self) -> bool {
417        *self == Autowkf::Autowkf1
418    }
419}
420#[doc = "Field `AUTOWKF` writer - PMC Auto Wakeup Interrupt flag."]
421pub type AutowkfW<'a, REG> = crate::BitWriter<'a, REG, Autowkf>;
422impl<'a, REG> AutowkfW<'a, REG>
423where
424    REG: crate::Writable + crate::RegisterSpec,
425{
426    #[doc = "No PMC Auto Wakeup Interrupt detected since last time cleared."]
427    #[inline(always)]
428    pub fn autowkf_0(self) -> &'a mut crate::W<REG> {
429        self.variant(Autowkf::Autowkf0)
430    }
431    #[doc = "PMC Auto wakeup caused a deep sleep wakeup and interrupt. Write 1 to clear."]
432    #[inline(always)]
433    pub fn autowkf_1(self) -> &'a mut crate::W<REG> {
434        self.variant(Autowkf::Autowkf1)
435    }
436}
437#[doc = "PMIC interrupt pin flag\n\nValue on reset: 0"]
438#[cfg_attr(feature = "defmt", derive(defmt::Format))]
439#[derive(Clone, Copy, Debug, PartialEq, Eq)]
440pub enum Intnpadf {
441    #[doc = "0: No interrupt detected since flag last cleared."]
442    Intnpadf0 = 0,
443    #[doc = "1: Pad interrupt caused a wakeup or interrupt event since the last time this flag was cleared. Write 1 to clear."]
444    Intnpadf1 = 1,
445}
446impl From<Intnpadf> for bool {
447    #[inline(always)]
448    fn from(variant: Intnpadf) -> Self {
449        variant as u8 != 0
450    }
451}
452#[doc = "Field `INTNPADF` reader - PMIC interrupt pin flag"]
453pub type IntnpadfR = crate::BitReader<Intnpadf>;
454impl IntnpadfR {
455    #[doc = "Get enumerated values variant"]
456    #[inline(always)]
457    pub const fn variant(&self) -> Intnpadf {
458        match self.bits {
459            false => Intnpadf::Intnpadf0,
460            true => Intnpadf::Intnpadf1,
461        }
462    }
463    #[doc = "No interrupt detected since flag last cleared."]
464    #[inline(always)]
465    pub fn is_intnpadf_0(&self) -> bool {
466        *self == Intnpadf::Intnpadf0
467    }
468    #[doc = "Pad interrupt caused a wakeup or interrupt event since the last time this flag was cleared. Write 1 to clear."]
469    #[inline(always)]
470    pub fn is_intnpadf_1(&self) -> bool {
471        *self == Intnpadf::Intnpadf1
472    }
473}
474#[doc = "Field `INTNPADF` writer - PMIC interrupt pin flag"]
475pub type IntnpadfW<'a, REG> = crate::BitWriter<'a, REG, Intnpadf>;
476impl<'a, REG> IntnpadfW<'a, REG>
477where
478    REG: crate::Writable + crate::RegisterSpec,
479{
480    #[doc = "No interrupt detected since flag last cleared."]
481    #[inline(always)]
482    pub fn intnpadf_0(self) -> &'a mut crate::W<REG> {
483        self.variant(Intnpadf::Intnpadf0)
484    }
485    #[doc = "Pad interrupt caused a wakeup or interrupt event since the last time this flag was cleared. Write 1 to clear."]
486    #[inline(always)]
487    pub fn intnpadf_1(self) -> &'a mut crate::W<REG> {
488        self.variant(Intnpadf::Intnpadf1)
489    }
490}
491#[doc = "Reset pad flag\n\nValue on reset: 0"]
492#[cfg_attr(feature = "defmt", derive(defmt::Format))]
493#[derive(Clone, Copy, Debug, PartialEq, Eq)]
494pub enum Resetnpadf {
495    #[doc = "0: No reset detected since last time this flag was cleared."]
496    Resetnpadf0 = 0,
497    #[doc = "1: Reset pad wakeup caused a wakeup or reset event since the last time this bit was cleared. Write 1 to clear."]
498    Resetnpadf1 = 1,
499}
500impl From<Resetnpadf> for bool {
501    #[inline(always)]
502    fn from(variant: Resetnpadf) -> Self {
503        variant as u8 != 0
504    }
505}
506#[doc = "Field `RESETNPADF` reader - Reset pad flag"]
507pub type ResetnpadfR = crate::BitReader<Resetnpadf>;
508impl ResetnpadfR {
509    #[doc = "Get enumerated values variant"]
510    #[inline(always)]
511    pub const fn variant(&self) -> Resetnpadf {
512        match self.bits {
513            false => Resetnpadf::Resetnpadf0,
514            true => Resetnpadf::Resetnpadf1,
515        }
516    }
517    #[doc = "No reset detected since last time this flag was cleared."]
518    #[inline(always)]
519    pub fn is_resetnpadf_0(&self) -> bool {
520        *self == Resetnpadf::Resetnpadf0
521    }
522    #[doc = "Reset pad wakeup caused a wakeup or reset event since the last time this bit was cleared. Write 1 to clear."]
523    #[inline(always)]
524    pub fn is_resetnpadf_1(&self) -> bool {
525        *self == Resetnpadf::Resetnpadf1
526    }
527}
528#[doc = "Field `RESETNPADF` writer - Reset pad flag"]
529pub type ResetnpadfW<'a, REG> = crate::BitWriter<'a, REG, Resetnpadf>;
530impl<'a, REG> ResetnpadfW<'a, REG>
531where
532    REG: crate::Writable + crate::RegisterSpec,
533{
534    #[doc = "No reset detected since last time this flag was cleared."]
535    #[inline(always)]
536    pub fn resetnpadf_0(self) -> &'a mut crate::W<REG> {
537        self.variant(Resetnpadf::Resetnpadf0)
538    }
539    #[doc = "Reset pad wakeup caused a wakeup or reset event since the last time this bit was cleared. Write 1 to clear."]
540    #[inline(always)]
541    pub fn resetnpadf_1(self) -> &'a mut crate::W<REG> {
542        self.variant(Resetnpadf::Resetnpadf1)
543    }
544}
545#[doc = "Deep powerdown wakeup flag\n\nValue on reset: 0"]
546#[cfg_attr(feature = "defmt", derive(defmt::Format))]
547#[derive(Clone, Copy, Debug, PartialEq, Eq)]
548pub enum Deeppdf {
549    #[doc = "0: No deep powerdown wakeup since last time flag was cleared."]
550    Deeppdf0 = 0,
551    #[doc = "1: Deep powerdown was entered since the last time this flag was cleared. Write 1 to clear"]
552    Deeppdf1 = 1,
553}
554impl From<Deeppdf> for bool {
555    #[inline(always)]
556    fn from(variant: Deeppdf) -> Self {
557        variant as u8 != 0
558    }
559}
560#[doc = "Field `DEEPPDF` reader - Deep powerdown wakeup flag"]
561pub type DeeppdfR = crate::BitReader<Deeppdf>;
562impl DeeppdfR {
563    #[doc = "Get enumerated values variant"]
564    #[inline(always)]
565    pub const fn variant(&self) -> Deeppdf {
566        match self.bits {
567            false => Deeppdf::Deeppdf0,
568            true => Deeppdf::Deeppdf1,
569        }
570    }
571    #[doc = "No deep powerdown wakeup since last time flag was cleared."]
572    #[inline(always)]
573    pub fn is_deeppdf_0(&self) -> bool {
574        *self == Deeppdf::Deeppdf0
575    }
576    #[doc = "Deep powerdown was entered since the last time this flag was cleared. Write 1 to clear"]
577    #[inline(always)]
578    pub fn is_deeppdf_1(&self) -> bool {
579        *self == Deeppdf::Deeppdf1
580    }
581}
582#[doc = "Field `DEEPPDF` writer - Deep powerdown wakeup flag"]
583pub type DeeppdfW<'a, REG> = crate::BitWriter<'a, REG, Deeppdf>;
584impl<'a, REG> DeeppdfW<'a, REG>
585where
586    REG: crate::Writable + crate::RegisterSpec,
587{
588    #[doc = "No deep powerdown wakeup since last time flag was cleared."]
589    #[inline(always)]
590    pub fn deeppdf_0(self) -> &'a mut crate::W<REG> {
591        self.variant(Deeppdf::Deeppdf0)
592    }
593    #[doc = "Deep powerdown was entered since the last time this flag was cleared. Write 1 to clear"]
594    #[inline(always)]
595    pub fn deeppdf_1(self) -> &'a mut crate::W<REG> {
596        self.variant(Deeppdf::Deeppdf1)
597    }
598}
599impl R {
600    #[doc = "Bit 16 - vddcore POR Flag"]
601    #[inline(always)]
602    pub fn porcoref(&self) -> PorcorefR {
603        PorcorefR::new(((self.bits >> 16) & 1) != 0)
604    }
605    #[doc = "Bit 17 - vdd1v8 power on reset flag"]
606    #[inline(always)]
607    pub fn por1v8f(&self) -> Por1v8fR {
608        Por1v8fR::new(((self.bits >> 17) & 1) != 0)
609    }
610    #[doc = "Bit 18 - vdd_ao18 power on reset flag"]
611    #[inline(always)]
612    pub fn porao18f(&self) -> Porao18fR {
613        Porao18fR::new(((self.bits >> 18) & 1) != 0)
614    }
615    #[doc = "Bit 20 - vddcore Low-Voltage Detector Flag This flag is set when a low voltage event was detected by the vddcore LVD monitor and it is enabled for interrupt or reset"]
616    #[inline(always)]
617    pub fn lvdcoref(&self) -> LvdcorefR {
618        LvdcorefR::new(((self.bits >> 20) & 1) != 0)
619    }
620    #[doc = "Bit 22 - vddcore High-Voltage Detector Flag This flag is set when a high-voltage event was detected by the vddcore HVD monitor and it is enabled for interrupt or reset"]
621    #[inline(always)]
622    pub fn hvdcoref(&self) -> HvdcorefR {
623        HvdcorefR::new(((self.bits >> 22) & 1) != 0)
624    }
625    #[doc = "Bit 24 - vdd1v8 High-Voltage Detector Flag This flag is set when a high-voltage event was detected by the vdd1v8 HVD monitor and it is enabled for interrupt or reset"]
626    #[inline(always)]
627    pub fn hvd1v8f(&self) -> Hvd1v8fR {
628        Hvd1v8fR::new(((self.bits >> 24) & 1) != 0)
629    }
630    #[doc = "Bit 27 - RTC Wakeup from deep powerdown mode flag."]
631    #[inline(always)]
632    pub fn rtcf(&self) -> RtcfR {
633        RtcfR::new(((self.bits >> 27) & 1) != 0)
634    }
635    #[doc = "Bit 28 - PMC Auto Wakeup Interrupt flag."]
636    #[inline(always)]
637    pub fn autowkf(&self) -> AutowkfR {
638        AutowkfR::new(((self.bits >> 28) & 1) != 0)
639    }
640    #[doc = "Bit 29 - PMIC interrupt pin flag"]
641    #[inline(always)]
642    pub fn intnpadf(&self) -> IntnpadfR {
643        IntnpadfR::new(((self.bits >> 29) & 1) != 0)
644    }
645    #[doc = "Bit 30 - Reset pad flag"]
646    #[inline(always)]
647    pub fn resetnpadf(&self) -> ResetnpadfR {
648        ResetnpadfR::new(((self.bits >> 30) & 1) != 0)
649    }
650    #[doc = "Bit 31 - Deep powerdown wakeup flag"]
651    #[inline(always)]
652    pub fn deeppdf(&self) -> DeeppdfR {
653        DeeppdfR::new(((self.bits >> 31) & 1) != 0)
654    }
655}
656#[cfg(feature = "debug")]
657impl core::fmt::Debug for R {
658    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
659        f.debug_struct("FLAGS")
660            .field("porcoref", &self.porcoref())
661            .field("por1v8f", &self.por1v8f())
662            .field("porao18f", &self.porao18f())
663            .field("lvdcoref", &self.lvdcoref())
664            .field("hvdcoref", &self.hvdcoref())
665            .field("hvd1v8f", &self.hvd1v8f())
666            .field("rtcf", &self.rtcf())
667            .field("autowkf", &self.autowkf())
668            .field("intnpadf", &self.intnpadf())
669            .field("resetnpadf", &self.resetnpadf())
670            .field("deeppdf", &self.deeppdf())
671            .finish()
672    }
673}
674impl W {
675    #[doc = "Bit 16 - vddcore POR Flag"]
676    #[inline(always)]
677    pub fn porcoref(&mut self) -> PorcorefW<FlagsSpec> {
678        PorcorefW::new(self, 16)
679    }
680    #[doc = "Bit 17 - vdd1v8 power on reset flag"]
681    #[inline(always)]
682    pub fn por1v8f(&mut self) -> Por1v8fW<FlagsSpec> {
683        Por1v8fW::new(self, 17)
684    }
685    #[doc = "Bit 18 - vdd_ao18 power on reset flag"]
686    #[inline(always)]
687    pub fn porao18f(&mut self) -> Porao18fW<FlagsSpec> {
688        Porao18fW::new(self, 18)
689    }
690    #[doc = "Bit 20 - vddcore Low-Voltage Detector Flag This flag is set when a low voltage event was detected by the vddcore LVD monitor and it is enabled for interrupt or reset"]
691    #[inline(always)]
692    pub fn lvdcoref(&mut self) -> LvdcorefW<FlagsSpec> {
693        LvdcorefW::new(self, 20)
694    }
695    #[doc = "Bit 22 - vddcore High-Voltage Detector Flag This flag is set when a high-voltage event was detected by the vddcore HVD monitor and it is enabled for interrupt or reset"]
696    #[inline(always)]
697    pub fn hvdcoref(&mut self) -> HvdcorefW<FlagsSpec> {
698        HvdcorefW::new(self, 22)
699    }
700    #[doc = "Bit 24 - vdd1v8 High-Voltage Detector Flag This flag is set when a high-voltage event was detected by the vdd1v8 HVD monitor and it is enabled for interrupt or reset"]
701    #[inline(always)]
702    pub fn hvd1v8f(&mut self) -> Hvd1v8fW<FlagsSpec> {
703        Hvd1v8fW::new(self, 24)
704    }
705    #[doc = "Bit 27 - RTC Wakeup from deep powerdown mode flag."]
706    #[inline(always)]
707    pub fn rtcf(&mut self) -> RtcfW<FlagsSpec> {
708        RtcfW::new(self, 27)
709    }
710    #[doc = "Bit 28 - PMC Auto Wakeup Interrupt flag."]
711    #[inline(always)]
712    pub fn autowkf(&mut self) -> AutowkfW<FlagsSpec> {
713        AutowkfW::new(self, 28)
714    }
715    #[doc = "Bit 29 - PMIC interrupt pin flag"]
716    #[inline(always)]
717    pub fn intnpadf(&mut self) -> IntnpadfW<FlagsSpec> {
718        IntnpadfW::new(self, 29)
719    }
720    #[doc = "Bit 30 - Reset pad flag"]
721    #[inline(always)]
722    pub fn resetnpadf(&mut self) -> ResetnpadfW<FlagsSpec> {
723        ResetnpadfW::new(self, 30)
724    }
725    #[doc = "Bit 31 - Deep powerdown wakeup flag"]
726    #[inline(always)]
727    pub fn deeppdf(&mut self) -> DeeppdfW<FlagsSpec> {
728        DeeppdfW::new(self, 31)
729    }
730}
731#[doc = "Wakeup, interrupt, and reset flags\n\nYou can [`read`](crate::Reg::read) this register and get [`flags::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`flags::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
732pub struct FlagsSpec;
733impl crate::RegisterSpec for FlagsSpec {
734    type Ux = u32;
735}
736#[doc = "`read()` method returns [`flags::R`](R) reader structure"]
737impl crate::Readable for FlagsSpec {}
738#[doc = "`write(|w| ..)` method takes [`flags::W`](W) writer structure"]
739impl crate::Writable for FlagsSpec {
740    type Safety = crate::Unsafe;
741    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
742    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
743}
744#[doc = "`reset()` method sets FLAGS to value 0x0017_0000"]
745impl crate::Resettable for FlagsSpec {
746    const RESET_VALUE: u32 = 0x0017_0000;
747}