1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
#[doc = "Register `CHCTR[%s]` reader"]
pub type R = crate::R<ChctrSpec>;
#[doc = "Register `CHCTR[%s]` writer"]
pub type W = crate::W<ChctrSpec>;
#[doc = "Input Class Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Iclsel {
    #[doc = "0: Use group-specific class 0"]
    Value1 = 0,
    #[doc = "1: Use group-specific class 1"]
    Value2 = 1,
    #[doc = "2: Use global class 0"]
    Value3 = 2,
    #[doc = "3: Use global class 1"]
    Value4 = 3,
}
impl From<Iclsel> for u8 {
    #[inline(always)]
    fn from(variant: Iclsel) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Iclsel {
    type Ux = u8;
}
#[doc = "Field `ICLSEL` reader - Input Class Select"]
pub type IclselR = crate::FieldReader<Iclsel>;
impl IclselR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Iclsel {
        match self.bits {
            0 => Iclsel::Value1,
            1 => Iclsel::Value2,
            2 => Iclsel::Value3,
            3 => Iclsel::Value4,
            _ => unreachable!(),
        }
    }
    #[doc = "Use group-specific class 0"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Iclsel::Value1
    }
    #[doc = "Use group-specific class 1"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Iclsel::Value2
    }
    #[doc = "Use global class 0"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == Iclsel::Value3
    }
    #[doc = "Use global class 1"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == Iclsel::Value4
    }
}
#[doc = "Field `ICLSEL` writer - Input Class Select"]
pub type IclselW<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, Iclsel>;
impl<'a, REG> IclselW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Use group-specific class 0"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Iclsel::Value1)
    }
    #[doc = "Use group-specific class 1"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Iclsel::Value2)
    }
    #[doc = "Use global class 0"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(Iclsel::Value3)
    }
    #[doc = "Use global class 1"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(Iclsel::Value4)
    }
}
#[doc = "Lower Boundary Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Bndsell {
    #[doc = "0: Use group-specific boundary 0"]
    Value1 = 0,
    #[doc = "1: Use group-specific boundary 1"]
    Value2 = 1,
    #[doc = "2: Use global boundary 0"]
    Value3 = 2,
    #[doc = "3: Use global boundary 1"]
    Value4 = 3,
}
impl From<Bndsell> for u8 {
    #[inline(always)]
    fn from(variant: Bndsell) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Bndsell {
    type Ux = u8;
}
#[doc = "Field `BNDSELL` reader - Lower Boundary Select"]
pub type BndsellR = crate::FieldReader<Bndsell>;
impl BndsellR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Bndsell {
        match self.bits {
            0 => Bndsell::Value1,
            1 => Bndsell::Value2,
            2 => Bndsell::Value3,
            3 => Bndsell::Value4,
            _ => unreachable!(),
        }
    }
    #[doc = "Use group-specific boundary 0"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Bndsell::Value1
    }
    #[doc = "Use group-specific boundary 1"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Bndsell::Value2
    }
    #[doc = "Use global boundary 0"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == Bndsell::Value3
    }
    #[doc = "Use global boundary 1"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == Bndsell::Value4
    }
}
#[doc = "Field `BNDSELL` writer - Lower Boundary Select"]
pub type BndsellW<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, Bndsell>;
impl<'a, REG> BndsellW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Use group-specific boundary 0"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Bndsell::Value1)
    }
    #[doc = "Use group-specific boundary 1"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Bndsell::Value2)
    }
    #[doc = "Use global boundary 0"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(Bndsell::Value3)
    }
    #[doc = "Use global boundary 1"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(Bndsell::Value4)
    }
}
#[doc = "Upper Boundary Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Bndselu {
    #[doc = "0: Use group-specific boundary 0"]
    Value1 = 0,
    #[doc = "1: Use group-specific boundary 1"]
    Value2 = 1,
    #[doc = "2: Use global boundary 0"]
    Value3 = 2,
    #[doc = "3: Use global boundary 1"]
    Value4 = 3,
}
impl From<Bndselu> for u8 {
    #[inline(always)]
    fn from(variant: Bndselu) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Bndselu {
    type Ux = u8;
}
#[doc = "Field `BNDSELU` reader - Upper Boundary Select"]
pub type BndseluR = crate::FieldReader<Bndselu>;
impl BndseluR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Bndselu {
        match self.bits {
            0 => Bndselu::Value1,
            1 => Bndselu::Value2,
            2 => Bndselu::Value3,
            3 => Bndselu::Value4,
            _ => unreachable!(),
        }
    }
    #[doc = "Use group-specific boundary 0"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Bndselu::Value1
    }
    #[doc = "Use group-specific boundary 1"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Bndselu::Value2
    }
    #[doc = "Use global boundary 0"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == Bndselu::Value3
    }
    #[doc = "Use global boundary 1"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == Bndselu::Value4
    }
}
#[doc = "Field `BNDSELU` writer - Upper Boundary Select"]
pub type BndseluW<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, Bndselu>;
impl<'a, REG> BndseluW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Use group-specific boundary 0"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Bndselu::Value1)
    }
    #[doc = "Use group-specific boundary 1"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Bndselu::Value2)
    }
    #[doc = "Use global boundary 0"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(Bndselu::Value3)
    }
    #[doc = "Use global boundary 1"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(Bndselu::Value4)
    }
}
#[doc = "Channel Event Mode\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Chevmode {
    #[doc = "0: Never"]
    Value1 = 0,
    #[doc = "1: NCM: If result is inside the boundary band FCM: If result becomes high (above cmp. val.)"]
    Value2 = 1,
    #[doc = "2: NCM: If result is outside the boundary band FCM: If result becomes low (below cmp. val.)"]
    Value3 = 2,
    #[doc = "3: NCM: Always (ignore band) FCM: If result switches to either level"]
    Value4 = 3,
}
impl From<Chevmode> for u8 {
    #[inline(always)]
    fn from(variant: Chevmode) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Chevmode {
    type Ux = u8;
}
#[doc = "Field `CHEVMODE` reader - Channel Event Mode"]
pub type ChevmodeR = crate::FieldReader<Chevmode>;
impl ChevmodeR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Chevmode {
        match self.bits {
            0 => Chevmode::Value1,
            1 => Chevmode::Value2,
            2 => Chevmode::Value3,
            3 => Chevmode::Value4,
            _ => unreachable!(),
        }
    }
    #[doc = "Never"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Chevmode::Value1
    }
    #[doc = "NCM: If result is inside the boundary band FCM: If result becomes high (above cmp. val.)"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Chevmode::Value2
    }
    #[doc = "NCM: If result is outside the boundary band FCM: If result becomes low (below cmp. val.)"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == Chevmode::Value3
    }
    #[doc = "NCM: Always (ignore band) FCM: If result switches to either level"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == Chevmode::Value4
    }
}
#[doc = "Field `CHEVMODE` writer - Channel Event Mode"]
pub type ChevmodeW<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, Chevmode>;
impl<'a, REG> ChevmodeW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Never"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Chevmode::Value1)
    }
    #[doc = "NCM: If result is inside the boundary band FCM: If result becomes high (above cmp. val.)"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Chevmode::Value2)
    }
    #[doc = "NCM: If result is outside the boundary band FCM: If result becomes low (below cmp. val.)"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(Chevmode::Value3)
    }
    #[doc = "NCM: Always (ignore band) FCM: If result switches to either level"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(Chevmode::Value4)
    }
}
#[doc = "Synchronization Request\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Sync {
    #[doc = "0: No synchroniz. request, standalone operation"]
    Value1 = 0,
    #[doc = "1: Request a synchronized conversion of this channel (only taken into account for a master)"]
    Value2 = 1,
}
impl From<Sync> for bool {
    #[inline(always)]
    fn from(variant: Sync) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SYNC` reader - Synchronization Request"]
pub type SyncR = crate::BitReader<Sync>;
impl SyncR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Sync {
        match self.bits {
            false => Sync::Value1,
            true => Sync::Value2,
        }
    }
    #[doc = "No synchroniz. request, standalone operation"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Sync::Value1
    }
    #[doc = "Request a synchronized conversion of this channel (only taken into account for a master)"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Sync::Value2
    }
}
#[doc = "Field `SYNC` writer - Synchronization Request"]
pub type SyncW<'a, REG> = crate::BitWriter<'a, REG, Sync>;
impl<'a, REG> SyncW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "No synchroniz. request, standalone operation"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Sync::Value1)
    }
    #[doc = "Request a synchronized conversion of this channel (only taken into account for a master)"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Sync::Value2)
    }
}
#[doc = "Reference Input Selection\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Refsel {
    #[doc = "0: Standard reference input VAREF"]
    Value1 = 0,
    #[doc = "1: Alternate reference input from CH0"]
    Value2 = 1,
}
impl From<Refsel> for bool {
    #[inline(always)]
    fn from(variant: Refsel) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `REFSEL` reader - Reference Input Selection"]
pub type RefselR = crate::BitReader<Refsel>;
impl RefselR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Refsel {
        match self.bits {
            false => Refsel::Value1,
            true => Refsel::Value2,
        }
    }
    #[doc = "Standard reference input VAREF"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Refsel::Value1
    }
    #[doc = "Alternate reference input from CH0"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Refsel::Value2
    }
}
#[doc = "Field `REFSEL` writer - Reference Input Selection"]
pub type RefselW<'a, REG> = crate::BitWriter<'a, REG, Refsel>;
impl<'a, REG> RefselW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Standard reference input VAREF"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Refsel::Value1)
    }
    #[doc = "Alternate reference input from CH0"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Refsel::Value2)
    }
}
#[doc = "Result Register\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Resreg {
    #[doc = "0: Store result in group result register GxRES0"]
    Value1 = 0,
    #[doc = "15: Store result in group result register GxRES15"]
    Value2 = 15,
}
impl From<Resreg> for u8 {
    #[inline(always)]
    fn from(variant: Resreg) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Resreg {
    type Ux = u8;
}
#[doc = "Field `RESREG` reader - Result Register"]
pub type ResregR = crate::FieldReader<Resreg>;
impl ResregR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<Resreg> {
        match self.bits {
            0 => Some(Resreg::Value1),
            15 => Some(Resreg::Value2),
            _ => None,
        }
    }
    #[doc = "Store result in group result register GxRES0"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Resreg::Value1
    }
    #[doc = "Store result in group result register GxRES15"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Resreg::Value2
    }
}
#[doc = "Field `RESREG` writer - Result Register"]
pub type ResregW<'a, REG> = crate::FieldWriter<'a, REG, 4, Resreg>;
impl<'a, REG> ResregW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Store result in group result register GxRES0"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Resreg::Value1)
    }
    #[doc = "Store result in group result register GxRES15"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Resreg::Value2)
    }
}
#[doc = "Result Target for Background Source\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Restbs {
    #[doc = "0: Store results in the selected group result register"]
    Value1 = 0,
    #[doc = "1: Store results in the global result register"]
    Value2 = 1,
}
impl From<Restbs> for bool {
    #[inline(always)]
    fn from(variant: Restbs) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `RESTBS` reader - Result Target for Background Source"]
pub type RestbsR = crate::BitReader<Restbs>;
impl RestbsR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Restbs {
        match self.bits {
            false => Restbs::Value1,
            true => Restbs::Value2,
        }
    }
    #[doc = "Store results in the selected group result register"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Restbs::Value1
    }
    #[doc = "Store results in the global result register"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Restbs::Value2
    }
}
#[doc = "Field `RESTBS` writer - Result Target for Background Source"]
pub type RestbsW<'a, REG> = crate::BitWriter<'a, REG, Restbs>;
impl<'a, REG> RestbsW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Store results in the selected group result register"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Restbs::Value1)
    }
    #[doc = "Store results in the global result register"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Restbs::Value2)
    }
}
#[doc = "Result Position\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Respos {
    #[doc = "0: Store results left-aligned"]
    Value1 = 0,
    #[doc = "1: Store results right-aligned"]
    Value2 = 1,
}
impl From<Respos> for bool {
    #[inline(always)]
    fn from(variant: Respos) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `RESPOS` reader - Result Position"]
pub type ResposR = crate::BitReader<Respos>;
impl ResposR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Respos {
        match self.bits {
            false => Respos::Value1,
            true => Respos::Value2,
        }
    }
    #[doc = "Store results left-aligned"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Respos::Value1
    }
    #[doc = "Store results right-aligned"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Respos::Value2
    }
}
#[doc = "Field `RESPOS` writer - Result Position"]
pub type ResposW<'a, REG> = crate::BitWriter<'a, REG, Respos>;
impl<'a, REG> ResposW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Store results left-aligned"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Respos::Value1)
    }
    #[doc = "Store results right-aligned"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Respos::Value2)
    }
}
#[doc = "Broken Wire Detection Channel\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Bwdch {
    #[doc = "0: Select VAGND"]
    Value1 = 0,
    #[doc = "1: Select VAREF"]
    Value2 = 1,
}
impl From<Bwdch> for u8 {
    #[inline(always)]
    fn from(variant: Bwdch) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Bwdch {
    type Ux = u8;
}
#[doc = "Field `BWDCH` reader - Broken Wire Detection Channel"]
pub type BwdchR = crate::FieldReader<Bwdch>;
impl BwdchR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Option<Bwdch> {
        match self.bits {
            0 => Some(Bwdch::Value1),
            1 => Some(Bwdch::Value2),
            _ => None,
        }
    }
    #[doc = "Select VAGND"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Bwdch::Value1
    }
    #[doc = "Select VAREF"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Bwdch::Value2
    }
}
#[doc = "Field `BWDCH` writer - Broken Wire Detection Channel"]
pub type BwdchW<'a, REG> = crate::FieldWriter<'a, REG, 2, Bwdch>;
impl<'a, REG> BwdchW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Select VAGND"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Bwdch::Value1)
    }
    #[doc = "Select VAREF"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Bwdch::Value2)
    }
}
#[doc = "Broken Wire Detection Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Bwden {
    #[doc = "0: Normal operation"]
    Value1 = 0,
    #[doc = "1: Additional preparation phase is enabled"]
    Value2 = 1,
}
impl From<Bwden> for bool {
    #[inline(always)]
    fn from(variant: Bwden) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `BWDEN` reader - Broken Wire Detection Enable"]
pub type BwdenR = crate::BitReader<Bwden>;
impl BwdenR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Bwden {
        match self.bits {
            false => Bwden::Value1,
            true => Bwden::Value2,
        }
    }
    #[doc = "Normal operation"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Bwden::Value1
    }
    #[doc = "Additional preparation phase is enabled"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Bwden::Value2
    }
}
#[doc = "Field `BWDEN` writer - Broken Wire Detection Enable"]
pub type BwdenW<'a, REG> = crate::BitWriter<'a, REG, Bwden>;
impl<'a, REG> BwdenW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Normal operation"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Bwden::Value1)
    }
    #[doc = "Additional preparation phase is enabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Bwden::Value2)
    }
}
impl R {
    #[doc = "Bits 0:1 - Input Class Select"]
    #[inline(always)]
    pub fn iclsel(&self) -> IclselR {
        IclselR::new((self.bits & 3) as u8)
    }
    #[doc = "Bits 4:5 - Lower Boundary Select"]
    #[inline(always)]
    pub fn bndsell(&self) -> BndsellR {
        BndsellR::new(((self.bits >> 4) & 3) as u8)
    }
    #[doc = "Bits 6:7 - Upper Boundary Select"]
    #[inline(always)]
    pub fn bndselu(&self) -> BndseluR {
        BndseluR::new(((self.bits >> 6) & 3) as u8)
    }
    #[doc = "Bits 8:9 - Channel Event Mode"]
    #[inline(always)]
    pub fn chevmode(&self) -> ChevmodeR {
        ChevmodeR::new(((self.bits >> 8) & 3) as u8)
    }
    #[doc = "Bit 10 - Synchronization Request"]
    #[inline(always)]
    pub fn sync(&self) -> SyncR {
        SyncR::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bit 11 - Reference Input Selection"]
    #[inline(always)]
    pub fn refsel(&self) -> RefselR {
        RefselR::new(((self.bits >> 11) & 1) != 0)
    }
    #[doc = "Bits 16:19 - Result Register"]
    #[inline(always)]
    pub fn resreg(&self) -> ResregR {
        ResregR::new(((self.bits >> 16) & 0x0f) as u8)
    }
    #[doc = "Bit 20 - Result Target for Background Source"]
    #[inline(always)]
    pub fn restbs(&self) -> RestbsR {
        RestbsR::new(((self.bits >> 20) & 1) != 0)
    }
    #[doc = "Bit 21 - Result Position"]
    #[inline(always)]
    pub fn respos(&self) -> ResposR {
        ResposR::new(((self.bits >> 21) & 1) != 0)
    }
    #[doc = "Bits 28:29 - Broken Wire Detection Channel"]
    #[inline(always)]
    pub fn bwdch(&self) -> BwdchR {
        BwdchR::new(((self.bits >> 28) & 3) as u8)
    }
    #[doc = "Bit 30 - Broken Wire Detection Enable"]
    #[inline(always)]
    pub fn bwden(&self) -> BwdenR {
        BwdenR::new(((self.bits >> 30) & 1) != 0)
    }
}
impl W {
    #[doc = "Bits 0:1 - Input Class Select"]
    #[inline(always)]
    #[must_use]
    pub fn iclsel(&mut self) -> IclselW<ChctrSpec> {
        IclselW::new(self, 0)
    }
    #[doc = "Bits 4:5 - Lower Boundary Select"]
    #[inline(always)]
    #[must_use]
    pub fn bndsell(&mut self) -> BndsellW<ChctrSpec> {
        BndsellW::new(self, 4)
    }
    #[doc = "Bits 6:7 - Upper Boundary Select"]
    #[inline(always)]
    #[must_use]
    pub fn bndselu(&mut self) -> BndseluW<ChctrSpec> {
        BndseluW::new(self, 6)
    }
    #[doc = "Bits 8:9 - Channel Event Mode"]
    #[inline(always)]
    #[must_use]
    pub fn chevmode(&mut self) -> ChevmodeW<ChctrSpec> {
        ChevmodeW::new(self, 8)
    }
    #[doc = "Bit 10 - Synchronization Request"]
    #[inline(always)]
    #[must_use]
    pub fn sync(&mut self) -> SyncW<ChctrSpec> {
        SyncW::new(self, 10)
    }
    #[doc = "Bit 11 - Reference Input Selection"]
    #[inline(always)]
    #[must_use]
    pub fn refsel(&mut self) -> RefselW<ChctrSpec> {
        RefselW::new(self, 11)
    }
    #[doc = "Bits 16:19 - Result Register"]
    #[inline(always)]
    #[must_use]
    pub fn resreg(&mut self) -> ResregW<ChctrSpec> {
        ResregW::new(self, 16)
    }
    #[doc = "Bit 20 - Result Target for Background Source"]
    #[inline(always)]
    #[must_use]
    pub fn restbs(&mut self) -> RestbsW<ChctrSpec> {
        RestbsW::new(self, 20)
    }
    #[doc = "Bit 21 - Result Position"]
    #[inline(always)]
    #[must_use]
    pub fn respos(&mut self) -> ResposW<ChctrSpec> {
        ResposW::new(self, 21)
    }
    #[doc = "Bits 28:29 - Broken Wire Detection Channel"]
    #[inline(always)]
    #[must_use]
    pub fn bwdch(&mut self) -> BwdchW<ChctrSpec> {
        BwdchW::new(self, 28)
    }
    #[doc = "Bit 30 - Broken Wire Detection Enable"]
    #[inline(always)]
    #[must_use]
    pub fn bwden(&mut self) -> BwdenW<ChctrSpec> {
        BwdenW::new(self, 30)
    }
}
#[doc = "Channel Ctrl. Reg.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`chctr::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`chctr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct ChctrSpec;
impl crate::RegisterSpec for ChctrSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`chctr::R`](R) reader structure"]
impl crate::Readable for ChctrSpec {}
#[doc = "`write(|w| ..)` method takes [`chctr::W`](W) writer structure"]
impl crate::Writable for ChctrSpec {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets CHCTR[%s]
to value 0"]
impl crate::Resettable for ChctrSpec {
    const RESET_VALUE: u32 = 0;
}