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
#[doc = "Register `PIO2_8` reader"]
pub struct R(crate::R<PIO2_8_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<PIO2_8_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<PIO2_8_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<PIO2_8_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `PIO2_8` writer"]
pub struct W(crate::W<PIO2_8_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<PIO2_8_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<PIO2_8_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<PIO2_8_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `FSEL` reader - Function Selector (Digital Function)"]
pub type FSEL_R = crate::FieldReader<u8, FSEL_A>;
#[doc = "Function Selector (Digital Function)\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum FSEL_A {
    #[doc = "0: Function 0"]
    FSEL_0 = 0,
    #[doc = "1: Function 1"]
    FSEL_1 = 1,
    #[doc = "2: Function 2"]
    FSEL_2 = 2,
    #[doc = "3: Function 3"]
    FSEL_3 = 3,
    #[doc = "4: Function 4"]
    FSEL_4 = 4,
    #[doc = "5: Function 5"]
    FSEL_5 = 5,
    #[doc = "6: Function 6"]
    FSEL_6 = 6,
    #[doc = "7: Function 7"]
    FSEL_7 = 7,
    #[doc = "8: Function 8"]
    FSEL_8 = 8,
    #[doc = "9: Function 9"]
    FSEL_9 = 9,
    #[doc = "10: Function 10"]
    FSEL_10 = 10,
    #[doc = "11: Function 11"]
    FSEL_11 = 11,
    #[doc = "12: Function 12"]
    FSEL_12 = 12,
    #[doc = "13: Function 13"]
    FSEL_13 = 13,
    #[doc = "14: Function 14"]
    FSEL_14 = 14,
    #[doc = "15: Function 15"]
    FSEL_15 = 15,
}
impl From<FSEL_A> for u8 {
    #[inline(always)]
    fn from(variant: FSEL_A) -> Self {
        variant as _
    }
}
impl FSEL_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> FSEL_A {
        match self.bits {
            0 => FSEL_A::FSEL_0,
            1 => FSEL_A::FSEL_1,
            2 => FSEL_A::FSEL_2,
            3 => FSEL_A::FSEL_3,
            4 => FSEL_A::FSEL_4,
            5 => FSEL_A::FSEL_5,
            6 => FSEL_A::FSEL_6,
            7 => FSEL_A::FSEL_7,
            8 => FSEL_A::FSEL_8,
            9 => FSEL_A::FSEL_9,
            10 => FSEL_A::FSEL_10,
            11 => FSEL_A::FSEL_11,
            12 => FSEL_A::FSEL_12,
            13 => FSEL_A::FSEL_13,
            14 => FSEL_A::FSEL_14,
            15 => FSEL_A::FSEL_15,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `FSEL_0`"]
    #[inline(always)]
    pub fn is_fsel_0(&self) -> bool {
        *self == FSEL_A::FSEL_0
    }
    #[doc = "Checks if the value of the field is `FSEL_1`"]
    #[inline(always)]
    pub fn is_fsel_1(&self) -> bool {
        *self == FSEL_A::FSEL_1
    }
    #[doc = "Checks if the value of the field is `FSEL_2`"]
    #[inline(always)]
    pub fn is_fsel_2(&self) -> bool {
        *self == FSEL_A::FSEL_2
    }
    #[doc = "Checks if the value of the field is `FSEL_3`"]
    #[inline(always)]
    pub fn is_fsel_3(&self) -> bool {
        *self == FSEL_A::FSEL_3
    }
    #[doc = "Checks if the value of the field is `FSEL_4`"]
    #[inline(always)]
    pub fn is_fsel_4(&self) -> bool {
        *self == FSEL_A::FSEL_4
    }
    #[doc = "Checks if the value of the field is `FSEL_5`"]
    #[inline(always)]
    pub fn is_fsel_5(&self) -> bool {
        *self == FSEL_A::FSEL_5
    }
    #[doc = "Checks if the value of the field is `FSEL_6`"]
    #[inline(always)]
    pub fn is_fsel_6(&self) -> bool {
        *self == FSEL_A::FSEL_6
    }
    #[doc = "Checks if the value of the field is `FSEL_7`"]
    #[inline(always)]
    pub fn is_fsel_7(&self) -> bool {
        *self == FSEL_A::FSEL_7
    }
    #[doc = "Checks if the value of the field is `FSEL_8`"]
    #[inline(always)]
    pub fn is_fsel_8(&self) -> bool {
        *self == FSEL_A::FSEL_8
    }
    #[doc = "Checks if the value of the field is `FSEL_9`"]
    #[inline(always)]
    pub fn is_fsel_9(&self) -> bool {
        *self == FSEL_A::FSEL_9
    }
    #[doc = "Checks if the value of the field is `FSEL_10`"]
    #[inline(always)]
    pub fn is_fsel_10(&self) -> bool {
        *self == FSEL_A::FSEL_10
    }
    #[doc = "Checks if the value of the field is `FSEL_11`"]
    #[inline(always)]
    pub fn is_fsel_11(&self) -> bool {
        *self == FSEL_A::FSEL_11
    }
    #[doc = "Checks if the value of the field is `FSEL_12`"]
    #[inline(always)]
    pub fn is_fsel_12(&self) -> bool {
        *self == FSEL_A::FSEL_12
    }
    #[doc = "Checks if the value of the field is `FSEL_13`"]
    #[inline(always)]
    pub fn is_fsel_13(&self) -> bool {
        *self == FSEL_A::FSEL_13
    }
    #[doc = "Checks if the value of the field is `FSEL_14`"]
    #[inline(always)]
    pub fn is_fsel_14(&self) -> bool {
        *self == FSEL_A::FSEL_14
    }
    #[doc = "Checks if the value of the field is `FSEL_15`"]
    #[inline(always)]
    pub fn is_fsel_15(&self) -> bool {
        *self == FSEL_A::FSEL_15
    }
}
#[doc = "Field `FSEL` writer - Function Selector (Digital Function)"]
pub type FSEL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, PIO2_8_SPEC, u8, FSEL_A, 4, O>;
impl<'a, const O: u8> FSEL_W<'a, O> {
    #[doc = "Function 0"]
    #[inline(always)]
    pub fn fsel_0(self) -> &'a mut W {
        self.variant(FSEL_A::FSEL_0)
    }
    #[doc = "Function 1"]
    #[inline(always)]
    pub fn fsel_1(self) -> &'a mut W {
        self.variant(FSEL_A::FSEL_1)
    }
    #[doc = "Function 2"]
    #[inline(always)]
    pub fn fsel_2(self) -> &'a mut W {
        self.variant(FSEL_A::FSEL_2)
    }
    #[doc = "Function 3"]
    #[inline(always)]
    pub fn fsel_3(self) -> &'a mut W {
        self.variant(FSEL_A::FSEL_3)
    }
    #[doc = "Function 4"]
    #[inline(always)]
    pub fn fsel_4(self) -> &'a mut W {
        self.variant(FSEL_A::FSEL_4)
    }
    #[doc = "Function 5"]
    #[inline(always)]
    pub fn fsel_5(self) -> &'a mut W {
        self.variant(FSEL_A::FSEL_5)
    }
    #[doc = "Function 6"]
    #[inline(always)]
    pub fn fsel_6(self) -> &'a mut W {
        self.variant(FSEL_A::FSEL_6)
    }
    #[doc = "Function 7"]
    #[inline(always)]
    pub fn fsel_7(self) -> &'a mut W {
        self.variant(FSEL_A::FSEL_7)
    }
    #[doc = "Function 8"]
    #[inline(always)]
    pub fn fsel_8(self) -> &'a mut W {
        self.variant(FSEL_A::FSEL_8)
    }
    #[doc = "Function 9"]
    #[inline(always)]
    pub fn fsel_9(self) -> &'a mut W {
        self.variant(FSEL_A::FSEL_9)
    }
    #[doc = "Function 10"]
    #[inline(always)]
    pub fn fsel_10(self) -> &'a mut W {
        self.variant(FSEL_A::FSEL_10)
    }
    #[doc = "Function 11"]
    #[inline(always)]
    pub fn fsel_11(self) -> &'a mut W {
        self.variant(FSEL_A::FSEL_11)
    }
    #[doc = "Function 12"]
    #[inline(always)]
    pub fn fsel_12(self) -> &'a mut W {
        self.variant(FSEL_A::FSEL_12)
    }
    #[doc = "Function 13"]
    #[inline(always)]
    pub fn fsel_13(self) -> &'a mut W {
        self.variant(FSEL_A::FSEL_13)
    }
    #[doc = "Function 14"]
    #[inline(always)]
    pub fn fsel_14(self) -> &'a mut W {
        self.variant(FSEL_A::FSEL_14)
    }
    #[doc = "Function 15"]
    #[inline(always)]
    pub fn fsel_15(self) -> &'a mut W {
        self.variant(FSEL_A::FSEL_15)
    }
}
#[doc = "Field `PUPDENA` reader - Pullup / Pulldown Enable"]
pub type PUPDENA_R = crate::BitReader<PUPDENA_A>;
#[doc = "Pullup / Pulldown Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PUPDENA_A {
    #[doc = "0: Disable"]
    PUPDENA_0 = 0,
    #[doc = "1: Enable"]
    PUPDENA_1 = 1,
}
impl From<PUPDENA_A> for bool {
    #[inline(always)]
    fn from(variant: PUPDENA_A) -> Self {
        variant as u8 != 0
    }
}
impl PUPDENA_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> PUPDENA_A {
        match self.bits {
            false => PUPDENA_A::PUPDENA_0,
            true => PUPDENA_A::PUPDENA_1,
        }
    }
    #[doc = "Checks if the value of the field is `PUPDENA_0`"]
    #[inline(always)]
    pub fn is_pupdena_0(&self) -> bool {
        *self == PUPDENA_A::PUPDENA_0
    }
    #[doc = "Checks if the value of the field is `PUPDENA_1`"]
    #[inline(always)]
    pub fn is_pupdena_1(&self) -> bool {
        *self == PUPDENA_A::PUPDENA_1
    }
}
#[doc = "Field `PUPDENA` writer - Pullup / Pulldown Enable"]
pub type PUPDENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, PIO2_8_SPEC, PUPDENA_A, O>;
impl<'a, const O: u8> PUPDENA_W<'a, O> {
    #[doc = "Disable"]
    #[inline(always)]
    pub fn pupdena_0(self) -> &'a mut W {
        self.variant(PUPDENA_A::PUPDENA_0)
    }
    #[doc = "Enable"]
    #[inline(always)]
    pub fn pupdena_1(self) -> &'a mut W {
        self.variant(PUPDENA_A::PUPDENA_1)
    }
}
#[doc = "Field `PUPDSEL` reader - Pullup or Pulldown Selector"]
pub type PUPDSEL_R = crate::BitReader<PUPDSEL_A>;
#[doc = "Pullup or Pulldown Selector\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PUPDSEL_A {
    #[doc = "0: Pull-down"]
    PUPDSEL_0 = 0,
    #[doc = "1: Pull-up"]
    PUPDSEL_1 = 1,
}
impl From<PUPDSEL_A> for bool {
    #[inline(always)]
    fn from(variant: PUPDSEL_A) -> Self {
        variant as u8 != 0
    }
}
impl PUPDSEL_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> PUPDSEL_A {
        match self.bits {
            false => PUPDSEL_A::PUPDSEL_0,
            true => PUPDSEL_A::PUPDSEL_1,
        }
    }
    #[doc = "Checks if the value of the field is `PUPDSEL_0`"]
    #[inline(always)]
    pub fn is_pupdsel_0(&self) -> bool {
        *self == PUPDSEL_A::PUPDSEL_0
    }
    #[doc = "Checks if the value of the field is `PUPDSEL_1`"]
    #[inline(always)]
    pub fn is_pupdsel_1(&self) -> bool {
        *self == PUPDSEL_A::PUPDSEL_1
    }
}
#[doc = "Field `PUPDSEL` writer - Pullup or Pulldown Selector"]
pub type PUPDSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PIO2_8_SPEC, PUPDSEL_A, O>;
impl<'a, const O: u8> PUPDSEL_W<'a, O> {
    #[doc = "Pull-down"]
    #[inline(always)]
    pub fn pupdsel_0(self) -> &'a mut W {
        self.variant(PUPDSEL_A::PUPDSEL_0)
    }
    #[doc = "Pull-up"]
    #[inline(always)]
    pub fn pupdsel_1(self) -> &'a mut W {
        self.variant(PUPDSEL_A::PUPDSEL_1)
    }
}
#[doc = "Field `IBENA` reader - Input Buffer Enable"]
pub type IBENA_R = crate::BitReader<IBENA_A>;
#[doc = "Input Buffer Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum IBENA_A {
    #[doc = "0: Input buffer disabled"]
    IBENA_0 = 0,
    #[doc = "1: Input buffer enabled"]
    IBENA_1 = 1,
}
impl From<IBENA_A> for bool {
    #[inline(always)]
    fn from(variant: IBENA_A) -> Self {
        variant as u8 != 0
    }
}
impl IBENA_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> IBENA_A {
        match self.bits {
            false => IBENA_A::IBENA_0,
            true => IBENA_A::IBENA_1,
        }
    }
    #[doc = "Checks if the value of the field is `IBENA_0`"]
    #[inline(always)]
    pub fn is_ibena_0(&self) -> bool {
        *self == IBENA_A::IBENA_0
    }
    #[doc = "Checks if the value of the field is `IBENA_1`"]
    #[inline(always)]
    pub fn is_ibena_1(&self) -> bool {
        *self == IBENA_A::IBENA_1
    }
}
#[doc = "Field `IBENA` writer - Input Buffer Enable"]
pub type IBENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, PIO2_8_SPEC, IBENA_A, O>;
impl<'a, const O: u8> IBENA_W<'a, O> {
    #[doc = "Input buffer disabled"]
    #[inline(always)]
    pub fn ibena_0(self) -> &'a mut W {
        self.variant(IBENA_A::IBENA_0)
    }
    #[doc = "Input buffer enabled"]
    #[inline(always)]
    pub fn ibena_1(self) -> &'a mut W {
        self.variant(IBENA_A::IBENA_1)
    }
}
#[doc = "Field `SLEWRATE` reader - Slew Rate Control"]
pub type SLEWRATE_R = crate::BitReader<SLEWRATE_A>;
#[doc = "Slew Rate Control\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SLEWRATE_A {
    #[doc = "0: Standard mode, output slew rate is not controlled."]
    SLEWRATE_0 = 0,
    #[doc = "1: Slow mode, output slew rate control is enabled, limiting the output rate change and maximum toggle frequency. See device datasheet for details."]
    SLEWRATE_1 = 1,
}
impl From<SLEWRATE_A> for bool {
    #[inline(always)]
    fn from(variant: SLEWRATE_A) -> Self {
        variant as u8 != 0
    }
}
impl SLEWRATE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> SLEWRATE_A {
        match self.bits {
            false => SLEWRATE_A::SLEWRATE_0,
            true => SLEWRATE_A::SLEWRATE_1,
        }
    }
    #[doc = "Checks if the value of the field is `SLEWRATE_0`"]
    #[inline(always)]
    pub fn is_slewrate_0(&self) -> bool {
        *self == SLEWRATE_A::SLEWRATE_0
    }
    #[doc = "Checks if the value of the field is `SLEWRATE_1`"]
    #[inline(always)]
    pub fn is_slewrate_1(&self) -> bool {
        *self == SLEWRATE_A::SLEWRATE_1
    }
}
#[doc = "Field `SLEWRATE` writer - Slew Rate Control"]
pub type SLEWRATE_W<'a, const O: u8> = crate::BitWriter<'a, u32, PIO2_8_SPEC, SLEWRATE_A, O>;
impl<'a, const O: u8> SLEWRATE_W<'a, O> {
    #[doc = "Standard mode, output slew rate is not controlled."]
    #[inline(always)]
    pub fn slewrate_0(self) -> &'a mut W {
        self.variant(SLEWRATE_A::SLEWRATE_0)
    }
    #[doc = "Slow mode, output slew rate control is enabled, limiting the output rate change and maximum toggle frequency. See device datasheet for details."]
    #[inline(always)]
    pub fn slewrate_1(self) -> &'a mut W {
        self.variant(SLEWRATE_A::SLEWRATE_1)
    }
}
#[doc = "Field `FULLDRIVE` reader - Drive Selector"]
pub type FULLDRIVE_R = crate::BitReader<FULLDRIVE_A>;
#[doc = "Drive Selector\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FULLDRIVE_A {
    #[doc = "0: Normal output drive"]
    FULLDRIVE_0 = 0,
    #[doc = "1: Full output drive, twice the drive of normal mode."]
    FULLDRIVE_1 = 1,
}
impl From<FULLDRIVE_A> for bool {
    #[inline(always)]
    fn from(variant: FULLDRIVE_A) -> Self {
        variant as u8 != 0
    }
}
impl FULLDRIVE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> FULLDRIVE_A {
        match self.bits {
            false => FULLDRIVE_A::FULLDRIVE_0,
            true => FULLDRIVE_A::FULLDRIVE_1,
        }
    }
    #[doc = "Checks if the value of the field is `FULLDRIVE_0`"]
    #[inline(always)]
    pub fn is_fulldrive_0(&self) -> bool {
        *self == FULLDRIVE_A::FULLDRIVE_0
    }
    #[doc = "Checks if the value of the field is `FULLDRIVE_1`"]
    #[inline(always)]
    pub fn is_fulldrive_1(&self) -> bool {
        *self == FULLDRIVE_A::FULLDRIVE_1
    }
}
#[doc = "Field `FULLDRIVE` writer - Drive Selector"]
pub type FULLDRIVE_W<'a, const O: u8> = crate::BitWriter<'a, u32, PIO2_8_SPEC, FULLDRIVE_A, O>;
impl<'a, const O: u8> FULLDRIVE_W<'a, O> {
    #[doc = "Normal output drive"]
    #[inline(always)]
    pub fn fulldrive_0(self) -> &'a mut W {
        self.variant(FULLDRIVE_A::FULLDRIVE_0)
    }
    #[doc = "Full output drive, twice the drive of normal mode."]
    #[inline(always)]
    pub fn fulldrive_1(self) -> &'a mut W {
        self.variant(FULLDRIVE_A::FULLDRIVE_1)
    }
}
#[doc = "Field `AMENA` reader - Analog Mux Enable"]
pub type AMENA_R = crate::BitReader<AMENA_A>;
#[doc = "Analog Mux Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AMENA_A {
    #[doc = "0: Analog multiplexor disabled, required for digital pin function"]
    AMENA_0 = 0,
    #[doc = "1: Analog multiplexor enabled, required for analog pin function"]
    AMENA_1 = 1,
}
impl From<AMENA_A> for bool {
    #[inline(always)]
    fn from(variant: AMENA_A) -> Self {
        variant as u8 != 0
    }
}
impl AMENA_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> AMENA_A {
        match self.bits {
            false => AMENA_A::AMENA_0,
            true => AMENA_A::AMENA_1,
        }
    }
    #[doc = "Checks if the value of the field is `AMENA_0`"]
    #[inline(always)]
    pub fn is_amena_0(&self) -> bool {
        *self == AMENA_A::AMENA_0
    }
    #[doc = "Checks if the value of the field is `AMENA_1`"]
    #[inline(always)]
    pub fn is_amena_1(&self) -> bool {
        *self == AMENA_A::AMENA_1
    }
}
#[doc = "Field `AMENA` writer - Analog Mux Enable"]
pub type AMENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, PIO2_8_SPEC, AMENA_A, O>;
impl<'a, const O: u8> AMENA_W<'a, O> {
    #[doc = "Analog multiplexor disabled, required for digital pin function"]
    #[inline(always)]
    pub fn amena_0(self) -> &'a mut W {
        self.variant(AMENA_A::AMENA_0)
    }
    #[doc = "Analog multiplexor enabled, required for analog pin function"]
    #[inline(always)]
    pub fn amena_1(self) -> &'a mut W {
        self.variant(AMENA_A::AMENA_1)
    }
}
#[doc = "Field `ODENA` reader - Open-drain mode enable"]
pub type ODENA_R = crate::BitReader<ODENA_A>;
#[doc = "Open-drain mode enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ODENA_A {
    #[doc = "0: Normal push-pull output"]
    ODENA_0 = 0,
    #[doc = "1: Pseudo open-drain output (high drive disabled)"]
    ODENA_1 = 1,
}
impl From<ODENA_A> for bool {
    #[inline(always)]
    fn from(variant: ODENA_A) -> Self {
        variant as u8 != 0
    }
}
impl ODENA_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> ODENA_A {
        match self.bits {
            false => ODENA_A::ODENA_0,
            true => ODENA_A::ODENA_1,
        }
    }
    #[doc = "Checks if the value of the field is `ODENA_0`"]
    #[inline(always)]
    pub fn is_odena_0(&self) -> bool {
        *self == ODENA_A::ODENA_0
    }
    #[doc = "Checks if the value of the field is `ODENA_1`"]
    #[inline(always)]
    pub fn is_odena_1(&self) -> bool {
        *self == ODENA_A::ODENA_1
    }
}
#[doc = "Field `ODENA` writer - Open-drain mode enable"]
pub type ODENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, PIO2_8_SPEC, ODENA_A, O>;
impl<'a, const O: u8> ODENA_W<'a, O> {
    #[doc = "Normal push-pull output"]
    #[inline(always)]
    pub fn odena_0(self) -> &'a mut W {
        self.variant(ODENA_A::ODENA_0)
    }
    #[doc = "Pseudo open-drain output (high drive disabled)"]
    #[inline(always)]
    pub fn odena_1(self) -> &'a mut W {
        self.variant(ODENA_A::ODENA_1)
    }
}
#[doc = "Field `IIENA` reader - Input Invert Enable"]
pub type IIENA_R = crate::BitReader<IIENA_A>;
#[doc = "Input Invert Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum IIENA_A {
    #[doc = "0: Disabled, Input function is not inverted"]
    IIENA_0 = 0,
    #[doc = "1: Enabled, Input is function inverted"]
    IIENA_1 = 1,
}
impl From<IIENA_A> for bool {
    #[inline(always)]
    fn from(variant: IIENA_A) -> Self {
        variant as u8 != 0
    }
}
impl IIENA_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> IIENA_A {
        match self.bits {
            false => IIENA_A::IIENA_0,
            true => IIENA_A::IIENA_1,
        }
    }
    #[doc = "Checks if the value of the field is `IIENA_0`"]
    #[inline(always)]
    pub fn is_iiena_0(&self) -> bool {
        *self == IIENA_A::IIENA_0
    }
    #[doc = "Checks if the value of the field is `IIENA_1`"]
    #[inline(always)]
    pub fn is_iiena_1(&self) -> bool {
        *self == IIENA_A::IIENA_1
    }
}
#[doc = "Field `IIENA` writer - Input Invert Enable"]
pub type IIENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, PIO2_8_SPEC, IIENA_A, O>;
impl<'a, const O: u8> IIENA_W<'a, O> {
    #[doc = "Disabled, Input function is not inverted"]
    #[inline(always)]
    pub fn iiena_0(self) -> &'a mut W {
        self.variant(IIENA_A::IIENA_0)
    }
    #[doc = "Enabled, Input is function inverted"]
    #[inline(always)]
    pub fn iiena_1(self) -> &'a mut W {
        self.variant(IIENA_A::IIENA_1)
    }
}
impl R {
    #[doc = "Bits 0:3 - Function Selector (Digital Function)"]
    #[inline(always)]
    pub fn fsel(&self) -> FSEL_R {
        FSEL_R::new((self.bits & 0x0f) as u8)
    }
    #[doc = "Bit 4 - Pullup / Pulldown Enable"]
    #[inline(always)]
    pub fn pupdena(&self) -> PUPDENA_R {
        PUPDENA_R::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - Pullup or Pulldown Selector"]
    #[inline(always)]
    pub fn pupdsel(&self) -> PUPDSEL_R {
        PUPDSEL_R::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bit 6 - Input Buffer Enable"]
    #[inline(always)]
    pub fn ibena(&self) -> IBENA_R {
        IBENA_R::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bit 7 - Slew Rate Control"]
    #[inline(always)]
    pub fn slewrate(&self) -> SLEWRATE_R {
        SLEWRATE_R::new(((self.bits >> 7) & 1) != 0)
    }
    #[doc = "Bit 8 - Drive Selector"]
    #[inline(always)]
    pub fn fulldrive(&self) -> FULLDRIVE_R {
        FULLDRIVE_R::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bit 9 - Analog Mux Enable"]
    #[inline(always)]
    pub fn amena(&self) -> AMENA_R {
        AMENA_R::new(((self.bits >> 9) & 1) != 0)
    }
    #[doc = "Bit 10 - Open-drain mode enable"]
    #[inline(always)]
    pub fn odena(&self) -> ODENA_R {
        ODENA_R::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bit 11 - Input Invert Enable"]
    #[inline(always)]
    pub fn iiena(&self) -> IIENA_R {
        IIENA_R::new(((self.bits >> 11) & 1) != 0)
    }
}
impl W {
    #[doc = "Bits 0:3 - Function Selector (Digital Function)"]
    #[inline(always)]
    #[must_use]
    pub fn fsel(&mut self) -> FSEL_W<0> {
        FSEL_W::new(self)
    }
    #[doc = "Bit 4 - Pullup / Pulldown Enable"]
    #[inline(always)]
    #[must_use]
    pub fn pupdena(&mut self) -> PUPDENA_W<4> {
        PUPDENA_W::new(self)
    }
    #[doc = "Bit 5 - Pullup or Pulldown Selector"]
    #[inline(always)]
    #[must_use]
    pub fn pupdsel(&mut self) -> PUPDSEL_W<5> {
        PUPDSEL_W::new(self)
    }
    #[doc = "Bit 6 - Input Buffer Enable"]
    #[inline(always)]
    #[must_use]
    pub fn ibena(&mut self) -> IBENA_W<6> {
        IBENA_W::new(self)
    }
    #[doc = "Bit 7 - Slew Rate Control"]
    #[inline(always)]
    #[must_use]
    pub fn slewrate(&mut self) -> SLEWRATE_W<7> {
        SLEWRATE_W::new(self)
    }
    #[doc = "Bit 8 - Drive Selector"]
    #[inline(always)]
    #[must_use]
    pub fn fulldrive(&mut self) -> FULLDRIVE_W<8> {
        FULLDRIVE_W::new(self)
    }
    #[doc = "Bit 9 - Analog Mux Enable"]
    #[inline(always)]
    #[must_use]
    pub fn amena(&mut self) -> AMENA_W<9> {
        AMENA_W::new(self)
    }
    #[doc = "Bit 10 - Open-drain mode enable"]
    #[inline(always)]
    #[must_use]
    pub fn odena(&mut self) -> ODENA_W<10> {
        ODENA_W::new(self)
    }
    #[doc = "Bit 11 - Input Invert Enable"]
    #[inline(always)]
    #[must_use]
    pub fn iiena(&mut self) -> IIENA_W<11> {
        IIENA_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 = "IOPCTL configuration\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 [pio2_8](index.html) module"]
pub struct PIO2_8_SPEC;
impl crate::RegisterSpec for PIO2_8_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [pio2_8::R](R) reader structure"]
impl crate::Readable for PIO2_8_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [pio2_8::W](W) writer structure"]
impl crate::Writable for PIO2_8_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 PIO2_8 to value 0"]
impl crate::Resettable for PIO2_8_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}