efm32pg23-pac 0.1.2

Peripheral access API for EFM32PG23 MCU (generated using svd2rust)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
#[doc = "Register `CFG` reader"]
pub struct R(crate::R<CFG_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<CFG_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<CFG_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<CFG_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `CFG` writer"]
pub struct W(crate::W<CFG_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<CFG_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl From<crate::W<CFG_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<CFG_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `CLRSRC` reader - WDOG Clear Source"]
pub type CLRSRC_R = crate::BitReader<CLRSRC_A>;
#[doc = "WDOG Clear Source\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CLRSRC_A {
    #[doc = "0: A write to the clear bit will clear the WDOG counter"]
    SW = 0,
    #[doc = "1: A rising edge on the PRS Source 0 will clear the WDOG counter"]
    PRSSRC0 = 1,
}
impl From<CLRSRC_A> for bool {
    #[inline(always)]
    fn from(variant: CLRSRC_A) -> Self {
        variant as u8 != 0
    }
}
impl CLRSRC_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CLRSRC_A {
        match self.bits {
            false => CLRSRC_A::SW,
            true => CLRSRC_A::PRSSRC0,
        }
    }
    #[doc = "Checks if the value of the field is `SW`"]
    #[inline(always)]
    pub fn is_sw(&self) -> bool {
        *self == CLRSRC_A::SW
    }
    #[doc = "Checks if the value of the field is `PRSSRC0`"]
    #[inline(always)]
    pub fn is_prssrc0(&self) -> bool {
        *self == CLRSRC_A::PRSSRC0
    }
}
#[doc = "Field `CLRSRC` writer - WDOG Clear Source"]
pub type CLRSRC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, CLRSRC_A, O>;
impl<'a, const O: u8> CLRSRC_W<'a, O> {
    #[doc = "A write to the clear bit will clear the WDOG counter"]
    #[inline(always)]
    pub fn sw(self) -> &'a mut W {
        self.variant(CLRSRC_A::SW)
    }
    #[doc = "A rising edge on the PRS Source 0 will clear the WDOG counter"]
    #[inline(always)]
    pub fn prssrc0(self) -> &'a mut W {
        self.variant(CLRSRC_A::PRSSRC0)
    }
}
#[doc = "Field `EM1RUN` reader - EM1 Run"]
pub type EM1RUN_R = crate::BitReader<EM1RUN_A>;
#[doc = "EM1 Run\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum EM1RUN_A {
    #[doc = "0: WDOG timer is frozen in EM1."]
    DISABLE = 0,
    #[doc = "1: WDOG timer is running in EM1."]
    ENABLE = 1,
}
impl From<EM1RUN_A> for bool {
    #[inline(always)]
    fn from(variant: EM1RUN_A) -> Self {
        variant as u8 != 0
    }
}
impl EM1RUN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> EM1RUN_A {
        match self.bits {
            false => EM1RUN_A::DISABLE,
            true => EM1RUN_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == EM1RUN_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == EM1RUN_A::ENABLE
    }
}
#[doc = "Field `EM1RUN` writer - EM1 Run"]
pub type EM1RUN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, EM1RUN_A, O>;
impl<'a, const O: u8> EM1RUN_W<'a, O> {
    #[doc = "WDOG timer is frozen in EM1."]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(EM1RUN_A::DISABLE)
    }
    #[doc = "WDOG timer is running in EM1."]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(EM1RUN_A::ENABLE)
    }
}
#[doc = "Field `EM2RUN` reader - EM2 Run"]
pub type EM2RUN_R = crate::BitReader<EM2RUN_A>;
#[doc = "EM2 Run\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum EM2RUN_A {
    #[doc = "0: WDOG timer is frozen in EM2."]
    DISABLE = 0,
    #[doc = "1: WDOG timer is running in EM2."]
    ENABLE = 1,
}
impl From<EM2RUN_A> for bool {
    #[inline(always)]
    fn from(variant: EM2RUN_A) -> Self {
        variant as u8 != 0
    }
}
impl EM2RUN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> EM2RUN_A {
        match self.bits {
            false => EM2RUN_A::DISABLE,
            true => EM2RUN_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == EM2RUN_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == EM2RUN_A::ENABLE
    }
}
#[doc = "Field `EM2RUN` writer - EM2 Run"]
pub type EM2RUN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, EM2RUN_A, O>;
impl<'a, const O: u8> EM2RUN_W<'a, O> {
    #[doc = "WDOG timer is frozen in EM2."]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(EM2RUN_A::DISABLE)
    }
    #[doc = "WDOG timer is running in EM2."]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(EM2RUN_A::ENABLE)
    }
}
#[doc = "Field `EM3RUN` reader - EM3 Run"]
pub type EM3RUN_R = crate::BitReader<EM3RUN_A>;
#[doc = "EM3 Run\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum EM3RUN_A {
    #[doc = "0: WDOG timer is frozen in EM3."]
    DISABLE = 0,
    #[doc = "1: WDOG timer is running in EM3."]
    ENABLE = 1,
}
impl From<EM3RUN_A> for bool {
    #[inline(always)]
    fn from(variant: EM3RUN_A) -> Self {
        variant as u8 != 0
    }
}
impl EM3RUN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> EM3RUN_A {
        match self.bits {
            false => EM3RUN_A::DISABLE,
            true => EM3RUN_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == EM3RUN_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == EM3RUN_A::ENABLE
    }
}
#[doc = "Field `EM3RUN` writer - EM3 Run"]
pub type EM3RUN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, EM3RUN_A, O>;
impl<'a, const O: u8> EM3RUN_W<'a, O> {
    #[doc = "WDOG timer is frozen in EM3."]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(EM3RUN_A::DISABLE)
    }
    #[doc = "WDOG timer is running in EM3."]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(EM3RUN_A::ENABLE)
    }
}
#[doc = "Field `EM4BLOCK` reader - EM4 Block"]
pub type EM4BLOCK_R = crate::BitReader<EM4BLOCK_A>;
#[doc = "EM4 Block\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum EM4BLOCK_A {
    #[doc = "0: EM4 can be entered by software. See EMU for detailed description."]
    DISABLE = 0,
    #[doc = "1: EM4 cannot be entered by software."]
    ENABLE = 1,
}
impl From<EM4BLOCK_A> for bool {
    #[inline(always)]
    fn from(variant: EM4BLOCK_A) -> Self {
        variant as u8 != 0
    }
}
impl EM4BLOCK_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> EM4BLOCK_A {
        match self.bits {
            false => EM4BLOCK_A::DISABLE,
            true => EM4BLOCK_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == EM4BLOCK_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == EM4BLOCK_A::ENABLE
    }
}
#[doc = "Field `EM4BLOCK` writer - EM4 Block"]
pub type EM4BLOCK_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, EM4BLOCK_A, O>;
impl<'a, const O: u8> EM4BLOCK_W<'a, O> {
    #[doc = "EM4 can be entered by software. See EMU for detailed description."]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(EM4BLOCK_A::DISABLE)
    }
    #[doc = "EM4 cannot be entered by software."]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(EM4BLOCK_A::ENABLE)
    }
}
#[doc = "Field `DEBUGRUN` reader - Debug Mode Run"]
pub type DEBUGRUN_R = crate::BitReader<DEBUGRUN_A>;
#[doc = "Debug Mode Run\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DEBUGRUN_A {
    #[doc = "0: WDOG timer is frozen in debug mode"]
    DISABLE = 0,
    #[doc = "1: WDOG timer is running in debug mode"]
    ENABLE = 1,
}
impl From<DEBUGRUN_A> for bool {
    #[inline(always)]
    fn from(variant: DEBUGRUN_A) -> Self {
        variant as u8 != 0
    }
}
impl DEBUGRUN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DEBUGRUN_A {
        match self.bits {
            false => DEBUGRUN_A::DISABLE,
            true => DEBUGRUN_A::ENABLE,
        }
    }
    #[doc = "Checks if the value of the field is `DISABLE`"]
    #[inline(always)]
    pub fn is_disable(&self) -> bool {
        *self == DEBUGRUN_A::DISABLE
    }
    #[doc = "Checks if the value of the field is `ENABLE`"]
    #[inline(always)]
    pub fn is_enable(&self) -> bool {
        *self == DEBUGRUN_A::ENABLE
    }
}
#[doc = "Field `DEBUGRUN` writer - Debug Mode Run"]
pub type DEBUGRUN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, DEBUGRUN_A, O>;
impl<'a, const O: u8> DEBUGRUN_W<'a, O> {
    #[doc = "WDOG timer is frozen in debug mode"]
    #[inline(always)]
    pub fn disable(self) -> &'a mut W {
        self.variant(DEBUGRUN_A::DISABLE)
    }
    #[doc = "WDOG timer is running in debug mode"]
    #[inline(always)]
    pub fn enable(self) -> &'a mut W {
        self.variant(DEBUGRUN_A::ENABLE)
    }
}
#[doc = "Field `WDOGRSTDIS` reader - WDOG Reset Disable"]
pub type WDOGRSTDIS_R = crate::BitReader<WDOGRSTDIS_A>;
#[doc = "WDOG Reset Disable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WDOGRSTDIS_A {
    #[doc = "0: A timeout will cause a WDOG reset"]
    EN = 0,
    #[doc = "1: A timeout will not cause a WDOG reset"]
    DIS = 1,
}
impl From<WDOGRSTDIS_A> for bool {
    #[inline(always)]
    fn from(variant: WDOGRSTDIS_A) -> Self {
        variant as u8 != 0
    }
}
impl WDOGRSTDIS_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> WDOGRSTDIS_A {
        match self.bits {
            false => WDOGRSTDIS_A::EN,
            true => WDOGRSTDIS_A::DIS,
        }
    }
    #[doc = "Checks if the value of the field is `EN`"]
    #[inline(always)]
    pub fn is_en(&self) -> bool {
        *self == WDOGRSTDIS_A::EN
    }
    #[doc = "Checks if the value of the field is `DIS`"]
    #[inline(always)]
    pub fn is_dis(&self) -> bool {
        *self == WDOGRSTDIS_A::DIS
    }
}
#[doc = "Field `WDOGRSTDIS` writer - WDOG Reset Disable"]
pub type WDOGRSTDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, WDOGRSTDIS_A, O>;
impl<'a, const O: u8> WDOGRSTDIS_W<'a, O> {
    #[doc = "A timeout will cause a WDOG reset"]
    #[inline(always)]
    pub fn en(self) -> &'a mut W {
        self.variant(WDOGRSTDIS_A::EN)
    }
    #[doc = "A timeout will not cause a WDOG reset"]
    #[inline(always)]
    pub fn dis(self) -> &'a mut W {
        self.variant(WDOGRSTDIS_A::DIS)
    }
}
#[doc = "Field `PRS0MISSRSTEN` reader - PRS Src0 Missing Event WDOG Reset"]
pub type PRS0MISSRSTEN_R = crate::BitReader<bool>;
#[doc = "Field `PRS0MISSRSTEN` writer - PRS Src0 Missing Event WDOG Reset"]
pub type PRS0MISSRSTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, bool, O>;
#[doc = "Field `PRS1MISSRSTEN` reader - PRS Src1 Missing Event WDOG Reset"]
pub type PRS1MISSRSTEN_R = crate::BitReader<bool>;
#[doc = "Field `PRS1MISSRSTEN` writer - PRS Src1 Missing Event WDOG Reset"]
pub type PRS1MISSRSTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, bool, O>;
#[doc = "Field `PERSEL` reader - WDOG Timeout Period Select"]
pub type PERSEL_R = crate::FieldReader<u8, PERSEL_A>;
#[doc = "WDOG Timeout Period Select\n\nValue on reset: 15"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum PERSEL_A {
    #[doc = "0: Timeout period of 9 wdog cycles"]
    SEL0 = 0,
    #[doc = "1: Timeout period of 17 wdog cycles"]
    SEL1 = 1,
    #[doc = "2: Timeout period of 33 wdog cycles"]
    SEL2 = 2,
    #[doc = "3: Timeout period of 65 wdog cycles"]
    SEL3 = 3,
    #[doc = "4: Timeout period of 129 wdog cycles"]
    SEL4 = 4,
    #[doc = "5: Timeout period of 257 wdog cycles"]
    SEL5 = 5,
    #[doc = "6: Timeout period of 513 wdog cycles"]
    SEL6 = 6,
    #[doc = "7: Timeout period of 1k wdog cycles"]
    SEL7 = 7,
    #[doc = "8: Timeout period of 2k wdog cycles"]
    SEL8 = 8,
    #[doc = "9: Timeout period of 4k wdog cycles"]
    SEL9 = 9,
    #[doc = "10: Timeout period of 8k wdog cycles"]
    SEL10 = 10,
    #[doc = "11: Timeout period of 16k wdog cycles"]
    SEL11 = 11,
    #[doc = "12: Timeout period of 32k wdog cycles"]
    SEL12 = 12,
    #[doc = "13: Timeout period of 64k wdog cycles"]
    SEL13 = 13,
    #[doc = "14: Timeout period of 128k wdog cycles"]
    SEL14 = 14,
    #[doc = "15: Timeout period of 256k wdog cycles"]
    SEL15 = 15,
}
impl From<PERSEL_A> for u8 {
    #[inline(always)]
    fn from(variant: PERSEL_A) -> Self {
        variant as _
    }
}
impl PERSEL_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> PERSEL_A {
        match self.bits {
            0 => PERSEL_A::SEL0,
            1 => PERSEL_A::SEL1,
            2 => PERSEL_A::SEL2,
            3 => PERSEL_A::SEL3,
            4 => PERSEL_A::SEL4,
            5 => PERSEL_A::SEL5,
            6 => PERSEL_A::SEL6,
            7 => PERSEL_A::SEL7,
            8 => PERSEL_A::SEL8,
            9 => PERSEL_A::SEL9,
            10 => PERSEL_A::SEL10,
            11 => PERSEL_A::SEL11,
            12 => PERSEL_A::SEL12,
            13 => PERSEL_A::SEL13,
            14 => PERSEL_A::SEL14,
            15 => PERSEL_A::SEL15,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `SEL0`"]
    #[inline(always)]
    pub fn is_sel0(&self) -> bool {
        *self == PERSEL_A::SEL0
    }
    #[doc = "Checks if the value of the field is `SEL1`"]
    #[inline(always)]
    pub fn is_sel1(&self) -> bool {
        *self == PERSEL_A::SEL1
    }
    #[doc = "Checks if the value of the field is `SEL2`"]
    #[inline(always)]
    pub fn is_sel2(&self) -> bool {
        *self == PERSEL_A::SEL2
    }
    #[doc = "Checks if the value of the field is `SEL3`"]
    #[inline(always)]
    pub fn is_sel3(&self) -> bool {
        *self == PERSEL_A::SEL3
    }
    #[doc = "Checks if the value of the field is `SEL4`"]
    #[inline(always)]
    pub fn is_sel4(&self) -> bool {
        *self == PERSEL_A::SEL4
    }
    #[doc = "Checks if the value of the field is `SEL5`"]
    #[inline(always)]
    pub fn is_sel5(&self) -> bool {
        *self == PERSEL_A::SEL5
    }
    #[doc = "Checks if the value of the field is `SEL6`"]
    #[inline(always)]
    pub fn is_sel6(&self) -> bool {
        *self == PERSEL_A::SEL6
    }
    #[doc = "Checks if the value of the field is `SEL7`"]
    #[inline(always)]
    pub fn is_sel7(&self) -> bool {
        *self == PERSEL_A::SEL7
    }
    #[doc = "Checks if the value of the field is `SEL8`"]
    #[inline(always)]
    pub fn is_sel8(&self) -> bool {
        *self == PERSEL_A::SEL8
    }
    #[doc = "Checks if the value of the field is `SEL9`"]
    #[inline(always)]
    pub fn is_sel9(&self) -> bool {
        *self == PERSEL_A::SEL9
    }
    #[doc = "Checks if the value of the field is `SEL10`"]
    #[inline(always)]
    pub fn is_sel10(&self) -> bool {
        *self == PERSEL_A::SEL10
    }
    #[doc = "Checks if the value of the field is `SEL11`"]
    #[inline(always)]
    pub fn is_sel11(&self) -> bool {
        *self == PERSEL_A::SEL11
    }
    #[doc = "Checks if the value of the field is `SEL12`"]
    #[inline(always)]
    pub fn is_sel12(&self) -> bool {
        *self == PERSEL_A::SEL12
    }
    #[doc = "Checks if the value of the field is `SEL13`"]
    #[inline(always)]
    pub fn is_sel13(&self) -> bool {
        *self == PERSEL_A::SEL13
    }
    #[doc = "Checks if the value of the field is `SEL14`"]
    #[inline(always)]
    pub fn is_sel14(&self) -> bool {
        *self == PERSEL_A::SEL14
    }
    #[doc = "Checks if the value of the field is `SEL15`"]
    #[inline(always)]
    pub fn is_sel15(&self) -> bool {
        *self == PERSEL_A::SEL15
    }
}
#[doc = "Field `PERSEL` writer - WDOG Timeout Period Select"]
pub type PERSEL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CFG_SPEC, u8, PERSEL_A, 4, O>;
impl<'a, const O: u8> PERSEL_W<'a, O> {
    #[doc = "Timeout period of 9 wdog cycles"]
    #[inline(always)]
    pub fn sel0(self) -> &'a mut W {
        self.variant(PERSEL_A::SEL0)
    }
    #[doc = "Timeout period of 17 wdog cycles"]
    #[inline(always)]
    pub fn sel1(self) -> &'a mut W {
        self.variant(PERSEL_A::SEL1)
    }
    #[doc = "Timeout period of 33 wdog cycles"]
    #[inline(always)]
    pub fn sel2(self) -> &'a mut W {
        self.variant(PERSEL_A::SEL2)
    }
    #[doc = "Timeout period of 65 wdog cycles"]
    #[inline(always)]
    pub fn sel3(self) -> &'a mut W {
        self.variant(PERSEL_A::SEL3)
    }
    #[doc = "Timeout period of 129 wdog cycles"]
    #[inline(always)]
    pub fn sel4(self) -> &'a mut W {
        self.variant(PERSEL_A::SEL4)
    }
    #[doc = "Timeout period of 257 wdog cycles"]
    #[inline(always)]
    pub fn sel5(self) -> &'a mut W {
        self.variant(PERSEL_A::SEL5)
    }
    #[doc = "Timeout period of 513 wdog cycles"]
    #[inline(always)]
    pub fn sel6(self) -> &'a mut W {
        self.variant(PERSEL_A::SEL6)
    }
    #[doc = "Timeout period of 1k wdog cycles"]
    #[inline(always)]
    pub fn sel7(self) -> &'a mut W {
        self.variant(PERSEL_A::SEL7)
    }
    #[doc = "Timeout period of 2k wdog cycles"]
    #[inline(always)]
    pub fn sel8(self) -> &'a mut W {
        self.variant(PERSEL_A::SEL8)
    }
    #[doc = "Timeout period of 4k wdog cycles"]
    #[inline(always)]
    pub fn sel9(self) -> &'a mut W {
        self.variant(PERSEL_A::SEL9)
    }
    #[doc = "Timeout period of 8k wdog cycles"]
    #[inline(always)]
    pub fn sel10(self) -> &'a mut W {
        self.variant(PERSEL_A::SEL10)
    }
    #[doc = "Timeout period of 16k wdog cycles"]
    #[inline(always)]
    pub fn sel11(self) -> &'a mut W {
        self.variant(PERSEL_A::SEL11)
    }
    #[doc = "Timeout period of 32k wdog cycles"]
    #[inline(always)]
    pub fn sel12(self) -> &'a mut W {
        self.variant(PERSEL_A::SEL12)
    }
    #[doc = "Timeout period of 64k wdog cycles"]
    #[inline(always)]
    pub fn sel13(self) -> &'a mut W {
        self.variant(PERSEL_A::SEL13)
    }
    #[doc = "Timeout period of 128k wdog cycles"]
    #[inline(always)]
    pub fn sel14(self) -> &'a mut W {
        self.variant(PERSEL_A::SEL14)
    }
    #[doc = "Timeout period of 256k wdog cycles"]
    #[inline(always)]
    pub fn sel15(self) -> &'a mut W {
        self.variant(PERSEL_A::SEL15)
    }
}
#[doc = "Field `WARNSEL` reader - WDOG Warning Period Select"]
pub type WARNSEL_R = crate::FieldReader<u8, WARNSEL_A>;
#[doc = "WDOG Warning Period Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum WARNSEL_A {
    #[doc = "0: Disable"]
    DIS = 0,
    #[doc = "1: Warning timeout is 25% of the Timeout."]
    SEL1 = 1,
    #[doc = "2: Warning timeout is 50% of the Timeout."]
    SEL2 = 2,
    #[doc = "3: Warning timeout is 75% of the Timeout."]
    SEL3 = 3,
}
impl From<WARNSEL_A> for u8 {
    #[inline(always)]
    fn from(variant: WARNSEL_A) -> Self {
        variant as _
    }
}
impl WARNSEL_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> WARNSEL_A {
        match self.bits {
            0 => WARNSEL_A::DIS,
            1 => WARNSEL_A::SEL1,
            2 => WARNSEL_A::SEL2,
            3 => WARNSEL_A::SEL3,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `DIS`"]
    #[inline(always)]
    pub fn is_dis(&self) -> bool {
        *self == WARNSEL_A::DIS
    }
    #[doc = "Checks if the value of the field is `SEL1`"]
    #[inline(always)]
    pub fn is_sel1(&self) -> bool {
        *self == WARNSEL_A::SEL1
    }
    #[doc = "Checks if the value of the field is `SEL2`"]
    #[inline(always)]
    pub fn is_sel2(&self) -> bool {
        *self == WARNSEL_A::SEL2
    }
    #[doc = "Checks if the value of the field is `SEL3`"]
    #[inline(always)]
    pub fn is_sel3(&self) -> bool {
        *self == WARNSEL_A::SEL3
    }
}
#[doc = "Field `WARNSEL` writer - WDOG Warning Period Select"]
pub type WARNSEL_W<'a, const O: u8> =
    crate::FieldWriterSafe<'a, u32, CFG_SPEC, u8, WARNSEL_A, 2, O>;
impl<'a, const O: u8> WARNSEL_W<'a, O> {
    #[doc = "Disable"]
    #[inline(always)]
    pub fn dis(self) -> &'a mut W {
        self.variant(WARNSEL_A::DIS)
    }
    #[doc = "Warning timeout is 25% of the Timeout."]
    #[inline(always)]
    pub fn sel1(self) -> &'a mut W {
        self.variant(WARNSEL_A::SEL1)
    }
    #[doc = "Warning timeout is 50% of the Timeout."]
    #[inline(always)]
    pub fn sel2(self) -> &'a mut W {
        self.variant(WARNSEL_A::SEL2)
    }
    #[doc = "Warning timeout is 75% of the Timeout."]
    #[inline(always)]
    pub fn sel3(self) -> &'a mut W {
        self.variant(WARNSEL_A::SEL3)
    }
}
#[doc = "Field `WINSEL` reader - WDOG Illegal Window Select"]
pub type WINSEL_R = crate::FieldReader<u8, WINSEL_A>;
#[doc = "WDOG Illegal Window Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum WINSEL_A {
    #[doc = "0: Disabled."]
    DIS = 0,
    #[doc = "1: Window timeout is 12.5% of the Timeout."]
    SEL1 = 1,
    #[doc = "2: Window timeout is 25% of the Timeout."]
    SEL2 = 2,
    #[doc = "3: Window timeout is 37.5% of the Timeout."]
    SEL3 = 3,
    #[doc = "4: Window timeout is 50% of the Timeout."]
    SEL4 = 4,
    #[doc = "5: Window timeout is 62.5% of the Timeout."]
    SEL5 = 5,
    #[doc = "6: Window timeout is 75.5% of the Timeout."]
    SEL6 = 6,
    #[doc = "7: Window timeout is 87.5% of the Timeout."]
    SEL7 = 7,
}
impl From<WINSEL_A> for u8 {
    #[inline(always)]
    fn from(variant: WINSEL_A) -> Self {
        variant as _
    }
}
impl WINSEL_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> WINSEL_A {
        match self.bits {
            0 => WINSEL_A::DIS,
            1 => WINSEL_A::SEL1,
            2 => WINSEL_A::SEL2,
            3 => WINSEL_A::SEL3,
            4 => WINSEL_A::SEL4,
            5 => WINSEL_A::SEL5,
            6 => WINSEL_A::SEL6,
            7 => WINSEL_A::SEL7,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `DIS`"]
    #[inline(always)]
    pub fn is_dis(&self) -> bool {
        *self == WINSEL_A::DIS
    }
    #[doc = "Checks if the value of the field is `SEL1`"]
    #[inline(always)]
    pub fn is_sel1(&self) -> bool {
        *self == WINSEL_A::SEL1
    }
    #[doc = "Checks if the value of the field is `SEL2`"]
    #[inline(always)]
    pub fn is_sel2(&self) -> bool {
        *self == WINSEL_A::SEL2
    }
    #[doc = "Checks if the value of the field is `SEL3`"]
    #[inline(always)]
    pub fn is_sel3(&self) -> bool {
        *self == WINSEL_A::SEL3
    }
    #[doc = "Checks if the value of the field is `SEL4`"]
    #[inline(always)]
    pub fn is_sel4(&self) -> bool {
        *self == WINSEL_A::SEL4
    }
    #[doc = "Checks if the value of the field is `SEL5`"]
    #[inline(always)]
    pub fn is_sel5(&self) -> bool {
        *self == WINSEL_A::SEL5
    }
    #[doc = "Checks if the value of the field is `SEL6`"]
    #[inline(always)]
    pub fn is_sel6(&self) -> bool {
        *self == WINSEL_A::SEL6
    }
    #[doc = "Checks if the value of the field is `SEL7`"]
    #[inline(always)]
    pub fn is_sel7(&self) -> bool {
        *self == WINSEL_A::SEL7
    }
}
#[doc = "Field `WINSEL` writer - WDOG Illegal Window Select"]
pub type WINSEL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CFG_SPEC, u8, WINSEL_A, 3, O>;
impl<'a, const O: u8> WINSEL_W<'a, O> {
    #[doc = "Disabled."]
    #[inline(always)]
    pub fn dis(self) -> &'a mut W {
        self.variant(WINSEL_A::DIS)
    }
    #[doc = "Window timeout is 12.5% of the Timeout."]
    #[inline(always)]
    pub fn sel1(self) -> &'a mut W {
        self.variant(WINSEL_A::SEL1)
    }
    #[doc = "Window timeout is 25% of the Timeout."]
    #[inline(always)]
    pub fn sel2(self) -> &'a mut W {
        self.variant(WINSEL_A::SEL2)
    }
    #[doc = "Window timeout is 37.5% of the Timeout."]
    #[inline(always)]
    pub fn sel3(self) -> &'a mut W {
        self.variant(WINSEL_A::SEL3)
    }
    #[doc = "Window timeout is 50% of the Timeout."]
    #[inline(always)]
    pub fn sel4(self) -> &'a mut W {
        self.variant(WINSEL_A::SEL4)
    }
    #[doc = "Window timeout is 62.5% of the Timeout."]
    #[inline(always)]
    pub fn sel5(self) -> &'a mut W {
        self.variant(WINSEL_A::SEL5)
    }
    #[doc = "Window timeout is 75.5% of the Timeout."]
    #[inline(always)]
    pub fn sel6(self) -> &'a mut W {
        self.variant(WINSEL_A::SEL6)
    }
    #[doc = "Window timeout is 87.5% of the Timeout."]
    #[inline(always)]
    pub fn sel7(self) -> &'a mut W {
        self.variant(WINSEL_A::SEL7)
    }
}
impl R {
    #[doc = "Bit 0 - WDOG Clear Source"]
    #[inline(always)]
    pub fn clrsrc(&self) -> CLRSRC_R {
        CLRSRC_R::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - EM1 Run"]
    #[inline(always)]
    pub fn em1run(&self) -> EM1RUN_R {
        EM1RUN_R::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - EM2 Run"]
    #[inline(always)]
    pub fn em2run(&self) -> EM2RUN_R {
        EM2RUN_R::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - EM3 Run"]
    #[inline(always)]
    pub fn em3run(&self) -> EM3RUN_R {
        EM3RUN_R::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 4 - EM4 Block"]
    #[inline(always)]
    pub fn em4block(&self) -> EM4BLOCK_R {
        EM4BLOCK_R::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - Debug Mode Run"]
    #[inline(always)]
    pub fn debugrun(&self) -> DEBUGRUN_R {
        DEBUGRUN_R::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bit 8 - WDOG Reset Disable"]
    #[inline(always)]
    pub fn wdogrstdis(&self) -> WDOGRSTDIS_R {
        WDOGRSTDIS_R::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bit 9 - PRS Src0 Missing Event WDOG Reset"]
    #[inline(always)]
    pub fn prs0missrsten(&self) -> PRS0MISSRSTEN_R {
        PRS0MISSRSTEN_R::new(((self.bits >> 9) & 1) != 0)
    }
    #[doc = "Bit 10 - PRS Src1 Missing Event WDOG Reset"]
    #[inline(always)]
    pub fn prs1missrsten(&self) -> PRS1MISSRSTEN_R {
        PRS1MISSRSTEN_R::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bits 16:19 - WDOG Timeout Period Select"]
    #[inline(always)]
    pub fn persel(&self) -> PERSEL_R {
        PERSEL_R::new(((self.bits >> 16) & 0x0f) as u8)
    }
    #[doc = "Bits 24:25 - WDOG Warning Period Select"]
    #[inline(always)]
    pub fn warnsel(&self) -> WARNSEL_R {
        WARNSEL_R::new(((self.bits >> 24) & 3) as u8)
    }
    #[doc = "Bits 28:30 - WDOG Illegal Window Select"]
    #[inline(always)]
    pub fn winsel(&self) -> WINSEL_R {
        WINSEL_R::new(((self.bits >> 28) & 7) as u8)
    }
}
impl W {
    #[doc = "Bit 0 - WDOG Clear Source"]
    #[inline(always)]
    #[must_use]
    pub fn clrsrc(&mut self) -> CLRSRC_W<0> {
        CLRSRC_W::new(self)
    }
    #[doc = "Bit 1 - EM1 Run"]
    #[inline(always)]
    #[must_use]
    pub fn em1run(&mut self) -> EM1RUN_W<1> {
        EM1RUN_W::new(self)
    }
    #[doc = "Bit 2 - EM2 Run"]
    #[inline(always)]
    #[must_use]
    pub fn em2run(&mut self) -> EM2RUN_W<2> {
        EM2RUN_W::new(self)
    }
    #[doc = "Bit 3 - EM3 Run"]
    #[inline(always)]
    #[must_use]
    pub fn em3run(&mut self) -> EM3RUN_W<3> {
        EM3RUN_W::new(self)
    }
    #[doc = "Bit 4 - EM4 Block"]
    #[inline(always)]
    #[must_use]
    pub fn em4block(&mut self) -> EM4BLOCK_W<4> {
        EM4BLOCK_W::new(self)
    }
    #[doc = "Bit 5 - Debug Mode Run"]
    #[inline(always)]
    #[must_use]
    pub fn debugrun(&mut self) -> DEBUGRUN_W<5> {
        DEBUGRUN_W::new(self)
    }
    #[doc = "Bit 8 - WDOG Reset Disable"]
    #[inline(always)]
    #[must_use]
    pub fn wdogrstdis(&mut self) -> WDOGRSTDIS_W<8> {
        WDOGRSTDIS_W::new(self)
    }
    #[doc = "Bit 9 - PRS Src0 Missing Event WDOG Reset"]
    #[inline(always)]
    #[must_use]
    pub fn prs0missrsten(&mut self) -> PRS0MISSRSTEN_W<9> {
        PRS0MISSRSTEN_W::new(self)
    }
    #[doc = "Bit 10 - PRS Src1 Missing Event WDOG Reset"]
    #[inline(always)]
    #[must_use]
    pub fn prs1missrsten(&mut self) -> PRS1MISSRSTEN_W<10> {
        PRS1MISSRSTEN_W::new(self)
    }
    #[doc = "Bits 16:19 - WDOG Timeout Period Select"]
    #[inline(always)]
    #[must_use]
    pub fn persel(&mut self) -> PERSEL_W<16> {
        PERSEL_W::new(self)
    }
    #[doc = "Bits 24:25 - WDOG Warning Period Select"]
    #[inline(always)]
    #[must_use]
    pub fn warnsel(&mut self) -> WARNSEL_W<24> {
        WARNSEL_W::new(self)
    }
    #[doc = "Bits 28:30 - WDOG Illegal Window Select"]
    #[inline(always)]
    #[must_use]
    pub fn winsel(&mut self) -> WINSEL_W<28> {
        WINSEL_W::new(self)
    }
    #[doc = "Writes raw bits to the register."]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "No Description\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct CFG_SPEC;
impl crate::RegisterSpec for CFG_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [cfg::R](R) reader structure"]
impl crate::Readable for CFG_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [cfg::W](W) writer structure"]
impl crate::Writable for CFG_SPEC {
    type Writer = W;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
}
#[doc = "`reset()` method sets CFG to value 0x000f_0000"]
impl crate::Resettable for CFG_SPEC {
    const RESET_VALUE: Self::Ux = 0x000f_0000;
}