mcxa-pac 0.1.1

Peripheral Access Crate for MCXA256 devices
Documentation
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
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
#[doc = "Register `INTCTRL` reader"]
pub type R = crate::R<IntctrlSpec>;
#[doc = "Register `INTCTRL` writer"]
pub type W = crate::W<IntctrlSpec>;
#[doc = "Simultaneous PHASEA and PHASEB Change Interrupt Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Sabie {
    #[doc = "0: Disabled"]
    Sabie0 = 0,
    #[doc = "1: Enabled"]
    Sabie1 = 1,
}
impl From<Sabie> for bool {
    #[inline(always)]
    fn from(variant: Sabie) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SABIE` reader - Simultaneous PHASEA and PHASEB Change Interrupt Enable"]
pub type SabieR = crate::BitReader<Sabie>;
impl SabieR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Sabie {
        match self.bits {
            false => Sabie::Sabie0,
            true => Sabie::Sabie1,
        }
    }
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn is_sabie0(&self) -> bool {
        *self == Sabie::Sabie0
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn is_sabie1(&self) -> bool {
        *self == Sabie::Sabie1
    }
}
#[doc = "Field `SABIE` writer - Simultaneous PHASEA and PHASEB Change Interrupt Enable"]
pub type SabieW<'a, REG> = crate::BitWriter<'a, REG, Sabie>;
impl<'a, REG> SabieW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn sabie0(self) -> &'a mut crate::W<REG> {
        self.variant(Sabie::Sabie0)
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn sabie1(self) -> &'a mut crate::W<REG> {
        self.variant(Sabie::Sabie1)
    }
}
#[doc = "Simultaneous PHASEA and PHASEB Change Interrupt Request\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Sabirq {
    #[doc = "0: No simultaneous change of PHASEA and PHASEB has occurred"]
    Sabirq0 = 0,
    #[doc = "1: A simultaneous change of PHASEA and PHASEB has occurred"]
    Sabirq1 = 1,
}
impl From<Sabirq> for bool {
    #[inline(always)]
    fn from(variant: Sabirq) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SABIRQ` reader - Simultaneous PHASEA and PHASEB Change Interrupt Request"]
pub type SabirqR = crate::BitReader<Sabirq>;
impl SabirqR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Sabirq {
        match self.bits {
            false => Sabirq::Sabirq0,
            true => Sabirq::Sabirq1,
        }
    }
    #[doc = "No simultaneous change of PHASEA and PHASEB has occurred"]
    #[inline(always)]
    pub fn is_sabirq0(&self) -> bool {
        *self == Sabirq::Sabirq0
    }
    #[doc = "A simultaneous change of PHASEA and PHASEB has occurred"]
    #[inline(always)]
    pub fn is_sabirq1(&self) -> bool {
        *self == Sabirq::Sabirq1
    }
}
#[doc = "Field `SABIRQ` writer - Simultaneous PHASEA and PHASEB Change Interrupt Request"]
pub type SabirqW<'a, REG> = crate::BitWriter1C<'a, REG, Sabirq>;
impl<'a, REG> SabirqW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No simultaneous change of PHASEA and PHASEB has occurred"]
    #[inline(always)]
    pub fn sabirq0(self) -> &'a mut crate::W<REG> {
        self.variant(Sabirq::Sabirq0)
    }
    #[doc = "A simultaneous change of PHASEA and PHASEB has occurred"]
    #[inline(always)]
    pub fn sabirq1(self) -> &'a mut crate::W<REG> {
        self.variant(Sabirq::Sabirq1)
    }
}
#[doc = "Count direction change interrupt enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Dirie {
    #[doc = "0: Disabled"]
    Dirie0 = 0,
    #[doc = "1: Enabled"]
    Dirie1 = 1,
}
impl From<Dirie> for bool {
    #[inline(always)]
    fn from(variant: Dirie) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DIRIE` reader - Count direction change interrupt enable"]
pub type DirieR = crate::BitReader<Dirie>;
impl DirieR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Dirie {
        match self.bits {
            false => Dirie::Dirie0,
            true => Dirie::Dirie1,
        }
    }
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn is_dirie0(&self) -> bool {
        *self == Dirie::Dirie0
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn is_dirie1(&self) -> bool {
        *self == Dirie::Dirie1
    }
}
#[doc = "Field `DIRIE` writer - Count direction change interrupt enable"]
pub type DirieW<'a, REG> = crate::BitWriter<'a, REG, Dirie>;
impl<'a, REG> DirieW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn dirie0(self) -> &'a mut crate::W<REG> {
        self.variant(Dirie::Dirie0)
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn dirie1(self) -> &'a mut crate::W<REG> {
        self.variant(Dirie::Dirie1)
    }
}
#[doc = "Count direction change interrupt\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Dirirq {
    #[doc = "0: Count direction unchanged"]
    Dirirq0 = 0,
    #[doc = "1: Count direction changed"]
    Dirirq1 = 1,
}
impl From<Dirirq> for bool {
    #[inline(always)]
    fn from(variant: Dirirq) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DIRIRQ` reader - Count direction change interrupt"]
pub type DirirqR = crate::BitReader<Dirirq>;
impl DirirqR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Dirirq {
        match self.bits {
            false => Dirirq::Dirirq0,
            true => Dirirq::Dirirq1,
        }
    }
    #[doc = "Count direction unchanged"]
    #[inline(always)]
    pub fn is_dirirq0(&self) -> bool {
        *self == Dirirq::Dirirq0
    }
    #[doc = "Count direction changed"]
    #[inline(always)]
    pub fn is_dirirq1(&self) -> bool {
        *self == Dirirq::Dirirq1
    }
}
#[doc = "Field `DIRIRQ` writer - Count direction change interrupt"]
pub type DirirqW<'a, REG> = crate::BitWriter1C<'a, REG, Dirirq>;
impl<'a, REG> DirirqW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Count direction unchanged"]
    #[inline(always)]
    pub fn dirirq0(self) -> &'a mut crate::W<REG> {
        self.variant(Dirirq::Dirirq0)
    }
    #[doc = "Count direction changed"]
    #[inline(always)]
    pub fn dirirq1(self) -> &'a mut crate::W<REG> {
        self.variant(Dirirq::Dirirq1)
    }
}
#[doc = "Roll-under Interrupt Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ruie {
    #[doc = "0: Disabled"]
    Ruie0 = 0,
    #[doc = "1: Enabled"]
    Ruie1 = 1,
}
impl From<Ruie> for bool {
    #[inline(always)]
    fn from(variant: Ruie) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `RUIE` reader - Roll-under Interrupt Enable"]
pub type RuieR = crate::BitReader<Ruie>;
impl RuieR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Ruie {
        match self.bits {
            false => Ruie::Ruie0,
            true => Ruie::Ruie1,
        }
    }
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn is_ruie0(&self) -> bool {
        *self == Ruie::Ruie0
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn is_ruie1(&self) -> bool {
        *self == Ruie::Ruie1
    }
}
#[doc = "Field `RUIE` writer - Roll-under Interrupt Enable"]
pub type RuieW<'a, REG> = crate::BitWriter<'a, REG, Ruie>;
impl<'a, REG> RuieW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn ruie0(self) -> &'a mut crate::W<REG> {
        self.variant(Ruie::Ruie0)
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn ruie1(self) -> &'a mut crate::W<REG> {
        self.variant(Ruie::Ruie1)
    }
}
#[doc = "Roll-under Interrupt Request\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ruirq {
    #[doc = "0: No roll-under has occurred"]
    Ruirq0 = 0,
    #[doc = "1: Roll-under has occurred"]
    Ruirq1 = 1,
}
impl From<Ruirq> for bool {
    #[inline(always)]
    fn from(variant: Ruirq) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `RUIRQ` reader - Roll-under Interrupt Request"]
pub type RuirqR = crate::BitReader<Ruirq>;
impl RuirqR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Ruirq {
        match self.bits {
            false => Ruirq::Ruirq0,
            true => Ruirq::Ruirq1,
        }
    }
    #[doc = "No roll-under has occurred"]
    #[inline(always)]
    pub fn is_ruirq0(&self) -> bool {
        *self == Ruirq::Ruirq0
    }
    #[doc = "Roll-under has occurred"]
    #[inline(always)]
    pub fn is_ruirq1(&self) -> bool {
        *self == Ruirq::Ruirq1
    }
}
#[doc = "Field `RUIRQ` writer - Roll-under Interrupt Request"]
pub type RuirqW<'a, REG> = crate::BitWriter1C<'a, REG, Ruirq>;
impl<'a, REG> RuirqW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No roll-under has occurred"]
    #[inline(always)]
    pub fn ruirq0(self) -> &'a mut crate::W<REG> {
        self.variant(Ruirq::Ruirq0)
    }
    #[doc = "Roll-under has occurred"]
    #[inline(always)]
    pub fn ruirq1(self) -> &'a mut crate::W<REG> {
        self.variant(Ruirq::Ruirq1)
    }
}
#[doc = "Roll-over Interrupt Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Roie {
    #[doc = "0: Disabled"]
    Roie = 0,
    #[doc = "1: Enabled"]
    Roie1 = 1,
}
impl From<Roie> for bool {
    #[inline(always)]
    fn from(variant: Roie) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ROIE` reader - Roll-over Interrupt Enable"]
pub type RoieR = crate::BitReader<Roie>;
impl RoieR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Roie {
        match self.bits {
            false => Roie::Roie,
            true => Roie::Roie1,
        }
    }
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn is_roie(&self) -> bool {
        *self == Roie::Roie
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn is_roie1(&self) -> bool {
        *self == Roie::Roie1
    }
}
#[doc = "Field `ROIE` writer - Roll-over Interrupt Enable"]
pub type RoieW<'a, REG> = crate::BitWriter<'a, REG, Roie>;
impl<'a, REG> RoieW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn roie(self) -> &'a mut crate::W<REG> {
        self.variant(Roie::Roie)
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn roie1(self) -> &'a mut crate::W<REG> {
        self.variant(Roie::Roie1)
    }
}
#[doc = "Roll-over Interrupt Request\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Roirq {
    #[doc = "0: No roll-over has occurred"]
    Roirq0 = 0,
    #[doc = "1: Roll-over has occurred"]
    Roirq1 = 1,
}
impl From<Roirq> for bool {
    #[inline(always)]
    fn from(variant: Roirq) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ROIRQ` reader - Roll-over Interrupt Request"]
pub type RoirqR = crate::BitReader<Roirq>;
impl RoirqR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Roirq {
        match self.bits {
            false => Roirq::Roirq0,
            true => Roirq::Roirq1,
        }
    }
    #[doc = "No roll-over has occurred"]
    #[inline(always)]
    pub fn is_roirq0(&self) -> bool {
        *self == Roirq::Roirq0
    }
    #[doc = "Roll-over has occurred"]
    #[inline(always)]
    pub fn is_roirq1(&self) -> bool {
        *self == Roirq::Roirq1
    }
}
#[doc = "Field `ROIRQ` writer - Roll-over Interrupt Request"]
pub type RoirqW<'a, REG> = crate::BitWriter1C<'a, REG, Roirq>;
impl<'a, REG> RoirqW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No roll-over has occurred"]
    #[inline(always)]
    pub fn roirq0(self) -> &'a mut crate::W<REG> {
        self.variant(Roirq::Roirq0)
    }
    #[doc = "Roll-over has occurred"]
    #[inline(always)]
    pub fn roirq1(self) -> &'a mut crate::W<REG> {
        self.variant(Roirq::Roirq1)
    }
}
#[doc = "Compare 0 Interrupt Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Cmp0ie {
    #[doc = "0: Disabled"]
    Cmp0ie0 = 0,
    #[doc = "1: Enabled"]
    Cmp0ie1 = 1,
}
impl From<Cmp0ie> for bool {
    #[inline(always)]
    fn from(variant: Cmp0ie) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CMP0IE` reader - Compare 0 Interrupt Enable"]
pub type Cmp0ieR = crate::BitReader<Cmp0ie>;
impl Cmp0ieR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Cmp0ie {
        match self.bits {
            false => Cmp0ie::Cmp0ie0,
            true => Cmp0ie::Cmp0ie1,
        }
    }
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn is_cmp0ie0(&self) -> bool {
        *self == Cmp0ie::Cmp0ie0
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn is_cmp0ie1(&self) -> bool {
        *self == Cmp0ie::Cmp0ie1
    }
}
#[doc = "Field `CMP0IE` writer - Compare 0 Interrupt Enable"]
pub type Cmp0ieW<'a, REG> = crate::BitWriter<'a, REG, Cmp0ie>;
impl<'a, REG> Cmp0ieW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn cmp0ie0(self) -> &'a mut crate::W<REG> {
        self.variant(Cmp0ie::Cmp0ie0)
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn cmp0ie1(self) -> &'a mut crate::W<REG> {
        self.variant(Cmp0ie::Cmp0ie1)
    }
}
#[doc = "Compare 0 Interrupt Request\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Cmp0irq {
    #[doc = "0: No match has occurred (the position counter does not match the COMP0 value)"]
    Cmp0irq0 = 0,
    #[doc = "1: COMP match has occurred (the position counter matches the COMP0 value)"]
    Cmp0irq1 = 1,
}
impl From<Cmp0irq> for bool {
    #[inline(always)]
    fn from(variant: Cmp0irq) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CMP0IRQ` reader - Compare 0 Interrupt Request"]
pub type Cmp0irqR = crate::BitReader<Cmp0irq>;
impl Cmp0irqR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Cmp0irq {
        match self.bits {
            false => Cmp0irq::Cmp0irq0,
            true => Cmp0irq::Cmp0irq1,
        }
    }
    #[doc = "No match has occurred (the position counter does not match the COMP0 value)"]
    #[inline(always)]
    pub fn is_cmp0irq0(&self) -> bool {
        *self == Cmp0irq::Cmp0irq0
    }
    #[doc = "COMP match has occurred (the position counter matches the COMP0 value)"]
    #[inline(always)]
    pub fn is_cmp0irq1(&self) -> bool {
        *self == Cmp0irq::Cmp0irq1
    }
}
#[doc = "Field `CMP0IRQ` writer - Compare 0 Interrupt Request"]
pub type Cmp0irqW<'a, REG> = crate::BitWriter1C<'a, REG, Cmp0irq>;
impl<'a, REG> Cmp0irqW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No match has occurred (the position counter does not match the COMP0 value)"]
    #[inline(always)]
    pub fn cmp0irq0(self) -> &'a mut crate::W<REG> {
        self.variant(Cmp0irq::Cmp0irq0)
    }
    #[doc = "COMP match has occurred (the position counter matches the COMP0 value)"]
    #[inline(always)]
    pub fn cmp0irq1(self) -> &'a mut crate::W<REG> {
        self.variant(Cmp0irq::Cmp0irq1)
    }
}
#[doc = "Compare1 Interrupt Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Cmp1ie {
    #[doc = "0: Disabled"]
    Cmp1ie0 = 0,
    #[doc = "1: Enabled"]
    Cmp1ie1 = 1,
}
impl From<Cmp1ie> for bool {
    #[inline(always)]
    fn from(variant: Cmp1ie) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CMP1IE` reader - Compare1 Interrupt Enable"]
pub type Cmp1ieR = crate::BitReader<Cmp1ie>;
impl Cmp1ieR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Cmp1ie {
        match self.bits {
            false => Cmp1ie::Cmp1ie0,
            true => Cmp1ie::Cmp1ie1,
        }
    }
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn is_cmp1ie0(&self) -> bool {
        *self == Cmp1ie::Cmp1ie0
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn is_cmp1ie1(&self) -> bool {
        *self == Cmp1ie::Cmp1ie1
    }
}
#[doc = "Field `CMP1IE` writer - Compare1 Interrupt Enable"]
pub type Cmp1ieW<'a, REG> = crate::BitWriter<'a, REG, Cmp1ie>;
impl<'a, REG> Cmp1ieW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn cmp1ie0(self) -> &'a mut crate::W<REG> {
        self.variant(Cmp1ie::Cmp1ie0)
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn cmp1ie1(self) -> &'a mut crate::W<REG> {
        self.variant(Cmp1ie::Cmp1ie1)
    }
}
#[doc = "Compare1 Interrupt Request\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Cmp1irq {
    #[doc = "0: No match has occurred (the position counter does not match the COMP1 value)"]
    Cmp1irq0 = 0,
    #[doc = "1: COMP1 match has occurred (the position counter matches the COMP1 value)"]
    Cmp1irq1 = 1,
}
impl From<Cmp1irq> for bool {
    #[inline(always)]
    fn from(variant: Cmp1irq) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CMP1IRQ` reader - Compare1 Interrupt Request"]
pub type Cmp1irqR = crate::BitReader<Cmp1irq>;
impl Cmp1irqR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Cmp1irq {
        match self.bits {
            false => Cmp1irq::Cmp1irq0,
            true => Cmp1irq::Cmp1irq1,
        }
    }
    #[doc = "No match has occurred (the position counter does not match the COMP1 value)"]
    #[inline(always)]
    pub fn is_cmp1irq0(&self) -> bool {
        *self == Cmp1irq::Cmp1irq0
    }
    #[doc = "COMP1 match has occurred (the position counter matches the COMP1 value)"]
    #[inline(always)]
    pub fn is_cmp1irq1(&self) -> bool {
        *self == Cmp1irq::Cmp1irq1
    }
}
#[doc = "Field `CMP1IRQ` writer - Compare1 Interrupt Request"]
pub type Cmp1irqW<'a, REG> = crate::BitWriter1C<'a, REG, Cmp1irq>;
impl<'a, REG> Cmp1irqW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No match has occurred (the position counter does not match the COMP1 value)"]
    #[inline(always)]
    pub fn cmp1irq0(self) -> &'a mut crate::W<REG> {
        self.variant(Cmp1irq::Cmp1irq0)
    }
    #[doc = "COMP1 match has occurred (the position counter matches the COMP1 value)"]
    #[inline(always)]
    pub fn cmp1irq1(self) -> &'a mut crate::W<REG> {
        self.variant(Cmp1irq::Cmp1irq1)
    }
}
#[doc = "Compare2 Interrupt Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Cmp2ie {
    #[doc = "0: Disabled"]
    Cmp2ie0 = 0,
    #[doc = "1: Enabled"]
    Cmp2ie1 = 1,
}
impl From<Cmp2ie> for bool {
    #[inline(always)]
    fn from(variant: Cmp2ie) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CMP2IE` reader - Compare2 Interrupt Enable"]
pub type Cmp2ieR = crate::BitReader<Cmp2ie>;
impl Cmp2ieR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Cmp2ie {
        match self.bits {
            false => Cmp2ie::Cmp2ie0,
            true => Cmp2ie::Cmp2ie1,
        }
    }
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn is_cmp2ie0(&self) -> bool {
        *self == Cmp2ie::Cmp2ie0
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn is_cmp2ie1(&self) -> bool {
        *self == Cmp2ie::Cmp2ie1
    }
}
#[doc = "Field `CMP2IE` writer - Compare2 Interrupt Enable"]
pub type Cmp2ieW<'a, REG> = crate::BitWriter<'a, REG, Cmp2ie>;
impl<'a, REG> Cmp2ieW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn cmp2ie0(self) -> &'a mut crate::W<REG> {
        self.variant(Cmp2ie::Cmp2ie0)
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn cmp2ie1(self) -> &'a mut crate::W<REG> {
        self.variant(Cmp2ie::Cmp2ie1)
    }
}
#[doc = "Compare2 Interrupt Request\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Cmp2irq {
    #[doc = "0: No match has occurred (the position counter does not match the COMP2 value)"]
    Cmp2irq0 = 0,
    #[doc = "1: COMP2 match has occurred (the position counter matches the COMP2 value)"]
    Cmp2irq1 = 1,
}
impl From<Cmp2irq> for bool {
    #[inline(always)]
    fn from(variant: Cmp2irq) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CMP2IRQ` reader - Compare2 Interrupt Request"]
pub type Cmp2irqR = crate::BitReader<Cmp2irq>;
impl Cmp2irqR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Cmp2irq {
        match self.bits {
            false => Cmp2irq::Cmp2irq0,
            true => Cmp2irq::Cmp2irq1,
        }
    }
    #[doc = "No match has occurred (the position counter does not match the COMP2 value)"]
    #[inline(always)]
    pub fn is_cmp2irq0(&self) -> bool {
        *self == Cmp2irq::Cmp2irq0
    }
    #[doc = "COMP2 match has occurred (the position counter matches the COMP2 value)"]
    #[inline(always)]
    pub fn is_cmp2irq1(&self) -> bool {
        *self == Cmp2irq::Cmp2irq1
    }
}
#[doc = "Field `CMP2IRQ` writer - Compare2 Interrupt Request"]
pub type Cmp2irqW<'a, REG> = crate::BitWriter1C<'a, REG, Cmp2irq>;
impl<'a, REG> Cmp2irqW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No match has occurred (the position counter does not match the COMP2 value)"]
    #[inline(always)]
    pub fn cmp2irq0(self) -> &'a mut crate::W<REG> {
        self.variant(Cmp2irq::Cmp2irq0)
    }
    #[doc = "COMP2 match has occurred (the position counter matches the COMP2 value)"]
    #[inline(always)]
    pub fn cmp2irq1(self) -> &'a mut crate::W<REG> {
        self.variant(Cmp2irq::Cmp2irq1)
    }
}
#[doc = "Compare3 Interrupt Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Cmp3ie {
    #[doc = "0: Disabled"]
    Cmp3ie0 = 0,
    #[doc = "1: Enabled"]
    Cmp3ie1 = 1,
}
impl From<Cmp3ie> for bool {
    #[inline(always)]
    fn from(variant: Cmp3ie) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CMP3IE` reader - Compare3 Interrupt Enable"]
pub type Cmp3ieR = crate::BitReader<Cmp3ie>;
impl Cmp3ieR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Cmp3ie {
        match self.bits {
            false => Cmp3ie::Cmp3ie0,
            true => Cmp3ie::Cmp3ie1,
        }
    }
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn is_cmp3ie0(&self) -> bool {
        *self == Cmp3ie::Cmp3ie0
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn is_cmp3ie1(&self) -> bool {
        *self == Cmp3ie::Cmp3ie1
    }
}
#[doc = "Field `CMP3IE` writer - Compare3 Interrupt Enable"]
pub type Cmp3ieW<'a, REG> = crate::BitWriter<'a, REG, Cmp3ie>;
impl<'a, REG> Cmp3ieW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disabled"]
    #[inline(always)]
    pub fn cmp3ie0(self) -> &'a mut crate::W<REG> {
        self.variant(Cmp3ie::Cmp3ie0)
    }
    #[doc = "Enabled"]
    #[inline(always)]
    pub fn cmp3ie1(self) -> &'a mut crate::W<REG> {
        self.variant(Cmp3ie::Cmp3ie1)
    }
}
#[doc = "Compare3 Interrupt Request\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Cmp3irq {
    #[doc = "0: No match has occurred (the position counter does not match the COMP3 value)"]
    Cmp3irq0 = 0,
    #[doc = "1: COMP3 match has occurred (the position counter matches the COMP3 value)"]
    Cmp3irq1 = 1,
}
impl From<Cmp3irq> for bool {
    #[inline(always)]
    fn from(variant: Cmp3irq) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CMP3IRQ` reader - Compare3 Interrupt Request"]
pub type Cmp3irqR = crate::BitReader<Cmp3irq>;
impl Cmp3irqR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Cmp3irq {
        match self.bits {
            false => Cmp3irq::Cmp3irq0,
            true => Cmp3irq::Cmp3irq1,
        }
    }
    #[doc = "No match has occurred (the position counter does not match the COMP3 value)"]
    #[inline(always)]
    pub fn is_cmp3irq0(&self) -> bool {
        *self == Cmp3irq::Cmp3irq0
    }
    #[doc = "COMP3 match has occurred (the position counter matches the COMP3 value)"]
    #[inline(always)]
    pub fn is_cmp3irq1(&self) -> bool {
        *self == Cmp3irq::Cmp3irq1
    }
}
#[doc = "Field `CMP3IRQ` writer - Compare3 Interrupt Request"]
pub type Cmp3irqW<'a, REG> = crate::BitWriter1C<'a, REG, Cmp3irq>;
impl<'a, REG> Cmp3irqW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No match has occurred (the position counter does not match the COMP3 value)"]
    #[inline(always)]
    pub fn cmp3irq0(self) -> &'a mut crate::W<REG> {
        self.variant(Cmp3irq::Cmp3irq0)
    }
    #[doc = "COMP3 match has occurred (the position counter matches the COMP3 value)"]
    #[inline(always)]
    pub fn cmp3irq1(self) -> &'a mut crate::W<REG> {
        self.variant(Cmp3irq::Cmp3irq1)
    }
}
impl R {
    #[doc = "Bit 0 - Simultaneous PHASEA and PHASEB Change Interrupt Enable"]
    #[inline(always)]
    pub fn sabie(&self) -> SabieR {
        SabieR::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Simultaneous PHASEA and PHASEB Change Interrupt Request"]
    #[inline(always)]
    pub fn sabirq(&self) -> SabirqR {
        SabirqR::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - Count direction change interrupt enable"]
    #[inline(always)]
    pub fn dirie(&self) -> DirieR {
        DirieR::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - Count direction change interrupt"]
    #[inline(always)]
    pub fn dirirq(&self) -> DirirqR {
        DirirqR::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 4 - Roll-under Interrupt Enable"]
    #[inline(always)]
    pub fn ruie(&self) -> RuieR {
        RuieR::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - Roll-under Interrupt Request"]
    #[inline(always)]
    pub fn ruirq(&self) -> RuirqR {
        RuirqR::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bit 6 - Roll-over Interrupt Enable"]
    #[inline(always)]
    pub fn roie(&self) -> RoieR {
        RoieR::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bit 7 - Roll-over Interrupt Request"]
    #[inline(always)]
    pub fn roirq(&self) -> RoirqR {
        RoirqR::new(((self.bits >> 7) & 1) != 0)
    }
    #[doc = "Bit 8 - Compare 0 Interrupt Enable"]
    #[inline(always)]
    pub fn cmp0ie(&self) -> Cmp0ieR {
        Cmp0ieR::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bit 9 - Compare 0 Interrupt Request"]
    #[inline(always)]
    pub fn cmp0irq(&self) -> Cmp0irqR {
        Cmp0irqR::new(((self.bits >> 9) & 1) != 0)
    }
    #[doc = "Bit 10 - Compare1 Interrupt Enable"]
    #[inline(always)]
    pub fn cmp1ie(&self) -> Cmp1ieR {
        Cmp1ieR::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bit 11 - Compare1 Interrupt Request"]
    #[inline(always)]
    pub fn cmp1irq(&self) -> Cmp1irqR {
        Cmp1irqR::new(((self.bits >> 11) & 1) != 0)
    }
    #[doc = "Bit 12 - Compare2 Interrupt Enable"]
    #[inline(always)]
    pub fn cmp2ie(&self) -> Cmp2ieR {
        Cmp2ieR::new(((self.bits >> 12) & 1) != 0)
    }
    #[doc = "Bit 13 - Compare2 Interrupt Request"]
    #[inline(always)]
    pub fn cmp2irq(&self) -> Cmp2irqR {
        Cmp2irqR::new(((self.bits >> 13) & 1) != 0)
    }
    #[doc = "Bit 14 - Compare3 Interrupt Enable"]
    #[inline(always)]
    pub fn cmp3ie(&self) -> Cmp3ieR {
        Cmp3ieR::new(((self.bits >> 14) & 1) != 0)
    }
    #[doc = "Bit 15 - Compare3 Interrupt Request"]
    #[inline(always)]
    pub fn cmp3irq(&self) -> Cmp3irqR {
        Cmp3irqR::new(((self.bits >> 15) & 1) != 0)
    }
}
#[cfg(feature = "debug")]
impl core::fmt::Debug for R {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        f.debug_struct("INTCTRL")
            .field("sabie", &self.sabie())
            .field("sabirq", &self.sabirq())
            .field("dirie", &self.dirie())
            .field("dirirq", &self.dirirq())
            .field("ruie", &self.ruie())
            .field("ruirq", &self.ruirq())
            .field("roie", &self.roie())
            .field("roirq", &self.roirq())
            .field("cmp0ie", &self.cmp0ie())
            .field("cmp0irq", &self.cmp0irq())
            .field("cmp1ie", &self.cmp1ie())
            .field("cmp1irq", &self.cmp1irq())
            .field("cmp2ie", &self.cmp2ie())
            .field("cmp2irq", &self.cmp2irq())
            .field("cmp3ie", &self.cmp3ie())
            .field("cmp3irq", &self.cmp3irq())
            .finish()
    }
}
impl W {
    #[doc = "Bit 0 - Simultaneous PHASEA and PHASEB Change Interrupt Enable"]
    #[inline(always)]
    pub fn sabie(&mut self) -> SabieW<'_, IntctrlSpec> {
        SabieW::new(self, 0)
    }
    #[doc = "Bit 1 - Simultaneous PHASEA and PHASEB Change Interrupt Request"]
    #[inline(always)]
    pub fn sabirq(&mut self) -> SabirqW<'_, IntctrlSpec> {
        SabirqW::new(self, 1)
    }
    #[doc = "Bit 2 - Count direction change interrupt enable"]
    #[inline(always)]
    pub fn dirie(&mut self) -> DirieW<'_, IntctrlSpec> {
        DirieW::new(self, 2)
    }
    #[doc = "Bit 3 - Count direction change interrupt"]
    #[inline(always)]
    pub fn dirirq(&mut self) -> DirirqW<'_, IntctrlSpec> {
        DirirqW::new(self, 3)
    }
    #[doc = "Bit 4 - Roll-under Interrupt Enable"]
    #[inline(always)]
    pub fn ruie(&mut self) -> RuieW<'_, IntctrlSpec> {
        RuieW::new(self, 4)
    }
    #[doc = "Bit 5 - Roll-under Interrupt Request"]
    #[inline(always)]
    pub fn ruirq(&mut self) -> RuirqW<'_, IntctrlSpec> {
        RuirqW::new(self, 5)
    }
    #[doc = "Bit 6 - Roll-over Interrupt Enable"]
    #[inline(always)]
    pub fn roie(&mut self) -> RoieW<'_, IntctrlSpec> {
        RoieW::new(self, 6)
    }
    #[doc = "Bit 7 - Roll-over Interrupt Request"]
    #[inline(always)]
    pub fn roirq(&mut self) -> RoirqW<'_, IntctrlSpec> {
        RoirqW::new(self, 7)
    }
    #[doc = "Bit 8 - Compare 0 Interrupt Enable"]
    #[inline(always)]
    pub fn cmp0ie(&mut self) -> Cmp0ieW<'_, IntctrlSpec> {
        Cmp0ieW::new(self, 8)
    }
    #[doc = "Bit 9 - Compare 0 Interrupt Request"]
    #[inline(always)]
    pub fn cmp0irq(&mut self) -> Cmp0irqW<'_, IntctrlSpec> {
        Cmp0irqW::new(self, 9)
    }
    #[doc = "Bit 10 - Compare1 Interrupt Enable"]
    #[inline(always)]
    pub fn cmp1ie(&mut self) -> Cmp1ieW<'_, IntctrlSpec> {
        Cmp1ieW::new(self, 10)
    }
    #[doc = "Bit 11 - Compare1 Interrupt Request"]
    #[inline(always)]
    pub fn cmp1irq(&mut self) -> Cmp1irqW<'_, IntctrlSpec> {
        Cmp1irqW::new(self, 11)
    }
    #[doc = "Bit 12 - Compare2 Interrupt Enable"]
    #[inline(always)]
    pub fn cmp2ie(&mut self) -> Cmp2ieW<'_, IntctrlSpec> {
        Cmp2ieW::new(self, 12)
    }
    #[doc = "Bit 13 - Compare2 Interrupt Request"]
    #[inline(always)]
    pub fn cmp2irq(&mut self) -> Cmp2irqW<'_, IntctrlSpec> {
        Cmp2irqW::new(self, 13)
    }
    #[doc = "Bit 14 - Compare3 Interrupt Enable"]
    #[inline(always)]
    pub fn cmp3ie(&mut self) -> Cmp3ieW<'_, IntctrlSpec> {
        Cmp3ieW::new(self, 14)
    }
    #[doc = "Bit 15 - Compare3 Interrupt Request"]
    #[inline(always)]
    pub fn cmp3irq(&mut self) -> Cmp3irqW<'_, IntctrlSpec> {
        Cmp3irqW::new(self, 15)
    }
}
#[doc = "Interrupt Control Register\n\nYou can [`read`](crate::Reg::read) this register and get [`intctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`intctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct IntctrlSpec;
impl crate::RegisterSpec for IntctrlSpec {
    type Ux = u16;
}
#[doc = "`read()` method returns [`intctrl::R`](R) reader structure"]
impl crate::Readable for IntctrlSpec {}
#[doc = "`write(|w| ..)` method takes [`intctrl::W`](W) writer structure"]
impl crate::Writable for IntctrlSpec {
    type Safety = crate::Unsafe;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u16 = 0xaaaa;
}
#[doc = "`reset()` method sets INTCTRL to value 0"]
impl crate::Resettable for IntctrlSpec {}