efm32pg1b-pac 0.4.3

Peripheral access API for Silicon Labs EFM32PG1B microcontrollers
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
///Register `SCANNEGSEL` reader
pub type R = crate::R<SCANNEGSELrs>;
///Register `SCANNEGSEL` writer
pub type W = crate::W<SCANNEGSELrs>;
///Negative Input Select Register for ADCn_INPUT0 in Differential Scan Mode
///
///Value on reset: 0
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum INPUT0NEGSEL {
    ///0: Selects ADCn_INPUT1 as negative channel input
    Input1 = 0,
    ///1: Selects ADCn_INPUT3 as negative channel input
    Input3 = 1,
    ///2: Selects ADCn_INPUT5 as negative channel input
    Input5 = 2,
    ///3: Selects ADCn_INPUT7 as negative channel input
    Input7 = 3,
}
impl From<INPUT0NEGSEL> for u8 {
    #[inline(always)]
    fn from(variant: INPUT0NEGSEL) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for INPUT0NEGSEL {
    type Ux = u8;
}
impl crate::IsEnum for INPUT0NEGSEL {}
///Field `INPUT0NEGSEL` reader - Negative Input Select Register for ADCn_INPUT0 in Differential Scan Mode
pub type Input0negselR = crate::FieldReader<INPUT0NEGSEL>;
impl Input0negselR {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> INPUT0NEGSEL {
        match self.bits {
            0 => INPUT0NEGSEL::Input1,
            1 => INPUT0NEGSEL::Input3,
            2 => INPUT0NEGSEL::Input5,
            3 => INPUT0NEGSEL::Input7,
            _ => unreachable!(),
        }
    }
    ///Selects ADCn_INPUT1 as negative channel input
    #[inline(always)]
    pub fn is_input1(&self) -> bool {
        *self == INPUT0NEGSEL::Input1
    }
    ///Selects ADCn_INPUT3 as negative channel input
    #[inline(always)]
    pub fn is_input3(&self) -> bool {
        *self == INPUT0NEGSEL::Input3
    }
    ///Selects ADCn_INPUT5 as negative channel input
    #[inline(always)]
    pub fn is_input5(&self) -> bool {
        *self == INPUT0NEGSEL::Input5
    }
    ///Selects ADCn_INPUT7 as negative channel input
    #[inline(always)]
    pub fn is_input7(&self) -> bool {
        *self == INPUT0NEGSEL::Input7
    }
}
///Field `INPUT0NEGSEL` writer - Negative Input Select Register for ADCn_INPUT0 in Differential Scan Mode
pub type Input0negselW<'a, REG> = crate::FieldWriter<'a, REG, 2, INPUT0NEGSEL, crate::Safe>;
impl<'a, REG> Input0negselW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    ///Selects ADCn_INPUT1 as negative channel input
    #[inline(always)]
    pub fn input1(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT0NEGSEL::Input1)
    }
    ///Selects ADCn_INPUT3 as negative channel input
    #[inline(always)]
    pub fn input3(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT0NEGSEL::Input3)
    }
    ///Selects ADCn_INPUT5 as negative channel input
    #[inline(always)]
    pub fn input5(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT0NEGSEL::Input5)
    }
    ///Selects ADCn_INPUT7 as negative channel input
    #[inline(always)]
    pub fn input7(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT0NEGSEL::Input7)
    }
}
///Negative Input Select Register for ADCn_INPUT2 in Differential Scan Mode
///
///Value on reset: 1
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum INPUT2NEGSEL {
    ///0: Selects ADCn_INPUT1 as negative channel input
    Input1 = 0,
    ///1: Selects ADCn_INPUT3 as negative channel input
    Input3 = 1,
    ///2: Selects ADCn_INPUT5 as negative channel input
    Input5 = 2,
    ///3: Selects ADCn_INPUT7 as negative channel input
    Input7 = 3,
}
impl From<INPUT2NEGSEL> for u8 {
    #[inline(always)]
    fn from(variant: INPUT2NEGSEL) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for INPUT2NEGSEL {
    type Ux = u8;
}
impl crate::IsEnum for INPUT2NEGSEL {}
///Field `INPUT2NEGSEL` reader - Negative Input Select Register for ADCn_INPUT2 in Differential Scan Mode
pub type Input2negselR = crate::FieldReader<INPUT2NEGSEL>;
impl Input2negselR {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> INPUT2NEGSEL {
        match self.bits {
            0 => INPUT2NEGSEL::Input1,
            1 => INPUT2NEGSEL::Input3,
            2 => INPUT2NEGSEL::Input5,
            3 => INPUT2NEGSEL::Input7,
            _ => unreachable!(),
        }
    }
    ///Selects ADCn_INPUT1 as negative channel input
    #[inline(always)]
    pub fn is_input1(&self) -> bool {
        *self == INPUT2NEGSEL::Input1
    }
    ///Selects ADCn_INPUT3 as negative channel input
    #[inline(always)]
    pub fn is_input3(&self) -> bool {
        *self == INPUT2NEGSEL::Input3
    }
    ///Selects ADCn_INPUT5 as negative channel input
    #[inline(always)]
    pub fn is_input5(&self) -> bool {
        *self == INPUT2NEGSEL::Input5
    }
    ///Selects ADCn_INPUT7 as negative channel input
    #[inline(always)]
    pub fn is_input7(&self) -> bool {
        *self == INPUT2NEGSEL::Input7
    }
}
///Field `INPUT2NEGSEL` writer - Negative Input Select Register for ADCn_INPUT2 in Differential Scan Mode
pub type Input2negselW<'a, REG> = crate::FieldWriter<'a, REG, 2, INPUT2NEGSEL, crate::Safe>;
impl<'a, REG> Input2negselW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    ///Selects ADCn_INPUT1 as negative channel input
    #[inline(always)]
    pub fn input1(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT2NEGSEL::Input1)
    }
    ///Selects ADCn_INPUT3 as negative channel input
    #[inline(always)]
    pub fn input3(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT2NEGSEL::Input3)
    }
    ///Selects ADCn_INPUT5 as negative channel input
    #[inline(always)]
    pub fn input5(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT2NEGSEL::Input5)
    }
    ///Selects ADCn_INPUT7 as negative channel input
    #[inline(always)]
    pub fn input7(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT2NEGSEL::Input7)
    }
}
///Negative Input Select Register for ADCn_INPUT4 in Differential Scan Mode
///
///Value on reset: 2
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum INPUT4NEGSEL {
    ///0: Selects ADCn_INPUT1 as negative channel input
    Input1 = 0,
    ///1: Selects ADCn_INPUT3 as negative channel input
    Input3 = 1,
    ///2: Selects ADCn_INPUT5 as negative channel input
    Input5 = 2,
    ///3: Selects ADCn_INPUT7 as negative channel input
    Input7 = 3,
}
impl From<INPUT4NEGSEL> for u8 {
    #[inline(always)]
    fn from(variant: INPUT4NEGSEL) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for INPUT4NEGSEL {
    type Ux = u8;
}
impl crate::IsEnum for INPUT4NEGSEL {}
///Field `INPUT4NEGSEL` reader - Negative Input Select Register for ADCn_INPUT4 in Differential Scan Mode
pub type Input4negselR = crate::FieldReader<INPUT4NEGSEL>;
impl Input4negselR {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> INPUT4NEGSEL {
        match self.bits {
            0 => INPUT4NEGSEL::Input1,
            1 => INPUT4NEGSEL::Input3,
            2 => INPUT4NEGSEL::Input5,
            3 => INPUT4NEGSEL::Input7,
            _ => unreachable!(),
        }
    }
    ///Selects ADCn_INPUT1 as negative channel input
    #[inline(always)]
    pub fn is_input1(&self) -> bool {
        *self == INPUT4NEGSEL::Input1
    }
    ///Selects ADCn_INPUT3 as negative channel input
    #[inline(always)]
    pub fn is_input3(&self) -> bool {
        *self == INPUT4NEGSEL::Input3
    }
    ///Selects ADCn_INPUT5 as negative channel input
    #[inline(always)]
    pub fn is_input5(&self) -> bool {
        *self == INPUT4NEGSEL::Input5
    }
    ///Selects ADCn_INPUT7 as negative channel input
    #[inline(always)]
    pub fn is_input7(&self) -> bool {
        *self == INPUT4NEGSEL::Input7
    }
}
///Field `INPUT4NEGSEL` writer - Negative Input Select Register for ADCn_INPUT4 in Differential Scan Mode
pub type Input4negselW<'a, REG> = crate::FieldWriter<'a, REG, 2, INPUT4NEGSEL, crate::Safe>;
impl<'a, REG> Input4negselW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    ///Selects ADCn_INPUT1 as negative channel input
    #[inline(always)]
    pub fn input1(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT4NEGSEL::Input1)
    }
    ///Selects ADCn_INPUT3 as negative channel input
    #[inline(always)]
    pub fn input3(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT4NEGSEL::Input3)
    }
    ///Selects ADCn_INPUT5 as negative channel input
    #[inline(always)]
    pub fn input5(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT4NEGSEL::Input5)
    }
    ///Selects ADCn_INPUT7 as negative channel input
    #[inline(always)]
    pub fn input7(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT4NEGSEL::Input7)
    }
}
///Negative Input Select Register for ADCn_INPUT1 in Differential Scan Mode
///
///Value on reset: 3
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum INPUT6NEGSEL {
    ///0: Selects ADCn_INPUT1 as negative channel input
    Input1 = 0,
    ///1: Selects ADCn_INPUT3 as negative channel input
    Input3 = 1,
    ///2: Selects ADCn_INPUT5 as negative channel input
    Input5 = 2,
    ///3: Selects ADCn_INPUT7 as negative channel input
    Input7 = 3,
}
impl From<INPUT6NEGSEL> for u8 {
    #[inline(always)]
    fn from(variant: INPUT6NEGSEL) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for INPUT6NEGSEL {
    type Ux = u8;
}
impl crate::IsEnum for INPUT6NEGSEL {}
///Field `INPUT6NEGSEL` reader - Negative Input Select Register for ADCn_INPUT1 in Differential Scan Mode
pub type Input6negselR = crate::FieldReader<INPUT6NEGSEL>;
impl Input6negselR {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> INPUT6NEGSEL {
        match self.bits {
            0 => INPUT6NEGSEL::Input1,
            1 => INPUT6NEGSEL::Input3,
            2 => INPUT6NEGSEL::Input5,
            3 => INPUT6NEGSEL::Input7,
            _ => unreachable!(),
        }
    }
    ///Selects ADCn_INPUT1 as negative channel input
    #[inline(always)]
    pub fn is_input1(&self) -> bool {
        *self == INPUT6NEGSEL::Input1
    }
    ///Selects ADCn_INPUT3 as negative channel input
    #[inline(always)]
    pub fn is_input3(&self) -> bool {
        *self == INPUT6NEGSEL::Input3
    }
    ///Selects ADCn_INPUT5 as negative channel input
    #[inline(always)]
    pub fn is_input5(&self) -> bool {
        *self == INPUT6NEGSEL::Input5
    }
    ///Selects ADCn_INPUT7 as negative channel input
    #[inline(always)]
    pub fn is_input7(&self) -> bool {
        *self == INPUT6NEGSEL::Input7
    }
}
///Field `INPUT6NEGSEL` writer - Negative Input Select Register for ADCn_INPUT1 in Differential Scan Mode
pub type Input6negselW<'a, REG> = crate::FieldWriter<'a, REG, 2, INPUT6NEGSEL, crate::Safe>;
impl<'a, REG> Input6negselW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    ///Selects ADCn_INPUT1 as negative channel input
    #[inline(always)]
    pub fn input1(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT6NEGSEL::Input1)
    }
    ///Selects ADCn_INPUT3 as negative channel input
    #[inline(always)]
    pub fn input3(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT6NEGSEL::Input3)
    }
    ///Selects ADCn_INPUT5 as negative channel input
    #[inline(always)]
    pub fn input5(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT6NEGSEL::Input5)
    }
    ///Selects ADCn_INPUT7 as negative channel input
    #[inline(always)]
    pub fn input7(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT6NEGSEL::Input7)
    }
}
///Negative Input Select Register for ADCn_INPUT9 in Differential Scan Mode
///
///Value on reset: 1
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum INPUT9NEGSEL {
    ///0: Selects ADCn_INPUT8 as negative channel input
    Input8 = 0,
    ///1: Selects ADCn_INPUT10 as negative channel input
    Input10 = 1,
    ///2: Selects ADCn_INPUT12 as negative channel input
    Input12 = 2,
    ///3: Selects ADCn_INPUT14 as negative channel input
    Input14 = 3,
}
impl From<INPUT9NEGSEL> for u8 {
    #[inline(always)]
    fn from(variant: INPUT9NEGSEL) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for INPUT9NEGSEL {
    type Ux = u8;
}
impl crate::IsEnum for INPUT9NEGSEL {}
///Field `INPUT9NEGSEL` reader - Negative Input Select Register for ADCn_INPUT9 in Differential Scan Mode
pub type Input9negselR = crate::FieldReader<INPUT9NEGSEL>;
impl Input9negselR {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> INPUT9NEGSEL {
        match self.bits {
            0 => INPUT9NEGSEL::Input8,
            1 => INPUT9NEGSEL::Input10,
            2 => INPUT9NEGSEL::Input12,
            3 => INPUT9NEGSEL::Input14,
            _ => unreachable!(),
        }
    }
    ///Selects ADCn_INPUT8 as negative channel input
    #[inline(always)]
    pub fn is_input8(&self) -> bool {
        *self == INPUT9NEGSEL::Input8
    }
    ///Selects ADCn_INPUT10 as negative channel input
    #[inline(always)]
    pub fn is_input10(&self) -> bool {
        *self == INPUT9NEGSEL::Input10
    }
    ///Selects ADCn_INPUT12 as negative channel input
    #[inline(always)]
    pub fn is_input12(&self) -> bool {
        *self == INPUT9NEGSEL::Input12
    }
    ///Selects ADCn_INPUT14 as negative channel input
    #[inline(always)]
    pub fn is_input14(&self) -> bool {
        *self == INPUT9NEGSEL::Input14
    }
}
///Field `INPUT9NEGSEL` writer - Negative Input Select Register for ADCn_INPUT9 in Differential Scan Mode
pub type Input9negselW<'a, REG> = crate::FieldWriter<'a, REG, 2, INPUT9NEGSEL, crate::Safe>;
impl<'a, REG> Input9negselW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    ///Selects ADCn_INPUT8 as negative channel input
    #[inline(always)]
    pub fn input8(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT9NEGSEL::Input8)
    }
    ///Selects ADCn_INPUT10 as negative channel input
    #[inline(always)]
    pub fn input10(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT9NEGSEL::Input10)
    }
    ///Selects ADCn_INPUT12 as negative channel input
    #[inline(always)]
    pub fn input12(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT9NEGSEL::Input12)
    }
    ///Selects ADCn_INPUT14 as negative channel input
    #[inline(always)]
    pub fn input14(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT9NEGSEL::Input14)
    }
}
///Negative Input Select Register for ADCn_INPUT11 in Differential Scan Mode
///
///Value on reset: 2
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum INPUT11NEGSEL {
    ///0: Selects ADCn_INPUT8 as negative channel input
    Input8 = 0,
    ///1: Selects ADCn_INPUT10 as negative channel input
    Input10 = 1,
    ///2: Selects ADCn_INPUT12 as negative channel input
    Input12 = 2,
    ///3: Selects ADCn_INPUT14 as negative channel input
    Input14 = 3,
}
impl From<INPUT11NEGSEL> for u8 {
    #[inline(always)]
    fn from(variant: INPUT11NEGSEL) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for INPUT11NEGSEL {
    type Ux = u8;
}
impl crate::IsEnum for INPUT11NEGSEL {}
///Field `INPUT11NEGSEL` reader - Negative Input Select Register for ADCn_INPUT11 in Differential Scan Mode
pub type Input11negselR = crate::FieldReader<INPUT11NEGSEL>;
impl Input11negselR {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> INPUT11NEGSEL {
        match self.bits {
            0 => INPUT11NEGSEL::Input8,
            1 => INPUT11NEGSEL::Input10,
            2 => INPUT11NEGSEL::Input12,
            3 => INPUT11NEGSEL::Input14,
            _ => unreachable!(),
        }
    }
    ///Selects ADCn_INPUT8 as negative channel input
    #[inline(always)]
    pub fn is_input8(&self) -> bool {
        *self == INPUT11NEGSEL::Input8
    }
    ///Selects ADCn_INPUT10 as negative channel input
    #[inline(always)]
    pub fn is_input10(&self) -> bool {
        *self == INPUT11NEGSEL::Input10
    }
    ///Selects ADCn_INPUT12 as negative channel input
    #[inline(always)]
    pub fn is_input12(&self) -> bool {
        *self == INPUT11NEGSEL::Input12
    }
    ///Selects ADCn_INPUT14 as negative channel input
    #[inline(always)]
    pub fn is_input14(&self) -> bool {
        *self == INPUT11NEGSEL::Input14
    }
}
///Field `INPUT11NEGSEL` writer - Negative Input Select Register for ADCn_INPUT11 in Differential Scan Mode
pub type Input11negselW<'a, REG> = crate::FieldWriter<'a, REG, 2, INPUT11NEGSEL, crate::Safe>;
impl<'a, REG> Input11negselW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    ///Selects ADCn_INPUT8 as negative channel input
    #[inline(always)]
    pub fn input8(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT11NEGSEL::Input8)
    }
    ///Selects ADCn_INPUT10 as negative channel input
    #[inline(always)]
    pub fn input10(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT11NEGSEL::Input10)
    }
    ///Selects ADCn_INPUT12 as negative channel input
    #[inline(always)]
    pub fn input12(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT11NEGSEL::Input12)
    }
    ///Selects ADCn_INPUT14 as negative channel input
    #[inline(always)]
    pub fn input14(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT11NEGSEL::Input14)
    }
}
///Negative Input Select Register for ADCn_INPUT13 in Differential Scan Mode
///
///Value on reset: 3
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum INPUT13NEGSEL {
    ///0: Selects ADCn_INPUT8 as negative channel input
    Input8 = 0,
    ///1: Selects ADCn_INPUT10 as negative channel input
    Input10 = 1,
    ///2: Selects ADCn_INPUT12 as negative channel input
    Input12 = 2,
    ///3: Selects ADCn_INPUT14 as negative channel input
    Input14 = 3,
}
impl From<INPUT13NEGSEL> for u8 {
    #[inline(always)]
    fn from(variant: INPUT13NEGSEL) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for INPUT13NEGSEL {
    type Ux = u8;
}
impl crate::IsEnum for INPUT13NEGSEL {}
///Field `INPUT13NEGSEL` reader - Negative Input Select Register for ADCn_INPUT13 in Differential Scan Mode
pub type Input13negselR = crate::FieldReader<INPUT13NEGSEL>;
impl Input13negselR {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> INPUT13NEGSEL {
        match self.bits {
            0 => INPUT13NEGSEL::Input8,
            1 => INPUT13NEGSEL::Input10,
            2 => INPUT13NEGSEL::Input12,
            3 => INPUT13NEGSEL::Input14,
            _ => unreachable!(),
        }
    }
    ///Selects ADCn_INPUT8 as negative channel input
    #[inline(always)]
    pub fn is_input8(&self) -> bool {
        *self == INPUT13NEGSEL::Input8
    }
    ///Selects ADCn_INPUT10 as negative channel input
    #[inline(always)]
    pub fn is_input10(&self) -> bool {
        *self == INPUT13NEGSEL::Input10
    }
    ///Selects ADCn_INPUT12 as negative channel input
    #[inline(always)]
    pub fn is_input12(&self) -> bool {
        *self == INPUT13NEGSEL::Input12
    }
    ///Selects ADCn_INPUT14 as negative channel input
    #[inline(always)]
    pub fn is_input14(&self) -> bool {
        *self == INPUT13NEGSEL::Input14
    }
}
///Field `INPUT13NEGSEL` writer - Negative Input Select Register for ADCn_INPUT13 in Differential Scan Mode
pub type Input13negselW<'a, REG> = crate::FieldWriter<'a, REG, 2, INPUT13NEGSEL, crate::Safe>;
impl<'a, REG> Input13negselW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    ///Selects ADCn_INPUT8 as negative channel input
    #[inline(always)]
    pub fn input8(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT13NEGSEL::Input8)
    }
    ///Selects ADCn_INPUT10 as negative channel input
    #[inline(always)]
    pub fn input10(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT13NEGSEL::Input10)
    }
    ///Selects ADCn_INPUT12 as negative channel input
    #[inline(always)]
    pub fn input12(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT13NEGSEL::Input12)
    }
    ///Selects ADCn_INPUT14 as negative channel input
    #[inline(always)]
    pub fn input14(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT13NEGSEL::Input14)
    }
}
///Negative Input Select Register for ADCn_INPUT15 in Differential Scan Mode
///
///Value on reset: 0
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum INPUT15NEGSEL {
    ///0: Selects ADCn_INPUT8 as negative channel input
    Input8 = 0,
    ///1: Selects ADCn_INPUT10 as negative channel input
    Input10 = 1,
    ///2: Selects ADCn_INPUT12 as negative channel input
    Input12 = 2,
    ///3: Selects ADCn_INPUT14 as negative channel input
    Input14 = 3,
}
impl From<INPUT15NEGSEL> for u8 {
    #[inline(always)]
    fn from(variant: INPUT15NEGSEL) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for INPUT15NEGSEL {
    type Ux = u8;
}
impl crate::IsEnum for INPUT15NEGSEL {}
///Field `INPUT15NEGSEL` reader - Negative Input Select Register for ADCn_INPUT15 in Differential Scan Mode
pub type Input15negselR = crate::FieldReader<INPUT15NEGSEL>;
impl Input15negselR {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> INPUT15NEGSEL {
        match self.bits {
            0 => INPUT15NEGSEL::Input8,
            1 => INPUT15NEGSEL::Input10,
            2 => INPUT15NEGSEL::Input12,
            3 => INPUT15NEGSEL::Input14,
            _ => unreachable!(),
        }
    }
    ///Selects ADCn_INPUT8 as negative channel input
    #[inline(always)]
    pub fn is_input8(&self) -> bool {
        *self == INPUT15NEGSEL::Input8
    }
    ///Selects ADCn_INPUT10 as negative channel input
    #[inline(always)]
    pub fn is_input10(&self) -> bool {
        *self == INPUT15NEGSEL::Input10
    }
    ///Selects ADCn_INPUT12 as negative channel input
    #[inline(always)]
    pub fn is_input12(&self) -> bool {
        *self == INPUT15NEGSEL::Input12
    }
    ///Selects ADCn_INPUT14 as negative channel input
    #[inline(always)]
    pub fn is_input14(&self) -> bool {
        *self == INPUT15NEGSEL::Input14
    }
}
///Field `INPUT15NEGSEL` writer - Negative Input Select Register for ADCn_INPUT15 in Differential Scan Mode
pub type Input15negselW<'a, REG> = crate::FieldWriter<'a, REG, 2, INPUT15NEGSEL, crate::Safe>;
impl<'a, REG> Input15negselW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    ///Selects ADCn_INPUT8 as negative channel input
    #[inline(always)]
    pub fn input8(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT15NEGSEL::Input8)
    }
    ///Selects ADCn_INPUT10 as negative channel input
    #[inline(always)]
    pub fn input10(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT15NEGSEL::Input10)
    }
    ///Selects ADCn_INPUT12 as negative channel input
    #[inline(always)]
    pub fn input12(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT15NEGSEL::Input12)
    }
    ///Selects ADCn_INPUT14 as negative channel input
    #[inline(always)]
    pub fn input14(self) -> &'a mut crate::W<REG> {
        self.variant(INPUT15NEGSEL::Input14)
    }
}
impl R {
    ///Bits 0:1 - Negative Input Select Register for ADCn_INPUT0 in Differential Scan Mode
    #[inline(always)]
    pub fn input0negsel(&self) -> Input0negselR {
        Input0negselR::new((self.bits & 3) as u8)
    }
    ///Bits 2:3 - Negative Input Select Register for ADCn_INPUT2 in Differential Scan Mode
    #[inline(always)]
    pub fn input2negsel(&self) -> Input2negselR {
        Input2negselR::new(((self.bits >> 2) & 3) as u8)
    }
    ///Bits 4:5 - Negative Input Select Register for ADCn_INPUT4 in Differential Scan Mode
    #[inline(always)]
    pub fn input4negsel(&self) -> Input4negselR {
        Input4negselR::new(((self.bits >> 4) & 3) as u8)
    }
    ///Bits 6:7 - Negative Input Select Register for ADCn_INPUT1 in Differential Scan Mode
    #[inline(always)]
    pub fn input6negsel(&self) -> Input6negselR {
        Input6negselR::new(((self.bits >> 6) & 3) as u8)
    }
    ///Bits 8:9 - Negative Input Select Register for ADCn_INPUT9 in Differential Scan Mode
    #[inline(always)]
    pub fn input9negsel(&self) -> Input9negselR {
        Input9negselR::new(((self.bits >> 8) & 3) as u8)
    }
    ///Bits 10:11 - Negative Input Select Register for ADCn_INPUT11 in Differential Scan Mode
    #[inline(always)]
    pub fn input11negsel(&self) -> Input11negselR {
        Input11negselR::new(((self.bits >> 10) & 3) as u8)
    }
    ///Bits 12:13 - Negative Input Select Register for ADCn_INPUT13 in Differential Scan Mode
    #[inline(always)]
    pub fn input13negsel(&self) -> Input13negselR {
        Input13negselR::new(((self.bits >> 12) & 3) as u8)
    }
    ///Bits 14:15 - Negative Input Select Register for ADCn_INPUT15 in Differential Scan Mode
    #[inline(always)]
    pub fn input15negsel(&self) -> Input15negselR {
        Input15negselR::new(((self.bits >> 14) & 3) as u8)
    }
}
impl core::fmt::Debug for R {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        f.debug_struct("SCANNEGSEL")
            .field("input0negsel", &self.input0negsel())
            .field("input2negsel", &self.input2negsel())
            .field("input4negsel", &self.input4negsel())
            .field("input6negsel", &self.input6negsel())
            .field("input9negsel", &self.input9negsel())
            .field("input11negsel", &self.input11negsel())
            .field("input13negsel", &self.input13negsel())
            .field("input15negsel", &self.input15negsel())
            .finish()
    }
}
impl W {
    ///Bits 0:1 - Negative Input Select Register for ADCn_INPUT0 in Differential Scan Mode
    #[inline(always)]
    pub fn input0negsel(&mut self) -> Input0negselW<'_, SCANNEGSELrs> {
        Input0negselW::new(self, 0)
    }
    ///Bits 2:3 - Negative Input Select Register for ADCn_INPUT2 in Differential Scan Mode
    #[inline(always)]
    pub fn input2negsel(&mut self) -> Input2negselW<'_, SCANNEGSELrs> {
        Input2negselW::new(self, 2)
    }
    ///Bits 4:5 - Negative Input Select Register for ADCn_INPUT4 in Differential Scan Mode
    #[inline(always)]
    pub fn input4negsel(&mut self) -> Input4negselW<'_, SCANNEGSELrs> {
        Input4negselW::new(self, 4)
    }
    ///Bits 6:7 - Negative Input Select Register for ADCn_INPUT1 in Differential Scan Mode
    #[inline(always)]
    pub fn input6negsel(&mut self) -> Input6negselW<'_, SCANNEGSELrs> {
        Input6negselW::new(self, 6)
    }
    ///Bits 8:9 - Negative Input Select Register for ADCn_INPUT9 in Differential Scan Mode
    #[inline(always)]
    pub fn input9negsel(&mut self) -> Input9negselW<'_, SCANNEGSELrs> {
        Input9negselW::new(self, 8)
    }
    ///Bits 10:11 - Negative Input Select Register for ADCn_INPUT11 in Differential Scan Mode
    #[inline(always)]
    pub fn input11negsel(&mut self) -> Input11negselW<'_, SCANNEGSELrs> {
        Input11negselW::new(self, 10)
    }
    ///Bits 12:13 - Negative Input Select Register for ADCn_INPUT13 in Differential Scan Mode
    #[inline(always)]
    pub fn input13negsel(&mut self) -> Input13negselW<'_, SCANNEGSELrs> {
        Input13negselW::new(self, 12)
    }
    ///Bits 14:15 - Negative Input Select Register for ADCn_INPUT15 in Differential Scan Mode
    #[inline(always)]
    pub fn input15negsel(&mut self) -> Input15negselW<'_, SCANNEGSELrs> {
        Input15negselW::new(self, 14)
    }
}
///Negative Input Select Register for Scan
///
///You can [`read`](crate::Reg::read) this register and get [`scannegsel::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`scannegsel::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
pub struct SCANNEGSELrs;
impl crate::RegisterSpec for SCANNEGSELrs {
    type Ux = u32;
}
///`read()` method returns [`scannegsel::R`](R) reader structure
impl crate::Readable for SCANNEGSELrs {}
///`write(|w| ..)` method takes [`scannegsel::W`](W) writer structure
impl crate::Writable for SCANNEGSELrs {
    type Safety = crate::Unsafe;
}
///`reset()` method sets SCANNEGSEL to value 0x39e4
impl crate::Resettable for SCANNEGSELrs {
    const RESET_VALUE: u32 = 0x39e4;
}