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
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
#[doc = "Register `CExCTL2` reader"]
pub struct R(crate::R<CEXCTL2_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<CEXCTL2_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<CEXCTL2_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<CEXCTL2_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `CExCTL2` writer"]
pub struct W(crate::W<CEXCTL2_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<CEXCTL2_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl From<crate::W<CEXCTL2_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<CEXCTL2_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Reference resistor tap 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum CEREF0_A {
    #[doc = "0: Reference resistor tap for setting 0."]
    CEREF0_0 = 0,
    #[doc = "1: Reference resistor tap for setting 1."]
    CEREF0_1 = 1,
    #[doc = "2: Reference resistor tap for setting 2."]
    CEREF0_2 = 2,
    #[doc = "3: Reference resistor tap for setting 3."]
    CEREF0_3 = 3,
    #[doc = "4: Reference resistor tap for setting 4."]
    CEREF0_4 = 4,
    #[doc = "5: Reference resistor tap for setting 5."]
    CEREF0_5 = 5,
    #[doc = "6: Reference resistor tap for setting 6."]
    CEREF0_6 = 6,
    #[doc = "7: Reference resistor tap for setting 7."]
    CEREF0_7 = 7,
    #[doc = "8: Reference resistor tap for setting 8."]
    CEREF0_8 = 8,
    #[doc = "9: Reference resistor tap for setting 9."]
    CEREF0_9 = 9,
    #[doc = "10: Reference resistor tap for setting 10."]
    CEREF0_10 = 10,
    #[doc = "11: Reference resistor tap for setting 11."]
    CEREF0_11 = 11,
    #[doc = "12: Reference resistor tap for setting 12."]
    CEREF0_12 = 12,
    #[doc = "13: Reference resistor tap for setting 13."]
    CEREF0_13 = 13,
    #[doc = "14: Reference resistor tap for setting 14."]
    CEREF0_14 = 14,
    #[doc = "15: Reference resistor tap for setting 15."]
    CEREF0_15 = 15,
    #[doc = "16: Reference resistor tap for setting 16."]
    CEREF0_16 = 16,
    #[doc = "17: Reference resistor tap for setting 17."]
    CEREF0_17 = 17,
    #[doc = "18: Reference resistor tap for setting 18."]
    CEREF0_18 = 18,
    #[doc = "19: Reference resistor tap for setting 19."]
    CEREF0_19 = 19,
    #[doc = "20: Reference resistor tap for setting 20."]
    CEREF0_20 = 20,
    #[doc = "21: Reference resistor tap for setting 21."]
    CEREF0_21 = 21,
    #[doc = "22: Reference resistor tap for setting 22."]
    CEREF0_22 = 22,
    #[doc = "23: Reference resistor tap for setting 23."]
    CEREF0_23 = 23,
    #[doc = "24: Reference resistor tap for setting 24."]
    CEREF0_24 = 24,
    #[doc = "25: Reference resistor tap for setting 25."]
    CEREF0_25 = 25,
    #[doc = "26: Reference resistor tap for setting 26."]
    CEREF0_26 = 26,
    #[doc = "27: Reference resistor tap for setting 27."]
    CEREF0_27 = 27,
    #[doc = "28: Reference resistor tap for setting 28."]
    CEREF0_28 = 28,
    #[doc = "29: Reference resistor tap for setting 29."]
    CEREF0_29 = 29,
    #[doc = "30: Reference resistor tap for setting 30."]
    CEREF0_30 = 30,
    #[doc = "31: Reference resistor tap for setting 31."]
    CEREF0_31 = 31,
}
impl From<CEREF0_A> for u8 {
    #[inline(always)]
    fn from(variant: CEREF0_A) -> Self {
        variant as _
    }
}
#[doc = "Field `CEREF0` reader - Reference resistor tap 0"]
pub type CEREF0_R = crate::FieldReader<u8, CEREF0_A>;
impl CEREF0_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CEREF0_A {
        match self.bits {
            0 => CEREF0_A::CEREF0_0,
            1 => CEREF0_A::CEREF0_1,
            2 => CEREF0_A::CEREF0_2,
            3 => CEREF0_A::CEREF0_3,
            4 => CEREF0_A::CEREF0_4,
            5 => CEREF0_A::CEREF0_5,
            6 => CEREF0_A::CEREF0_6,
            7 => CEREF0_A::CEREF0_7,
            8 => CEREF0_A::CEREF0_8,
            9 => CEREF0_A::CEREF0_9,
            10 => CEREF0_A::CEREF0_10,
            11 => CEREF0_A::CEREF0_11,
            12 => CEREF0_A::CEREF0_12,
            13 => CEREF0_A::CEREF0_13,
            14 => CEREF0_A::CEREF0_14,
            15 => CEREF0_A::CEREF0_15,
            16 => CEREF0_A::CEREF0_16,
            17 => CEREF0_A::CEREF0_17,
            18 => CEREF0_A::CEREF0_18,
            19 => CEREF0_A::CEREF0_19,
            20 => CEREF0_A::CEREF0_20,
            21 => CEREF0_A::CEREF0_21,
            22 => CEREF0_A::CEREF0_22,
            23 => CEREF0_A::CEREF0_23,
            24 => CEREF0_A::CEREF0_24,
            25 => CEREF0_A::CEREF0_25,
            26 => CEREF0_A::CEREF0_26,
            27 => CEREF0_A::CEREF0_27,
            28 => CEREF0_A::CEREF0_28,
            29 => CEREF0_A::CEREF0_29,
            30 => CEREF0_A::CEREF0_30,
            31 => CEREF0_A::CEREF0_31,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `CEREF0_0`"]
    #[inline(always)]
    pub fn is_ceref0_0(&self) -> bool {
        *self == CEREF0_A::CEREF0_0
    }
    #[doc = "Checks if the value of the field is `CEREF0_1`"]
    #[inline(always)]
    pub fn is_ceref0_1(&self) -> bool {
        *self == CEREF0_A::CEREF0_1
    }
    #[doc = "Checks if the value of the field is `CEREF0_2`"]
    #[inline(always)]
    pub fn is_ceref0_2(&self) -> bool {
        *self == CEREF0_A::CEREF0_2
    }
    #[doc = "Checks if the value of the field is `CEREF0_3`"]
    #[inline(always)]
    pub fn is_ceref0_3(&self) -> bool {
        *self == CEREF0_A::CEREF0_3
    }
    #[doc = "Checks if the value of the field is `CEREF0_4`"]
    #[inline(always)]
    pub fn is_ceref0_4(&self) -> bool {
        *self == CEREF0_A::CEREF0_4
    }
    #[doc = "Checks if the value of the field is `CEREF0_5`"]
    #[inline(always)]
    pub fn is_ceref0_5(&self) -> bool {
        *self == CEREF0_A::CEREF0_5
    }
    #[doc = "Checks if the value of the field is `CEREF0_6`"]
    #[inline(always)]
    pub fn is_ceref0_6(&self) -> bool {
        *self == CEREF0_A::CEREF0_6
    }
    #[doc = "Checks if the value of the field is `CEREF0_7`"]
    #[inline(always)]
    pub fn is_ceref0_7(&self) -> bool {
        *self == CEREF0_A::CEREF0_7
    }
    #[doc = "Checks if the value of the field is `CEREF0_8`"]
    #[inline(always)]
    pub fn is_ceref0_8(&self) -> bool {
        *self == CEREF0_A::CEREF0_8
    }
    #[doc = "Checks if the value of the field is `CEREF0_9`"]
    #[inline(always)]
    pub fn is_ceref0_9(&self) -> bool {
        *self == CEREF0_A::CEREF0_9
    }
    #[doc = "Checks if the value of the field is `CEREF0_10`"]
    #[inline(always)]
    pub fn is_ceref0_10(&self) -> bool {
        *self == CEREF0_A::CEREF0_10
    }
    #[doc = "Checks if the value of the field is `CEREF0_11`"]
    #[inline(always)]
    pub fn is_ceref0_11(&self) -> bool {
        *self == CEREF0_A::CEREF0_11
    }
    #[doc = "Checks if the value of the field is `CEREF0_12`"]
    #[inline(always)]
    pub fn is_ceref0_12(&self) -> bool {
        *self == CEREF0_A::CEREF0_12
    }
    #[doc = "Checks if the value of the field is `CEREF0_13`"]
    #[inline(always)]
    pub fn is_ceref0_13(&self) -> bool {
        *self == CEREF0_A::CEREF0_13
    }
    #[doc = "Checks if the value of the field is `CEREF0_14`"]
    #[inline(always)]
    pub fn is_ceref0_14(&self) -> bool {
        *self == CEREF0_A::CEREF0_14
    }
    #[doc = "Checks if the value of the field is `CEREF0_15`"]
    #[inline(always)]
    pub fn is_ceref0_15(&self) -> bool {
        *self == CEREF0_A::CEREF0_15
    }
    #[doc = "Checks if the value of the field is `CEREF0_16`"]
    #[inline(always)]
    pub fn is_ceref0_16(&self) -> bool {
        *self == CEREF0_A::CEREF0_16
    }
    #[doc = "Checks if the value of the field is `CEREF0_17`"]
    #[inline(always)]
    pub fn is_ceref0_17(&self) -> bool {
        *self == CEREF0_A::CEREF0_17
    }
    #[doc = "Checks if the value of the field is `CEREF0_18`"]
    #[inline(always)]
    pub fn is_ceref0_18(&self) -> bool {
        *self == CEREF0_A::CEREF0_18
    }
    #[doc = "Checks if the value of the field is `CEREF0_19`"]
    #[inline(always)]
    pub fn is_ceref0_19(&self) -> bool {
        *self == CEREF0_A::CEREF0_19
    }
    #[doc = "Checks if the value of the field is `CEREF0_20`"]
    #[inline(always)]
    pub fn is_ceref0_20(&self) -> bool {
        *self == CEREF0_A::CEREF0_20
    }
    #[doc = "Checks if the value of the field is `CEREF0_21`"]
    #[inline(always)]
    pub fn is_ceref0_21(&self) -> bool {
        *self == CEREF0_A::CEREF0_21
    }
    #[doc = "Checks if the value of the field is `CEREF0_22`"]
    #[inline(always)]
    pub fn is_ceref0_22(&self) -> bool {
        *self == CEREF0_A::CEREF0_22
    }
    #[doc = "Checks if the value of the field is `CEREF0_23`"]
    #[inline(always)]
    pub fn is_ceref0_23(&self) -> bool {
        *self == CEREF0_A::CEREF0_23
    }
    #[doc = "Checks if the value of the field is `CEREF0_24`"]
    #[inline(always)]
    pub fn is_ceref0_24(&self) -> bool {
        *self == CEREF0_A::CEREF0_24
    }
    #[doc = "Checks if the value of the field is `CEREF0_25`"]
    #[inline(always)]
    pub fn is_ceref0_25(&self) -> bool {
        *self == CEREF0_A::CEREF0_25
    }
    #[doc = "Checks if the value of the field is `CEREF0_26`"]
    #[inline(always)]
    pub fn is_ceref0_26(&self) -> bool {
        *self == CEREF0_A::CEREF0_26
    }
    #[doc = "Checks if the value of the field is `CEREF0_27`"]
    #[inline(always)]
    pub fn is_ceref0_27(&self) -> bool {
        *self == CEREF0_A::CEREF0_27
    }
    #[doc = "Checks if the value of the field is `CEREF0_28`"]
    #[inline(always)]
    pub fn is_ceref0_28(&self) -> bool {
        *self == CEREF0_A::CEREF0_28
    }
    #[doc = "Checks if the value of the field is `CEREF0_29`"]
    #[inline(always)]
    pub fn is_ceref0_29(&self) -> bool {
        *self == CEREF0_A::CEREF0_29
    }
    #[doc = "Checks if the value of the field is `CEREF0_30`"]
    #[inline(always)]
    pub fn is_ceref0_30(&self) -> bool {
        *self == CEREF0_A::CEREF0_30
    }
    #[doc = "Checks if the value of the field is `CEREF0_31`"]
    #[inline(always)]
    pub fn is_ceref0_31(&self) -> bool {
        *self == CEREF0_A::CEREF0_31
    }
}
#[doc = "Field `CEREF0` writer - Reference resistor tap 0"]
pub type CEREF0_W<'a, const O: u8> =
    crate::FieldWriterSafe<'a, u16, CEXCTL2_SPEC, u8, CEREF0_A, 5, O>;
impl<'a, const O: u8> CEREF0_W<'a, O> {
    #[doc = "Reference resistor tap for setting 0."]
    #[inline(always)]
    pub fn ceref0_0(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_0)
    }
    #[doc = "Reference resistor tap for setting 1."]
    #[inline(always)]
    pub fn ceref0_1(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_1)
    }
    #[doc = "Reference resistor tap for setting 2."]
    #[inline(always)]
    pub fn ceref0_2(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_2)
    }
    #[doc = "Reference resistor tap for setting 3."]
    #[inline(always)]
    pub fn ceref0_3(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_3)
    }
    #[doc = "Reference resistor tap for setting 4."]
    #[inline(always)]
    pub fn ceref0_4(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_4)
    }
    #[doc = "Reference resistor tap for setting 5."]
    #[inline(always)]
    pub fn ceref0_5(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_5)
    }
    #[doc = "Reference resistor tap for setting 6."]
    #[inline(always)]
    pub fn ceref0_6(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_6)
    }
    #[doc = "Reference resistor tap for setting 7."]
    #[inline(always)]
    pub fn ceref0_7(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_7)
    }
    #[doc = "Reference resistor tap for setting 8."]
    #[inline(always)]
    pub fn ceref0_8(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_8)
    }
    #[doc = "Reference resistor tap for setting 9."]
    #[inline(always)]
    pub fn ceref0_9(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_9)
    }
    #[doc = "Reference resistor tap for setting 10."]
    #[inline(always)]
    pub fn ceref0_10(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_10)
    }
    #[doc = "Reference resistor tap for setting 11."]
    #[inline(always)]
    pub fn ceref0_11(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_11)
    }
    #[doc = "Reference resistor tap for setting 12."]
    #[inline(always)]
    pub fn ceref0_12(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_12)
    }
    #[doc = "Reference resistor tap for setting 13."]
    #[inline(always)]
    pub fn ceref0_13(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_13)
    }
    #[doc = "Reference resistor tap for setting 14."]
    #[inline(always)]
    pub fn ceref0_14(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_14)
    }
    #[doc = "Reference resistor tap for setting 15."]
    #[inline(always)]
    pub fn ceref0_15(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_15)
    }
    #[doc = "Reference resistor tap for setting 16."]
    #[inline(always)]
    pub fn ceref0_16(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_16)
    }
    #[doc = "Reference resistor tap for setting 17."]
    #[inline(always)]
    pub fn ceref0_17(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_17)
    }
    #[doc = "Reference resistor tap for setting 18."]
    #[inline(always)]
    pub fn ceref0_18(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_18)
    }
    #[doc = "Reference resistor tap for setting 19."]
    #[inline(always)]
    pub fn ceref0_19(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_19)
    }
    #[doc = "Reference resistor tap for setting 20."]
    #[inline(always)]
    pub fn ceref0_20(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_20)
    }
    #[doc = "Reference resistor tap for setting 21."]
    #[inline(always)]
    pub fn ceref0_21(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_21)
    }
    #[doc = "Reference resistor tap for setting 22."]
    #[inline(always)]
    pub fn ceref0_22(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_22)
    }
    #[doc = "Reference resistor tap for setting 23."]
    #[inline(always)]
    pub fn ceref0_23(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_23)
    }
    #[doc = "Reference resistor tap for setting 24."]
    #[inline(always)]
    pub fn ceref0_24(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_24)
    }
    #[doc = "Reference resistor tap for setting 25."]
    #[inline(always)]
    pub fn ceref0_25(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_25)
    }
    #[doc = "Reference resistor tap for setting 26."]
    #[inline(always)]
    pub fn ceref0_26(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_26)
    }
    #[doc = "Reference resistor tap for setting 27."]
    #[inline(always)]
    pub fn ceref0_27(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_27)
    }
    #[doc = "Reference resistor tap for setting 28."]
    #[inline(always)]
    pub fn ceref0_28(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_28)
    }
    #[doc = "Reference resistor tap for setting 29."]
    #[inline(always)]
    pub fn ceref0_29(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_29)
    }
    #[doc = "Reference resistor tap for setting 30."]
    #[inline(always)]
    pub fn ceref0_30(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_30)
    }
    #[doc = "Reference resistor tap for setting 31."]
    #[inline(always)]
    pub fn ceref0_31(self) -> &'a mut W {
        self.variant(CEREF0_A::CEREF0_31)
    }
}
#[doc = "Reference select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CERSEL_A {
    #[doc = "0: When CEEX = 0, VREF is applied to the V+ terminal; When CEEX = 1, VREF is applied to the V- terminal"]
    CERSEL_0 = 0,
    #[doc = "1: When CEEX = 0, VREF is applied to the V- terminal; When CEEX = 1, VREF is applied to the V+ terminal"]
    CERSEL_1 = 1,
}
impl From<CERSEL_A> for bool {
    #[inline(always)]
    fn from(variant: CERSEL_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CERSEL` reader - Reference select"]
pub type CERSEL_R = crate::BitReader<CERSEL_A>;
impl CERSEL_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CERSEL_A {
        match self.bits {
            false => CERSEL_A::CERSEL_0,
            true => CERSEL_A::CERSEL_1,
        }
    }
    #[doc = "Checks if the value of the field is `CERSEL_0`"]
    #[inline(always)]
    pub fn is_cersel_0(&self) -> bool {
        *self == CERSEL_A::CERSEL_0
    }
    #[doc = "Checks if the value of the field is `CERSEL_1`"]
    #[inline(always)]
    pub fn is_cersel_1(&self) -> bool {
        *self == CERSEL_A::CERSEL_1
    }
}
#[doc = "Field `CERSEL` writer - Reference select"]
pub type CERSEL_W<'a, const O: u8> = crate::BitWriter<'a, u16, CEXCTL2_SPEC, CERSEL_A, O>;
impl<'a, const O: u8> CERSEL_W<'a, O> {
    #[doc = "When CEEX = 0, VREF is applied to the V+ terminal; When CEEX = 1, VREF is applied to the V- terminal"]
    #[inline(always)]
    pub fn cersel_0(self) -> &'a mut W {
        self.variant(CERSEL_A::CERSEL_0)
    }
    #[doc = "When CEEX = 0, VREF is applied to the V- terminal; When CEEX = 1, VREF is applied to the V+ terminal"]
    #[inline(always)]
    pub fn cersel_1(self) -> &'a mut W {
        self.variant(CERSEL_A::CERSEL_1)
    }
}
#[doc = "Reference source\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum CERS_A {
    #[doc = "0: No current is drawn by the reference circuitry"]
    CERS_0 = 0,
    #[doc = "1: VCC applied to the resistor ladder"]
    CERS_1 = 1,
    #[doc = "2: Shared reference voltage applied to the resistor ladder"]
    CERS_2 = 2,
    #[doc = "3: Shared reference voltage supplied to V(CREF). Resistor ladder is off"]
    CERS_3 = 3,
}
impl From<CERS_A> for u8 {
    #[inline(always)]
    fn from(variant: CERS_A) -> Self {
        variant as _
    }
}
#[doc = "Field `CERS` reader - Reference source"]
pub type CERS_R = crate::FieldReader<u8, CERS_A>;
impl CERS_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CERS_A {
        match self.bits {
            0 => CERS_A::CERS_0,
            1 => CERS_A::CERS_1,
            2 => CERS_A::CERS_2,
            3 => CERS_A::CERS_3,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `CERS_0`"]
    #[inline(always)]
    pub fn is_cers_0(&self) -> bool {
        *self == CERS_A::CERS_0
    }
    #[doc = "Checks if the value of the field is `CERS_1`"]
    #[inline(always)]
    pub fn is_cers_1(&self) -> bool {
        *self == CERS_A::CERS_1
    }
    #[doc = "Checks if the value of the field is `CERS_2`"]
    #[inline(always)]
    pub fn is_cers_2(&self) -> bool {
        *self == CERS_A::CERS_2
    }
    #[doc = "Checks if the value of the field is `CERS_3`"]
    #[inline(always)]
    pub fn is_cers_3(&self) -> bool {
        *self == CERS_A::CERS_3
    }
}
#[doc = "Field `CERS` writer - Reference source"]
pub type CERS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u16, CEXCTL2_SPEC, u8, CERS_A, 2, O>;
impl<'a, const O: u8> CERS_W<'a, O> {
    #[doc = "No current is drawn by the reference circuitry"]
    #[inline(always)]
    pub fn cers_0(self) -> &'a mut W {
        self.variant(CERS_A::CERS_0)
    }
    #[doc = "VCC applied to the resistor ladder"]
    #[inline(always)]
    pub fn cers_1(self) -> &'a mut W {
        self.variant(CERS_A::CERS_1)
    }
    #[doc = "Shared reference voltage applied to the resistor ladder"]
    #[inline(always)]
    pub fn cers_2(self) -> &'a mut W {
        self.variant(CERS_A::CERS_2)
    }
    #[doc = "Shared reference voltage supplied to V(CREF). Resistor ladder is off"]
    #[inline(always)]
    pub fn cers_3(self) -> &'a mut W {
        self.variant(CERS_A::CERS_3)
    }
}
#[doc = "Reference resistor tap 1\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum CEREF1_A {
    #[doc = "0: Reference resistor tap for setting 0."]
    CEREF1_0 = 0,
    #[doc = "1: Reference resistor tap for setting 1."]
    CEREF1_1 = 1,
    #[doc = "2: Reference resistor tap for setting 2."]
    CEREF1_2 = 2,
    #[doc = "3: Reference resistor tap for setting 3."]
    CEREF1_3 = 3,
    #[doc = "4: Reference resistor tap for setting 4."]
    CEREF1_4 = 4,
    #[doc = "5: Reference resistor tap for setting 5."]
    CEREF1_5 = 5,
    #[doc = "6: Reference resistor tap for setting 6."]
    CEREF1_6 = 6,
    #[doc = "7: Reference resistor tap for setting 7."]
    CEREF1_7 = 7,
    #[doc = "8: Reference resistor tap for setting 8."]
    CEREF1_8 = 8,
    #[doc = "9: Reference resistor tap for setting 9."]
    CEREF1_9 = 9,
    #[doc = "10: Reference resistor tap for setting 10."]
    CEREF1_10 = 10,
    #[doc = "11: Reference resistor tap for setting 11."]
    CEREF1_11 = 11,
    #[doc = "12: Reference resistor tap for setting 12."]
    CEREF1_12 = 12,
    #[doc = "13: Reference resistor tap for setting 13."]
    CEREF1_13 = 13,
    #[doc = "14: Reference resistor tap for setting 14."]
    CEREF1_14 = 14,
    #[doc = "15: Reference resistor tap for setting 15."]
    CEREF1_15 = 15,
    #[doc = "16: Reference resistor tap for setting 16."]
    CEREF1_16 = 16,
    #[doc = "17: Reference resistor tap for setting 17."]
    CEREF1_17 = 17,
    #[doc = "18: Reference resistor tap for setting 18."]
    CEREF1_18 = 18,
    #[doc = "19: Reference resistor tap for setting 19."]
    CEREF1_19 = 19,
    #[doc = "20: Reference resistor tap for setting 20."]
    CEREF1_20 = 20,
    #[doc = "21: Reference resistor tap for setting 21."]
    CEREF1_21 = 21,
    #[doc = "22: Reference resistor tap for setting 22."]
    CEREF1_22 = 22,
    #[doc = "23: Reference resistor tap for setting 23."]
    CEREF1_23 = 23,
    #[doc = "24: Reference resistor tap for setting 24."]
    CEREF1_24 = 24,
    #[doc = "25: Reference resistor tap for setting 25."]
    CEREF1_25 = 25,
    #[doc = "26: Reference resistor tap for setting 26."]
    CEREF1_26 = 26,
    #[doc = "27: Reference resistor tap for setting 27."]
    CEREF1_27 = 27,
    #[doc = "28: Reference resistor tap for setting 28."]
    CEREF1_28 = 28,
    #[doc = "29: Reference resistor tap for setting 29."]
    CEREF1_29 = 29,
    #[doc = "30: Reference resistor tap for setting 30."]
    CEREF1_30 = 30,
    #[doc = "31: Reference resistor tap for setting 31."]
    CEREF1_31 = 31,
}
impl From<CEREF1_A> for u8 {
    #[inline(always)]
    fn from(variant: CEREF1_A) -> Self {
        variant as _
    }
}
#[doc = "Field `CEREF1` reader - Reference resistor tap 1"]
pub type CEREF1_R = crate::FieldReader<u8, CEREF1_A>;
impl CEREF1_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CEREF1_A {
        match self.bits {
            0 => CEREF1_A::CEREF1_0,
            1 => CEREF1_A::CEREF1_1,
            2 => CEREF1_A::CEREF1_2,
            3 => CEREF1_A::CEREF1_3,
            4 => CEREF1_A::CEREF1_4,
            5 => CEREF1_A::CEREF1_5,
            6 => CEREF1_A::CEREF1_6,
            7 => CEREF1_A::CEREF1_7,
            8 => CEREF1_A::CEREF1_8,
            9 => CEREF1_A::CEREF1_9,
            10 => CEREF1_A::CEREF1_10,
            11 => CEREF1_A::CEREF1_11,
            12 => CEREF1_A::CEREF1_12,
            13 => CEREF1_A::CEREF1_13,
            14 => CEREF1_A::CEREF1_14,
            15 => CEREF1_A::CEREF1_15,
            16 => CEREF1_A::CEREF1_16,
            17 => CEREF1_A::CEREF1_17,
            18 => CEREF1_A::CEREF1_18,
            19 => CEREF1_A::CEREF1_19,
            20 => CEREF1_A::CEREF1_20,
            21 => CEREF1_A::CEREF1_21,
            22 => CEREF1_A::CEREF1_22,
            23 => CEREF1_A::CEREF1_23,
            24 => CEREF1_A::CEREF1_24,
            25 => CEREF1_A::CEREF1_25,
            26 => CEREF1_A::CEREF1_26,
            27 => CEREF1_A::CEREF1_27,
            28 => CEREF1_A::CEREF1_28,
            29 => CEREF1_A::CEREF1_29,
            30 => CEREF1_A::CEREF1_30,
            31 => CEREF1_A::CEREF1_31,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `CEREF1_0`"]
    #[inline(always)]
    pub fn is_ceref1_0(&self) -> bool {
        *self == CEREF1_A::CEREF1_0
    }
    #[doc = "Checks if the value of the field is `CEREF1_1`"]
    #[inline(always)]
    pub fn is_ceref1_1(&self) -> bool {
        *self == CEREF1_A::CEREF1_1
    }
    #[doc = "Checks if the value of the field is `CEREF1_2`"]
    #[inline(always)]
    pub fn is_ceref1_2(&self) -> bool {
        *self == CEREF1_A::CEREF1_2
    }
    #[doc = "Checks if the value of the field is `CEREF1_3`"]
    #[inline(always)]
    pub fn is_ceref1_3(&self) -> bool {
        *self == CEREF1_A::CEREF1_3
    }
    #[doc = "Checks if the value of the field is `CEREF1_4`"]
    #[inline(always)]
    pub fn is_ceref1_4(&self) -> bool {
        *self == CEREF1_A::CEREF1_4
    }
    #[doc = "Checks if the value of the field is `CEREF1_5`"]
    #[inline(always)]
    pub fn is_ceref1_5(&self) -> bool {
        *self == CEREF1_A::CEREF1_5
    }
    #[doc = "Checks if the value of the field is `CEREF1_6`"]
    #[inline(always)]
    pub fn is_ceref1_6(&self) -> bool {
        *self == CEREF1_A::CEREF1_6
    }
    #[doc = "Checks if the value of the field is `CEREF1_7`"]
    #[inline(always)]
    pub fn is_ceref1_7(&self) -> bool {
        *self == CEREF1_A::CEREF1_7
    }
    #[doc = "Checks if the value of the field is `CEREF1_8`"]
    #[inline(always)]
    pub fn is_ceref1_8(&self) -> bool {
        *self == CEREF1_A::CEREF1_8
    }
    #[doc = "Checks if the value of the field is `CEREF1_9`"]
    #[inline(always)]
    pub fn is_ceref1_9(&self) -> bool {
        *self == CEREF1_A::CEREF1_9
    }
    #[doc = "Checks if the value of the field is `CEREF1_10`"]
    #[inline(always)]
    pub fn is_ceref1_10(&self) -> bool {
        *self == CEREF1_A::CEREF1_10
    }
    #[doc = "Checks if the value of the field is `CEREF1_11`"]
    #[inline(always)]
    pub fn is_ceref1_11(&self) -> bool {
        *self == CEREF1_A::CEREF1_11
    }
    #[doc = "Checks if the value of the field is `CEREF1_12`"]
    #[inline(always)]
    pub fn is_ceref1_12(&self) -> bool {
        *self == CEREF1_A::CEREF1_12
    }
    #[doc = "Checks if the value of the field is `CEREF1_13`"]
    #[inline(always)]
    pub fn is_ceref1_13(&self) -> bool {
        *self == CEREF1_A::CEREF1_13
    }
    #[doc = "Checks if the value of the field is `CEREF1_14`"]
    #[inline(always)]
    pub fn is_ceref1_14(&self) -> bool {
        *self == CEREF1_A::CEREF1_14
    }
    #[doc = "Checks if the value of the field is `CEREF1_15`"]
    #[inline(always)]
    pub fn is_ceref1_15(&self) -> bool {
        *self == CEREF1_A::CEREF1_15
    }
    #[doc = "Checks if the value of the field is `CEREF1_16`"]
    #[inline(always)]
    pub fn is_ceref1_16(&self) -> bool {
        *self == CEREF1_A::CEREF1_16
    }
    #[doc = "Checks if the value of the field is `CEREF1_17`"]
    #[inline(always)]
    pub fn is_ceref1_17(&self) -> bool {
        *self == CEREF1_A::CEREF1_17
    }
    #[doc = "Checks if the value of the field is `CEREF1_18`"]
    #[inline(always)]
    pub fn is_ceref1_18(&self) -> bool {
        *self == CEREF1_A::CEREF1_18
    }
    #[doc = "Checks if the value of the field is `CEREF1_19`"]
    #[inline(always)]
    pub fn is_ceref1_19(&self) -> bool {
        *self == CEREF1_A::CEREF1_19
    }
    #[doc = "Checks if the value of the field is `CEREF1_20`"]
    #[inline(always)]
    pub fn is_ceref1_20(&self) -> bool {
        *self == CEREF1_A::CEREF1_20
    }
    #[doc = "Checks if the value of the field is `CEREF1_21`"]
    #[inline(always)]
    pub fn is_ceref1_21(&self) -> bool {
        *self == CEREF1_A::CEREF1_21
    }
    #[doc = "Checks if the value of the field is `CEREF1_22`"]
    #[inline(always)]
    pub fn is_ceref1_22(&self) -> bool {
        *self == CEREF1_A::CEREF1_22
    }
    #[doc = "Checks if the value of the field is `CEREF1_23`"]
    #[inline(always)]
    pub fn is_ceref1_23(&self) -> bool {
        *self == CEREF1_A::CEREF1_23
    }
    #[doc = "Checks if the value of the field is `CEREF1_24`"]
    #[inline(always)]
    pub fn is_ceref1_24(&self) -> bool {
        *self == CEREF1_A::CEREF1_24
    }
    #[doc = "Checks if the value of the field is `CEREF1_25`"]
    #[inline(always)]
    pub fn is_ceref1_25(&self) -> bool {
        *self == CEREF1_A::CEREF1_25
    }
    #[doc = "Checks if the value of the field is `CEREF1_26`"]
    #[inline(always)]
    pub fn is_ceref1_26(&self) -> bool {
        *self == CEREF1_A::CEREF1_26
    }
    #[doc = "Checks if the value of the field is `CEREF1_27`"]
    #[inline(always)]
    pub fn is_ceref1_27(&self) -> bool {
        *self == CEREF1_A::CEREF1_27
    }
    #[doc = "Checks if the value of the field is `CEREF1_28`"]
    #[inline(always)]
    pub fn is_ceref1_28(&self) -> bool {
        *self == CEREF1_A::CEREF1_28
    }
    #[doc = "Checks if the value of the field is `CEREF1_29`"]
    #[inline(always)]
    pub fn is_ceref1_29(&self) -> bool {
        *self == CEREF1_A::CEREF1_29
    }
    #[doc = "Checks if the value of the field is `CEREF1_30`"]
    #[inline(always)]
    pub fn is_ceref1_30(&self) -> bool {
        *self == CEREF1_A::CEREF1_30
    }
    #[doc = "Checks if the value of the field is `CEREF1_31`"]
    #[inline(always)]
    pub fn is_ceref1_31(&self) -> bool {
        *self == CEREF1_A::CEREF1_31
    }
}
#[doc = "Field `CEREF1` writer - Reference resistor tap 1"]
pub type CEREF1_W<'a, const O: u8> =
    crate::FieldWriterSafe<'a, u16, CEXCTL2_SPEC, u8, CEREF1_A, 5, O>;
impl<'a, const O: u8> CEREF1_W<'a, O> {
    #[doc = "Reference resistor tap for setting 0."]
    #[inline(always)]
    pub fn ceref1_0(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_0)
    }
    #[doc = "Reference resistor tap for setting 1."]
    #[inline(always)]
    pub fn ceref1_1(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_1)
    }
    #[doc = "Reference resistor tap for setting 2."]
    #[inline(always)]
    pub fn ceref1_2(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_2)
    }
    #[doc = "Reference resistor tap for setting 3."]
    #[inline(always)]
    pub fn ceref1_3(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_3)
    }
    #[doc = "Reference resistor tap for setting 4."]
    #[inline(always)]
    pub fn ceref1_4(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_4)
    }
    #[doc = "Reference resistor tap for setting 5."]
    #[inline(always)]
    pub fn ceref1_5(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_5)
    }
    #[doc = "Reference resistor tap for setting 6."]
    #[inline(always)]
    pub fn ceref1_6(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_6)
    }
    #[doc = "Reference resistor tap for setting 7."]
    #[inline(always)]
    pub fn ceref1_7(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_7)
    }
    #[doc = "Reference resistor tap for setting 8."]
    #[inline(always)]
    pub fn ceref1_8(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_8)
    }
    #[doc = "Reference resistor tap for setting 9."]
    #[inline(always)]
    pub fn ceref1_9(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_9)
    }
    #[doc = "Reference resistor tap for setting 10."]
    #[inline(always)]
    pub fn ceref1_10(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_10)
    }
    #[doc = "Reference resistor tap for setting 11."]
    #[inline(always)]
    pub fn ceref1_11(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_11)
    }
    #[doc = "Reference resistor tap for setting 12."]
    #[inline(always)]
    pub fn ceref1_12(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_12)
    }
    #[doc = "Reference resistor tap for setting 13."]
    #[inline(always)]
    pub fn ceref1_13(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_13)
    }
    #[doc = "Reference resistor tap for setting 14."]
    #[inline(always)]
    pub fn ceref1_14(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_14)
    }
    #[doc = "Reference resistor tap for setting 15."]
    #[inline(always)]
    pub fn ceref1_15(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_15)
    }
    #[doc = "Reference resistor tap for setting 16."]
    #[inline(always)]
    pub fn ceref1_16(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_16)
    }
    #[doc = "Reference resistor tap for setting 17."]
    #[inline(always)]
    pub fn ceref1_17(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_17)
    }
    #[doc = "Reference resistor tap for setting 18."]
    #[inline(always)]
    pub fn ceref1_18(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_18)
    }
    #[doc = "Reference resistor tap for setting 19."]
    #[inline(always)]
    pub fn ceref1_19(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_19)
    }
    #[doc = "Reference resistor tap for setting 20."]
    #[inline(always)]
    pub fn ceref1_20(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_20)
    }
    #[doc = "Reference resistor tap for setting 21."]
    #[inline(always)]
    pub fn ceref1_21(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_21)
    }
    #[doc = "Reference resistor tap for setting 22."]
    #[inline(always)]
    pub fn ceref1_22(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_22)
    }
    #[doc = "Reference resistor tap for setting 23."]
    #[inline(always)]
    pub fn ceref1_23(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_23)
    }
    #[doc = "Reference resistor tap for setting 24."]
    #[inline(always)]
    pub fn ceref1_24(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_24)
    }
    #[doc = "Reference resistor tap for setting 25."]
    #[inline(always)]
    pub fn ceref1_25(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_25)
    }
    #[doc = "Reference resistor tap for setting 26."]
    #[inline(always)]
    pub fn ceref1_26(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_26)
    }
    #[doc = "Reference resistor tap for setting 27."]
    #[inline(always)]
    pub fn ceref1_27(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_27)
    }
    #[doc = "Reference resistor tap for setting 28."]
    #[inline(always)]
    pub fn ceref1_28(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_28)
    }
    #[doc = "Reference resistor tap for setting 29."]
    #[inline(always)]
    pub fn ceref1_29(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_29)
    }
    #[doc = "Reference resistor tap for setting 30."]
    #[inline(always)]
    pub fn ceref1_30(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_30)
    }
    #[doc = "Reference resistor tap for setting 31."]
    #[inline(always)]
    pub fn ceref1_31(self) -> &'a mut W {
        self.variant(CEREF1_A::CEREF1_31)
    }
}
#[doc = "Reference voltage level\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum CEREFL_A {
    #[doc = "0: Reference amplifier is disabled. No reference voltage is requested"]
    CEREFL_0 = 0,
    #[doc = "1: 1.2 V is selected as shared reference voltage input"]
    CEREFL_1 = 1,
    #[doc = "2: 2.0 V is selected as shared reference voltage input"]
    CEREFL_2 = 2,
    #[doc = "3: 2.5 V is selected as shared reference voltage input"]
    CEREFL_3 = 3,
}
impl From<CEREFL_A> for u8 {
    #[inline(always)]
    fn from(variant: CEREFL_A) -> Self {
        variant as _
    }
}
#[doc = "Field `CEREFL` reader - Reference voltage level"]
pub type CEREFL_R = crate::FieldReader<u8, CEREFL_A>;
impl CEREFL_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CEREFL_A {
        match self.bits {
            0 => CEREFL_A::CEREFL_0,
            1 => CEREFL_A::CEREFL_1,
            2 => CEREFL_A::CEREFL_2,
            3 => CEREFL_A::CEREFL_3,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `CEREFL_0`"]
    #[inline(always)]
    pub fn is_cerefl_0(&self) -> bool {
        *self == CEREFL_A::CEREFL_0
    }
    #[doc = "Checks if the value of the field is `CEREFL_1`"]
    #[inline(always)]
    pub fn is_cerefl_1(&self) -> bool {
        *self == CEREFL_A::CEREFL_1
    }
    #[doc = "Checks if the value of the field is `CEREFL_2`"]
    #[inline(always)]
    pub fn is_cerefl_2(&self) -> bool {
        *self == CEREFL_A::CEREFL_2
    }
    #[doc = "Checks if the value of the field is `CEREFL_3`"]
    #[inline(always)]
    pub fn is_cerefl_3(&self) -> bool {
        *self == CEREFL_A::CEREFL_3
    }
}
#[doc = "Field `CEREFL` writer - Reference voltage level"]
pub type CEREFL_W<'a, const O: u8> =
    crate::FieldWriterSafe<'a, u16, CEXCTL2_SPEC, u8, CEREFL_A, 2, O>;
impl<'a, const O: u8> CEREFL_W<'a, O> {
    #[doc = "Reference amplifier is disabled. No reference voltage is requested"]
    #[inline(always)]
    pub fn cerefl_0(self) -> &'a mut W {
        self.variant(CEREFL_A::CEREFL_0)
    }
    #[doc = "1.2 V is selected as shared reference voltage input"]
    #[inline(always)]
    pub fn cerefl_1(self) -> &'a mut W {
        self.variant(CEREFL_A::CEREFL_1)
    }
    #[doc = "2.0 V is selected as shared reference voltage input"]
    #[inline(always)]
    pub fn cerefl_2(self) -> &'a mut W {
        self.variant(CEREFL_A::CEREFL_2)
    }
    #[doc = "2.5 V is selected as shared reference voltage input"]
    #[inline(always)]
    pub fn cerefl_3(self) -> &'a mut W {
        self.variant(CEREFL_A::CEREFL_3)
    }
}
#[doc = "Reference accuracy\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CEREFACC_A {
    #[doc = "0: Static mode"]
    CEREFACC_0 = 0,
    #[doc = "1: Clocked (low power, low accuracy) mode"]
    CEREFACC_1 = 1,
}
impl From<CEREFACC_A> for bool {
    #[inline(always)]
    fn from(variant: CEREFACC_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CEREFACC` reader - Reference accuracy"]
pub type CEREFACC_R = crate::BitReader<CEREFACC_A>;
impl CEREFACC_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CEREFACC_A {
        match self.bits {
            false => CEREFACC_A::CEREFACC_0,
            true => CEREFACC_A::CEREFACC_1,
        }
    }
    #[doc = "Checks if the value of the field is `CEREFACC_0`"]
    #[inline(always)]
    pub fn is_cerefacc_0(&self) -> bool {
        *self == CEREFACC_A::CEREFACC_0
    }
    #[doc = "Checks if the value of the field is `CEREFACC_1`"]
    #[inline(always)]
    pub fn is_cerefacc_1(&self) -> bool {
        *self == CEREFACC_A::CEREFACC_1
    }
}
#[doc = "Field `CEREFACC` writer - Reference accuracy"]
pub type CEREFACC_W<'a, const O: u8> = crate::BitWriter<'a, u16, CEXCTL2_SPEC, CEREFACC_A, O>;
impl<'a, const O: u8> CEREFACC_W<'a, O> {
    #[doc = "Static mode"]
    #[inline(always)]
    pub fn cerefacc_0(self) -> &'a mut W {
        self.variant(CEREFACC_A::CEREFACC_0)
    }
    #[doc = "Clocked (low power, low accuracy) mode"]
    #[inline(always)]
    pub fn cerefacc_1(self) -> &'a mut W {
        self.variant(CEREFACC_A::CEREFACC_1)
    }
}
impl R {
    #[doc = "Bits 0:4 - Reference resistor tap 0"]
    #[inline(always)]
    pub fn ceref0(&self) -> CEREF0_R {
        CEREF0_R::new((self.bits & 0x1f) as u8)
    }
    #[doc = "Bit 5 - Reference select"]
    #[inline(always)]
    pub fn cersel(&self) -> CERSEL_R {
        CERSEL_R::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bits 6:7 - Reference source"]
    #[inline(always)]
    pub fn cers(&self) -> CERS_R {
        CERS_R::new(((self.bits >> 6) & 3) as u8)
    }
    #[doc = "Bits 8:12 - Reference resistor tap 1"]
    #[inline(always)]
    pub fn ceref1(&self) -> CEREF1_R {
        CEREF1_R::new(((self.bits >> 8) & 0x1f) as u8)
    }
    #[doc = "Bits 13:14 - Reference voltage level"]
    #[inline(always)]
    pub fn cerefl(&self) -> CEREFL_R {
        CEREFL_R::new(((self.bits >> 13) & 3) as u8)
    }
    #[doc = "Bit 15 - Reference accuracy"]
    #[inline(always)]
    pub fn cerefacc(&self) -> CEREFACC_R {
        CEREFACC_R::new(((self.bits >> 15) & 1) != 0)
    }
}
impl W {
    #[doc = "Bits 0:4 - Reference resistor tap 0"]
    #[inline(always)]
    pub fn ceref0(&mut self) -> CEREF0_W<0> {
        CEREF0_W::new(self)
    }
    #[doc = "Bit 5 - Reference select"]
    #[inline(always)]
    pub fn cersel(&mut self) -> CERSEL_W<5> {
        CERSEL_W::new(self)
    }
    #[doc = "Bits 6:7 - Reference source"]
    #[inline(always)]
    pub fn cers(&mut self) -> CERS_W<6> {
        CERS_W::new(self)
    }
    #[doc = "Bits 8:12 - Reference resistor tap 1"]
    #[inline(always)]
    pub fn ceref1(&mut self) -> CEREF1_W<8> {
        CEREF1_W::new(self)
    }
    #[doc = "Bits 13:14 - Reference voltage level"]
    #[inline(always)]
    pub fn cerefl(&mut self) -> CEREFL_W<13> {
        CEREFL_W::new(self)
    }
    #[doc = "Bit 15 - Reference accuracy"]
    #[inline(always)]
    pub fn cerefacc(&mut self) -> CEREFACC_W<15> {
        CEREFACC_W::new(self)
    }
    #[doc = "Writes raw bits to the register."]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u16) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "Comparator Control Register 2\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cex_ctl2](index.html) module"]
pub struct CEXCTL2_SPEC;
impl crate::RegisterSpec for CEXCTL2_SPEC {
    type Ux = u16;
}
#[doc = "`read()` method returns [cex_ctl2::R](R) reader structure"]
impl crate::Readable for CEXCTL2_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [cex_ctl2::W](W) writer structure"]
impl crate::Writable for CEXCTL2_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets CExCTL2 to value 0"]
impl crate::Resettable for CEXCTL2_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}