mcxa_pac/cmc/
ssrs.rs

1#[doc = "Register `SSRS` reader"]
2pub type R = crate::R<SsrsSpec>;
3#[doc = "Register `SSRS` writer"]
4pub type W = crate::W<SsrsSpec>;
5#[doc = "Wake-up Reset\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum Wakeup {
9    #[doc = "0: Reset not generated"]
10    Disabled = 0,
11    #[doc = "1: Reset generated"]
12    Enabled = 1,
13}
14impl From<Wakeup> for bool {
15    #[inline(always)]
16    fn from(variant: Wakeup) -> Self {
17        variant as u8 != 0
18    }
19}
20#[doc = "Field `WAKEUP` reader - Wake-up Reset"]
21pub type WakeupR = crate::BitReader<Wakeup>;
22impl WakeupR {
23    #[doc = "Get enumerated values variant"]
24    #[inline(always)]
25    pub const fn variant(&self) -> Wakeup {
26        match self.bits {
27            false => Wakeup::Disabled,
28            true => Wakeup::Enabled,
29        }
30    }
31    #[doc = "Reset not generated"]
32    #[inline(always)]
33    pub fn is_disabled(&self) -> bool {
34        *self == Wakeup::Disabled
35    }
36    #[doc = "Reset generated"]
37    #[inline(always)]
38    pub fn is_enabled(&self) -> bool {
39        *self == Wakeup::Enabled
40    }
41}
42#[doc = "Field `WAKEUP` writer - Wake-up Reset"]
43pub type WakeupW<'a, REG> = crate::BitWriter1C<'a, REG, Wakeup>;
44impl<'a, REG> WakeupW<'a, REG>
45where
46    REG: crate::Writable + crate::RegisterSpec,
47{
48    #[doc = "Reset not generated"]
49    #[inline(always)]
50    pub fn disabled(self) -> &'a mut crate::W<REG> {
51        self.variant(Wakeup::Disabled)
52    }
53    #[doc = "Reset generated"]
54    #[inline(always)]
55    pub fn enabled(self) -> &'a mut crate::W<REG> {
56        self.variant(Wakeup::Enabled)
57    }
58}
59#[doc = "Power-on Reset\n\nValue on reset: 1"]
60#[cfg_attr(feature = "defmt", derive(defmt::Format))]
61#[derive(Clone, Copy, Debug, PartialEq, Eq)]
62pub enum Por {
63    #[doc = "0: Reset not generated"]
64    Disabled = 0,
65    #[doc = "1: Reset generated"]
66    Enabled = 1,
67}
68impl From<Por> for bool {
69    #[inline(always)]
70    fn from(variant: Por) -> Self {
71        variant as u8 != 0
72    }
73}
74#[doc = "Field `POR` reader - Power-on Reset"]
75pub type PorR = crate::BitReader<Por>;
76impl PorR {
77    #[doc = "Get enumerated values variant"]
78    #[inline(always)]
79    pub const fn variant(&self) -> Por {
80        match self.bits {
81            false => Por::Disabled,
82            true => Por::Enabled,
83        }
84    }
85    #[doc = "Reset not generated"]
86    #[inline(always)]
87    pub fn is_disabled(&self) -> bool {
88        *self == Por::Disabled
89    }
90    #[doc = "Reset generated"]
91    #[inline(always)]
92    pub fn is_enabled(&self) -> bool {
93        *self == Por::Enabled
94    }
95}
96#[doc = "Field `POR` writer - Power-on Reset"]
97pub type PorW<'a, REG> = crate::BitWriter1C<'a, REG, Por>;
98impl<'a, REG> PorW<'a, REG>
99where
100    REG: crate::Writable + crate::RegisterSpec,
101{
102    #[doc = "Reset not generated"]
103    #[inline(always)]
104    pub fn disabled(self) -> &'a mut crate::W<REG> {
105        self.variant(Por::Disabled)
106    }
107    #[doc = "Reset generated"]
108    #[inline(always)]
109    pub fn enabled(self) -> &'a mut crate::W<REG> {
110        self.variant(Por::Enabled)
111    }
112}
113#[doc = "Voltage Detect Reset\n\nValue on reset: 1"]
114#[cfg_attr(feature = "defmt", derive(defmt::Format))]
115#[derive(Clone, Copy, Debug, PartialEq, Eq)]
116pub enum Vd {
117    #[doc = "0: Reset not generated"]
118    Disabled = 0,
119    #[doc = "1: Reset generated"]
120    Enabled = 1,
121}
122impl From<Vd> for bool {
123    #[inline(always)]
124    fn from(variant: Vd) -> Self {
125        variant as u8 != 0
126    }
127}
128#[doc = "Field `VD` reader - Voltage Detect Reset"]
129pub type VdR = crate::BitReader<Vd>;
130impl VdR {
131    #[doc = "Get enumerated values variant"]
132    #[inline(always)]
133    pub const fn variant(&self) -> Vd {
134        match self.bits {
135            false => Vd::Disabled,
136            true => Vd::Enabled,
137        }
138    }
139    #[doc = "Reset not generated"]
140    #[inline(always)]
141    pub fn is_disabled(&self) -> bool {
142        *self == Vd::Disabled
143    }
144    #[doc = "Reset generated"]
145    #[inline(always)]
146    pub fn is_enabled(&self) -> bool {
147        *self == Vd::Enabled
148    }
149}
150#[doc = "Warm Reset\n\nValue on reset: 0"]
151#[cfg_attr(feature = "defmt", derive(defmt::Format))]
152#[derive(Clone, Copy, Debug, PartialEq, Eq)]
153pub enum Warm {
154    #[doc = "0: Reset not generated"]
155    Disabled = 0,
156    #[doc = "1: Reset generated"]
157    Enabled = 1,
158}
159impl From<Warm> for bool {
160    #[inline(always)]
161    fn from(variant: Warm) -> Self {
162        variant as u8 != 0
163    }
164}
165#[doc = "Field `WARM` reader - Warm Reset"]
166pub type WarmR = crate::BitReader<Warm>;
167impl WarmR {
168    #[doc = "Get enumerated values variant"]
169    #[inline(always)]
170    pub const fn variant(&self) -> Warm {
171        match self.bits {
172            false => Warm::Disabled,
173            true => Warm::Enabled,
174        }
175    }
176    #[doc = "Reset not generated"]
177    #[inline(always)]
178    pub fn is_disabled(&self) -> bool {
179        *self == Warm::Disabled
180    }
181    #[doc = "Reset generated"]
182    #[inline(always)]
183    pub fn is_enabled(&self) -> bool {
184        *self == Warm::Enabled
185    }
186}
187#[doc = "Field `WARM` writer - Warm Reset"]
188pub type WarmW<'a, REG> = crate::BitWriter1C<'a, REG, Warm>;
189impl<'a, REG> WarmW<'a, REG>
190where
191    REG: crate::Writable + crate::RegisterSpec,
192{
193    #[doc = "Reset not generated"]
194    #[inline(always)]
195    pub fn disabled(self) -> &'a mut crate::W<REG> {
196        self.variant(Warm::Disabled)
197    }
198    #[doc = "Reset generated"]
199    #[inline(always)]
200    pub fn enabled(self) -> &'a mut crate::W<REG> {
201        self.variant(Warm::Enabled)
202    }
203}
204#[doc = "Fatal Reset\n\nValue on reset: 0"]
205#[cfg_attr(feature = "defmt", derive(defmt::Format))]
206#[derive(Clone, Copy, Debug, PartialEq, Eq)]
207pub enum Fatal {
208    #[doc = "0: Reset was not generated"]
209    Disabled = 0,
210    #[doc = "1: Reset was generated"]
211    Enabled = 1,
212}
213impl From<Fatal> for bool {
214    #[inline(always)]
215    fn from(variant: Fatal) -> Self {
216        variant as u8 != 0
217    }
218}
219#[doc = "Field `FATAL` reader - Fatal Reset"]
220pub type FatalR = crate::BitReader<Fatal>;
221impl FatalR {
222    #[doc = "Get enumerated values variant"]
223    #[inline(always)]
224    pub const fn variant(&self) -> Fatal {
225        match self.bits {
226            false => Fatal::Disabled,
227            true => Fatal::Enabled,
228        }
229    }
230    #[doc = "Reset was not generated"]
231    #[inline(always)]
232    pub fn is_disabled(&self) -> bool {
233        *self == Fatal::Disabled
234    }
235    #[doc = "Reset was generated"]
236    #[inline(always)]
237    pub fn is_enabled(&self) -> bool {
238        *self == Fatal::Enabled
239    }
240}
241#[doc = "Field `FATAL` writer - Fatal Reset"]
242pub type FatalW<'a, REG> = crate::BitWriter1C<'a, REG, Fatal>;
243impl<'a, REG> FatalW<'a, REG>
244where
245    REG: crate::Writable + crate::RegisterSpec,
246{
247    #[doc = "Reset was not generated"]
248    #[inline(always)]
249    pub fn disabled(self) -> &'a mut crate::W<REG> {
250        self.variant(Fatal::Disabled)
251    }
252    #[doc = "Reset was generated"]
253    #[inline(always)]
254    pub fn enabled(self) -> &'a mut crate::W<REG> {
255        self.variant(Fatal::Enabled)
256    }
257}
258#[doc = "Pin Reset\n\nValue on reset: 0"]
259#[cfg_attr(feature = "defmt", derive(defmt::Format))]
260#[derive(Clone, Copy, Debug, PartialEq, Eq)]
261pub enum Pin {
262    #[doc = "0: Reset not generated"]
263    Disabled = 0,
264    #[doc = "1: Reset generated"]
265    Enabled = 1,
266}
267impl From<Pin> for bool {
268    #[inline(always)]
269    fn from(variant: Pin) -> Self {
270        variant as u8 != 0
271    }
272}
273#[doc = "Field `PIN` reader - Pin Reset"]
274pub type PinR = crate::BitReader<Pin>;
275impl PinR {
276    #[doc = "Get enumerated values variant"]
277    #[inline(always)]
278    pub const fn variant(&self) -> Pin {
279        match self.bits {
280            false => Pin::Disabled,
281            true => Pin::Enabled,
282        }
283    }
284    #[doc = "Reset not generated"]
285    #[inline(always)]
286    pub fn is_disabled(&self) -> bool {
287        *self == Pin::Disabled
288    }
289    #[doc = "Reset generated"]
290    #[inline(always)]
291    pub fn is_enabled(&self) -> bool {
292        *self == Pin::Enabled
293    }
294}
295#[doc = "Field `PIN` writer - Pin Reset"]
296pub type PinW<'a, REG> = crate::BitWriter1C<'a, REG, Pin>;
297impl<'a, REG> PinW<'a, REG>
298where
299    REG: crate::Writable + crate::RegisterSpec,
300{
301    #[doc = "Reset not generated"]
302    #[inline(always)]
303    pub fn disabled(self) -> &'a mut crate::W<REG> {
304        self.variant(Pin::Disabled)
305    }
306    #[doc = "Reset generated"]
307    #[inline(always)]
308    pub fn enabled(self) -> &'a mut crate::W<REG> {
309        self.variant(Pin::Enabled)
310    }
311}
312#[doc = "DAP Reset\n\nValue on reset: 0"]
313#[cfg_attr(feature = "defmt", derive(defmt::Format))]
314#[derive(Clone, Copy, Debug, PartialEq, Eq)]
315pub enum Dap {
316    #[doc = "0: Reset not generated"]
317    Disabled = 0,
318    #[doc = "1: Reset generated"]
319    Enabled = 1,
320}
321impl From<Dap> for bool {
322    #[inline(always)]
323    fn from(variant: Dap) -> Self {
324        variant as u8 != 0
325    }
326}
327#[doc = "Field `DAP` reader - DAP Reset"]
328pub type DapR = crate::BitReader<Dap>;
329impl DapR {
330    #[doc = "Get enumerated values variant"]
331    #[inline(always)]
332    pub const fn variant(&self) -> Dap {
333        match self.bits {
334            false => Dap::Disabled,
335            true => Dap::Enabled,
336        }
337    }
338    #[doc = "Reset not generated"]
339    #[inline(always)]
340    pub fn is_disabled(&self) -> bool {
341        *self == Dap::Disabled
342    }
343    #[doc = "Reset generated"]
344    #[inline(always)]
345    pub fn is_enabled(&self) -> bool {
346        *self == Dap::Enabled
347    }
348}
349#[doc = "Field `DAP` writer - DAP Reset"]
350pub type DapW<'a, REG> = crate::BitWriter1C<'a, REG, Dap>;
351impl<'a, REG> DapW<'a, REG>
352where
353    REG: crate::Writable + crate::RegisterSpec,
354{
355    #[doc = "Reset not generated"]
356    #[inline(always)]
357    pub fn disabled(self) -> &'a mut crate::W<REG> {
358        self.variant(Dap::Disabled)
359    }
360    #[doc = "Reset generated"]
361    #[inline(always)]
362    pub fn enabled(self) -> &'a mut crate::W<REG> {
363        self.variant(Dap::Enabled)
364    }
365}
366#[doc = "Reset Timeout\n\nValue on reset: 0"]
367#[cfg_attr(feature = "defmt", derive(defmt::Format))]
368#[derive(Clone, Copy, Debug, PartialEq, Eq)]
369pub enum Rstack {
370    #[doc = "0: Reset not generated"]
371    Disabled = 0,
372    #[doc = "1: Reset generated"]
373    Enabled = 1,
374}
375impl From<Rstack> for bool {
376    #[inline(always)]
377    fn from(variant: Rstack) -> Self {
378        variant as u8 != 0
379    }
380}
381#[doc = "Field `RSTACK` reader - Reset Timeout"]
382pub type RstackR = crate::BitReader<Rstack>;
383impl RstackR {
384    #[doc = "Get enumerated values variant"]
385    #[inline(always)]
386    pub const fn variant(&self) -> Rstack {
387        match self.bits {
388            false => Rstack::Disabled,
389            true => Rstack::Enabled,
390        }
391    }
392    #[doc = "Reset not generated"]
393    #[inline(always)]
394    pub fn is_disabled(&self) -> bool {
395        *self == Rstack::Disabled
396    }
397    #[doc = "Reset generated"]
398    #[inline(always)]
399    pub fn is_enabled(&self) -> bool {
400        *self == Rstack::Enabled
401    }
402}
403#[doc = "Field `RSTACK` writer - Reset Timeout"]
404pub type RstackW<'a, REG> = crate::BitWriter1C<'a, REG, Rstack>;
405impl<'a, REG> RstackW<'a, REG>
406where
407    REG: crate::Writable + crate::RegisterSpec,
408{
409    #[doc = "Reset not generated"]
410    #[inline(always)]
411    pub fn disabled(self) -> &'a mut crate::W<REG> {
412        self.variant(Rstack::Disabled)
413    }
414    #[doc = "Reset generated"]
415    #[inline(always)]
416    pub fn enabled(self) -> &'a mut crate::W<REG> {
417        self.variant(Rstack::Enabled)
418    }
419}
420#[doc = "Low Power Acknowledge Timeout Reset\n\nValue on reset: 0"]
421#[cfg_attr(feature = "defmt", derive(defmt::Format))]
422#[derive(Clone, Copy, Debug, PartialEq, Eq)]
423pub enum Lpack {
424    #[doc = "0: Reset not generated"]
425    Disabled = 0,
426    #[doc = "1: Reset generated"]
427    Enabled = 1,
428}
429impl From<Lpack> for bool {
430    #[inline(always)]
431    fn from(variant: Lpack) -> Self {
432        variant as u8 != 0
433    }
434}
435#[doc = "Field `LPACK` reader - Low Power Acknowledge Timeout Reset"]
436pub type LpackR = crate::BitReader<Lpack>;
437impl LpackR {
438    #[doc = "Get enumerated values variant"]
439    #[inline(always)]
440    pub const fn variant(&self) -> Lpack {
441        match self.bits {
442            false => Lpack::Disabled,
443            true => Lpack::Enabled,
444        }
445    }
446    #[doc = "Reset not generated"]
447    #[inline(always)]
448    pub fn is_disabled(&self) -> bool {
449        *self == Lpack::Disabled
450    }
451    #[doc = "Reset generated"]
452    #[inline(always)]
453    pub fn is_enabled(&self) -> bool {
454        *self == Lpack::Enabled
455    }
456}
457#[doc = "Field `LPACK` writer - Low Power Acknowledge Timeout Reset"]
458pub type LpackW<'a, REG> = crate::BitWriter1C<'a, REG, Lpack>;
459impl<'a, REG> LpackW<'a, REG>
460where
461    REG: crate::Writable + crate::RegisterSpec,
462{
463    #[doc = "Reset not generated"]
464    #[inline(always)]
465    pub fn disabled(self) -> &'a mut crate::W<REG> {
466        self.variant(Lpack::Disabled)
467    }
468    #[doc = "Reset generated"]
469    #[inline(always)]
470    pub fn enabled(self) -> &'a mut crate::W<REG> {
471        self.variant(Lpack::Enabled)
472    }
473}
474#[doc = "System Clock Generation Reset\n\nValue on reset: 0"]
475#[cfg_attr(feature = "defmt", derive(defmt::Format))]
476#[derive(Clone, Copy, Debug, PartialEq, Eq)]
477pub enum Scg {
478    #[doc = "0: Reset is not generated"]
479    Disabled = 0,
480    #[doc = "1: Reset is generated"]
481    Enabled = 1,
482}
483impl From<Scg> for bool {
484    #[inline(always)]
485    fn from(variant: Scg) -> Self {
486        variant as u8 != 0
487    }
488}
489#[doc = "Field `SCG` reader - System Clock Generation Reset"]
490pub type ScgR = crate::BitReader<Scg>;
491impl ScgR {
492    #[doc = "Get enumerated values variant"]
493    #[inline(always)]
494    pub const fn variant(&self) -> Scg {
495        match self.bits {
496            false => Scg::Disabled,
497            true => Scg::Enabled,
498        }
499    }
500    #[doc = "Reset is not generated"]
501    #[inline(always)]
502    pub fn is_disabled(&self) -> bool {
503        *self == Scg::Disabled
504    }
505    #[doc = "Reset is generated"]
506    #[inline(always)]
507    pub fn is_enabled(&self) -> bool {
508        *self == Scg::Enabled
509    }
510}
511#[doc = "Field `SCG` writer - System Clock Generation Reset"]
512pub type ScgW<'a, REG> = crate::BitWriter1C<'a, REG, Scg>;
513impl<'a, REG> ScgW<'a, REG>
514where
515    REG: crate::Writable + crate::RegisterSpec,
516{
517    #[doc = "Reset is not generated"]
518    #[inline(always)]
519    pub fn disabled(self) -> &'a mut crate::W<REG> {
520        self.variant(Scg::Disabled)
521    }
522    #[doc = "Reset is generated"]
523    #[inline(always)]
524    pub fn enabled(self) -> &'a mut crate::W<REG> {
525        self.variant(Scg::Enabled)
526    }
527}
528#[doc = "Windowed Watchdog 0 Reset\n\nValue on reset: 0"]
529#[cfg_attr(feature = "defmt", derive(defmt::Format))]
530#[derive(Clone, Copy, Debug, PartialEq, Eq)]
531pub enum Wwdt0 {
532    #[doc = "0: Reset is not generated"]
533    Disabled = 0,
534    #[doc = "1: Reset is generated"]
535    Enabled = 1,
536}
537impl From<Wwdt0> for bool {
538    #[inline(always)]
539    fn from(variant: Wwdt0) -> Self {
540        variant as u8 != 0
541    }
542}
543#[doc = "Field `WWDT0` reader - Windowed Watchdog 0 Reset"]
544pub type Wwdt0R = crate::BitReader<Wwdt0>;
545impl Wwdt0R {
546    #[doc = "Get enumerated values variant"]
547    #[inline(always)]
548    pub const fn variant(&self) -> Wwdt0 {
549        match self.bits {
550            false => Wwdt0::Disabled,
551            true => Wwdt0::Enabled,
552        }
553    }
554    #[doc = "Reset is not generated"]
555    #[inline(always)]
556    pub fn is_disabled(&self) -> bool {
557        *self == Wwdt0::Disabled
558    }
559    #[doc = "Reset is generated"]
560    #[inline(always)]
561    pub fn is_enabled(&self) -> bool {
562        *self == Wwdt0::Enabled
563    }
564}
565#[doc = "Field `WWDT0` writer - Windowed Watchdog 0 Reset"]
566pub type Wwdt0W<'a, REG> = crate::BitWriter1C<'a, REG, Wwdt0>;
567impl<'a, REG> Wwdt0W<'a, REG>
568where
569    REG: crate::Writable + crate::RegisterSpec,
570{
571    #[doc = "Reset is not generated"]
572    #[inline(always)]
573    pub fn disabled(self) -> &'a mut crate::W<REG> {
574        self.variant(Wwdt0::Disabled)
575    }
576    #[doc = "Reset is generated"]
577    #[inline(always)]
578    pub fn enabled(self) -> &'a mut crate::W<REG> {
579        self.variant(Wwdt0::Enabled)
580    }
581}
582#[doc = "Software Reset\n\nValue on reset: 0"]
583#[cfg_attr(feature = "defmt", derive(defmt::Format))]
584#[derive(Clone, Copy, Debug, PartialEq, Eq)]
585pub enum Sw {
586    #[doc = "0: Reset not generated"]
587    Disabled = 0,
588    #[doc = "1: Reset generated"]
589    Enabled = 1,
590}
591impl From<Sw> for bool {
592    #[inline(always)]
593    fn from(variant: Sw) -> Self {
594        variant as u8 != 0
595    }
596}
597#[doc = "Field `SW` reader - Software Reset"]
598pub type SwR = crate::BitReader<Sw>;
599impl SwR {
600    #[doc = "Get enumerated values variant"]
601    #[inline(always)]
602    pub const fn variant(&self) -> Sw {
603        match self.bits {
604            false => Sw::Disabled,
605            true => Sw::Enabled,
606        }
607    }
608    #[doc = "Reset not generated"]
609    #[inline(always)]
610    pub fn is_disabled(&self) -> bool {
611        *self == Sw::Disabled
612    }
613    #[doc = "Reset generated"]
614    #[inline(always)]
615    pub fn is_enabled(&self) -> bool {
616        *self == Sw::Enabled
617    }
618}
619#[doc = "Field `SW` writer - Software Reset"]
620pub type SwW<'a, REG> = crate::BitWriter1C<'a, REG, Sw>;
621impl<'a, REG> SwW<'a, REG>
622where
623    REG: crate::Writable + crate::RegisterSpec,
624{
625    #[doc = "Reset not generated"]
626    #[inline(always)]
627    pub fn disabled(self) -> &'a mut crate::W<REG> {
628        self.variant(Sw::Disabled)
629    }
630    #[doc = "Reset generated"]
631    #[inline(always)]
632    pub fn enabled(self) -> &'a mut crate::W<REG> {
633        self.variant(Sw::Enabled)
634    }
635}
636#[doc = "Lockup Reset\n\nValue on reset: 0"]
637#[cfg_attr(feature = "defmt", derive(defmt::Format))]
638#[derive(Clone, Copy, Debug, PartialEq, Eq)]
639pub enum Lockup {
640    #[doc = "0: Reset not generated"]
641    Disabled = 0,
642    #[doc = "1: Reset generated"]
643    Enabled = 1,
644}
645impl From<Lockup> for bool {
646    #[inline(always)]
647    fn from(variant: Lockup) -> Self {
648        variant as u8 != 0
649    }
650}
651#[doc = "Field `LOCKUP` reader - Lockup Reset"]
652pub type LockupR = crate::BitReader<Lockup>;
653impl LockupR {
654    #[doc = "Get enumerated values variant"]
655    #[inline(always)]
656    pub const fn variant(&self) -> Lockup {
657        match self.bits {
658            false => Lockup::Disabled,
659            true => Lockup::Enabled,
660        }
661    }
662    #[doc = "Reset not generated"]
663    #[inline(always)]
664    pub fn is_disabled(&self) -> bool {
665        *self == Lockup::Disabled
666    }
667    #[doc = "Reset generated"]
668    #[inline(always)]
669    pub fn is_enabled(&self) -> bool {
670        *self == Lockup::Enabled
671    }
672}
673#[doc = "Field `LOCKUP` writer - Lockup Reset"]
674pub type LockupW<'a, REG> = crate::BitWriter1C<'a, REG, Lockup>;
675impl<'a, REG> LockupW<'a, REG>
676where
677    REG: crate::Writable + crate::RegisterSpec,
678{
679    #[doc = "Reset not generated"]
680    #[inline(always)]
681    pub fn disabled(self) -> &'a mut crate::W<REG> {
682        self.variant(Lockup::Disabled)
683    }
684    #[doc = "Reset generated"]
685    #[inline(always)]
686    pub fn enabled(self) -> &'a mut crate::W<REG> {
687        self.variant(Lockup::Enabled)
688    }
689}
690#[doc = "Code Watchdog 0 Reset\n\nValue on reset: 0"]
691#[cfg_attr(feature = "defmt", derive(defmt::Format))]
692#[derive(Clone, Copy, Debug, PartialEq, Eq)]
693pub enum Cdog0 {
694    #[doc = "0: Reset is not generated"]
695    Disabled = 0,
696    #[doc = "1: Reset is generated"]
697    Enabled = 1,
698}
699impl From<Cdog0> for bool {
700    #[inline(always)]
701    fn from(variant: Cdog0) -> Self {
702        variant as u8 != 0
703    }
704}
705#[doc = "Field `CDOG0` reader - Code Watchdog 0 Reset"]
706pub type Cdog0R = crate::BitReader<Cdog0>;
707impl Cdog0R {
708    #[doc = "Get enumerated values variant"]
709    #[inline(always)]
710    pub const fn variant(&self) -> Cdog0 {
711        match self.bits {
712            false => Cdog0::Disabled,
713            true => Cdog0::Enabled,
714        }
715    }
716    #[doc = "Reset is not generated"]
717    #[inline(always)]
718    pub fn is_disabled(&self) -> bool {
719        *self == Cdog0::Disabled
720    }
721    #[doc = "Reset is generated"]
722    #[inline(always)]
723    pub fn is_enabled(&self) -> bool {
724        *self == Cdog0::Enabled
725    }
726}
727#[doc = "Field `CDOG0` writer - Code Watchdog 0 Reset"]
728pub type Cdog0W<'a, REG> = crate::BitWriter1C<'a, REG, Cdog0>;
729impl<'a, REG> Cdog0W<'a, REG>
730where
731    REG: crate::Writable + crate::RegisterSpec,
732{
733    #[doc = "Reset is not generated"]
734    #[inline(always)]
735    pub fn disabled(self) -> &'a mut crate::W<REG> {
736        self.variant(Cdog0::Disabled)
737    }
738    #[doc = "Reset is generated"]
739    #[inline(always)]
740    pub fn enabled(self) -> &'a mut crate::W<REG> {
741        self.variant(Cdog0::Enabled)
742    }
743}
744#[doc = "Code Watchdog 1 Reset\n\nValue on reset: 0"]
745#[cfg_attr(feature = "defmt", derive(defmt::Format))]
746#[derive(Clone, Copy, Debug, PartialEq, Eq)]
747pub enum Cdog1 {
748    #[doc = "0: Reset is not generated"]
749    Disabled = 0,
750    #[doc = "1: Reset is generated"]
751    Enabled = 1,
752}
753impl From<Cdog1> for bool {
754    #[inline(always)]
755    fn from(variant: Cdog1) -> Self {
756        variant as u8 != 0
757    }
758}
759#[doc = "Field `CDOG1` reader - Code Watchdog 1 Reset"]
760pub type Cdog1R = crate::BitReader<Cdog1>;
761impl Cdog1R {
762    #[doc = "Get enumerated values variant"]
763    #[inline(always)]
764    pub const fn variant(&self) -> Cdog1 {
765        match self.bits {
766            false => Cdog1::Disabled,
767            true => Cdog1::Enabled,
768        }
769    }
770    #[doc = "Reset is not generated"]
771    #[inline(always)]
772    pub fn is_disabled(&self) -> bool {
773        *self == Cdog1::Disabled
774    }
775    #[doc = "Reset is generated"]
776    #[inline(always)]
777    pub fn is_enabled(&self) -> bool {
778        *self == Cdog1::Enabled
779    }
780}
781#[doc = "Field `CDOG1` writer - Code Watchdog 1 Reset"]
782pub type Cdog1W<'a, REG> = crate::BitWriter1C<'a, REG, Cdog1>;
783impl<'a, REG> Cdog1W<'a, REG>
784where
785    REG: crate::Writable + crate::RegisterSpec,
786{
787    #[doc = "Reset is not generated"]
788    #[inline(always)]
789    pub fn disabled(self) -> &'a mut crate::W<REG> {
790        self.variant(Cdog1::Disabled)
791    }
792    #[doc = "Reset is generated"]
793    #[inline(always)]
794    pub fn enabled(self) -> &'a mut crate::W<REG> {
795        self.variant(Cdog1::Enabled)
796    }
797}
798#[doc = "JTAG System Reset\n\nValue on reset: 0"]
799#[cfg_attr(feature = "defmt", derive(defmt::Format))]
800#[derive(Clone, Copy, Debug, PartialEq, Eq)]
801pub enum Jtag {
802    #[doc = "0: Reset not generated"]
803    Disabled = 0,
804    #[doc = "1: Reset generated"]
805    Enabled = 1,
806}
807impl From<Jtag> for bool {
808    #[inline(always)]
809    fn from(variant: Jtag) -> Self {
810        variant as u8 != 0
811    }
812}
813#[doc = "Field `JTAG` reader - JTAG System Reset"]
814pub type JtagR = crate::BitReader<Jtag>;
815impl JtagR {
816    #[doc = "Get enumerated values variant"]
817    #[inline(always)]
818    pub const fn variant(&self) -> Jtag {
819        match self.bits {
820            false => Jtag::Disabled,
821            true => Jtag::Enabled,
822        }
823    }
824    #[doc = "Reset not generated"]
825    #[inline(always)]
826    pub fn is_disabled(&self) -> bool {
827        *self == Jtag::Disabled
828    }
829    #[doc = "Reset generated"]
830    #[inline(always)]
831    pub fn is_enabled(&self) -> bool {
832        *self == Jtag::Enabled
833    }
834}
835#[doc = "Field `JTAG` writer - JTAG System Reset"]
836pub type JtagW<'a, REG> = crate::BitWriter1C<'a, REG, Jtag>;
837impl<'a, REG> JtagW<'a, REG>
838where
839    REG: crate::Writable + crate::RegisterSpec,
840{
841    #[doc = "Reset not generated"]
842    #[inline(always)]
843    pub fn disabled(self) -> &'a mut crate::W<REG> {
844        self.variant(Jtag::Disabled)
845    }
846    #[doc = "Reset generated"]
847    #[inline(always)]
848    pub fn enabled(self) -> &'a mut crate::W<REG> {
849        self.variant(Jtag::Enabled)
850    }
851}
852#[doc = "Tamper Reset\n\nValue on reset: 0"]
853#[cfg_attr(feature = "defmt", derive(defmt::Format))]
854#[derive(Clone, Copy, Debug, PartialEq, Eq)]
855pub enum Tamper {
856    #[doc = "0: Reset not generated"]
857    Disabled = 0,
858    #[doc = "1: Reset generated"]
859    Enabled = 1,
860}
861impl From<Tamper> for bool {
862    #[inline(always)]
863    fn from(variant: Tamper) -> Self {
864        variant as u8 != 0
865    }
866}
867#[doc = "Field `TAMPER` reader - Tamper Reset"]
868pub type TamperR = crate::BitReader<Tamper>;
869impl TamperR {
870    #[doc = "Get enumerated values variant"]
871    #[inline(always)]
872    pub const fn variant(&self) -> Tamper {
873        match self.bits {
874            false => Tamper::Disabled,
875            true => Tamper::Enabled,
876        }
877    }
878    #[doc = "Reset not generated"]
879    #[inline(always)]
880    pub fn is_disabled(&self) -> bool {
881        *self == Tamper::Disabled
882    }
883    #[doc = "Reset generated"]
884    #[inline(always)]
885    pub fn is_enabled(&self) -> bool {
886        *self == Tamper::Enabled
887    }
888}
889#[doc = "Field `TAMPER` writer - Tamper Reset"]
890pub type TamperW<'a, REG> = crate::BitWriter1C<'a, REG, Tamper>;
891impl<'a, REG> TamperW<'a, REG>
892where
893    REG: crate::Writable + crate::RegisterSpec,
894{
895    #[doc = "Reset not generated"]
896    #[inline(always)]
897    pub fn disabled(self) -> &'a mut crate::W<REG> {
898        self.variant(Tamper::Disabled)
899    }
900    #[doc = "Reset generated"]
901    #[inline(always)]
902    pub fn enabled(self) -> &'a mut crate::W<REG> {
903        self.variant(Tamper::Enabled)
904    }
905}
906impl R {
907    #[doc = "Bit 0 - Wake-up Reset"]
908    #[inline(always)]
909    pub fn wakeup(&self) -> WakeupR {
910        WakeupR::new((self.bits & 1) != 0)
911    }
912    #[doc = "Bit 1 - Power-on Reset"]
913    #[inline(always)]
914    pub fn por(&self) -> PorR {
915        PorR::new(((self.bits >> 1) & 1) != 0)
916    }
917    #[doc = "Bit 2 - Voltage Detect Reset"]
918    #[inline(always)]
919    pub fn vd(&self) -> VdR {
920        VdR::new(((self.bits >> 2) & 1) != 0)
921    }
922    #[doc = "Bit 4 - Warm Reset"]
923    #[inline(always)]
924    pub fn warm(&self) -> WarmR {
925        WarmR::new(((self.bits >> 4) & 1) != 0)
926    }
927    #[doc = "Bit 5 - Fatal Reset"]
928    #[inline(always)]
929    pub fn fatal(&self) -> FatalR {
930        FatalR::new(((self.bits >> 5) & 1) != 0)
931    }
932    #[doc = "Bit 8 - Pin Reset"]
933    #[inline(always)]
934    pub fn pin(&self) -> PinR {
935        PinR::new(((self.bits >> 8) & 1) != 0)
936    }
937    #[doc = "Bit 9 - DAP Reset"]
938    #[inline(always)]
939    pub fn dap(&self) -> DapR {
940        DapR::new(((self.bits >> 9) & 1) != 0)
941    }
942    #[doc = "Bit 10 - Reset Timeout"]
943    #[inline(always)]
944    pub fn rstack(&self) -> RstackR {
945        RstackR::new(((self.bits >> 10) & 1) != 0)
946    }
947    #[doc = "Bit 11 - Low Power Acknowledge Timeout Reset"]
948    #[inline(always)]
949    pub fn lpack(&self) -> LpackR {
950        LpackR::new(((self.bits >> 11) & 1) != 0)
951    }
952    #[doc = "Bit 12 - System Clock Generation Reset"]
953    #[inline(always)]
954    pub fn scg(&self) -> ScgR {
955        ScgR::new(((self.bits >> 12) & 1) != 0)
956    }
957    #[doc = "Bit 13 - Windowed Watchdog 0 Reset"]
958    #[inline(always)]
959    pub fn wwdt0(&self) -> Wwdt0R {
960        Wwdt0R::new(((self.bits >> 13) & 1) != 0)
961    }
962    #[doc = "Bit 14 - Software Reset"]
963    #[inline(always)]
964    pub fn sw(&self) -> SwR {
965        SwR::new(((self.bits >> 14) & 1) != 0)
966    }
967    #[doc = "Bit 15 - Lockup Reset"]
968    #[inline(always)]
969    pub fn lockup(&self) -> LockupR {
970        LockupR::new(((self.bits >> 15) & 1) != 0)
971    }
972    #[doc = "Bit 26 - Code Watchdog 0 Reset"]
973    #[inline(always)]
974    pub fn cdog0(&self) -> Cdog0R {
975        Cdog0R::new(((self.bits >> 26) & 1) != 0)
976    }
977    #[doc = "Bit 27 - Code Watchdog 1 Reset"]
978    #[inline(always)]
979    pub fn cdog1(&self) -> Cdog1R {
980        Cdog1R::new(((self.bits >> 27) & 1) != 0)
981    }
982    #[doc = "Bit 28 - JTAG System Reset"]
983    #[inline(always)]
984    pub fn jtag(&self) -> JtagR {
985        JtagR::new(((self.bits >> 28) & 1) != 0)
986    }
987    #[doc = "Bit 31 - Tamper Reset"]
988    #[inline(always)]
989    pub fn tamper(&self) -> TamperR {
990        TamperR::new(((self.bits >> 31) & 1) != 0)
991    }
992}
993#[cfg(feature = "debug")]
994impl core::fmt::Debug for R {
995    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
996        f.debug_struct("SSRS")
997            .field("wakeup", &self.wakeup())
998            .field("por", &self.por())
999            .field("vd", &self.vd())
1000            .field("warm", &self.warm())
1001            .field("fatal", &self.fatal())
1002            .field("pin", &self.pin())
1003            .field("dap", &self.dap())
1004            .field("rstack", &self.rstack())
1005            .field("lpack", &self.lpack())
1006            .field("scg", &self.scg())
1007            .field("wwdt0", &self.wwdt0())
1008            .field("sw", &self.sw())
1009            .field("lockup", &self.lockup())
1010            .field("cdog0", &self.cdog0())
1011            .field("cdog1", &self.cdog1())
1012            .field("jtag", &self.jtag())
1013            .field("tamper", &self.tamper())
1014            .finish()
1015    }
1016}
1017impl W {
1018    #[doc = "Bit 0 - Wake-up Reset"]
1019    #[inline(always)]
1020    pub fn wakeup(&mut self) -> WakeupW<'_, SsrsSpec> {
1021        WakeupW::new(self, 0)
1022    }
1023    #[doc = "Bit 1 - Power-on Reset"]
1024    #[inline(always)]
1025    pub fn por(&mut self) -> PorW<'_, SsrsSpec> {
1026        PorW::new(self, 1)
1027    }
1028    #[doc = "Bit 4 - Warm Reset"]
1029    #[inline(always)]
1030    pub fn warm(&mut self) -> WarmW<'_, SsrsSpec> {
1031        WarmW::new(self, 4)
1032    }
1033    #[doc = "Bit 5 - Fatal Reset"]
1034    #[inline(always)]
1035    pub fn fatal(&mut self) -> FatalW<'_, SsrsSpec> {
1036        FatalW::new(self, 5)
1037    }
1038    #[doc = "Bit 8 - Pin Reset"]
1039    #[inline(always)]
1040    pub fn pin(&mut self) -> PinW<'_, SsrsSpec> {
1041        PinW::new(self, 8)
1042    }
1043    #[doc = "Bit 9 - DAP Reset"]
1044    #[inline(always)]
1045    pub fn dap(&mut self) -> DapW<'_, SsrsSpec> {
1046        DapW::new(self, 9)
1047    }
1048    #[doc = "Bit 10 - Reset Timeout"]
1049    #[inline(always)]
1050    pub fn rstack(&mut self) -> RstackW<'_, SsrsSpec> {
1051        RstackW::new(self, 10)
1052    }
1053    #[doc = "Bit 11 - Low Power Acknowledge Timeout Reset"]
1054    #[inline(always)]
1055    pub fn lpack(&mut self) -> LpackW<'_, SsrsSpec> {
1056        LpackW::new(self, 11)
1057    }
1058    #[doc = "Bit 12 - System Clock Generation Reset"]
1059    #[inline(always)]
1060    pub fn scg(&mut self) -> ScgW<'_, SsrsSpec> {
1061        ScgW::new(self, 12)
1062    }
1063    #[doc = "Bit 13 - Windowed Watchdog 0 Reset"]
1064    #[inline(always)]
1065    pub fn wwdt0(&mut self) -> Wwdt0W<'_, SsrsSpec> {
1066        Wwdt0W::new(self, 13)
1067    }
1068    #[doc = "Bit 14 - Software Reset"]
1069    #[inline(always)]
1070    pub fn sw(&mut self) -> SwW<'_, SsrsSpec> {
1071        SwW::new(self, 14)
1072    }
1073    #[doc = "Bit 15 - Lockup Reset"]
1074    #[inline(always)]
1075    pub fn lockup(&mut self) -> LockupW<'_, SsrsSpec> {
1076        LockupW::new(self, 15)
1077    }
1078    #[doc = "Bit 26 - Code Watchdog 0 Reset"]
1079    #[inline(always)]
1080    pub fn cdog0(&mut self) -> Cdog0W<'_, SsrsSpec> {
1081        Cdog0W::new(self, 26)
1082    }
1083    #[doc = "Bit 27 - Code Watchdog 1 Reset"]
1084    #[inline(always)]
1085    pub fn cdog1(&mut self) -> Cdog1W<'_, SsrsSpec> {
1086        Cdog1W::new(self, 27)
1087    }
1088    #[doc = "Bit 28 - JTAG System Reset"]
1089    #[inline(always)]
1090    pub fn jtag(&mut self) -> JtagW<'_, SsrsSpec> {
1091        JtagW::new(self, 28)
1092    }
1093    #[doc = "Bit 31 - Tamper Reset"]
1094    #[inline(always)]
1095    pub fn tamper(&mut self) -> TamperW<'_, SsrsSpec> {
1096        TamperW::new(self, 31)
1097    }
1098}
1099#[doc = "Sticky System Reset Status\n\nYou can [`read`](crate::Reg::read) this register and get [`ssrs::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ssrs::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
1100pub struct SsrsSpec;
1101impl crate::RegisterSpec for SsrsSpec {
1102    type Ux = u32;
1103}
1104#[doc = "`read()` method returns [`ssrs::R`](R) reader structure"]
1105impl crate::Readable for SsrsSpec {}
1106#[doc = "`write(|w| ..)` method takes [`ssrs::W`](W) writer structure"]
1107impl crate::Writable for SsrsSpec {
1108    type Safety = crate::Unsafe;
1109    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0x9c00_ff33;
1110}
1111#[doc = "`reset()` method sets SSRS to value 0x06"]
1112impl crate::Resettable for SsrsSpec {
1113    const RESET_VALUE: u32 = 0x06;
1114}