Skip to main content

mcxa_pac/cmc/
srie.rs

1#[doc = "Register `SRIE` reader"]
2pub type R = crate::R<SrieSpec>;
3#[doc = "Register `SRIE` writer"]
4pub type W = crate::W<SrieSpec>;
5#[doc = "Pin Reset\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum Pin {
9    #[doc = "0: Interrupt disabled"]
10    Disabled = 0,
11    #[doc = "1: Interrupt enabled"]
12    Enabled = 1,
13}
14impl From<Pin> for bool {
15    #[inline(always)]
16    fn from(variant: Pin) -> Self {
17        variant as u8 != 0
18    }
19}
20#[doc = "Field `PIN` reader - Pin Reset"]
21pub type PinR = crate::BitReader<Pin>;
22impl PinR {
23    #[doc = "Get enumerated values variant"]
24    #[inline(always)]
25    pub const fn variant(&self) -> Pin {
26        match self.bits {
27            false => Pin::Disabled,
28            true => Pin::Enabled,
29        }
30    }
31    #[doc = "Interrupt disabled"]
32    #[inline(always)]
33    pub fn is_disabled(&self) -> bool {
34        *self == Pin::Disabled
35    }
36    #[doc = "Interrupt enabled"]
37    #[inline(always)]
38    pub fn is_enabled(&self) -> bool {
39        *self == Pin::Enabled
40    }
41}
42#[doc = "Field `PIN` writer - Pin Reset"]
43pub type PinW<'a, REG> = crate::BitWriter<'a, REG, Pin>;
44impl<'a, REG> PinW<'a, REG>
45where
46    REG: crate::Writable + crate::RegisterSpec,
47{
48    #[doc = "Interrupt disabled"]
49    #[inline(always)]
50    pub fn disabled(self) -> &'a mut crate::W<REG> {
51        self.variant(Pin::Disabled)
52    }
53    #[doc = "Interrupt enabled"]
54    #[inline(always)]
55    pub fn enabled(self) -> &'a mut crate::W<REG> {
56        self.variant(Pin::Enabled)
57    }
58}
59#[doc = "DAP Reset\n\nValue on reset: 0"]
60#[cfg_attr(feature = "defmt", derive(defmt::Format))]
61#[derive(Clone, Copy, Debug, PartialEq, Eq)]
62pub enum Dap {
63    #[doc = "0: Interrupt disabled"]
64    Disabled = 0,
65    #[doc = "1: Interrupt enabled"]
66    Enabled = 1,
67}
68impl From<Dap> for bool {
69    #[inline(always)]
70    fn from(variant: Dap) -> Self {
71        variant as u8 != 0
72    }
73}
74#[doc = "Field `DAP` reader - DAP Reset"]
75pub type DapR = crate::BitReader<Dap>;
76impl DapR {
77    #[doc = "Get enumerated values variant"]
78    #[inline(always)]
79    pub const fn variant(&self) -> Dap {
80        match self.bits {
81            false => Dap::Disabled,
82            true => Dap::Enabled,
83        }
84    }
85    #[doc = "Interrupt disabled"]
86    #[inline(always)]
87    pub fn is_disabled(&self) -> bool {
88        *self == Dap::Disabled
89    }
90    #[doc = "Interrupt enabled"]
91    #[inline(always)]
92    pub fn is_enabled(&self) -> bool {
93        *self == Dap::Enabled
94    }
95}
96#[doc = "Field `DAP` writer - DAP Reset"]
97pub type DapW<'a, REG> = crate::BitWriter<'a, REG, Dap>;
98impl<'a, REG> DapW<'a, REG>
99where
100    REG: crate::Writable + crate::RegisterSpec,
101{
102    #[doc = "Interrupt disabled"]
103    #[inline(always)]
104    pub fn disabled(self) -> &'a mut crate::W<REG> {
105        self.variant(Dap::Disabled)
106    }
107    #[doc = "Interrupt enabled"]
108    #[inline(always)]
109    pub fn enabled(self) -> &'a mut crate::W<REG> {
110        self.variant(Dap::Enabled)
111    }
112}
113#[doc = "Low Power Acknowledge Timeout Reset\n\nValue on reset: 1"]
114#[cfg_attr(feature = "defmt", derive(defmt::Format))]
115#[derive(Clone, Copy, Debug, PartialEq, Eq)]
116pub enum Lpack {
117    #[doc = "0: Interrupt disabled"]
118    Disabled = 0,
119    #[doc = "1: Interrupt enabled"]
120    Enabled = 1,
121}
122impl From<Lpack> for bool {
123    #[inline(always)]
124    fn from(variant: Lpack) -> Self {
125        variant as u8 != 0
126    }
127}
128#[doc = "Field `LPACK` reader - Low Power Acknowledge Timeout Reset"]
129pub type LpackR = crate::BitReader<Lpack>;
130impl LpackR {
131    #[doc = "Get enumerated values variant"]
132    #[inline(always)]
133    pub const fn variant(&self) -> Lpack {
134        match self.bits {
135            false => Lpack::Disabled,
136            true => Lpack::Enabled,
137        }
138    }
139    #[doc = "Interrupt disabled"]
140    #[inline(always)]
141    pub fn is_disabled(&self) -> bool {
142        *self == Lpack::Disabled
143    }
144    #[doc = "Interrupt enabled"]
145    #[inline(always)]
146    pub fn is_enabled(&self) -> bool {
147        *self == Lpack::Enabled
148    }
149}
150#[doc = "Field `LPACK` writer - Low Power Acknowledge Timeout Reset"]
151pub type LpackW<'a, REG> = crate::BitWriter<'a, REG, Lpack>;
152impl<'a, REG> LpackW<'a, REG>
153where
154    REG: crate::Writable + crate::RegisterSpec,
155{
156    #[doc = "Interrupt disabled"]
157    #[inline(always)]
158    pub fn disabled(self) -> &'a mut crate::W<REG> {
159        self.variant(Lpack::Disabled)
160    }
161    #[doc = "Interrupt enabled"]
162    #[inline(always)]
163    pub fn enabled(self) -> &'a mut crate::W<REG> {
164        self.variant(Lpack::Enabled)
165    }
166}
167#[doc = "System Clock Generation Reset\n\nValue on reset: 0"]
168#[cfg_attr(feature = "defmt", derive(defmt::Format))]
169#[derive(Clone, Copy, Debug, PartialEq, Eq)]
170pub enum Scg {
171    #[doc = "0: Interrupt disabled"]
172    Disabled = 0,
173    #[doc = "1: Interrupt enabled"]
174    Enabled = 1,
175}
176impl From<Scg> for bool {
177    #[inline(always)]
178    fn from(variant: Scg) -> Self {
179        variant as u8 != 0
180    }
181}
182#[doc = "Field `SCG` reader - System Clock Generation Reset"]
183pub type ScgR = crate::BitReader<Scg>;
184impl ScgR {
185    #[doc = "Get enumerated values variant"]
186    #[inline(always)]
187    pub const fn variant(&self) -> Scg {
188        match self.bits {
189            false => Scg::Disabled,
190            true => Scg::Enabled,
191        }
192    }
193    #[doc = "Interrupt disabled"]
194    #[inline(always)]
195    pub fn is_disabled(&self) -> bool {
196        *self == Scg::Disabled
197    }
198    #[doc = "Interrupt enabled"]
199    #[inline(always)]
200    pub fn is_enabled(&self) -> bool {
201        *self == Scg::Enabled
202    }
203}
204#[doc = "Field `SCG` writer - System Clock Generation Reset"]
205pub type ScgW<'a, REG> = crate::BitWriter<'a, REG, Scg>;
206impl<'a, REG> ScgW<'a, REG>
207where
208    REG: crate::Writable + crate::RegisterSpec,
209{
210    #[doc = "Interrupt disabled"]
211    #[inline(always)]
212    pub fn disabled(self) -> &'a mut crate::W<REG> {
213        self.variant(Scg::Disabled)
214    }
215    #[doc = "Interrupt enabled"]
216    #[inline(always)]
217    pub fn enabled(self) -> &'a mut crate::W<REG> {
218        self.variant(Scg::Enabled)
219    }
220}
221#[doc = "Windowed Watchdog 0 Reset\n\nValue on reset: 0"]
222#[cfg_attr(feature = "defmt", derive(defmt::Format))]
223#[derive(Clone, Copy, Debug, PartialEq, Eq)]
224pub enum Wwdt0 {
225    #[doc = "0: Interrupt disabled"]
226    Disabled = 0,
227    #[doc = "1: Interrupt enabled"]
228    Enabled = 1,
229}
230impl From<Wwdt0> for bool {
231    #[inline(always)]
232    fn from(variant: Wwdt0) -> Self {
233        variant as u8 != 0
234    }
235}
236#[doc = "Field `WWDT0` reader - Windowed Watchdog 0 Reset"]
237pub type Wwdt0R = crate::BitReader<Wwdt0>;
238impl Wwdt0R {
239    #[doc = "Get enumerated values variant"]
240    #[inline(always)]
241    pub const fn variant(&self) -> Wwdt0 {
242        match self.bits {
243            false => Wwdt0::Disabled,
244            true => Wwdt0::Enabled,
245        }
246    }
247    #[doc = "Interrupt disabled"]
248    #[inline(always)]
249    pub fn is_disabled(&self) -> bool {
250        *self == Wwdt0::Disabled
251    }
252    #[doc = "Interrupt enabled"]
253    #[inline(always)]
254    pub fn is_enabled(&self) -> bool {
255        *self == Wwdt0::Enabled
256    }
257}
258#[doc = "Field `WWDT0` writer - Windowed Watchdog 0 Reset"]
259pub type Wwdt0W<'a, REG> = crate::BitWriter<'a, REG, Wwdt0>;
260impl<'a, REG> Wwdt0W<'a, REG>
261where
262    REG: crate::Writable + crate::RegisterSpec,
263{
264    #[doc = "Interrupt disabled"]
265    #[inline(always)]
266    pub fn disabled(self) -> &'a mut crate::W<REG> {
267        self.variant(Wwdt0::Disabled)
268    }
269    #[doc = "Interrupt enabled"]
270    #[inline(always)]
271    pub fn enabled(self) -> &'a mut crate::W<REG> {
272        self.variant(Wwdt0::Enabled)
273    }
274}
275#[doc = "Software Reset\n\nValue on reset: 0"]
276#[cfg_attr(feature = "defmt", derive(defmt::Format))]
277#[derive(Clone, Copy, Debug, PartialEq, Eq)]
278pub enum Sw {
279    #[doc = "0: Interrupt disabled"]
280    Disabled = 0,
281    #[doc = "1: Interrupt enabled"]
282    Enabled = 1,
283}
284impl From<Sw> for bool {
285    #[inline(always)]
286    fn from(variant: Sw) -> Self {
287        variant as u8 != 0
288    }
289}
290#[doc = "Field `SW` reader - Software Reset"]
291pub type SwR = crate::BitReader<Sw>;
292impl SwR {
293    #[doc = "Get enumerated values variant"]
294    #[inline(always)]
295    pub const fn variant(&self) -> Sw {
296        match self.bits {
297            false => Sw::Disabled,
298            true => Sw::Enabled,
299        }
300    }
301    #[doc = "Interrupt disabled"]
302    #[inline(always)]
303    pub fn is_disabled(&self) -> bool {
304        *self == Sw::Disabled
305    }
306    #[doc = "Interrupt enabled"]
307    #[inline(always)]
308    pub fn is_enabled(&self) -> bool {
309        *self == Sw::Enabled
310    }
311}
312#[doc = "Field `SW` writer - Software Reset"]
313pub type SwW<'a, REG> = crate::BitWriter<'a, REG, Sw>;
314impl<'a, REG> SwW<'a, REG>
315where
316    REG: crate::Writable + crate::RegisterSpec,
317{
318    #[doc = "Interrupt disabled"]
319    #[inline(always)]
320    pub fn disabled(self) -> &'a mut crate::W<REG> {
321        self.variant(Sw::Disabled)
322    }
323    #[doc = "Interrupt enabled"]
324    #[inline(always)]
325    pub fn enabled(self) -> &'a mut crate::W<REG> {
326        self.variant(Sw::Enabled)
327    }
328}
329#[doc = "Lockup Reset\n\nValue on reset: 1"]
330#[cfg_attr(feature = "defmt", derive(defmt::Format))]
331#[derive(Clone, Copy, Debug, PartialEq, Eq)]
332pub enum Lockup {
333    #[doc = "0: Interrupt disabled"]
334    Disabled = 0,
335    #[doc = "1: Interrupt enabled"]
336    Enabled = 1,
337}
338impl From<Lockup> for bool {
339    #[inline(always)]
340    fn from(variant: Lockup) -> Self {
341        variant as u8 != 0
342    }
343}
344#[doc = "Field `LOCKUP` reader - Lockup Reset"]
345pub type LockupR = crate::BitReader<Lockup>;
346impl LockupR {
347    #[doc = "Get enumerated values variant"]
348    #[inline(always)]
349    pub const fn variant(&self) -> Lockup {
350        match self.bits {
351            false => Lockup::Disabled,
352            true => Lockup::Enabled,
353        }
354    }
355    #[doc = "Interrupt disabled"]
356    #[inline(always)]
357    pub fn is_disabled(&self) -> bool {
358        *self == Lockup::Disabled
359    }
360    #[doc = "Interrupt enabled"]
361    #[inline(always)]
362    pub fn is_enabled(&self) -> bool {
363        *self == Lockup::Enabled
364    }
365}
366#[doc = "Field `LOCKUP` writer - Lockup Reset"]
367pub type LockupW<'a, REG> = crate::BitWriter<'a, REG, Lockup>;
368impl<'a, REG> LockupW<'a, REG>
369where
370    REG: crate::Writable + crate::RegisterSpec,
371{
372    #[doc = "Interrupt disabled"]
373    #[inline(always)]
374    pub fn disabled(self) -> &'a mut crate::W<REG> {
375        self.variant(Lockup::Disabled)
376    }
377    #[doc = "Interrupt enabled"]
378    #[inline(always)]
379    pub fn enabled(self) -> &'a mut crate::W<REG> {
380        self.variant(Lockup::Enabled)
381    }
382}
383#[doc = "Code Watchdog 0 Reset\n\nValue on reset: 0"]
384#[cfg_attr(feature = "defmt", derive(defmt::Format))]
385#[derive(Clone, Copy, Debug, PartialEq, Eq)]
386pub enum Cdog0 {
387    #[doc = "0: Interrupt disabled"]
388    Disabled = 0,
389    #[doc = "1: Interrupt enabled"]
390    Enabled = 1,
391}
392impl From<Cdog0> for bool {
393    #[inline(always)]
394    fn from(variant: Cdog0) -> Self {
395        variant as u8 != 0
396    }
397}
398#[doc = "Field `CDOG0` reader - Code Watchdog 0 Reset"]
399pub type Cdog0R = crate::BitReader<Cdog0>;
400impl Cdog0R {
401    #[doc = "Get enumerated values variant"]
402    #[inline(always)]
403    pub const fn variant(&self) -> Cdog0 {
404        match self.bits {
405            false => Cdog0::Disabled,
406            true => Cdog0::Enabled,
407        }
408    }
409    #[doc = "Interrupt disabled"]
410    #[inline(always)]
411    pub fn is_disabled(&self) -> bool {
412        *self == Cdog0::Disabled
413    }
414    #[doc = "Interrupt enabled"]
415    #[inline(always)]
416    pub fn is_enabled(&self) -> bool {
417        *self == Cdog0::Enabled
418    }
419}
420#[doc = "Field `CDOG0` writer - Code Watchdog 0 Reset"]
421pub type Cdog0W<'a, REG> = crate::BitWriter<'a, REG, Cdog0>;
422impl<'a, REG> Cdog0W<'a, REG>
423where
424    REG: crate::Writable + crate::RegisterSpec,
425{
426    #[doc = "Interrupt disabled"]
427    #[inline(always)]
428    pub fn disabled(self) -> &'a mut crate::W<REG> {
429        self.variant(Cdog0::Disabled)
430    }
431    #[doc = "Interrupt enabled"]
432    #[inline(always)]
433    pub fn enabled(self) -> &'a mut crate::W<REG> {
434        self.variant(Cdog0::Enabled)
435    }
436}
437#[doc = "Code Watchdog 1 Reset\n\nValue on reset: 0"]
438#[cfg_attr(feature = "defmt", derive(defmt::Format))]
439#[derive(Clone, Copy, Debug, PartialEq, Eq)]
440pub enum Cdog1 {
441    #[doc = "0: Interrupt disabled"]
442    Disabled = 0,
443    #[doc = "1: Interrupt enabled"]
444    Enabled = 1,
445}
446impl From<Cdog1> for bool {
447    #[inline(always)]
448    fn from(variant: Cdog1) -> Self {
449        variant as u8 != 0
450    }
451}
452#[doc = "Field `CDOG1` reader - Code Watchdog 1 Reset"]
453pub type Cdog1R = crate::BitReader<Cdog1>;
454impl Cdog1R {
455    #[doc = "Get enumerated values variant"]
456    #[inline(always)]
457    pub const fn variant(&self) -> Cdog1 {
458        match self.bits {
459            false => Cdog1::Disabled,
460            true => Cdog1::Enabled,
461        }
462    }
463    #[doc = "Interrupt disabled"]
464    #[inline(always)]
465    pub fn is_disabled(&self) -> bool {
466        *self == Cdog1::Disabled
467    }
468    #[doc = "Interrupt enabled"]
469    #[inline(always)]
470    pub fn is_enabled(&self) -> bool {
471        *self == Cdog1::Enabled
472    }
473}
474#[doc = "Field `CDOG1` writer - Code Watchdog 1 Reset"]
475pub type Cdog1W<'a, REG> = crate::BitWriter<'a, REG, Cdog1>;
476impl<'a, REG> Cdog1W<'a, REG>
477where
478    REG: crate::Writable + crate::RegisterSpec,
479{
480    #[doc = "Interrupt disabled"]
481    #[inline(always)]
482    pub fn disabled(self) -> &'a mut crate::W<REG> {
483        self.variant(Cdog1::Disabled)
484    }
485    #[doc = "Interrupt enabled"]
486    #[inline(always)]
487    pub fn enabled(self) -> &'a mut crate::W<REG> {
488        self.variant(Cdog1::Enabled)
489    }
490}
491impl R {
492    #[doc = "Bit 8 - Pin Reset"]
493    #[inline(always)]
494    pub fn pin(&self) -> PinR {
495        PinR::new(((self.bits >> 8) & 1) != 0)
496    }
497    #[doc = "Bit 9 - DAP Reset"]
498    #[inline(always)]
499    pub fn dap(&self) -> DapR {
500        DapR::new(((self.bits >> 9) & 1) != 0)
501    }
502    #[doc = "Bit 11 - Low Power Acknowledge Timeout Reset"]
503    #[inline(always)]
504    pub fn lpack(&self) -> LpackR {
505        LpackR::new(((self.bits >> 11) & 1) != 0)
506    }
507    #[doc = "Bit 12 - System Clock Generation Reset"]
508    #[inline(always)]
509    pub fn scg(&self) -> ScgR {
510        ScgR::new(((self.bits >> 12) & 1) != 0)
511    }
512    #[doc = "Bit 13 - Windowed Watchdog 0 Reset"]
513    #[inline(always)]
514    pub fn wwdt0(&self) -> Wwdt0R {
515        Wwdt0R::new(((self.bits >> 13) & 1) != 0)
516    }
517    #[doc = "Bit 14 - Software Reset"]
518    #[inline(always)]
519    pub fn sw(&self) -> SwR {
520        SwR::new(((self.bits >> 14) & 1) != 0)
521    }
522    #[doc = "Bit 15 - Lockup Reset"]
523    #[inline(always)]
524    pub fn lockup(&self) -> LockupR {
525        LockupR::new(((self.bits >> 15) & 1) != 0)
526    }
527    #[doc = "Bit 26 - Code Watchdog 0 Reset"]
528    #[inline(always)]
529    pub fn cdog0(&self) -> Cdog0R {
530        Cdog0R::new(((self.bits >> 26) & 1) != 0)
531    }
532    #[doc = "Bit 27 - Code Watchdog 1 Reset"]
533    #[inline(always)]
534    pub fn cdog1(&self) -> Cdog1R {
535        Cdog1R::new(((self.bits >> 27) & 1) != 0)
536    }
537}
538#[cfg(feature = "debug")]
539impl core::fmt::Debug for R {
540    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
541        f.debug_struct("SRIE")
542            .field("pin", &self.pin())
543            .field("dap", &self.dap())
544            .field("lpack", &self.lpack())
545            .field("scg", &self.scg())
546            .field("wwdt0", &self.wwdt0())
547            .field("sw", &self.sw())
548            .field("lockup", &self.lockup())
549            .field("cdog0", &self.cdog0())
550            .field("cdog1", &self.cdog1())
551            .finish()
552    }
553}
554impl W {
555    #[doc = "Bit 8 - Pin Reset"]
556    #[inline(always)]
557    pub fn pin(&mut self) -> PinW<'_, SrieSpec> {
558        PinW::new(self, 8)
559    }
560    #[doc = "Bit 9 - DAP Reset"]
561    #[inline(always)]
562    pub fn dap(&mut self) -> DapW<'_, SrieSpec> {
563        DapW::new(self, 9)
564    }
565    #[doc = "Bit 11 - Low Power Acknowledge Timeout Reset"]
566    #[inline(always)]
567    pub fn lpack(&mut self) -> LpackW<'_, SrieSpec> {
568        LpackW::new(self, 11)
569    }
570    #[doc = "Bit 12 - System Clock Generation Reset"]
571    #[inline(always)]
572    pub fn scg(&mut self) -> ScgW<'_, SrieSpec> {
573        ScgW::new(self, 12)
574    }
575    #[doc = "Bit 13 - Windowed Watchdog 0 Reset"]
576    #[inline(always)]
577    pub fn wwdt0(&mut self) -> Wwdt0W<'_, SrieSpec> {
578        Wwdt0W::new(self, 13)
579    }
580    #[doc = "Bit 14 - Software Reset"]
581    #[inline(always)]
582    pub fn sw(&mut self) -> SwW<'_, SrieSpec> {
583        SwW::new(self, 14)
584    }
585    #[doc = "Bit 15 - Lockup Reset"]
586    #[inline(always)]
587    pub fn lockup(&mut self) -> LockupW<'_, SrieSpec> {
588        LockupW::new(self, 15)
589    }
590    #[doc = "Bit 26 - Code Watchdog 0 Reset"]
591    #[inline(always)]
592    pub fn cdog0(&mut self) -> Cdog0W<'_, SrieSpec> {
593        Cdog0W::new(self, 26)
594    }
595    #[doc = "Bit 27 - Code Watchdog 1 Reset"]
596    #[inline(always)]
597    pub fn cdog1(&mut self) -> Cdog1W<'_, SrieSpec> {
598        Cdog1W::new(self, 27)
599    }
600}
601#[doc = "System Reset Interrupt Enable\n\nYou can [`read`](crate::Reg::read) this register and get [`srie::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`srie::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
602pub struct SrieSpec;
603impl crate::RegisterSpec for SrieSpec {
604    type Ux = u32;
605}
606#[doc = "`read()` method returns [`srie::R`](R) reader structure"]
607impl crate::Readable for SrieSpec {}
608#[doc = "`write(|w| ..)` method takes [`srie::W`](W) writer structure"]
609impl crate::Writable for SrieSpec {
610    type Safety = crate::Unsafe;
611}
612#[doc = "`reset()` method sets SRIE to value 0x8800"]
613impl crate::Resettable for SrieSpec {
614    const RESET_VALUE: u32 = 0x8800;
615}