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
#[doc = "Register `PCR0` reader"]
pub type R = crate::R<Pcr0Spec>;
#[doc = "Register `PCR0` writer"]
pub type W = crate::W<Pcr0Spec>;
#[doc = "Pull Select\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ps {
    #[doc = "0: Enables internal pulldown resistor"]
    Ps0 = 0,
    #[doc = "1: Enables internal pullup resistor"]
    Ps1 = 1,
}
impl From<Ps> for bool {
    #[inline(always)]
    fn from(variant: Ps) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `PS` reader - Pull Select"]
pub type PsR = crate::BitReader<Ps>;
impl PsR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Ps {
        match self.bits {
            false => Ps::Ps0,
            true => Ps::Ps1,
        }
    }
    #[doc = "Enables internal pulldown resistor"]
    #[inline(always)]
    pub fn is_ps0(&self) -> bool {
        *self == Ps::Ps0
    }
    #[doc = "Enables internal pullup resistor"]
    #[inline(always)]
    pub fn is_ps1(&self) -> bool {
        *self == Ps::Ps1
    }
}
#[doc = "Field `PS` writer - Pull Select"]
pub type PsW<'a, REG> = crate::BitWriter<'a, REG, Ps>;
impl<'a, REG> PsW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Enables internal pulldown resistor"]
    #[inline(always)]
    pub fn ps0(self) -> &'a mut crate::W<REG> {
        self.variant(Ps::Ps0)
    }
    #[doc = "Enables internal pullup resistor"]
    #[inline(always)]
    pub fn ps1(self) -> &'a mut crate::W<REG> {
        self.variant(Ps::Ps1)
    }
}
#[doc = "Pull Enable\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Pe {
    #[doc = "0: Disables"]
    Pe0 = 0,
    #[doc = "1: Enables"]
    Pe1 = 1,
}
impl From<Pe> for bool {
    #[inline(always)]
    fn from(variant: Pe) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `PE` reader - Pull Enable"]
pub type PeR = crate::BitReader<Pe>;
impl PeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Pe {
        match self.bits {
            false => Pe::Pe0,
            true => Pe::Pe1,
        }
    }
    #[doc = "Disables"]
    #[inline(always)]
    pub fn is_pe0(&self) -> bool {
        *self == Pe::Pe0
    }
    #[doc = "Enables"]
    #[inline(always)]
    pub fn is_pe1(&self) -> bool {
        *self == Pe::Pe1
    }
}
#[doc = "Field `PE` writer - Pull Enable"]
pub type PeW<'a, REG> = crate::BitWriter<'a, REG, Pe>;
impl<'a, REG> PeW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disables"]
    #[inline(always)]
    pub fn pe0(self) -> &'a mut crate::W<REG> {
        self.variant(Pe::Pe0)
    }
    #[doc = "Enables"]
    #[inline(always)]
    pub fn pe1(self) -> &'a mut crate::W<REG> {
        self.variant(Pe::Pe1)
    }
}
#[doc = "Slew Rate Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Sre {
    #[doc = "0: Fast"]
    Sre0 = 0,
    #[doc = "1: Slow"]
    Sre1 = 1,
}
impl From<Sre> for bool {
    #[inline(always)]
    fn from(variant: Sre) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SRE` reader - Slew Rate Enable"]
pub type SreR = crate::BitReader<Sre>;
impl SreR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Sre {
        match self.bits {
            false => Sre::Sre0,
            true => Sre::Sre1,
        }
    }
    #[doc = "Fast"]
    #[inline(always)]
    pub fn is_sre0(&self) -> bool {
        *self == Sre::Sre0
    }
    #[doc = "Slow"]
    #[inline(always)]
    pub fn is_sre1(&self) -> bool {
        *self == Sre::Sre1
    }
}
#[doc = "Field `SRE` writer - Slew Rate Enable"]
pub type SreW<'a, REG> = crate::BitWriter<'a, REG, Sre>;
impl<'a, REG> SreW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Fast"]
    #[inline(always)]
    pub fn sre0(self) -> &'a mut crate::W<REG> {
        self.variant(Sre::Sre0)
    }
    #[doc = "Slow"]
    #[inline(always)]
    pub fn sre1(self) -> &'a mut crate::W<REG> {
        self.variant(Sre::Sre1)
    }
}
#[doc = "Open Drain Enable\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ode {
    #[doc = "0: Disables"]
    Ode0 = 0,
    #[doc = "1: Enables"]
    Ode1 = 1,
}
impl From<Ode> for bool {
    #[inline(always)]
    fn from(variant: Ode) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ODE` reader - Open Drain Enable"]
pub type OdeR = crate::BitReader<Ode>;
impl OdeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Ode {
        match self.bits {
            false => Ode::Ode0,
            true => Ode::Ode1,
        }
    }
    #[doc = "Disables"]
    #[inline(always)]
    pub fn is_ode0(&self) -> bool {
        *self == Ode::Ode0
    }
    #[doc = "Enables"]
    #[inline(always)]
    pub fn is_ode1(&self) -> bool {
        *self == Ode::Ode1
    }
}
#[doc = "Field `ODE` writer - Open Drain Enable"]
pub type OdeW<'a, REG> = crate::BitWriter<'a, REG, Ode>;
impl<'a, REG> OdeW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disables"]
    #[inline(always)]
    pub fn ode0(self) -> &'a mut crate::W<REG> {
        self.variant(Ode::Ode0)
    }
    #[doc = "Enables"]
    #[inline(always)]
    pub fn ode1(self) -> &'a mut crate::W<REG> {
        self.variant(Ode::Ode1)
    }
}
#[doc = "Drive Strength Enable\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Dse {
    #[doc = "0: Low"]
    Dse0 = 0,
    #[doc = "1: High"]
    Dse1 = 1,
}
impl From<Dse> for bool {
    #[inline(always)]
    fn from(variant: Dse) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DSE` reader - Drive Strength Enable"]
pub type DseR = crate::BitReader<Dse>;
impl DseR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Dse {
        match self.bits {
            false => Dse::Dse0,
            true => Dse::Dse1,
        }
    }
    #[doc = "Low"]
    #[inline(always)]
    pub fn is_dse0(&self) -> bool {
        *self == Dse::Dse0
    }
    #[doc = "High"]
    #[inline(always)]
    pub fn is_dse1(&self) -> bool {
        *self == Dse::Dse1
    }
}
#[doc = "Field `DSE` writer - Drive Strength Enable"]
pub type DseW<'a, REG> = crate::BitWriter<'a, REG, Dse>;
impl<'a, REG> DseW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Low"]
    #[inline(always)]
    pub fn dse0(self) -> &'a mut crate::W<REG> {
        self.variant(Dse::Dse0)
    }
    #[doc = "High"]
    #[inline(always)]
    pub fn dse1(self) -> &'a mut crate::W<REG> {
        self.variant(Dse::Dse1)
    }
}
#[doc = "Pin Multiplex Control\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Mux {
    #[doc = "0: Alternative 0 (typically GPIO)"]
    Mux0 = 0,
    #[doc = "1: Alternative 1 (Pin/Port Dependent)"]
    Mux1 = 1,
    #[doc = "2: Alternative 2 (Pin/Port Dependent)"]
    Mux2 = 2,
    #[doc = "3: Alternative 3 (Pin/Port Dependent)"]
    Mux3 = 3,
    #[doc = "4: Alternative 4 (Pin/Port Dependent)"]
    Mux4 = 4,
    #[doc = "5: Alternative 5 (Pin/Port Dependent)"]
    Mux5 = 5,
    #[doc = "6: Alternative 6 (Pin/Port Dependent)"]
    Mux6 = 6,
    #[doc = "7: Alternative 7 (Pin/Port Dependent)"]
    Mux7 = 7,
    #[doc = "8: Alternative 8 (Pin/Port Dependent)"]
    Mux8 = 8,
    #[doc = "9: Alternative 9 (Pin/Port Dependent)"]
    Mux9 = 9,
    #[doc = "10: Alternative 10 (Pin/Port Dependent)"]
    Mux10 = 10,
    #[doc = "11: Alternative 11 (Pin/Port Dependent)"]
    Mux11 = 11,
    #[doc = "12: Alternative 12 (Pin/Port Dependent)"]
    Mux12 = 12,
    #[doc = "13: Alternative 13 (Pin/Port Dependent)"]
    Mux13 = 13,
    #[doc = "14: Alternative 14 (Pin/Port Dependent)"]
    Mux14 = 14,
    #[doc = "15: Alternative 15 (Pin/Port Dependent)"]
    Mux15 = 15,
}
impl From<Mux> for u8 {
    #[inline(always)]
    fn from(variant: Mux) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Mux {
    type Ux = u8;
}
impl crate::IsEnum for Mux {}
#[doc = "Field `MUX` reader - Pin Multiplex Control"]
pub type MuxR = crate::FieldReader<Mux>;
impl MuxR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Mux {
        match self.bits {
            0 => Mux::Mux0,
            1 => Mux::Mux1,
            2 => Mux::Mux2,
            3 => Mux::Mux3,
            4 => Mux::Mux4,
            5 => Mux::Mux5,
            6 => Mux::Mux6,
            7 => Mux::Mux7,
            8 => Mux::Mux8,
            9 => Mux::Mux9,
            10 => Mux::Mux10,
            11 => Mux::Mux11,
            12 => Mux::Mux12,
            13 => Mux::Mux13,
            14 => Mux::Mux14,
            15 => Mux::Mux15,
            _ => unreachable!(),
        }
    }
    #[doc = "Alternative 0 (typically GPIO)"]
    #[inline(always)]
    pub fn is_mux0(&self) -> bool {
        *self == Mux::Mux0
    }
    #[doc = "Alternative 1 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn is_mux1(&self) -> bool {
        *self == Mux::Mux1
    }
    #[doc = "Alternative 2 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn is_mux2(&self) -> bool {
        *self == Mux::Mux2
    }
    #[doc = "Alternative 3 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn is_mux3(&self) -> bool {
        *self == Mux::Mux3
    }
    #[doc = "Alternative 4 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn is_mux4(&self) -> bool {
        *self == Mux::Mux4
    }
    #[doc = "Alternative 5 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn is_mux5(&self) -> bool {
        *self == Mux::Mux5
    }
    #[doc = "Alternative 6 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn is_mux6(&self) -> bool {
        *self == Mux::Mux6
    }
    #[doc = "Alternative 7 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn is_mux7(&self) -> bool {
        *self == Mux::Mux7
    }
    #[doc = "Alternative 8 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn is_mux8(&self) -> bool {
        *self == Mux::Mux8
    }
    #[doc = "Alternative 9 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn is_mux9(&self) -> bool {
        *self == Mux::Mux9
    }
    #[doc = "Alternative 10 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn is_mux10(&self) -> bool {
        *self == Mux::Mux10
    }
    #[doc = "Alternative 11 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn is_mux11(&self) -> bool {
        *self == Mux::Mux11
    }
    #[doc = "Alternative 12 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn is_mux12(&self) -> bool {
        *self == Mux::Mux12
    }
    #[doc = "Alternative 13 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn is_mux13(&self) -> bool {
        *self == Mux::Mux13
    }
    #[doc = "Alternative 14 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn is_mux14(&self) -> bool {
        *self == Mux::Mux14
    }
    #[doc = "Alternative 15 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn is_mux15(&self) -> bool {
        *self == Mux::Mux15
    }
}
#[doc = "Field `MUX` writer - Pin Multiplex Control"]
pub type MuxW<'a, REG> = crate::FieldWriter<'a, REG, 4, Mux, crate::Safe>;
impl<'a, REG> MuxW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Alternative 0 (typically GPIO)"]
    #[inline(always)]
    pub fn mux0(self) -> &'a mut crate::W<REG> {
        self.variant(Mux::Mux0)
    }
    #[doc = "Alternative 1 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn mux1(self) -> &'a mut crate::W<REG> {
        self.variant(Mux::Mux1)
    }
    #[doc = "Alternative 2 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn mux2(self) -> &'a mut crate::W<REG> {
        self.variant(Mux::Mux2)
    }
    #[doc = "Alternative 3 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn mux3(self) -> &'a mut crate::W<REG> {
        self.variant(Mux::Mux3)
    }
    #[doc = "Alternative 4 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn mux4(self) -> &'a mut crate::W<REG> {
        self.variant(Mux::Mux4)
    }
    #[doc = "Alternative 5 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn mux5(self) -> &'a mut crate::W<REG> {
        self.variant(Mux::Mux5)
    }
    #[doc = "Alternative 6 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn mux6(self) -> &'a mut crate::W<REG> {
        self.variant(Mux::Mux6)
    }
    #[doc = "Alternative 7 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn mux7(self) -> &'a mut crate::W<REG> {
        self.variant(Mux::Mux7)
    }
    #[doc = "Alternative 8 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn mux8(self) -> &'a mut crate::W<REG> {
        self.variant(Mux::Mux8)
    }
    #[doc = "Alternative 9 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn mux9(self) -> &'a mut crate::W<REG> {
        self.variant(Mux::Mux9)
    }
    #[doc = "Alternative 10 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn mux10(self) -> &'a mut crate::W<REG> {
        self.variant(Mux::Mux10)
    }
    #[doc = "Alternative 11 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn mux11(self) -> &'a mut crate::W<REG> {
        self.variant(Mux::Mux11)
    }
    #[doc = "Alternative 12 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn mux12(self) -> &'a mut crate::W<REG> {
        self.variant(Mux::Mux12)
    }
    #[doc = "Alternative 13 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn mux13(self) -> &'a mut crate::W<REG> {
        self.variant(Mux::Mux13)
    }
    #[doc = "Alternative 14 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn mux14(self) -> &'a mut crate::W<REG> {
        self.variant(Mux::Mux14)
    }
    #[doc = "Alternative 15 (Pin/Port Dependent)"]
    #[inline(always)]
    pub fn mux15(self) -> &'a mut crate::W<REG> {
        self.variant(Mux::Mux15)
    }
}
#[doc = "Input Buffer Enable\n\nValue on reset: 1"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ibe {
    #[doc = "0: Disables"]
    Ibe0 = 0,
    #[doc = "1: Enables"]
    Ibe1 = 1,
}
impl From<Ibe> for bool {
    #[inline(always)]
    fn from(variant: Ibe) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `IBE` reader - Input Buffer Enable"]
pub type IbeR = crate::BitReader<Ibe>;
impl IbeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Ibe {
        match self.bits {
            false => Ibe::Ibe0,
            true => Ibe::Ibe1,
        }
    }
    #[doc = "Disables"]
    #[inline(always)]
    pub fn is_ibe0(&self) -> bool {
        *self == Ibe::Ibe0
    }
    #[doc = "Enables"]
    #[inline(always)]
    pub fn is_ibe1(&self) -> bool {
        *self == Ibe::Ibe1
    }
}
#[doc = "Field `IBE` writer - Input Buffer Enable"]
pub type IbeW<'a, REG> = crate::BitWriter<'a, REG, Ibe>;
impl<'a, REG> IbeW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Disables"]
    #[inline(always)]
    pub fn ibe0(self) -> &'a mut crate::W<REG> {
        self.variant(Ibe::Ibe0)
    }
    #[doc = "Enables"]
    #[inline(always)]
    pub fn ibe1(self) -> &'a mut crate::W<REG> {
        self.variant(Ibe::Ibe1)
    }
}
#[doc = "Invert Input\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Inv {
    #[doc = "0: Does not invert"]
    Inv0 = 0,
    #[doc = "1: Inverts"]
    Inv1 = 1,
}
impl From<Inv> for bool {
    #[inline(always)]
    fn from(variant: Inv) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `INV` reader - Invert Input"]
pub type InvR = crate::BitReader<Inv>;
impl InvR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Inv {
        match self.bits {
            false => Inv::Inv0,
            true => Inv::Inv1,
        }
    }
    #[doc = "Does not invert"]
    #[inline(always)]
    pub fn is_inv0(&self) -> bool {
        *self == Inv::Inv0
    }
    #[doc = "Inverts"]
    #[inline(always)]
    pub fn is_inv1(&self) -> bool {
        *self == Inv::Inv1
    }
}
#[doc = "Field `INV` writer - Invert Input"]
pub type InvW<'a, REG> = crate::BitWriter<'a, REG, Inv>;
impl<'a, REG> InvW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Does not invert"]
    #[inline(always)]
    pub fn inv0(self) -> &'a mut crate::W<REG> {
        self.variant(Inv::Inv0)
    }
    #[doc = "Inverts"]
    #[inline(always)]
    pub fn inv1(self) -> &'a mut crate::W<REG> {
        self.variant(Inv::Inv1)
    }
}
#[doc = "Lock Register\n\nValue on reset: 0"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Lk {
    #[doc = "0: Does not lock"]
    Lk0 = 0,
    #[doc = "1: Locks"]
    Lk1 = 1,
}
impl From<Lk> for bool {
    #[inline(always)]
    fn from(variant: Lk) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `LK` reader - Lock Register"]
pub type LkR = crate::BitReader<Lk>;
impl LkR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Lk {
        match self.bits {
            false => Lk::Lk0,
            true => Lk::Lk1,
        }
    }
    #[doc = "Does not lock"]
    #[inline(always)]
    pub fn is_lk0(&self) -> bool {
        *self == Lk::Lk0
    }
    #[doc = "Locks"]
    #[inline(always)]
    pub fn is_lk1(&self) -> bool {
        *self == Lk::Lk1
    }
}
#[doc = "Field `LK` writer - Lock Register"]
pub type LkW<'a, REG> = crate::BitWriter<'a, REG, Lk>;
impl<'a, REG> LkW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Does not lock"]
    #[inline(always)]
    pub fn lk0(self) -> &'a mut crate::W<REG> {
        self.variant(Lk::Lk0)
    }
    #[doc = "Locks"]
    #[inline(always)]
    pub fn lk1(self) -> &'a mut crate::W<REG> {
        self.variant(Lk::Lk1)
    }
}
impl R {
    #[doc = "Bit 0 - Pull Select"]
    #[inline(always)]
    pub fn ps(&self) -> PsR {
        PsR::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Pull Enable"]
    #[inline(always)]
    pub fn pe(&self) -> PeR {
        PeR::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 3 - Slew Rate Enable"]
    #[inline(always)]
    pub fn sre(&self) -> SreR {
        SreR::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 5 - Open Drain Enable"]
    #[inline(always)]
    pub fn ode(&self) -> OdeR {
        OdeR::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bit 6 - Drive Strength Enable"]
    #[inline(always)]
    pub fn dse(&self) -> DseR {
        DseR::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bits 8:11 - Pin Multiplex Control"]
    #[inline(always)]
    pub fn mux(&self) -> MuxR {
        MuxR::new(((self.bits >> 8) & 0x0f) as u8)
    }
    #[doc = "Bit 12 - Input Buffer Enable"]
    #[inline(always)]
    pub fn ibe(&self) -> IbeR {
        IbeR::new(((self.bits >> 12) & 1) != 0)
    }
    #[doc = "Bit 13 - Invert Input"]
    #[inline(always)]
    pub fn inv(&self) -> InvR {
        InvR::new(((self.bits >> 13) & 1) != 0)
    }
    #[doc = "Bit 15 - Lock Register"]
    #[inline(always)]
    pub fn lk(&self) -> LkR {
        LkR::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("PCR0")
            .field("ps", &self.ps())
            .field("pe", &self.pe())
            .field("sre", &self.sre())
            .field("ode", &self.ode())
            .field("dse", &self.dse())
            .field("mux", &self.mux())
            .field("ibe", &self.ibe())
            .field("inv", &self.inv())
            .field("lk", &self.lk())
            .finish()
    }
}
impl W {
    #[doc = "Bit 0 - Pull Select"]
    #[inline(always)]
    pub fn ps(&mut self) -> PsW<'_, Pcr0Spec> {
        PsW::new(self, 0)
    }
    #[doc = "Bit 1 - Pull Enable"]
    #[inline(always)]
    pub fn pe(&mut self) -> PeW<'_, Pcr0Spec> {
        PeW::new(self, 1)
    }
    #[doc = "Bit 3 - Slew Rate Enable"]
    #[inline(always)]
    pub fn sre(&mut self) -> SreW<'_, Pcr0Spec> {
        SreW::new(self, 3)
    }
    #[doc = "Bit 5 - Open Drain Enable"]
    #[inline(always)]
    pub fn ode(&mut self) -> OdeW<'_, Pcr0Spec> {
        OdeW::new(self, 5)
    }
    #[doc = "Bit 6 - Drive Strength Enable"]
    #[inline(always)]
    pub fn dse(&mut self) -> DseW<'_, Pcr0Spec> {
        DseW::new(self, 6)
    }
    #[doc = "Bits 8:11 - Pin Multiplex Control"]
    #[inline(always)]
    pub fn mux(&mut self) -> MuxW<'_, Pcr0Spec> {
        MuxW::new(self, 8)
    }
    #[doc = "Bit 12 - Input Buffer Enable"]
    #[inline(always)]
    pub fn ibe(&mut self) -> IbeW<'_, Pcr0Spec> {
        IbeW::new(self, 12)
    }
    #[doc = "Bit 13 - Invert Input"]
    #[inline(always)]
    pub fn inv(&mut self) -> InvW<'_, Pcr0Spec> {
        InvW::new(self, 13)
    }
    #[doc = "Bit 15 - Lock Register"]
    #[inline(always)]
    pub fn lk(&mut self) -> LkW<'_, Pcr0Spec> {
        LkW::new(self, 15)
    }
}
#[doc = "Pin Control 0\n\nYou can [`read`](crate::Reg::read) this register and get [`pcr0::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pcr0::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct Pcr0Spec;
impl crate::RegisterSpec for Pcr0Spec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`pcr0::R`](R) reader structure"]
impl crate::Readable for Pcr0Spec {}
#[doc = "`write(|w| ..)` method takes [`pcr0::W`](W) writer structure"]
impl crate::Writable for Pcr0Spec {
    type Safety = crate::Unsafe;
}
#[doc = "`reset()` method sets PCR0 to value 0x1143"]
impl crate::Resettable for Pcr0Spec {
    const RESET_VALUE: u32 = 0x1143;
}