s32k148-pac 0.1.0

Device Support Crate for NXP S32K148 Devices
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
#[doc = "Register `SC1L` reader"]
pub struct R(crate::R<SC1L_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<SC1L_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<SC1L_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<SC1L_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `SC1L` writer"]
pub struct W(crate::W<SC1L_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<SC1L_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<SC1L_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<SC1L_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Input channel select\n\nValue on reset: 63"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum ADCH_A {
    #[doc = "0: Exernal intput channel 0 is selected."]
    _000000 = 0,
    #[doc = "1: Exernal channel 1 is selected as input."]
    _000001 = 1,
    #[doc = "2: Exernal channel 2 is selected as input."]
    _000010 = 2,
    #[doc = "3: Exernal channel 3 is selected as input."]
    _000011 = 3,
    #[doc = "4: Exernal channel 4 is selected as input."]
    _000100 = 4,
    #[doc = "5: Exernal channel 5 is selected as input."]
    _000101 = 5,
    #[doc = "6: Exernal channel 6 is selected as input."]
    _000110 = 6,
    #[doc = "7: Exernal channel 7 is selected as input."]
    _000111 = 7,
    #[doc = "8: Exernal channel 8 is selected as input."]
    _001000 = 8,
    #[doc = "9: Exernal channel 9 is selected as input."]
    _01001 = 9,
    #[doc = "10: Exernal channel 10 is selected as input."]
    _001010 = 10,
    #[doc = "11: Exernal channel 11 is selected as input."]
    _001011 = 11,
    #[doc = "12: Exernal channel 12 is selected as input."]
    _001100 = 12,
    #[doc = "13: Exernal channel 13 is selected as input."]
    _001101 = 13,
    #[doc = "14: Exernal channel 14 is selected as input."]
    _001110 = 14,
    #[doc = "15: Exernal channel 15 is selected as input."]
    _001111 = 15,
    #[doc = "21: Internal channel 0 is selected as input."]
    _010101 = 21,
    #[doc = "22: Internal channel 1 is selected as input."]
    _010110 = 22,
    #[doc = "23: Internal channel 2 is selected as input."]
    _010111 = 23,
    #[doc = "26: Temp Sensor"]
    _011010 = 26,
    #[doc = "27: Band Gap"]
    _011011 = 27,
    #[doc = "28: Internal channel 3 is selected as input."]
    _011100 = 28,
    #[doc = "29: VREFSH is selected as input. Voltage reference selected is determined by SC2\\[REFSEL\\]."]
    _011101 = 29,
    #[doc = "30: VREFSL is selected as input. Voltage reference selected is determined by SC2\\[REFSEL\\]."]
    _011110 = 30,
    #[doc = "31: Module is disabled"]
    _011111 = 31,
    #[doc = "32: Internal channel 16 is selected as input."]
    _100000 = 32,
    #[doc = "33: Exernal channel 17 is selected as input."]
    _100001 = 33,
    #[doc = "34: Exernal channel 18 is selected as input."]
    _100010 = 34,
    #[doc = "35: Exernal channel 19 is selected as input."]
    _100011 = 35,
    #[doc = "36: Exernal channel 20 is selected as input."]
    _100100 = 36,
    #[doc = "37: Exernal channel 21 is selected as input."]
    _100101 = 37,
    #[doc = "38: Exernal channel 22 is selected as input."]
    _100110 = 38,
    #[doc = "39: Exernal channel 23 is selected as input."]
    _100111 = 39,
    #[doc = "40: Exernal channel 24 is selected as input."]
    _101000 = 40,
    #[doc = "41: Exernal channel 25 is selected as input."]
    _101001 = 41,
    #[doc = "42: Exernal channel 26 is selected as input."]
    _101010 = 42,
    #[doc = "43: Exernal channel 27 is selected as input."]
    _101011 = 43,
    #[doc = "44: Exernal channel 28 is selected as input."]
    _101100 = 44,
    #[doc = "45: Exernal channel 29 is selected as input."]
    _101101 = 45,
    #[doc = "46: Exernal channel 30 is selected as input."]
    _101110 = 46,
    #[doc = "47: Exernal channel 31 is selected as input."]
    _101111 = 47,
    #[doc = "48: Module is disabled"]
    _11XXXX = 48,
}
impl From<ADCH_A> for u8 {
    #[inline(always)]
    fn from(variant: ADCH_A) -> Self {
        variant as _
    }
}
#[doc = "Field `ADCH` reader - Input channel select"]
pub struct ADCH_R(crate::FieldReader<u8, ADCH_A>);
impl ADCH_R {
    #[inline(always)]
    pub(crate) fn new(bits: u8) -> Self {
        ADCH_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<ADCH_A> {
        match self.bits {
            0 => Some(ADCH_A::_000000),
            1 => Some(ADCH_A::_000001),
            2 => Some(ADCH_A::_000010),
            3 => Some(ADCH_A::_000011),
            4 => Some(ADCH_A::_000100),
            5 => Some(ADCH_A::_000101),
            6 => Some(ADCH_A::_000110),
            7 => Some(ADCH_A::_000111),
            8 => Some(ADCH_A::_001000),
            9 => Some(ADCH_A::_01001),
            10 => Some(ADCH_A::_001010),
            11 => Some(ADCH_A::_001011),
            12 => Some(ADCH_A::_001100),
            13 => Some(ADCH_A::_001101),
            14 => Some(ADCH_A::_001110),
            15 => Some(ADCH_A::_001111),
            21 => Some(ADCH_A::_010101),
            22 => Some(ADCH_A::_010110),
            23 => Some(ADCH_A::_010111),
            26 => Some(ADCH_A::_011010),
            27 => Some(ADCH_A::_011011),
            28 => Some(ADCH_A::_011100),
            29 => Some(ADCH_A::_011101),
            30 => Some(ADCH_A::_011110),
            31 => Some(ADCH_A::_011111),
            32 => Some(ADCH_A::_100000),
            33 => Some(ADCH_A::_100001),
            34 => Some(ADCH_A::_100010),
            35 => Some(ADCH_A::_100011),
            36 => Some(ADCH_A::_100100),
            37 => Some(ADCH_A::_100101),
            38 => Some(ADCH_A::_100110),
            39 => Some(ADCH_A::_100111),
            40 => Some(ADCH_A::_101000),
            41 => Some(ADCH_A::_101001),
            42 => Some(ADCH_A::_101010),
            43 => Some(ADCH_A::_101011),
            44 => Some(ADCH_A::_101100),
            45 => Some(ADCH_A::_101101),
            46 => Some(ADCH_A::_101110),
            47 => Some(ADCH_A::_101111),
            48 => Some(ADCH_A::_11XXXX),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `_000000`"]
    #[inline(always)]
    pub fn is_000000(&self) -> bool {
        **self == ADCH_A::_000000
    }
    #[doc = "Checks if the value of the field is `_000001`"]
    #[inline(always)]
    pub fn is_000001(&self) -> bool {
        **self == ADCH_A::_000001
    }
    #[doc = "Checks if the value of the field is `_000010`"]
    #[inline(always)]
    pub fn is_000010(&self) -> bool {
        **self == ADCH_A::_000010
    }
    #[doc = "Checks if the value of the field is `_000011`"]
    #[inline(always)]
    pub fn is_000011(&self) -> bool {
        **self == ADCH_A::_000011
    }
    #[doc = "Checks if the value of the field is `_000100`"]
    #[inline(always)]
    pub fn is_000100(&self) -> bool {
        **self == ADCH_A::_000100
    }
    #[doc = "Checks if the value of the field is `_000101`"]
    #[inline(always)]
    pub fn is_000101(&self) -> bool {
        **self == ADCH_A::_000101
    }
    #[doc = "Checks if the value of the field is `_000110`"]
    #[inline(always)]
    pub fn is_000110(&self) -> bool {
        **self == ADCH_A::_000110
    }
    #[doc = "Checks if the value of the field is `_000111`"]
    #[inline(always)]
    pub fn is_000111(&self) -> bool {
        **self == ADCH_A::_000111
    }
    #[doc = "Checks if the value of the field is `_001000`"]
    #[inline(always)]
    pub fn is_001000(&self) -> bool {
        **self == ADCH_A::_001000
    }
    #[doc = "Checks if the value of the field is `_01001`"]
    #[inline(always)]
    pub fn is_01001(&self) -> bool {
        **self == ADCH_A::_01001
    }
    #[doc = "Checks if the value of the field is `_001010`"]
    #[inline(always)]
    pub fn is_001010(&self) -> bool {
        **self == ADCH_A::_001010
    }
    #[doc = "Checks if the value of the field is `_001011`"]
    #[inline(always)]
    pub fn is_001011(&self) -> bool {
        **self == ADCH_A::_001011
    }
    #[doc = "Checks if the value of the field is `_001100`"]
    #[inline(always)]
    pub fn is_001100(&self) -> bool {
        **self == ADCH_A::_001100
    }
    #[doc = "Checks if the value of the field is `_001101`"]
    #[inline(always)]
    pub fn is_001101(&self) -> bool {
        **self == ADCH_A::_001101
    }
    #[doc = "Checks if the value of the field is `_001110`"]
    #[inline(always)]
    pub fn is_001110(&self) -> bool {
        **self == ADCH_A::_001110
    }
    #[doc = "Checks if the value of the field is `_001111`"]
    #[inline(always)]
    pub fn is_001111(&self) -> bool {
        **self == ADCH_A::_001111
    }
    #[doc = "Checks if the value of the field is `_010101`"]
    #[inline(always)]
    pub fn is_010101(&self) -> bool {
        **self == ADCH_A::_010101
    }
    #[doc = "Checks if the value of the field is `_010110`"]
    #[inline(always)]
    pub fn is_010110(&self) -> bool {
        **self == ADCH_A::_010110
    }
    #[doc = "Checks if the value of the field is `_010111`"]
    #[inline(always)]
    pub fn is_010111(&self) -> bool {
        **self == ADCH_A::_010111
    }
    #[doc = "Checks if the value of the field is `_011010`"]
    #[inline(always)]
    pub fn is_011010(&self) -> bool {
        **self == ADCH_A::_011010
    }
    #[doc = "Checks if the value of the field is `_011011`"]
    #[inline(always)]
    pub fn is_011011(&self) -> bool {
        **self == ADCH_A::_011011
    }
    #[doc = "Checks if the value of the field is `_011100`"]
    #[inline(always)]
    pub fn is_011100(&self) -> bool {
        **self == ADCH_A::_011100
    }
    #[doc = "Checks if the value of the field is `_011101`"]
    #[inline(always)]
    pub fn is_011101(&self) -> bool {
        **self == ADCH_A::_011101
    }
    #[doc = "Checks if the value of the field is `_011110`"]
    #[inline(always)]
    pub fn is_011110(&self) -> bool {
        **self == ADCH_A::_011110
    }
    #[doc = "Checks if the value of the field is `_011111`"]
    #[inline(always)]
    pub fn is_011111(&self) -> bool {
        **self == ADCH_A::_011111
    }
    #[doc = "Checks if the value of the field is `_100000`"]
    #[inline(always)]
    pub fn is_100000(&self) -> bool {
        **self == ADCH_A::_100000
    }
    #[doc = "Checks if the value of the field is `_100001`"]
    #[inline(always)]
    pub fn is_100001(&self) -> bool {
        **self == ADCH_A::_100001
    }
    #[doc = "Checks if the value of the field is `_100010`"]
    #[inline(always)]
    pub fn is_100010(&self) -> bool {
        **self == ADCH_A::_100010
    }
    #[doc = "Checks if the value of the field is `_100011`"]
    #[inline(always)]
    pub fn is_100011(&self) -> bool {
        **self == ADCH_A::_100011
    }
    #[doc = "Checks if the value of the field is `_100100`"]
    #[inline(always)]
    pub fn is_100100(&self) -> bool {
        **self == ADCH_A::_100100
    }
    #[doc = "Checks if the value of the field is `_100101`"]
    #[inline(always)]
    pub fn is_100101(&self) -> bool {
        **self == ADCH_A::_100101
    }
    #[doc = "Checks if the value of the field is `_100110`"]
    #[inline(always)]
    pub fn is_100110(&self) -> bool {
        **self == ADCH_A::_100110
    }
    #[doc = "Checks if the value of the field is `_100111`"]
    #[inline(always)]
    pub fn is_100111(&self) -> bool {
        **self == ADCH_A::_100111
    }
    #[doc = "Checks if the value of the field is `_101000`"]
    #[inline(always)]
    pub fn is_101000(&self) -> bool {
        **self == ADCH_A::_101000
    }
    #[doc = "Checks if the value of the field is `_101001`"]
    #[inline(always)]
    pub fn is_101001(&self) -> bool {
        **self == ADCH_A::_101001
    }
    #[doc = "Checks if the value of the field is `_101010`"]
    #[inline(always)]
    pub fn is_101010(&self) -> bool {
        **self == ADCH_A::_101010
    }
    #[doc = "Checks if the value of the field is `_101011`"]
    #[inline(always)]
    pub fn is_101011(&self) -> bool {
        **self == ADCH_A::_101011
    }
    #[doc = "Checks if the value of the field is `_101100`"]
    #[inline(always)]
    pub fn is_101100(&self) -> bool {
        **self == ADCH_A::_101100
    }
    #[doc = "Checks if the value of the field is `_101101`"]
    #[inline(always)]
    pub fn is_101101(&self) -> bool {
        **self == ADCH_A::_101101
    }
    #[doc = "Checks if the value of the field is `_101110`"]
    #[inline(always)]
    pub fn is_101110(&self) -> bool {
        **self == ADCH_A::_101110
    }
    #[doc = "Checks if the value of the field is `_101111`"]
    #[inline(always)]
    pub fn is_101111(&self) -> bool {
        **self == ADCH_A::_101111
    }
    #[doc = "Checks if the value of the field is `_11XXXX`"]
    #[inline(always)]
    pub fn is_11xxxx(&self) -> bool {
        **self == ADCH_A::_11XXXX
    }
}
impl core::ops::Deref for ADCH_R {
    type Target = crate::FieldReader<u8, ADCH_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `ADCH` writer - Input channel select"]
pub struct ADCH_W<'a> {
    w: &'a mut W,
}
impl<'a> ADCH_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: ADCH_A) -> &'a mut W {
        unsafe { self.bits(variant.into()) }
    }
    #[doc = "Exernal intput channel 0 is selected."]
    #[inline(always)]
    pub fn _000000(self) -> &'a mut W {
        self.variant(ADCH_A::_000000)
    }
    #[doc = "Exernal channel 1 is selected as input."]
    #[inline(always)]
    pub fn _000001(self) -> &'a mut W {
        self.variant(ADCH_A::_000001)
    }
    #[doc = "Exernal channel 2 is selected as input."]
    #[inline(always)]
    pub fn _000010(self) -> &'a mut W {
        self.variant(ADCH_A::_000010)
    }
    #[doc = "Exernal channel 3 is selected as input."]
    #[inline(always)]
    pub fn _000011(self) -> &'a mut W {
        self.variant(ADCH_A::_000011)
    }
    #[doc = "Exernal channel 4 is selected as input."]
    #[inline(always)]
    pub fn _000100(self) -> &'a mut W {
        self.variant(ADCH_A::_000100)
    }
    #[doc = "Exernal channel 5 is selected as input."]
    #[inline(always)]
    pub fn _000101(self) -> &'a mut W {
        self.variant(ADCH_A::_000101)
    }
    #[doc = "Exernal channel 6 is selected as input."]
    #[inline(always)]
    pub fn _000110(self) -> &'a mut W {
        self.variant(ADCH_A::_000110)
    }
    #[doc = "Exernal channel 7 is selected as input."]
    #[inline(always)]
    pub fn _000111(self) -> &'a mut W {
        self.variant(ADCH_A::_000111)
    }
    #[doc = "Exernal channel 8 is selected as input."]
    #[inline(always)]
    pub fn _001000(self) -> &'a mut W {
        self.variant(ADCH_A::_001000)
    }
    #[doc = "Exernal channel 9 is selected as input."]
    #[inline(always)]
    pub fn _01001(self) -> &'a mut W {
        self.variant(ADCH_A::_01001)
    }
    #[doc = "Exernal channel 10 is selected as input."]
    #[inline(always)]
    pub fn _001010(self) -> &'a mut W {
        self.variant(ADCH_A::_001010)
    }
    #[doc = "Exernal channel 11 is selected as input."]
    #[inline(always)]
    pub fn _001011(self) -> &'a mut W {
        self.variant(ADCH_A::_001011)
    }
    #[doc = "Exernal channel 12 is selected as input."]
    #[inline(always)]
    pub fn _001100(self) -> &'a mut W {
        self.variant(ADCH_A::_001100)
    }
    #[doc = "Exernal channel 13 is selected as input."]
    #[inline(always)]
    pub fn _001101(self) -> &'a mut W {
        self.variant(ADCH_A::_001101)
    }
    #[doc = "Exernal channel 14 is selected as input."]
    #[inline(always)]
    pub fn _001110(self) -> &'a mut W {
        self.variant(ADCH_A::_001110)
    }
    #[doc = "Exernal channel 15 is selected as input."]
    #[inline(always)]
    pub fn _001111(self) -> &'a mut W {
        self.variant(ADCH_A::_001111)
    }
    #[doc = "Internal channel 0 is selected as input."]
    #[inline(always)]
    pub fn _010101(self) -> &'a mut W {
        self.variant(ADCH_A::_010101)
    }
    #[doc = "Internal channel 1 is selected as input."]
    #[inline(always)]
    pub fn _010110(self) -> &'a mut W {
        self.variant(ADCH_A::_010110)
    }
    #[doc = "Internal channel 2 is selected as input."]
    #[inline(always)]
    pub fn _010111(self) -> &'a mut W {
        self.variant(ADCH_A::_010111)
    }
    #[doc = "Temp Sensor"]
    #[inline(always)]
    pub fn _011010(self) -> &'a mut W {
        self.variant(ADCH_A::_011010)
    }
    #[doc = "Band Gap"]
    #[inline(always)]
    pub fn _011011(self) -> &'a mut W {
        self.variant(ADCH_A::_011011)
    }
    #[doc = "Internal channel 3 is selected as input."]
    #[inline(always)]
    pub fn _011100(self) -> &'a mut W {
        self.variant(ADCH_A::_011100)
    }
    #[doc = "VREFSH is selected as input. Voltage reference selected is determined by SC2\\[REFSEL\\]."]
    #[inline(always)]
    pub fn _011101(self) -> &'a mut W {
        self.variant(ADCH_A::_011101)
    }
    #[doc = "VREFSL is selected as input. Voltage reference selected is determined by SC2\\[REFSEL\\]."]
    #[inline(always)]
    pub fn _011110(self) -> &'a mut W {
        self.variant(ADCH_A::_011110)
    }
    #[doc = "Module is disabled"]
    #[inline(always)]
    pub fn _011111(self) -> &'a mut W {
        self.variant(ADCH_A::_011111)
    }
    #[doc = "Internal channel 16 is selected as input."]
    #[inline(always)]
    pub fn _100000(self) -> &'a mut W {
        self.variant(ADCH_A::_100000)
    }
    #[doc = "Exernal channel 17 is selected as input."]
    #[inline(always)]
    pub fn _100001(self) -> &'a mut W {
        self.variant(ADCH_A::_100001)
    }
    #[doc = "Exernal channel 18 is selected as input."]
    #[inline(always)]
    pub fn _100010(self) -> &'a mut W {
        self.variant(ADCH_A::_100010)
    }
    #[doc = "Exernal channel 19 is selected as input."]
    #[inline(always)]
    pub fn _100011(self) -> &'a mut W {
        self.variant(ADCH_A::_100011)
    }
    #[doc = "Exernal channel 20 is selected as input."]
    #[inline(always)]
    pub fn _100100(self) -> &'a mut W {
        self.variant(ADCH_A::_100100)
    }
    #[doc = "Exernal channel 21 is selected as input."]
    #[inline(always)]
    pub fn _100101(self) -> &'a mut W {
        self.variant(ADCH_A::_100101)
    }
    #[doc = "Exernal channel 22 is selected as input."]
    #[inline(always)]
    pub fn _100110(self) -> &'a mut W {
        self.variant(ADCH_A::_100110)
    }
    #[doc = "Exernal channel 23 is selected as input."]
    #[inline(always)]
    pub fn _100111(self) -> &'a mut W {
        self.variant(ADCH_A::_100111)
    }
    #[doc = "Exernal channel 24 is selected as input."]
    #[inline(always)]
    pub fn _101000(self) -> &'a mut W {
        self.variant(ADCH_A::_101000)
    }
    #[doc = "Exernal channel 25 is selected as input."]
    #[inline(always)]
    pub fn _101001(self) -> &'a mut W {
        self.variant(ADCH_A::_101001)
    }
    #[doc = "Exernal channel 26 is selected as input."]
    #[inline(always)]
    pub fn _101010(self) -> &'a mut W {
        self.variant(ADCH_A::_101010)
    }
    #[doc = "Exernal channel 27 is selected as input."]
    #[inline(always)]
    pub fn _101011(self) -> &'a mut W {
        self.variant(ADCH_A::_101011)
    }
    #[doc = "Exernal channel 28 is selected as input."]
    #[inline(always)]
    pub fn _101100(self) -> &'a mut W {
        self.variant(ADCH_A::_101100)
    }
    #[doc = "Exernal channel 29 is selected as input."]
    #[inline(always)]
    pub fn _101101(self) -> &'a mut W {
        self.variant(ADCH_A::_101101)
    }
    #[doc = "Exernal channel 30 is selected as input."]
    #[inline(always)]
    pub fn _101110(self) -> &'a mut W {
        self.variant(ADCH_A::_101110)
    }
    #[doc = "Exernal channel 31 is selected as input."]
    #[inline(always)]
    pub fn _101111(self) -> &'a mut W {
        self.variant(ADCH_A::_101111)
    }
    #[doc = "Module is disabled"]
    #[inline(always)]
    pub fn _11xxxx(self) -> &'a mut W {
        self.variant(ADCH_A::_11XXXX)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        self.w.bits = (self.w.bits & !0x3f) | (value as u32 & 0x3f);
        self.w
    }
}
#[doc = "Interrupt Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum AIEN_A {
    #[doc = "0: Conversion complete interrupt is disabled."]
    _0 = 0,
    #[doc = "1: Conversion complete interrupt is enabled."]
    _1 = 1,
}
impl From<AIEN_A> for bool {
    #[inline(always)]
    fn from(variant: AIEN_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `AIEN` reader - Interrupt Enable"]
pub struct AIEN_R(crate::FieldReader<bool, AIEN_A>);
impl AIEN_R {
    #[inline(always)]
    pub(crate) fn new(bits: bool) -> Self {
        AIEN_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> AIEN_A {
        match self.bits {
            false => AIEN_A::_0,
            true => AIEN_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        **self == AIEN_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        **self == AIEN_A::_1
    }
}
impl core::ops::Deref for AIEN_R {
    type Target = crate::FieldReader<bool, AIEN_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `AIEN` writer - Interrupt Enable"]
pub struct AIEN_W<'a> {
    w: &'a mut W,
}
impl<'a> AIEN_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: AIEN_A) -> &'a mut W {
        self.bit(variant.into())
    }
    #[doc = "Conversion complete interrupt is disabled."]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(AIEN_A::_0)
    }
    #[doc = "Conversion complete interrupt is enabled."]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(AIEN_A::_1)
    }
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6);
        self.w
    }
}
#[doc = "Conversion Complete Flag\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum COCO_A {
    #[doc = "0: Conversion is not completed."]
    _0 = 0,
    #[doc = "1: Conversion is completed."]
    _1 = 1,
}
impl From<COCO_A> for bool {
    #[inline(always)]
    fn from(variant: COCO_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `COCO` reader - Conversion Complete Flag"]
pub struct COCO_R(crate::FieldReader<bool, COCO_A>);
impl COCO_R {
    #[inline(always)]
    pub(crate) fn new(bits: bool) -> Self {
        COCO_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> COCO_A {
        match self.bits {
            false => COCO_A::_0,
            true => COCO_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        **self == COCO_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        **self == COCO_A::_1
    }
}
impl core::ops::Deref for COCO_R {
    type Target = crate::FieldReader<bool, COCO_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl R {
    #[doc = "Bits 0:5 - Input channel select"]
    #[inline(always)]
    pub fn adch(&self) -> ADCH_R {
        ADCH_R::new((self.bits & 0x3f) as u8)
    }
    #[doc = "Bit 6 - Interrupt Enable"]
    #[inline(always)]
    pub fn aien(&self) -> AIEN_R {
        AIEN_R::new(((self.bits >> 6) & 0x01) != 0)
    }
    #[doc = "Bit 7 - Conversion Complete Flag"]
    #[inline(always)]
    pub fn coco(&self) -> COCO_R {
        COCO_R::new(((self.bits >> 7) & 0x01) != 0)
    }
}
impl W {
    #[doc = "Bits 0:5 - Input channel select"]
    #[inline(always)]
    pub fn adch(&mut self) -> ADCH_W {
        ADCH_W { w: self }
    }
    #[doc = "Bit 6 - Interrupt Enable"]
    #[inline(always)]
    pub fn aien(&mut self) -> AIEN_W {
        AIEN_W { w: 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 = "ADC Status and Control Register 1\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 [sc1l](index.html) module"]
pub struct SC1L_SPEC;
impl crate::RegisterSpec for SC1L_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [sc1l::R](R) reader structure"]
impl crate::Readable for SC1L_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [sc1l::W](W) writer structure"]
impl crate::Writable for SC1L_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets SC1L to value 0x3f"]
impl crate::Resettable for SC1L_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0x3f
    }
}