cc430f5137 0.1.0

Peripheral access API for CC430F5137 microcontroller
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
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
#[doc = "Register `CBCTL2` reader"]
pub type R = crate::R<Cbctl2Spec>;
#[doc = "Register `CBCTL2` writer"]
pub type W = crate::W<Cbctl2Spec>;
#[doc = "Comp. B Reference 0 Resistor Select Bit : 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Cbref0 {
    #[doc = "0: Comp. B Int. Ref.0 Select 0 : 1/32"]
    Cbref0_0 = 0,
    #[doc = "1: Comp. B Int. Ref.0 Select 1 : 2/32"]
    Cbref0_1 = 1,
    #[doc = "2: Comp. B Int. Ref.0 Select 2 : 3/32"]
    Cbref0_2 = 2,
    #[doc = "3: Comp. B Int. Ref.0 Select 3 : 4/32"]
    Cbref0_3 = 3,
    #[doc = "4: Comp. B Int. Ref.0 Select 4 : 5/32"]
    Cbref0_4 = 4,
    #[doc = "5: Comp. B Int. Ref.0 Select 5 : 6/32"]
    Cbref0_5 = 5,
    #[doc = "6: Comp. B Int. Ref.0 Select 6 : 7/32"]
    Cbref0_6 = 6,
    #[doc = "7: Comp. B Int. Ref.0 Select 7 : 8/32"]
    Cbref0_7 = 7,
    #[doc = "8: Comp. B Int. Ref.0 Select 0 : 9/32"]
    Cbref0_8 = 8,
    #[doc = "9: Comp. B Int. Ref.0 Select 1 : 10/32"]
    Cbref0_9 = 9,
    #[doc = "10: Comp. B Int. Ref.0 Select 2 : 11/32"]
    Cbref0_10 = 10,
    #[doc = "11: Comp. B Int. Ref.0 Select 3 : 12/32"]
    Cbref0_11 = 11,
    #[doc = "12: Comp. B Int. Ref.0 Select 4 : 13/32"]
    Cbref0_12 = 12,
    #[doc = "13: Comp. B Int. Ref.0 Select 5 : 14/32"]
    Cbref0_13 = 13,
    #[doc = "14: Comp. B Int. Ref.0 Select 6 : 15/32"]
    Cbref0_14 = 14,
    #[doc = "15: Comp. B Int. Ref.0 Select 7 : 16/32"]
    Cbref0_15 = 15,
    #[doc = "16: Comp. B Int. Ref.0 Select 0 : 17/32"]
    Cbref0_16 = 16,
    #[doc = "17: Comp. B Int. Ref.0 Select 1 : 18/32"]
    Cbref0_17 = 17,
    #[doc = "18: Comp. B Int. Ref.0 Select 2 : 19/32"]
    Cbref0_18 = 18,
    #[doc = "19: Comp. B Int. Ref.0 Select 3 : 20/32"]
    Cbref0_19 = 19,
    #[doc = "20: Comp. B Int. Ref.0 Select 4 : 21/32"]
    Cbref0_20 = 20,
    #[doc = "21: Comp. B Int. Ref.0 Select 5 : 22/32"]
    Cbref0_21 = 21,
    #[doc = "22: Comp. B Int. Ref.0 Select 6 : 23/32"]
    Cbref0_22 = 22,
    #[doc = "23: Comp. B Int. Ref.0 Select 7 : 24/32"]
    Cbref0_23 = 23,
    #[doc = "24: Comp. B Int. Ref.0 Select 0 : 25/32"]
    Cbref0_24 = 24,
    #[doc = "25: Comp. B Int. Ref.0 Select 1 : 26/32"]
    Cbref0_25 = 25,
    #[doc = "26: Comp. B Int. Ref.0 Select 2 : 27/32"]
    Cbref0_26 = 26,
    #[doc = "27: Comp. B Int. Ref.0 Select 3 : 28/32"]
    Cbref0_27 = 27,
    #[doc = "28: Comp. B Int. Ref.0 Select 4 : 29/32"]
    Cbref0_28 = 28,
    #[doc = "29: Comp. B Int. Ref.0 Select 5 : 30/32"]
    Cbref0_29 = 29,
    #[doc = "30: Comp. B Int. Ref.0 Select 6 : 31/32"]
    Cbref0_30 = 30,
    #[doc = "31: Comp. B Int. Ref.0 Select 7 : 32/32"]
    Cbref0_31 = 31,
}
impl From<Cbref0> for u8 {
    #[inline(always)]
    fn from(variant: Cbref0) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Cbref0 {
    type Ux = u8;
}
impl crate::IsEnum for Cbref0 {}
#[doc = "Field `CBREF0` reader - Comp. B Reference 0 Resistor Select Bit : 0"]
pub type Cbref0R = crate::FieldReader<Cbref0>;
impl Cbref0R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Cbref0 {
        match self.bits {
            0 => Cbref0::Cbref0_0,
            1 => Cbref0::Cbref0_1,
            2 => Cbref0::Cbref0_2,
            3 => Cbref0::Cbref0_3,
            4 => Cbref0::Cbref0_4,
            5 => Cbref0::Cbref0_5,
            6 => Cbref0::Cbref0_6,
            7 => Cbref0::Cbref0_7,
            8 => Cbref0::Cbref0_8,
            9 => Cbref0::Cbref0_9,
            10 => Cbref0::Cbref0_10,
            11 => Cbref0::Cbref0_11,
            12 => Cbref0::Cbref0_12,
            13 => Cbref0::Cbref0_13,
            14 => Cbref0::Cbref0_14,
            15 => Cbref0::Cbref0_15,
            16 => Cbref0::Cbref0_16,
            17 => Cbref0::Cbref0_17,
            18 => Cbref0::Cbref0_18,
            19 => Cbref0::Cbref0_19,
            20 => Cbref0::Cbref0_20,
            21 => Cbref0::Cbref0_21,
            22 => Cbref0::Cbref0_22,
            23 => Cbref0::Cbref0_23,
            24 => Cbref0::Cbref0_24,
            25 => Cbref0::Cbref0_25,
            26 => Cbref0::Cbref0_26,
            27 => Cbref0::Cbref0_27,
            28 => Cbref0::Cbref0_28,
            29 => Cbref0::Cbref0_29,
            30 => Cbref0::Cbref0_30,
            31 => Cbref0::Cbref0_31,
            _ => unreachable!(),
        }
    }
    #[doc = "Comp. B Int. Ref.0 Select 0 : 1/32"]
    #[inline(always)]
    pub fn is_cbref0_0(&self) -> bool {
        *self == Cbref0::Cbref0_0
    }
    #[doc = "Comp. B Int. Ref.0 Select 1 : 2/32"]
    #[inline(always)]
    pub fn is_cbref0_1(&self) -> bool {
        *self == Cbref0::Cbref0_1
    }
    #[doc = "Comp. B Int. Ref.0 Select 2 : 3/32"]
    #[inline(always)]
    pub fn is_cbref0_2(&self) -> bool {
        *self == Cbref0::Cbref0_2
    }
    #[doc = "Comp. B Int. Ref.0 Select 3 : 4/32"]
    #[inline(always)]
    pub fn is_cbref0_3(&self) -> bool {
        *self == Cbref0::Cbref0_3
    }
    #[doc = "Comp. B Int. Ref.0 Select 4 : 5/32"]
    #[inline(always)]
    pub fn is_cbref0_4(&self) -> bool {
        *self == Cbref0::Cbref0_4
    }
    #[doc = "Comp. B Int. Ref.0 Select 5 : 6/32"]
    #[inline(always)]
    pub fn is_cbref0_5(&self) -> bool {
        *self == Cbref0::Cbref0_5
    }
    #[doc = "Comp. B Int. Ref.0 Select 6 : 7/32"]
    #[inline(always)]
    pub fn is_cbref0_6(&self) -> bool {
        *self == Cbref0::Cbref0_6
    }
    #[doc = "Comp. B Int. Ref.0 Select 7 : 8/32"]
    #[inline(always)]
    pub fn is_cbref0_7(&self) -> bool {
        *self == Cbref0::Cbref0_7
    }
    #[doc = "Comp. B Int. Ref.0 Select 0 : 9/32"]
    #[inline(always)]
    pub fn is_cbref0_8(&self) -> bool {
        *self == Cbref0::Cbref0_8
    }
    #[doc = "Comp. B Int. Ref.0 Select 1 : 10/32"]
    #[inline(always)]
    pub fn is_cbref0_9(&self) -> bool {
        *self == Cbref0::Cbref0_9
    }
    #[doc = "Comp. B Int. Ref.0 Select 2 : 11/32"]
    #[inline(always)]
    pub fn is_cbref0_10(&self) -> bool {
        *self == Cbref0::Cbref0_10
    }
    #[doc = "Comp. B Int. Ref.0 Select 3 : 12/32"]
    #[inline(always)]
    pub fn is_cbref0_11(&self) -> bool {
        *self == Cbref0::Cbref0_11
    }
    #[doc = "Comp. B Int. Ref.0 Select 4 : 13/32"]
    #[inline(always)]
    pub fn is_cbref0_12(&self) -> bool {
        *self == Cbref0::Cbref0_12
    }
    #[doc = "Comp. B Int. Ref.0 Select 5 : 14/32"]
    #[inline(always)]
    pub fn is_cbref0_13(&self) -> bool {
        *self == Cbref0::Cbref0_13
    }
    #[doc = "Comp. B Int. Ref.0 Select 6 : 15/32"]
    #[inline(always)]
    pub fn is_cbref0_14(&self) -> bool {
        *self == Cbref0::Cbref0_14
    }
    #[doc = "Comp. B Int. Ref.0 Select 7 : 16/32"]
    #[inline(always)]
    pub fn is_cbref0_15(&self) -> bool {
        *self == Cbref0::Cbref0_15
    }
    #[doc = "Comp. B Int. Ref.0 Select 0 : 17/32"]
    #[inline(always)]
    pub fn is_cbref0_16(&self) -> bool {
        *self == Cbref0::Cbref0_16
    }
    #[doc = "Comp. B Int. Ref.0 Select 1 : 18/32"]
    #[inline(always)]
    pub fn is_cbref0_17(&self) -> bool {
        *self == Cbref0::Cbref0_17
    }
    #[doc = "Comp. B Int. Ref.0 Select 2 : 19/32"]
    #[inline(always)]
    pub fn is_cbref0_18(&self) -> bool {
        *self == Cbref0::Cbref0_18
    }
    #[doc = "Comp. B Int. Ref.0 Select 3 : 20/32"]
    #[inline(always)]
    pub fn is_cbref0_19(&self) -> bool {
        *self == Cbref0::Cbref0_19
    }
    #[doc = "Comp. B Int. Ref.0 Select 4 : 21/32"]
    #[inline(always)]
    pub fn is_cbref0_20(&self) -> bool {
        *self == Cbref0::Cbref0_20
    }
    #[doc = "Comp. B Int. Ref.0 Select 5 : 22/32"]
    #[inline(always)]
    pub fn is_cbref0_21(&self) -> bool {
        *self == Cbref0::Cbref0_21
    }
    #[doc = "Comp. B Int. Ref.0 Select 6 : 23/32"]
    #[inline(always)]
    pub fn is_cbref0_22(&self) -> bool {
        *self == Cbref0::Cbref0_22
    }
    #[doc = "Comp. B Int. Ref.0 Select 7 : 24/32"]
    #[inline(always)]
    pub fn is_cbref0_23(&self) -> bool {
        *self == Cbref0::Cbref0_23
    }
    #[doc = "Comp. B Int. Ref.0 Select 0 : 25/32"]
    #[inline(always)]
    pub fn is_cbref0_24(&self) -> bool {
        *self == Cbref0::Cbref0_24
    }
    #[doc = "Comp. B Int. Ref.0 Select 1 : 26/32"]
    #[inline(always)]
    pub fn is_cbref0_25(&self) -> bool {
        *self == Cbref0::Cbref0_25
    }
    #[doc = "Comp. B Int. Ref.0 Select 2 : 27/32"]
    #[inline(always)]
    pub fn is_cbref0_26(&self) -> bool {
        *self == Cbref0::Cbref0_26
    }
    #[doc = "Comp. B Int. Ref.0 Select 3 : 28/32"]
    #[inline(always)]
    pub fn is_cbref0_27(&self) -> bool {
        *self == Cbref0::Cbref0_27
    }
    #[doc = "Comp. B Int. Ref.0 Select 4 : 29/32"]
    #[inline(always)]
    pub fn is_cbref0_28(&self) -> bool {
        *self == Cbref0::Cbref0_28
    }
    #[doc = "Comp. B Int. Ref.0 Select 5 : 30/32"]
    #[inline(always)]
    pub fn is_cbref0_29(&self) -> bool {
        *self == Cbref0::Cbref0_29
    }
    #[doc = "Comp. B Int. Ref.0 Select 6 : 31/32"]
    #[inline(always)]
    pub fn is_cbref0_30(&self) -> bool {
        *self == Cbref0::Cbref0_30
    }
    #[doc = "Comp. B Int. Ref.0 Select 7 : 32/32"]
    #[inline(always)]
    pub fn is_cbref0_31(&self) -> bool {
        *self == Cbref0::Cbref0_31
    }
}
#[doc = "Field `CBREF0` writer - Comp. B Reference 0 Resistor Select Bit : 0"]
pub type Cbref0W<'a, REG> = crate::FieldWriter<'a, REG, 5, Cbref0, crate::Safe>;
impl<'a, REG> Cbref0W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Comp. B Int. Ref.0 Select 0 : 1/32"]
    #[inline(always)]
    pub fn cbref0_0(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_0)
    }
    #[doc = "Comp. B Int. Ref.0 Select 1 : 2/32"]
    #[inline(always)]
    pub fn cbref0_1(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_1)
    }
    #[doc = "Comp. B Int. Ref.0 Select 2 : 3/32"]
    #[inline(always)]
    pub fn cbref0_2(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_2)
    }
    #[doc = "Comp. B Int. Ref.0 Select 3 : 4/32"]
    #[inline(always)]
    pub fn cbref0_3(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_3)
    }
    #[doc = "Comp. B Int. Ref.0 Select 4 : 5/32"]
    #[inline(always)]
    pub fn cbref0_4(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_4)
    }
    #[doc = "Comp. B Int. Ref.0 Select 5 : 6/32"]
    #[inline(always)]
    pub fn cbref0_5(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_5)
    }
    #[doc = "Comp. B Int. Ref.0 Select 6 : 7/32"]
    #[inline(always)]
    pub fn cbref0_6(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_6)
    }
    #[doc = "Comp. B Int. Ref.0 Select 7 : 8/32"]
    #[inline(always)]
    pub fn cbref0_7(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_7)
    }
    #[doc = "Comp. B Int. Ref.0 Select 0 : 9/32"]
    #[inline(always)]
    pub fn cbref0_8(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_8)
    }
    #[doc = "Comp. B Int. Ref.0 Select 1 : 10/32"]
    #[inline(always)]
    pub fn cbref0_9(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_9)
    }
    #[doc = "Comp. B Int. Ref.0 Select 2 : 11/32"]
    #[inline(always)]
    pub fn cbref0_10(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_10)
    }
    #[doc = "Comp. B Int. Ref.0 Select 3 : 12/32"]
    #[inline(always)]
    pub fn cbref0_11(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_11)
    }
    #[doc = "Comp. B Int. Ref.0 Select 4 : 13/32"]
    #[inline(always)]
    pub fn cbref0_12(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_12)
    }
    #[doc = "Comp. B Int. Ref.0 Select 5 : 14/32"]
    #[inline(always)]
    pub fn cbref0_13(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_13)
    }
    #[doc = "Comp. B Int. Ref.0 Select 6 : 15/32"]
    #[inline(always)]
    pub fn cbref0_14(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_14)
    }
    #[doc = "Comp. B Int. Ref.0 Select 7 : 16/32"]
    #[inline(always)]
    pub fn cbref0_15(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_15)
    }
    #[doc = "Comp. B Int. Ref.0 Select 0 : 17/32"]
    #[inline(always)]
    pub fn cbref0_16(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_16)
    }
    #[doc = "Comp. B Int. Ref.0 Select 1 : 18/32"]
    #[inline(always)]
    pub fn cbref0_17(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_17)
    }
    #[doc = "Comp. B Int. Ref.0 Select 2 : 19/32"]
    #[inline(always)]
    pub fn cbref0_18(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_18)
    }
    #[doc = "Comp. B Int. Ref.0 Select 3 : 20/32"]
    #[inline(always)]
    pub fn cbref0_19(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_19)
    }
    #[doc = "Comp. B Int. Ref.0 Select 4 : 21/32"]
    #[inline(always)]
    pub fn cbref0_20(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_20)
    }
    #[doc = "Comp. B Int. Ref.0 Select 5 : 22/32"]
    #[inline(always)]
    pub fn cbref0_21(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_21)
    }
    #[doc = "Comp. B Int. Ref.0 Select 6 : 23/32"]
    #[inline(always)]
    pub fn cbref0_22(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_22)
    }
    #[doc = "Comp. B Int. Ref.0 Select 7 : 24/32"]
    #[inline(always)]
    pub fn cbref0_23(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_23)
    }
    #[doc = "Comp. B Int. Ref.0 Select 0 : 25/32"]
    #[inline(always)]
    pub fn cbref0_24(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_24)
    }
    #[doc = "Comp. B Int. Ref.0 Select 1 : 26/32"]
    #[inline(always)]
    pub fn cbref0_25(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_25)
    }
    #[doc = "Comp. B Int. Ref.0 Select 2 : 27/32"]
    #[inline(always)]
    pub fn cbref0_26(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_26)
    }
    #[doc = "Comp. B Int. Ref.0 Select 3 : 28/32"]
    #[inline(always)]
    pub fn cbref0_27(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_27)
    }
    #[doc = "Comp. B Int. Ref.0 Select 4 : 29/32"]
    #[inline(always)]
    pub fn cbref0_28(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_28)
    }
    #[doc = "Comp. B Int. Ref.0 Select 5 : 30/32"]
    #[inline(always)]
    pub fn cbref0_29(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_29)
    }
    #[doc = "Comp. B Int. Ref.0 Select 6 : 31/32"]
    #[inline(always)]
    pub fn cbref0_30(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_30)
    }
    #[doc = "Comp. B Int. Ref.0 Select 7 : 32/32"]
    #[inline(always)]
    pub fn cbref0_31(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref0::Cbref0_31)
    }
}
#[doc = "Field `CBRSEL` reader - Comp. B Reference select"]
pub type CbrselR = crate::BitReader;
#[doc = "Field `CBRSEL` writer - Comp. B Reference select"]
pub type CbrselW<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Comp. B Reference Source Bit : 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Cbrs {
    #[doc = "0: Comp. B Reference Source 0 : Off"]
    Cbrs0 = 0,
    #[doc = "1: Comp. B Reference Source 1 : Vcc"]
    Cbrs1 = 1,
    #[doc = "2: Comp. B Reference Source 2 : Shared Ref."]
    Cbrs2 = 2,
    #[doc = "3: Comp. B Reference Source 3 : Shared Ref. / Off"]
    Cbrs3 = 3,
}
impl From<Cbrs> for u8 {
    #[inline(always)]
    fn from(variant: Cbrs) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Cbrs {
    type Ux = u8;
}
impl crate::IsEnum for Cbrs {}
#[doc = "Field `CBRS` reader - Comp. B Reference Source Bit : 0"]
pub type CbrsR = crate::FieldReader<Cbrs>;
impl CbrsR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Cbrs {
        match self.bits {
            0 => Cbrs::Cbrs0,
            1 => Cbrs::Cbrs1,
            2 => Cbrs::Cbrs2,
            3 => Cbrs::Cbrs3,
            _ => unreachable!(),
        }
    }
    #[doc = "Comp. B Reference Source 0 : Off"]
    #[inline(always)]
    pub fn is_cbrs_0(&self) -> bool {
        *self == Cbrs::Cbrs0
    }
    #[doc = "Comp. B Reference Source 1 : Vcc"]
    #[inline(always)]
    pub fn is_cbrs_1(&self) -> bool {
        *self == Cbrs::Cbrs1
    }
    #[doc = "Comp. B Reference Source 2 : Shared Ref."]
    #[inline(always)]
    pub fn is_cbrs_2(&self) -> bool {
        *self == Cbrs::Cbrs2
    }
    #[doc = "Comp. B Reference Source 3 : Shared Ref. / Off"]
    #[inline(always)]
    pub fn is_cbrs_3(&self) -> bool {
        *self == Cbrs::Cbrs3
    }
}
#[doc = "Field `CBRS` writer - Comp. B Reference Source Bit : 0"]
pub type CbrsW<'a, REG> = crate::FieldWriter<'a, REG, 2, Cbrs, crate::Safe>;
impl<'a, REG> CbrsW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Comp. B Reference Source 0 : Off"]
    #[inline(always)]
    pub fn cbrs_0(self) -> &'a mut crate::W<REG> {
        self.variant(Cbrs::Cbrs0)
    }
    #[doc = "Comp. B Reference Source 1 : Vcc"]
    #[inline(always)]
    pub fn cbrs_1(self) -> &'a mut crate::W<REG> {
        self.variant(Cbrs::Cbrs1)
    }
    #[doc = "Comp. B Reference Source 2 : Shared Ref."]
    #[inline(always)]
    pub fn cbrs_2(self) -> &'a mut crate::W<REG> {
        self.variant(Cbrs::Cbrs2)
    }
    #[doc = "Comp. B Reference Source 3 : Shared Ref. / Off"]
    #[inline(always)]
    pub fn cbrs_3(self) -> &'a mut crate::W<REG> {
        self.variant(Cbrs::Cbrs3)
    }
}
#[doc = "Comp. B Reference 1 Resistor Select Bit : 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Cbref1 {
    #[doc = "0: Comp. B Int. Ref.1 Select 0 : 1/32"]
    Cbref1_0 = 0,
    #[doc = "1: Comp. B Int. Ref.1 Select 1 : 2/32"]
    Cbref1_1 = 1,
    #[doc = "2: Comp. B Int. Ref.1 Select 2 : 3/32"]
    Cbref1_2 = 2,
    #[doc = "3: Comp. B Int. Ref.1 Select 3 : 4/32"]
    Cbref1_3 = 3,
    #[doc = "4: Comp. B Int. Ref.1 Select 4 : 5/32"]
    Cbref1_4 = 4,
    #[doc = "5: Comp. B Int. Ref.1 Select 5 : 6/32"]
    Cbref1_5 = 5,
    #[doc = "6: Comp. B Int. Ref.1 Select 6 : 7/32"]
    Cbref1_6 = 6,
    #[doc = "7: Comp. B Int. Ref.1 Select 7 : 8/32"]
    Cbref1_7 = 7,
    #[doc = "8: Comp. B Int. Ref.1 Select 0 : 9/32"]
    Cbref1_8 = 8,
    #[doc = "9: Comp. B Int. Ref.1 Select 1 : 10/32"]
    Cbref1_9 = 9,
    #[doc = "10: Comp. B Int. Ref.1 Select 2 : 11/32"]
    Cbref1_10 = 10,
    #[doc = "11: Comp. B Int. Ref.1 Select 3 : 12/32"]
    Cbref1_11 = 11,
    #[doc = "12: Comp. B Int. Ref.1 Select 4 : 13/32"]
    Cbref1_12 = 12,
    #[doc = "13: Comp. B Int. Ref.1 Select 5 : 14/32"]
    Cbref1_13 = 13,
    #[doc = "14: Comp. B Int. Ref.1 Select 6 : 15/32"]
    Cbref1_14 = 14,
    #[doc = "15: Comp. B Int. Ref.1 Select 7 : 16/32"]
    Cbref1_15 = 15,
    #[doc = "16: Comp. B Int. Ref.1 Select 0 : 17/32"]
    Cbref1_16 = 16,
    #[doc = "17: Comp. B Int. Ref.1 Select 1 : 18/32"]
    Cbref1_17 = 17,
    #[doc = "18: Comp. B Int. Ref.1 Select 2 : 19/32"]
    Cbref1_18 = 18,
    #[doc = "19: Comp. B Int. Ref.1 Select 3 : 20/32"]
    Cbref1_19 = 19,
    #[doc = "20: Comp. B Int. Ref.1 Select 4 : 21/32"]
    Cbref1_20 = 20,
    #[doc = "21: Comp. B Int. Ref.1 Select 5 : 22/32"]
    Cbref1_21 = 21,
    #[doc = "22: Comp. B Int. Ref.1 Select 6 : 23/32"]
    Cbref1_22 = 22,
    #[doc = "23: Comp. B Int. Ref.1 Select 7 : 24/32"]
    Cbref1_23 = 23,
    #[doc = "24: Comp. B Int. Ref.1 Select 0 : 25/32"]
    Cbref1_24 = 24,
    #[doc = "25: Comp. B Int. Ref.1 Select 1 : 26/32"]
    Cbref1_25 = 25,
    #[doc = "26: Comp. B Int. Ref.1 Select 2 : 27/32"]
    Cbref1_26 = 26,
    #[doc = "27: Comp. B Int. Ref.1 Select 3 : 28/32"]
    Cbref1_27 = 27,
    #[doc = "28: Comp. B Int. Ref.1 Select 4 : 29/32"]
    Cbref1_28 = 28,
    #[doc = "29: Comp. B Int. Ref.1 Select 5 : 30/32"]
    Cbref1_29 = 29,
    #[doc = "30: Comp. B Int. Ref.1 Select 6 : 31/32"]
    Cbref1_30 = 30,
    #[doc = "31: Comp. B Int. Ref.1 Select 7 : 32/32"]
    Cbref1_31 = 31,
}
impl From<Cbref1> for u8 {
    #[inline(always)]
    fn from(variant: Cbref1) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Cbref1 {
    type Ux = u8;
}
impl crate::IsEnum for Cbref1 {}
#[doc = "Field `CBREF1` reader - Comp. B Reference 1 Resistor Select Bit : 0"]
pub type Cbref1R = crate::FieldReader<Cbref1>;
impl Cbref1R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Cbref1 {
        match self.bits {
            0 => Cbref1::Cbref1_0,
            1 => Cbref1::Cbref1_1,
            2 => Cbref1::Cbref1_2,
            3 => Cbref1::Cbref1_3,
            4 => Cbref1::Cbref1_4,
            5 => Cbref1::Cbref1_5,
            6 => Cbref1::Cbref1_6,
            7 => Cbref1::Cbref1_7,
            8 => Cbref1::Cbref1_8,
            9 => Cbref1::Cbref1_9,
            10 => Cbref1::Cbref1_10,
            11 => Cbref1::Cbref1_11,
            12 => Cbref1::Cbref1_12,
            13 => Cbref1::Cbref1_13,
            14 => Cbref1::Cbref1_14,
            15 => Cbref1::Cbref1_15,
            16 => Cbref1::Cbref1_16,
            17 => Cbref1::Cbref1_17,
            18 => Cbref1::Cbref1_18,
            19 => Cbref1::Cbref1_19,
            20 => Cbref1::Cbref1_20,
            21 => Cbref1::Cbref1_21,
            22 => Cbref1::Cbref1_22,
            23 => Cbref1::Cbref1_23,
            24 => Cbref1::Cbref1_24,
            25 => Cbref1::Cbref1_25,
            26 => Cbref1::Cbref1_26,
            27 => Cbref1::Cbref1_27,
            28 => Cbref1::Cbref1_28,
            29 => Cbref1::Cbref1_29,
            30 => Cbref1::Cbref1_30,
            31 => Cbref1::Cbref1_31,
            _ => unreachable!(),
        }
    }
    #[doc = "Comp. B Int. Ref.1 Select 0 : 1/32"]
    #[inline(always)]
    pub fn is_cbref1_0(&self) -> bool {
        *self == Cbref1::Cbref1_0
    }
    #[doc = "Comp. B Int. Ref.1 Select 1 : 2/32"]
    #[inline(always)]
    pub fn is_cbref1_1(&self) -> bool {
        *self == Cbref1::Cbref1_1
    }
    #[doc = "Comp. B Int. Ref.1 Select 2 : 3/32"]
    #[inline(always)]
    pub fn is_cbref1_2(&self) -> bool {
        *self == Cbref1::Cbref1_2
    }
    #[doc = "Comp. B Int. Ref.1 Select 3 : 4/32"]
    #[inline(always)]
    pub fn is_cbref1_3(&self) -> bool {
        *self == Cbref1::Cbref1_3
    }
    #[doc = "Comp. B Int. Ref.1 Select 4 : 5/32"]
    #[inline(always)]
    pub fn is_cbref1_4(&self) -> bool {
        *self == Cbref1::Cbref1_4
    }
    #[doc = "Comp. B Int. Ref.1 Select 5 : 6/32"]
    #[inline(always)]
    pub fn is_cbref1_5(&self) -> bool {
        *self == Cbref1::Cbref1_5
    }
    #[doc = "Comp. B Int. Ref.1 Select 6 : 7/32"]
    #[inline(always)]
    pub fn is_cbref1_6(&self) -> bool {
        *self == Cbref1::Cbref1_6
    }
    #[doc = "Comp. B Int. Ref.1 Select 7 : 8/32"]
    #[inline(always)]
    pub fn is_cbref1_7(&self) -> bool {
        *self == Cbref1::Cbref1_7
    }
    #[doc = "Comp. B Int. Ref.1 Select 0 : 9/32"]
    #[inline(always)]
    pub fn is_cbref1_8(&self) -> bool {
        *self == Cbref1::Cbref1_8
    }
    #[doc = "Comp. B Int. Ref.1 Select 1 : 10/32"]
    #[inline(always)]
    pub fn is_cbref1_9(&self) -> bool {
        *self == Cbref1::Cbref1_9
    }
    #[doc = "Comp. B Int. Ref.1 Select 2 : 11/32"]
    #[inline(always)]
    pub fn is_cbref1_10(&self) -> bool {
        *self == Cbref1::Cbref1_10
    }
    #[doc = "Comp. B Int. Ref.1 Select 3 : 12/32"]
    #[inline(always)]
    pub fn is_cbref1_11(&self) -> bool {
        *self == Cbref1::Cbref1_11
    }
    #[doc = "Comp. B Int. Ref.1 Select 4 : 13/32"]
    #[inline(always)]
    pub fn is_cbref1_12(&self) -> bool {
        *self == Cbref1::Cbref1_12
    }
    #[doc = "Comp. B Int. Ref.1 Select 5 : 14/32"]
    #[inline(always)]
    pub fn is_cbref1_13(&self) -> bool {
        *self == Cbref1::Cbref1_13
    }
    #[doc = "Comp. B Int. Ref.1 Select 6 : 15/32"]
    #[inline(always)]
    pub fn is_cbref1_14(&self) -> bool {
        *self == Cbref1::Cbref1_14
    }
    #[doc = "Comp. B Int. Ref.1 Select 7 : 16/32"]
    #[inline(always)]
    pub fn is_cbref1_15(&self) -> bool {
        *self == Cbref1::Cbref1_15
    }
    #[doc = "Comp. B Int. Ref.1 Select 0 : 17/32"]
    #[inline(always)]
    pub fn is_cbref1_16(&self) -> bool {
        *self == Cbref1::Cbref1_16
    }
    #[doc = "Comp. B Int. Ref.1 Select 1 : 18/32"]
    #[inline(always)]
    pub fn is_cbref1_17(&self) -> bool {
        *self == Cbref1::Cbref1_17
    }
    #[doc = "Comp. B Int. Ref.1 Select 2 : 19/32"]
    #[inline(always)]
    pub fn is_cbref1_18(&self) -> bool {
        *self == Cbref1::Cbref1_18
    }
    #[doc = "Comp. B Int. Ref.1 Select 3 : 20/32"]
    #[inline(always)]
    pub fn is_cbref1_19(&self) -> bool {
        *self == Cbref1::Cbref1_19
    }
    #[doc = "Comp. B Int. Ref.1 Select 4 : 21/32"]
    #[inline(always)]
    pub fn is_cbref1_20(&self) -> bool {
        *self == Cbref1::Cbref1_20
    }
    #[doc = "Comp. B Int. Ref.1 Select 5 : 22/32"]
    #[inline(always)]
    pub fn is_cbref1_21(&self) -> bool {
        *self == Cbref1::Cbref1_21
    }
    #[doc = "Comp. B Int. Ref.1 Select 6 : 23/32"]
    #[inline(always)]
    pub fn is_cbref1_22(&self) -> bool {
        *self == Cbref1::Cbref1_22
    }
    #[doc = "Comp. B Int. Ref.1 Select 7 : 24/32"]
    #[inline(always)]
    pub fn is_cbref1_23(&self) -> bool {
        *self == Cbref1::Cbref1_23
    }
    #[doc = "Comp. B Int. Ref.1 Select 0 : 25/32"]
    #[inline(always)]
    pub fn is_cbref1_24(&self) -> bool {
        *self == Cbref1::Cbref1_24
    }
    #[doc = "Comp. B Int. Ref.1 Select 1 : 26/32"]
    #[inline(always)]
    pub fn is_cbref1_25(&self) -> bool {
        *self == Cbref1::Cbref1_25
    }
    #[doc = "Comp. B Int. Ref.1 Select 2 : 27/32"]
    #[inline(always)]
    pub fn is_cbref1_26(&self) -> bool {
        *self == Cbref1::Cbref1_26
    }
    #[doc = "Comp. B Int. Ref.1 Select 3 : 28/32"]
    #[inline(always)]
    pub fn is_cbref1_27(&self) -> bool {
        *self == Cbref1::Cbref1_27
    }
    #[doc = "Comp. B Int. Ref.1 Select 4 : 29/32"]
    #[inline(always)]
    pub fn is_cbref1_28(&self) -> bool {
        *self == Cbref1::Cbref1_28
    }
    #[doc = "Comp. B Int. Ref.1 Select 5 : 30/32"]
    #[inline(always)]
    pub fn is_cbref1_29(&self) -> bool {
        *self == Cbref1::Cbref1_29
    }
    #[doc = "Comp. B Int. Ref.1 Select 6 : 31/32"]
    #[inline(always)]
    pub fn is_cbref1_30(&self) -> bool {
        *self == Cbref1::Cbref1_30
    }
    #[doc = "Comp. B Int. Ref.1 Select 7 : 32/32"]
    #[inline(always)]
    pub fn is_cbref1_31(&self) -> bool {
        *self == Cbref1::Cbref1_31
    }
}
#[doc = "Field `CBREF1` writer - Comp. B Reference 1 Resistor Select Bit : 0"]
pub type Cbref1W<'a, REG> = crate::FieldWriter<'a, REG, 5, Cbref1, crate::Safe>;
impl<'a, REG> Cbref1W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Comp. B Int. Ref.1 Select 0 : 1/32"]
    #[inline(always)]
    pub fn cbref1_0(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_0)
    }
    #[doc = "Comp. B Int. Ref.1 Select 1 : 2/32"]
    #[inline(always)]
    pub fn cbref1_1(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_1)
    }
    #[doc = "Comp. B Int. Ref.1 Select 2 : 3/32"]
    #[inline(always)]
    pub fn cbref1_2(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_2)
    }
    #[doc = "Comp. B Int. Ref.1 Select 3 : 4/32"]
    #[inline(always)]
    pub fn cbref1_3(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_3)
    }
    #[doc = "Comp. B Int. Ref.1 Select 4 : 5/32"]
    #[inline(always)]
    pub fn cbref1_4(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_4)
    }
    #[doc = "Comp. B Int. Ref.1 Select 5 : 6/32"]
    #[inline(always)]
    pub fn cbref1_5(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_5)
    }
    #[doc = "Comp. B Int. Ref.1 Select 6 : 7/32"]
    #[inline(always)]
    pub fn cbref1_6(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_6)
    }
    #[doc = "Comp. B Int. Ref.1 Select 7 : 8/32"]
    #[inline(always)]
    pub fn cbref1_7(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_7)
    }
    #[doc = "Comp. B Int. Ref.1 Select 0 : 9/32"]
    #[inline(always)]
    pub fn cbref1_8(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_8)
    }
    #[doc = "Comp. B Int. Ref.1 Select 1 : 10/32"]
    #[inline(always)]
    pub fn cbref1_9(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_9)
    }
    #[doc = "Comp. B Int. Ref.1 Select 2 : 11/32"]
    #[inline(always)]
    pub fn cbref1_10(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_10)
    }
    #[doc = "Comp. B Int. Ref.1 Select 3 : 12/32"]
    #[inline(always)]
    pub fn cbref1_11(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_11)
    }
    #[doc = "Comp. B Int. Ref.1 Select 4 : 13/32"]
    #[inline(always)]
    pub fn cbref1_12(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_12)
    }
    #[doc = "Comp. B Int. Ref.1 Select 5 : 14/32"]
    #[inline(always)]
    pub fn cbref1_13(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_13)
    }
    #[doc = "Comp. B Int. Ref.1 Select 6 : 15/32"]
    #[inline(always)]
    pub fn cbref1_14(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_14)
    }
    #[doc = "Comp. B Int. Ref.1 Select 7 : 16/32"]
    #[inline(always)]
    pub fn cbref1_15(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_15)
    }
    #[doc = "Comp. B Int. Ref.1 Select 0 : 17/32"]
    #[inline(always)]
    pub fn cbref1_16(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_16)
    }
    #[doc = "Comp. B Int. Ref.1 Select 1 : 18/32"]
    #[inline(always)]
    pub fn cbref1_17(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_17)
    }
    #[doc = "Comp. B Int. Ref.1 Select 2 : 19/32"]
    #[inline(always)]
    pub fn cbref1_18(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_18)
    }
    #[doc = "Comp. B Int. Ref.1 Select 3 : 20/32"]
    #[inline(always)]
    pub fn cbref1_19(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_19)
    }
    #[doc = "Comp. B Int. Ref.1 Select 4 : 21/32"]
    #[inline(always)]
    pub fn cbref1_20(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_20)
    }
    #[doc = "Comp. B Int. Ref.1 Select 5 : 22/32"]
    #[inline(always)]
    pub fn cbref1_21(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_21)
    }
    #[doc = "Comp. B Int. Ref.1 Select 6 : 23/32"]
    #[inline(always)]
    pub fn cbref1_22(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_22)
    }
    #[doc = "Comp. B Int. Ref.1 Select 7 : 24/32"]
    #[inline(always)]
    pub fn cbref1_23(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_23)
    }
    #[doc = "Comp. B Int. Ref.1 Select 0 : 25/32"]
    #[inline(always)]
    pub fn cbref1_24(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_24)
    }
    #[doc = "Comp. B Int. Ref.1 Select 1 : 26/32"]
    #[inline(always)]
    pub fn cbref1_25(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_25)
    }
    #[doc = "Comp. B Int. Ref.1 Select 2 : 27/32"]
    #[inline(always)]
    pub fn cbref1_26(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_26)
    }
    #[doc = "Comp. B Int. Ref.1 Select 3 : 28/32"]
    #[inline(always)]
    pub fn cbref1_27(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_27)
    }
    #[doc = "Comp. B Int. Ref.1 Select 4 : 29/32"]
    #[inline(always)]
    pub fn cbref1_28(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_28)
    }
    #[doc = "Comp. B Int. Ref.1 Select 5 : 30/32"]
    #[inline(always)]
    pub fn cbref1_29(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_29)
    }
    #[doc = "Comp. B Int. Ref.1 Select 6 : 31/32"]
    #[inline(always)]
    pub fn cbref1_30(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_30)
    }
    #[doc = "Comp. B Int. Ref.1 Select 7 : 32/32"]
    #[inline(always)]
    pub fn cbref1_31(self) -> &'a mut crate::W<REG> {
        self.variant(Cbref1::Cbref1_31)
    }
}
#[doc = "Comp. B Reference voltage level Bit : 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Cbrefl {
    #[doc = "0: Comp. B Reference voltage level 0 : None"]
    Cbrefl0 = 0,
    #[doc = "1: Comp. B Reference voltage level 1 : 1.5V"]
    Cbrefl1 = 1,
    #[doc = "2: Comp. B Reference voltage level 2 : 2.0V"]
    Cbrefl2 = 2,
    #[doc = "3: Comp. B Reference voltage level 3 : 2.5V"]
    Cbrefl3 = 3,
}
impl From<Cbrefl> for u8 {
    #[inline(always)]
    fn from(variant: Cbrefl) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Cbrefl {
    type Ux = u8;
}
impl crate::IsEnum for Cbrefl {}
#[doc = "Field `CBREFL` reader - Comp. B Reference voltage level Bit : 0"]
pub type CbreflR = crate::FieldReader<Cbrefl>;
impl CbreflR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Cbrefl {
        match self.bits {
            0 => Cbrefl::Cbrefl0,
            1 => Cbrefl::Cbrefl1,
            2 => Cbrefl::Cbrefl2,
            3 => Cbrefl::Cbrefl3,
            _ => unreachable!(),
        }
    }
    #[doc = "Comp. B Reference voltage level 0 : None"]
    #[inline(always)]
    pub fn is_cbrefl_0(&self) -> bool {
        *self == Cbrefl::Cbrefl0
    }
    #[doc = "Comp. B Reference voltage level 1 : 1.5V"]
    #[inline(always)]
    pub fn is_cbrefl_1(&self) -> bool {
        *self == Cbrefl::Cbrefl1
    }
    #[doc = "Comp. B Reference voltage level 2 : 2.0V"]
    #[inline(always)]
    pub fn is_cbrefl_2(&self) -> bool {
        *self == Cbrefl::Cbrefl2
    }
    #[doc = "Comp. B Reference voltage level 3 : 2.5V"]
    #[inline(always)]
    pub fn is_cbrefl_3(&self) -> bool {
        *self == Cbrefl::Cbrefl3
    }
}
#[doc = "Field `CBREFL` writer - Comp. B Reference voltage level Bit : 0"]
pub type CbreflW<'a, REG> = crate::FieldWriter<'a, REG, 2, Cbrefl, crate::Safe>;
impl<'a, REG> CbreflW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Comp. B Reference voltage level 0 : None"]
    #[inline(always)]
    pub fn cbrefl_0(self) -> &'a mut crate::W<REG> {
        self.variant(Cbrefl::Cbrefl0)
    }
    #[doc = "Comp. B Reference voltage level 1 : 1.5V"]
    #[inline(always)]
    pub fn cbrefl_1(self) -> &'a mut crate::W<REG> {
        self.variant(Cbrefl::Cbrefl1)
    }
    #[doc = "Comp. B Reference voltage level 2 : 2.0V"]
    #[inline(always)]
    pub fn cbrefl_2(self) -> &'a mut crate::W<REG> {
        self.variant(Cbrefl::Cbrefl2)
    }
    #[doc = "Comp. B Reference voltage level 3 : 2.5V"]
    #[inline(always)]
    pub fn cbrefl_3(self) -> &'a mut crate::W<REG> {
        self.variant(Cbrefl::Cbrefl3)
    }
}
#[doc = "Field `CBREFACC` reader - Comp. B Reference Accuracy"]
pub type CbrefaccR = crate::BitReader;
#[doc = "Field `CBREFACC` writer - Comp. B Reference Accuracy"]
pub type CbrefaccW<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
    #[doc = "Bits 0:4 - Comp. B Reference 0 Resistor Select Bit : 0"]
    #[inline(always)]
    pub fn cbref0(&self) -> Cbref0R {
        Cbref0R::new((self.bits & 0x1f) as u8)
    }
    #[doc = "Bit 5 - Comp. B Reference select"]
    #[inline(always)]
    pub fn cbrsel(&self) -> CbrselR {
        CbrselR::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bits 6:7 - Comp. B Reference Source Bit : 0"]
    #[inline(always)]
    pub fn cbrs(&self) -> CbrsR {
        CbrsR::new(((self.bits >> 6) & 3) as u8)
    }
    #[doc = "Bits 8:12 - Comp. B Reference 1 Resistor Select Bit : 0"]
    #[inline(always)]
    pub fn cbref1(&self) -> Cbref1R {
        Cbref1R::new(((self.bits >> 8) & 0x1f) as u8)
    }
    #[doc = "Bits 13:14 - Comp. B Reference voltage level Bit : 0"]
    #[inline(always)]
    pub fn cbrefl(&self) -> CbreflR {
        CbreflR::new(((self.bits >> 13) & 3) as u8)
    }
    #[doc = "Bit 15 - Comp. B Reference Accuracy"]
    #[inline(always)]
    pub fn cbrefacc(&self) -> CbrefaccR {
        CbrefaccR::new(((self.bits >> 15) & 1) != 0)
    }
}
impl W {
    #[doc = "Bits 0:4 - Comp. B Reference 0 Resistor Select Bit : 0"]
    #[inline(always)]
    pub fn cbref0(&mut self) -> Cbref0W<'_, Cbctl2Spec> {
        Cbref0W::new(self, 0)
    }
    #[doc = "Bit 5 - Comp. B Reference select"]
    #[inline(always)]
    pub fn cbrsel(&mut self) -> CbrselW<'_, Cbctl2Spec> {
        CbrselW::new(self, 5)
    }
    #[doc = "Bits 6:7 - Comp. B Reference Source Bit : 0"]
    #[inline(always)]
    pub fn cbrs(&mut self) -> CbrsW<'_, Cbctl2Spec> {
        CbrsW::new(self, 6)
    }
    #[doc = "Bits 8:12 - Comp. B Reference 1 Resistor Select Bit : 0"]
    #[inline(always)]
    pub fn cbref1(&mut self) -> Cbref1W<'_, Cbctl2Spec> {
        Cbref1W::new(self, 8)
    }
    #[doc = "Bits 13:14 - Comp. B Reference voltage level Bit : 0"]
    #[inline(always)]
    pub fn cbrefl(&mut self) -> CbreflW<'_, Cbctl2Spec> {
        CbreflW::new(self, 13)
    }
    #[doc = "Bit 15 - Comp. B Reference Accuracy"]
    #[inline(always)]
    pub fn cbrefacc(&mut self) -> CbrefaccW<'_, Cbctl2Spec> {
        CbrefaccW::new(self, 15)
    }
}
#[doc = "Comparator B Control Register 2\n\nYou can [`read`](crate::Reg::read) this register and get [`cbctl2::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cbctl2::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct Cbctl2Spec;
impl crate::RegisterSpec for Cbctl2Spec {
    type Ux = u16;
}
#[doc = "`read()` method returns [`cbctl2::R`](R) reader structure"]
impl crate::Readable for Cbctl2Spec {}
#[doc = "`write(|w| ..)` method takes [`cbctl2::W`](W) writer structure"]
impl crate::Writable for Cbctl2Spec {
    type Safety = crate::Unsafe;
}
#[doc = "`reset()` method sets CBCTL2 to value 0"]
impl crate::Resettable for Cbctl2Spec {}