ra4m2 0.2.0

Peripheral access API for ra4m2 microcontrollers (generated using svd2rust)
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
#[doc = "Register `GTIOR` reader"]
pub struct R(crate::R<GTIOR_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<GTIOR_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<GTIOR_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<GTIOR_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `GTIOR` writer"]
pub struct W(crate::W<GTIOR_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<GTIOR_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<GTIOR_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<GTIOR_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `GTIOA` reader - GTIOCnA Pin Function Select"]
pub type GTIOA_R = crate::FieldReader<u8, u8>;
#[doc = "Field `GTIOA` writer - GTIOCnA Pin Function Select"]
pub type GTIOA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GTIOR_SPEC, u8, u8, 5, O>;
#[doc = "Field `OADFLT` reader - GTIOCnA Pin Output Value Setting at the Count Stop"]
pub type OADFLT_R = crate::BitReader<OADFLT_A>;
#[doc = "GTIOCnA Pin Output Value Setting at the Count Stop\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OADFLT_A {
    #[doc = "0: The GTIOCnA pin outputs low when counting stops"]
    _0 = 0,
    #[doc = "1: The GTIOCnA pin outputs high when counting stops"]
    _1 = 1,
}
impl From<OADFLT_A> for bool {
    #[inline(always)]
    fn from(variant: OADFLT_A) -> Self {
        variant as u8 != 0
    }
}
impl OADFLT_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> OADFLT_A {
        match self.bits {
            false => OADFLT_A::_0,
            true => OADFLT_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == OADFLT_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == OADFLT_A::_1
    }
}
#[doc = "Field `OADFLT` writer - GTIOCnA Pin Output Value Setting at the Count Stop"]
pub type OADFLT_W<'a, const O: u8> = crate::BitWriter<'a, u32, GTIOR_SPEC, OADFLT_A, O>;
impl<'a, const O: u8> OADFLT_W<'a, O> {
    #[doc = "The GTIOCnA pin outputs low when counting stops"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(OADFLT_A::_0)
    }
    #[doc = "The GTIOCnA pin outputs high when counting stops"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(OADFLT_A::_1)
    }
}
#[doc = "Field `OAHLD` reader - GTIOCnA Pin Output Setting at the Start/Stop Count"]
pub type OAHLD_R = crate::BitReader<OAHLD_A>;
#[doc = "GTIOCnA Pin Output Setting at the Start/Stop Count\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OAHLD_A {
    #[doc = "0: The GTIOCnA pin output level at the start or stop of counting depends on the register setting"]
    _0 = 0,
    #[doc = "1: The GTIOCnA pin output level is retained at the start or stop of counting"]
    _1 = 1,
}
impl From<OAHLD_A> for bool {
    #[inline(always)]
    fn from(variant: OAHLD_A) -> Self {
        variant as u8 != 0
    }
}
impl OAHLD_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> OAHLD_A {
        match self.bits {
            false => OAHLD_A::_0,
            true => OAHLD_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == OAHLD_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == OAHLD_A::_1
    }
}
#[doc = "Field `OAHLD` writer - GTIOCnA Pin Output Setting at the Start/Stop Count"]
pub type OAHLD_W<'a, const O: u8> = crate::BitWriter<'a, u32, GTIOR_SPEC, OAHLD_A, O>;
impl<'a, const O: u8> OAHLD_W<'a, O> {
    #[doc = "The GTIOCnA pin output level at the start or stop of counting depends on the register setting"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(OAHLD_A::_0)
    }
    #[doc = "The GTIOCnA pin output level is retained at the start or stop of counting"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(OAHLD_A::_1)
    }
}
#[doc = "Field `OAE` reader - GTIOCnA Pin Output Enable"]
pub type OAE_R = crate::BitReader<OAE_A>;
#[doc = "GTIOCnA Pin Output Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OAE_A {
    #[doc = "0: Output is disabled"]
    _0 = 0,
    #[doc = "1: Output is enabled"]
    _1 = 1,
}
impl From<OAE_A> for bool {
    #[inline(always)]
    fn from(variant: OAE_A) -> Self {
        variant as u8 != 0
    }
}
impl OAE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> OAE_A {
        match self.bits {
            false => OAE_A::_0,
            true => OAE_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == OAE_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == OAE_A::_1
    }
}
#[doc = "Field `OAE` writer - GTIOCnA Pin Output Enable"]
pub type OAE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GTIOR_SPEC, OAE_A, O>;
impl<'a, const O: u8> OAE_W<'a, O> {
    #[doc = "Output is disabled"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(OAE_A::_0)
    }
    #[doc = "Output is enabled"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(OAE_A::_1)
    }
}
#[doc = "Field `OADF` reader - GTIOCnA Pin Disable Value Setting"]
pub type OADF_R = crate::FieldReader<u8, OADF_A>;
#[doc = "GTIOCnA Pin Disable Value Setting\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum OADF_A {
    #[doc = "0: Output disable is prohibited"]
    _00 = 0,
    #[doc = "1: GTIOCnA pin is set to Hi-Z on output disable"]
    _01 = 1,
    #[doc = "2: GTIOCnA pin is set to 0 on output disable"]
    _10 = 2,
    #[doc = "3: GTIOCnA pin is set to 1 on output disable"]
    _11 = 3,
}
impl From<OADF_A> for u8 {
    #[inline(always)]
    fn from(variant: OADF_A) -> Self {
        variant as _
    }
}
impl OADF_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> OADF_A {
        match self.bits {
            0 => OADF_A::_00,
            1 => OADF_A::_01,
            2 => OADF_A::_10,
            3 => OADF_A::_11,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `_00`"]
    #[inline(always)]
    pub fn is_00(&self) -> bool {
        *self == OADF_A::_00
    }
    #[doc = "Checks if the value of the field is `_01`"]
    #[inline(always)]
    pub fn is_01(&self) -> bool {
        *self == OADF_A::_01
    }
    #[doc = "Checks if the value of the field is `_10`"]
    #[inline(always)]
    pub fn is_10(&self) -> bool {
        *self == OADF_A::_10
    }
    #[doc = "Checks if the value of the field is `_11`"]
    #[inline(always)]
    pub fn is_11(&self) -> bool {
        *self == OADF_A::_11
    }
}
#[doc = "Field `OADF` writer - GTIOCnA Pin Disable Value Setting"]
pub type OADF_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, GTIOR_SPEC, u8, OADF_A, 2, O>;
impl<'a, const O: u8> OADF_W<'a, O> {
    #[doc = "Output disable is prohibited"]
    #[inline(always)]
    pub fn _00(self) -> &'a mut W {
        self.variant(OADF_A::_00)
    }
    #[doc = "GTIOCnA pin is set to Hi-Z on output disable"]
    #[inline(always)]
    pub fn _01(self) -> &'a mut W {
        self.variant(OADF_A::_01)
    }
    #[doc = "GTIOCnA pin is set to 0 on output disable"]
    #[inline(always)]
    pub fn _10(self) -> &'a mut W {
        self.variant(OADF_A::_10)
    }
    #[doc = "GTIOCnA pin is set to 1 on output disable"]
    #[inline(always)]
    pub fn _11(self) -> &'a mut W {
        self.variant(OADF_A::_11)
    }
}
#[doc = "Field `NFAEN` reader - Noise Filter A Enable"]
pub type NFAEN_R = crate::BitReader<NFAEN_A>;
#[doc = "Noise Filter A Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum NFAEN_A {
    #[doc = "0: The noise filter for the GTIOCnA pin is disabled"]
    _0 = 0,
    #[doc = "1: The noise filter for the GTIOCnA pin is enabled"]
    _1 = 1,
}
impl From<NFAEN_A> for bool {
    #[inline(always)]
    fn from(variant: NFAEN_A) -> Self {
        variant as u8 != 0
    }
}
impl NFAEN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> NFAEN_A {
        match self.bits {
            false => NFAEN_A::_0,
            true => NFAEN_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == NFAEN_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == NFAEN_A::_1
    }
}
#[doc = "Field `NFAEN` writer - Noise Filter A Enable"]
pub type NFAEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GTIOR_SPEC, NFAEN_A, O>;
impl<'a, const O: u8> NFAEN_W<'a, O> {
    #[doc = "The noise filter for the GTIOCnA pin is disabled"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(NFAEN_A::_0)
    }
    #[doc = "The noise filter for the GTIOCnA pin is enabled"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(NFAEN_A::_1)
    }
}
#[doc = "Field `NFCSA` reader - Noise Filter A Sampling Clock Select"]
pub type NFCSA_R = crate::FieldReader<u8, NFCSA_A>;
#[doc = "Noise Filter A Sampling Clock Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum NFCSA_A {
    #[doc = "0: PCLKD/1"]
    _00 = 0,
    #[doc = "1: PCLKD/4"]
    _01 = 1,
    #[doc = "2: PCLKD/16"]
    _10 = 2,
    #[doc = "3: PCLKD/64"]
    _11 = 3,
}
impl From<NFCSA_A> for u8 {
    #[inline(always)]
    fn from(variant: NFCSA_A) -> Self {
        variant as _
    }
}
impl NFCSA_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> NFCSA_A {
        match self.bits {
            0 => NFCSA_A::_00,
            1 => NFCSA_A::_01,
            2 => NFCSA_A::_10,
            3 => NFCSA_A::_11,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `_00`"]
    #[inline(always)]
    pub fn is_00(&self) -> bool {
        *self == NFCSA_A::_00
    }
    #[doc = "Checks if the value of the field is `_01`"]
    #[inline(always)]
    pub fn is_01(&self) -> bool {
        *self == NFCSA_A::_01
    }
    #[doc = "Checks if the value of the field is `_10`"]
    #[inline(always)]
    pub fn is_10(&self) -> bool {
        *self == NFCSA_A::_10
    }
    #[doc = "Checks if the value of the field is `_11`"]
    #[inline(always)]
    pub fn is_11(&self) -> bool {
        *self == NFCSA_A::_11
    }
}
#[doc = "Field `NFCSA` writer - Noise Filter A Sampling Clock Select"]
pub type NFCSA_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, GTIOR_SPEC, u8, NFCSA_A, 2, O>;
impl<'a, const O: u8> NFCSA_W<'a, O> {
    #[doc = "PCLKD/1"]
    #[inline(always)]
    pub fn _00(self) -> &'a mut W {
        self.variant(NFCSA_A::_00)
    }
    #[doc = "PCLKD/4"]
    #[inline(always)]
    pub fn _01(self) -> &'a mut W {
        self.variant(NFCSA_A::_01)
    }
    #[doc = "PCLKD/16"]
    #[inline(always)]
    pub fn _10(self) -> &'a mut W {
        self.variant(NFCSA_A::_10)
    }
    #[doc = "PCLKD/64"]
    #[inline(always)]
    pub fn _11(self) -> &'a mut W {
        self.variant(NFCSA_A::_11)
    }
}
#[doc = "Field `GTIOB` reader - GTIOCnB Pin Function Select"]
pub type GTIOB_R = crate::FieldReader<u8, u8>;
#[doc = "Field `GTIOB` writer - GTIOCnB Pin Function Select"]
pub type GTIOB_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GTIOR_SPEC, u8, u8, 5, O>;
#[doc = "Field `OBDFLT` reader - GTIOCnB Pin Output Value Setting at the Count Stop"]
pub type OBDFLT_R = crate::BitReader<OBDFLT_A>;
#[doc = "GTIOCnB Pin Output Value Setting at the Count Stop\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OBDFLT_A {
    #[doc = "0: The GTIOCnB pin outputs low when counting stops"]
    _0 = 0,
    #[doc = "1: The GTIOCnB pin outputs high when counting stops"]
    _1 = 1,
}
impl From<OBDFLT_A> for bool {
    #[inline(always)]
    fn from(variant: OBDFLT_A) -> Self {
        variant as u8 != 0
    }
}
impl OBDFLT_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> OBDFLT_A {
        match self.bits {
            false => OBDFLT_A::_0,
            true => OBDFLT_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == OBDFLT_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == OBDFLT_A::_1
    }
}
#[doc = "Field `OBDFLT` writer - GTIOCnB Pin Output Value Setting at the Count Stop"]
pub type OBDFLT_W<'a, const O: u8> = crate::BitWriter<'a, u32, GTIOR_SPEC, OBDFLT_A, O>;
impl<'a, const O: u8> OBDFLT_W<'a, O> {
    #[doc = "The GTIOCnB pin outputs low when counting stops"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(OBDFLT_A::_0)
    }
    #[doc = "The GTIOCnB pin outputs high when counting stops"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(OBDFLT_A::_1)
    }
}
#[doc = "Field `OBHLD` reader - GTIOCnB Pin Output Setting at the Start/Stop Count"]
pub type OBHLD_R = crate::BitReader<OBHLD_A>;
#[doc = "GTIOCnB Pin Output Setting at the Start/Stop Count\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OBHLD_A {
    #[doc = "0: The GTIOCnB pin output level at the start/stop of counting depends on the register setting"]
    _0 = 0,
    #[doc = "1: The GTIOCnB pin output level is retained at the start/stop of counting"]
    _1 = 1,
}
impl From<OBHLD_A> for bool {
    #[inline(always)]
    fn from(variant: OBHLD_A) -> Self {
        variant as u8 != 0
    }
}
impl OBHLD_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> OBHLD_A {
        match self.bits {
            false => OBHLD_A::_0,
            true => OBHLD_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == OBHLD_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == OBHLD_A::_1
    }
}
#[doc = "Field `OBHLD` writer - GTIOCnB Pin Output Setting at the Start/Stop Count"]
pub type OBHLD_W<'a, const O: u8> = crate::BitWriter<'a, u32, GTIOR_SPEC, OBHLD_A, O>;
impl<'a, const O: u8> OBHLD_W<'a, O> {
    #[doc = "The GTIOCnB pin output level at the start/stop of counting depends on the register setting"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(OBHLD_A::_0)
    }
    #[doc = "The GTIOCnB pin output level is retained at the start/stop of counting"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(OBHLD_A::_1)
    }
}
#[doc = "Field `OBE` reader - GTIOCnB Pin Output Enable"]
pub type OBE_R = crate::BitReader<OBE_A>;
#[doc = "GTIOCnB Pin Output Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OBE_A {
    #[doc = "0: Output is disabled"]
    _0 = 0,
    #[doc = "1: Output is enabled"]
    _1 = 1,
}
impl From<OBE_A> for bool {
    #[inline(always)]
    fn from(variant: OBE_A) -> Self {
        variant as u8 != 0
    }
}
impl OBE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> OBE_A {
        match self.bits {
            false => OBE_A::_0,
            true => OBE_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == OBE_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == OBE_A::_1
    }
}
#[doc = "Field `OBE` writer - GTIOCnB Pin Output Enable"]
pub type OBE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GTIOR_SPEC, OBE_A, O>;
impl<'a, const O: u8> OBE_W<'a, O> {
    #[doc = "Output is disabled"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(OBE_A::_0)
    }
    #[doc = "Output is enabled"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(OBE_A::_1)
    }
}
#[doc = "Field `OBDF` reader - GTIOCnB Pin Disable Value Setting"]
pub type OBDF_R = crate::FieldReader<u8, OBDF_A>;
#[doc = "GTIOCnB Pin Disable Value Setting\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum OBDF_A {
    #[doc = "0: Output disable is prohibited"]
    _00 = 0,
    #[doc = "1: GTIOCnB pin is set to Hi-Z on output disable"]
    _01 = 1,
    #[doc = "2: GTIOCnB pin is set to 0 on output disable"]
    _10 = 2,
    #[doc = "3: GTIOCnB pin is set to 1 on output disable"]
    _11 = 3,
}
impl From<OBDF_A> for u8 {
    #[inline(always)]
    fn from(variant: OBDF_A) -> Self {
        variant as _
    }
}
impl OBDF_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> OBDF_A {
        match self.bits {
            0 => OBDF_A::_00,
            1 => OBDF_A::_01,
            2 => OBDF_A::_10,
            3 => OBDF_A::_11,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `_00`"]
    #[inline(always)]
    pub fn is_00(&self) -> bool {
        *self == OBDF_A::_00
    }
    #[doc = "Checks if the value of the field is `_01`"]
    #[inline(always)]
    pub fn is_01(&self) -> bool {
        *self == OBDF_A::_01
    }
    #[doc = "Checks if the value of the field is `_10`"]
    #[inline(always)]
    pub fn is_10(&self) -> bool {
        *self == OBDF_A::_10
    }
    #[doc = "Checks if the value of the field is `_11`"]
    #[inline(always)]
    pub fn is_11(&self) -> bool {
        *self == OBDF_A::_11
    }
}
#[doc = "Field `OBDF` writer - GTIOCnB Pin Disable Value Setting"]
pub type OBDF_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, GTIOR_SPEC, u8, OBDF_A, 2, O>;
impl<'a, const O: u8> OBDF_W<'a, O> {
    #[doc = "Output disable is prohibited"]
    #[inline(always)]
    pub fn _00(self) -> &'a mut W {
        self.variant(OBDF_A::_00)
    }
    #[doc = "GTIOCnB pin is set to Hi-Z on output disable"]
    #[inline(always)]
    pub fn _01(self) -> &'a mut W {
        self.variant(OBDF_A::_01)
    }
    #[doc = "GTIOCnB pin is set to 0 on output disable"]
    #[inline(always)]
    pub fn _10(self) -> &'a mut W {
        self.variant(OBDF_A::_10)
    }
    #[doc = "GTIOCnB pin is set to 1 on output disable"]
    #[inline(always)]
    pub fn _11(self) -> &'a mut W {
        self.variant(OBDF_A::_11)
    }
}
#[doc = "Field `NFBEN` reader - Noise Filter B Enable"]
pub type NFBEN_R = crate::BitReader<NFBEN_A>;
#[doc = "Noise Filter B Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum NFBEN_A {
    #[doc = "0: The noise filter for the GTIOCnB pin is disabled"]
    _0 = 0,
    #[doc = "1: The noise filter for the GTIOCnB pin is enabled"]
    _1 = 1,
}
impl From<NFBEN_A> for bool {
    #[inline(always)]
    fn from(variant: NFBEN_A) -> Self {
        variant as u8 != 0
    }
}
impl NFBEN_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> NFBEN_A {
        match self.bits {
            false => NFBEN_A::_0,
            true => NFBEN_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == NFBEN_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == NFBEN_A::_1
    }
}
#[doc = "Field `NFBEN` writer - Noise Filter B Enable"]
pub type NFBEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GTIOR_SPEC, NFBEN_A, O>;
impl<'a, const O: u8> NFBEN_W<'a, O> {
    #[doc = "The noise filter for the GTIOCnB pin is disabled"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(NFBEN_A::_0)
    }
    #[doc = "The noise filter for the GTIOCnB pin is enabled"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(NFBEN_A::_1)
    }
}
#[doc = "Field `NFCSB` reader - Noise Filter B Sampling Clock Select"]
pub type NFCSB_R = crate::FieldReader<u8, NFCSB_A>;
#[doc = "Noise Filter B Sampling Clock Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum NFCSB_A {
    #[doc = "0: PCLKD/1"]
    _00 = 0,
    #[doc = "1: PCLKD/4"]
    _01 = 1,
    #[doc = "2: PCLKD/16"]
    _10 = 2,
    #[doc = "3: PCLKD/64"]
    _11 = 3,
}
impl From<NFCSB_A> for u8 {
    #[inline(always)]
    fn from(variant: NFCSB_A) -> Self {
        variant as _
    }
}
impl NFCSB_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> NFCSB_A {
        match self.bits {
            0 => NFCSB_A::_00,
            1 => NFCSB_A::_01,
            2 => NFCSB_A::_10,
            3 => NFCSB_A::_11,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `_00`"]
    #[inline(always)]
    pub fn is_00(&self) -> bool {
        *self == NFCSB_A::_00
    }
    #[doc = "Checks if the value of the field is `_01`"]
    #[inline(always)]
    pub fn is_01(&self) -> bool {
        *self == NFCSB_A::_01
    }
    #[doc = "Checks if the value of the field is `_10`"]
    #[inline(always)]
    pub fn is_10(&self) -> bool {
        *self == NFCSB_A::_10
    }
    #[doc = "Checks if the value of the field is `_11`"]
    #[inline(always)]
    pub fn is_11(&self) -> bool {
        *self == NFCSB_A::_11
    }
}
#[doc = "Field `NFCSB` writer - Noise Filter B Sampling Clock Select"]
pub type NFCSB_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, GTIOR_SPEC, u8, NFCSB_A, 2, O>;
impl<'a, const O: u8> NFCSB_W<'a, O> {
    #[doc = "PCLKD/1"]
    #[inline(always)]
    pub fn _00(self) -> &'a mut W {
        self.variant(NFCSB_A::_00)
    }
    #[doc = "PCLKD/4"]
    #[inline(always)]
    pub fn _01(self) -> &'a mut W {
        self.variant(NFCSB_A::_01)
    }
    #[doc = "PCLKD/16"]
    #[inline(always)]
    pub fn _10(self) -> &'a mut W {
        self.variant(NFCSB_A::_10)
    }
    #[doc = "PCLKD/64"]
    #[inline(always)]
    pub fn _11(self) -> &'a mut W {
        self.variant(NFCSB_A::_11)
    }
}
impl R {
    #[doc = "Bits 0:4 - GTIOCnA Pin Function Select"]
    #[inline(always)]
    pub fn gtioa(&self) -> GTIOA_R {
        GTIOA_R::new((self.bits & 0x1f) as u8)
    }
    #[doc = "Bit 6 - GTIOCnA Pin Output Value Setting at the Count Stop"]
    #[inline(always)]
    pub fn oadflt(&self) -> OADFLT_R {
        OADFLT_R::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bit 7 - GTIOCnA Pin Output Setting at the Start/Stop Count"]
    #[inline(always)]
    pub fn oahld(&self) -> OAHLD_R {
        OAHLD_R::new(((self.bits >> 7) & 1) != 0)
    }
    #[doc = "Bit 8 - GTIOCnA Pin Output Enable"]
    #[inline(always)]
    pub fn oae(&self) -> OAE_R {
        OAE_R::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bits 9:10 - GTIOCnA Pin Disable Value Setting"]
    #[inline(always)]
    pub fn oadf(&self) -> OADF_R {
        OADF_R::new(((self.bits >> 9) & 3) as u8)
    }
    #[doc = "Bit 13 - Noise Filter A Enable"]
    #[inline(always)]
    pub fn nfaen(&self) -> NFAEN_R {
        NFAEN_R::new(((self.bits >> 13) & 1) != 0)
    }
    #[doc = "Bits 14:15 - Noise Filter A Sampling Clock Select"]
    #[inline(always)]
    pub fn nfcsa(&self) -> NFCSA_R {
        NFCSA_R::new(((self.bits >> 14) & 3) as u8)
    }
    #[doc = "Bits 16:20 - GTIOCnB Pin Function Select"]
    #[inline(always)]
    pub fn gtiob(&self) -> GTIOB_R {
        GTIOB_R::new(((self.bits >> 16) & 0x1f) as u8)
    }
    #[doc = "Bit 22 - GTIOCnB Pin Output Value Setting at the Count Stop"]
    #[inline(always)]
    pub fn obdflt(&self) -> OBDFLT_R {
        OBDFLT_R::new(((self.bits >> 22) & 1) != 0)
    }
    #[doc = "Bit 23 - GTIOCnB Pin Output Setting at the Start/Stop Count"]
    #[inline(always)]
    pub fn obhld(&self) -> OBHLD_R {
        OBHLD_R::new(((self.bits >> 23) & 1) != 0)
    }
    #[doc = "Bit 24 - GTIOCnB Pin Output Enable"]
    #[inline(always)]
    pub fn obe(&self) -> OBE_R {
        OBE_R::new(((self.bits >> 24) & 1) != 0)
    }
    #[doc = "Bits 25:26 - GTIOCnB Pin Disable Value Setting"]
    #[inline(always)]
    pub fn obdf(&self) -> OBDF_R {
        OBDF_R::new(((self.bits >> 25) & 3) as u8)
    }
    #[doc = "Bit 29 - Noise Filter B Enable"]
    #[inline(always)]
    pub fn nfben(&self) -> NFBEN_R {
        NFBEN_R::new(((self.bits >> 29) & 1) != 0)
    }
    #[doc = "Bits 30:31 - Noise Filter B Sampling Clock Select"]
    #[inline(always)]
    pub fn nfcsb(&self) -> NFCSB_R {
        NFCSB_R::new(((self.bits >> 30) & 3) as u8)
    }
}
impl W {
    #[doc = "Bits 0:4 - GTIOCnA Pin Function Select"]
    #[inline(always)]
    #[must_use]
    pub fn gtioa(&mut self) -> GTIOA_W<0> {
        GTIOA_W::new(self)
    }
    #[doc = "Bit 6 - GTIOCnA Pin Output Value Setting at the Count Stop"]
    #[inline(always)]
    #[must_use]
    pub fn oadflt(&mut self) -> OADFLT_W<6> {
        OADFLT_W::new(self)
    }
    #[doc = "Bit 7 - GTIOCnA Pin Output Setting at the Start/Stop Count"]
    #[inline(always)]
    #[must_use]
    pub fn oahld(&mut self) -> OAHLD_W<7> {
        OAHLD_W::new(self)
    }
    #[doc = "Bit 8 - GTIOCnA Pin Output Enable"]
    #[inline(always)]
    #[must_use]
    pub fn oae(&mut self) -> OAE_W<8> {
        OAE_W::new(self)
    }
    #[doc = "Bits 9:10 - GTIOCnA Pin Disable Value Setting"]
    #[inline(always)]
    #[must_use]
    pub fn oadf(&mut self) -> OADF_W<9> {
        OADF_W::new(self)
    }
    #[doc = "Bit 13 - Noise Filter A Enable"]
    #[inline(always)]
    #[must_use]
    pub fn nfaen(&mut self) -> NFAEN_W<13> {
        NFAEN_W::new(self)
    }
    #[doc = "Bits 14:15 - Noise Filter A Sampling Clock Select"]
    #[inline(always)]
    #[must_use]
    pub fn nfcsa(&mut self) -> NFCSA_W<14> {
        NFCSA_W::new(self)
    }
    #[doc = "Bits 16:20 - GTIOCnB Pin Function Select"]
    #[inline(always)]
    #[must_use]
    pub fn gtiob(&mut self) -> GTIOB_W<16> {
        GTIOB_W::new(self)
    }
    #[doc = "Bit 22 - GTIOCnB Pin Output Value Setting at the Count Stop"]
    #[inline(always)]
    #[must_use]
    pub fn obdflt(&mut self) -> OBDFLT_W<22> {
        OBDFLT_W::new(self)
    }
    #[doc = "Bit 23 - GTIOCnB Pin Output Setting at the Start/Stop Count"]
    #[inline(always)]
    #[must_use]
    pub fn obhld(&mut self) -> OBHLD_W<23> {
        OBHLD_W::new(self)
    }
    #[doc = "Bit 24 - GTIOCnB Pin Output Enable"]
    #[inline(always)]
    #[must_use]
    pub fn obe(&mut self) -> OBE_W<24> {
        OBE_W::new(self)
    }
    #[doc = "Bits 25:26 - GTIOCnB Pin Disable Value Setting"]
    #[inline(always)]
    #[must_use]
    pub fn obdf(&mut self) -> OBDF_W<25> {
        OBDF_W::new(self)
    }
    #[doc = "Bit 29 - Noise Filter B Enable"]
    #[inline(always)]
    #[must_use]
    pub fn nfben(&mut self) -> NFBEN_W<29> {
        NFBEN_W::new(self)
    }
    #[doc = "Bits 30:31 - Noise Filter B Sampling Clock Select"]
    #[inline(always)]
    #[must_use]
    pub fn nfcsb(&mut self) -> NFCSB_W<30> {
        NFCSB_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 = "General PWM Timer I/O Control Register\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).\n\nFor information about available fields see [gtior](index.html) module"]
pub struct GTIOR_SPEC;
impl crate::RegisterSpec for GTIOR_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [gtior::R](R) reader structure"]
impl crate::Readable for GTIOR_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [gtior::W](W) writer structure"]
impl crate::Writable for GTIOR_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 GTIOR to value 0"]
impl crate::Resettable for GTIOR_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}