efm32pg12_pac/acmp0/
inputsel.rs

1#[doc = "Reader of register INPUTSEL"]
2pub type R = crate::R<u32, super::INPUTSEL>;
3#[doc = "Writer for register INPUTSEL"]
4pub type W = crate::W<u32, super::INPUTSEL>;
5#[doc = "Register INPUTSEL `reset()`'s with value 0"]
6impl crate::ResetValue for super::INPUTSEL {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0
11    }
12}
13#[doc = "Reader of field `POSSEL`"]
14pub type POSSEL_R = crate::R<u8, u8>;
15#[doc = "Write proxy for field `POSSEL`"]
16pub struct POSSEL_W<'a> {
17    w: &'a mut W,
18}
19impl<'a> POSSEL_W<'a> {
20    #[doc = r"Writes raw bits to the field"]
21    #[inline(always)]
22    pub unsafe fn bits(self, value: u8) -> &'a mut W {
23        self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff);
24        self.w
25    }
26}
27#[doc = "Reader of field `NEGSEL`"]
28pub type NEGSEL_R = crate::R<u8, u8>;
29#[doc = "Write proxy for field `NEGSEL`"]
30pub struct NEGSEL_W<'a> {
31    w: &'a mut W,
32}
33impl<'a> NEGSEL_W<'a> {
34    #[doc = r"Writes raw bits to the field"]
35    #[inline(always)]
36    pub unsafe fn bits(self, value: u8) -> &'a mut W {
37        self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8);
38        self.w
39    }
40}
41#[doc = "VA Selection\n\nValue on reset: 0"]
42#[derive(Clone, Copy, Debug, PartialEq)]
43#[repr(u8)]
44pub enum VASEL_A {
45    #[doc = "0: ACMPVDD"]
46    VDD = 0,
47    #[doc = "1: APORT2Y Channel 0"]
48    APORT2YCH0 = 1,
49    #[doc = "3: APORT2Y Channel 2"]
50    APORT2YCH2 = 3,
51    #[doc = "5: APORT2Y Channel 4"]
52    APORT2YCH4 = 5,
53    #[doc = "7: APORT2Y Channel 6"]
54    APORT2YCH6 = 7,
55    #[doc = "9: APORT2Y Channel 8"]
56    APORT2YCH8 = 9,
57    #[doc = "11: APORT2Y Channel 10"]
58    APORT2YCH10 = 11,
59    #[doc = "13: APORT2Y Channel 12"]
60    APORT2YCH12 = 13,
61    #[doc = "15: APORT2Y Channel 14"]
62    APORT2YCH14 = 15,
63    #[doc = "17: APORT2Y Channel 16"]
64    APORT2YCH16 = 17,
65    #[doc = "19: APORT2Y Channel 18"]
66    APORT2YCH18 = 19,
67    #[doc = "21: APORT2Y Channel 20"]
68    APORT2YCH20 = 21,
69    #[doc = "23: APORT2Y Channel 22"]
70    APORT2YCH22 = 23,
71    #[doc = "25: APORT2Y Channel 24"]
72    APORT2YCH24 = 25,
73    #[doc = "27: APORT2Y Channel 26"]
74    APORT2YCH26 = 27,
75    #[doc = "29: APORT2Y Channel 28"]
76    APORT2YCH28 = 29,
77    #[doc = "31: APORT2Y Channel 30"]
78    APORT2YCH30 = 31,
79    #[doc = "32: APORT1X Channel 0"]
80    APORT1XCH0 = 32,
81    #[doc = "33: APORT1Y Channel 1"]
82    APORT1YCH1 = 33,
83    #[doc = "34: APORT1X Channel 2"]
84    APORT1XCH2 = 34,
85    #[doc = "35: APORT1Y Channel 3"]
86    APORT1YCH3 = 35,
87    #[doc = "36: APORT1X Channel 4"]
88    APORT1XCH4 = 36,
89    #[doc = "37: APORT1Y Channel 5"]
90    APORT1YCH5 = 37,
91    #[doc = "38: APORT1X Channel 6"]
92    APORT1XCH6 = 38,
93    #[doc = "39: APORT1Y Channel 7"]
94    APORT1YCH7 = 39,
95    #[doc = "40: APORT1X Channel 8"]
96    APORT1XCH8 = 40,
97    #[doc = "41: APORT1Y Channel 9"]
98    APORT1YCH9 = 41,
99    #[doc = "42: APORT1X Channel 10"]
100    APORT1XCH10 = 42,
101    #[doc = "43: APORT1Y Channel 11"]
102    APORT1YCH11 = 43,
103    #[doc = "44: APORT1X Channel 12"]
104    APORT1XCH12 = 44,
105    #[doc = "45: APORT1Y Channel 13"]
106    APORT1YCH13 = 45,
107    #[doc = "46: APORT1X Channel 14"]
108    APORT1XCH14 = 46,
109    #[doc = "47: APORT1Y Channel 15"]
110    APORT1YCH15 = 47,
111    #[doc = "48: APORT1X Channel 16"]
112    APORT1XCH16 = 48,
113    #[doc = "49: APORT1Y Channel 17"]
114    APORT1YCH17 = 49,
115    #[doc = "50: APORT1X Channel 18"]
116    APORT1XCH18 = 50,
117    #[doc = "51: APORT1Y Channel 19"]
118    APORT1YCH19 = 51,
119    #[doc = "52: APORT1X Channel 20"]
120    APORT1XCH20 = 52,
121    #[doc = "53: APORT1Y Channel 21"]
122    APORT1YCH21 = 53,
123    #[doc = "54: APORT1X Channel 22"]
124    APORT1XCH22 = 54,
125    #[doc = "55: APORT1Y Channel 23"]
126    APORT1YCH23 = 55,
127    #[doc = "56: APORT1X Channel 24"]
128    APORT1XCH24 = 56,
129    #[doc = "57: APORT1Y Channel 25"]
130    APORT1YCH25 = 57,
131    #[doc = "58: APORT1X Channel 26"]
132    APORT1XCH26 = 58,
133    #[doc = "59: APORT1Y Channel 27"]
134    APORT1YCH27 = 59,
135    #[doc = "60: APORT1X Channel 28"]
136    APORT1XCH28 = 60,
137    #[doc = "61: APORT1Y Channel 29"]
138    APORT1YCH29 = 61,
139    #[doc = "62: APORT1X Channel 30"]
140    APORT1XCH30 = 62,
141    #[doc = "63: APORT1Y Channel 31"]
142    APORT1YCH31 = 63,
143}
144impl From<VASEL_A> for u8 {
145    #[inline(always)]
146    fn from(variant: VASEL_A) -> Self {
147        variant as _
148    }
149}
150#[doc = "Reader of field `VASEL`"]
151pub type VASEL_R = crate::R<u8, VASEL_A>;
152impl VASEL_R {
153    #[doc = r"Get enumerated values variant"]
154    #[inline(always)]
155    pub fn variant(&self) -> crate::Variant<u8, VASEL_A> {
156        use crate::Variant::*;
157        match self.bits {
158            0 => Val(VASEL_A::VDD),
159            1 => Val(VASEL_A::APORT2YCH0),
160            3 => Val(VASEL_A::APORT2YCH2),
161            5 => Val(VASEL_A::APORT2YCH4),
162            7 => Val(VASEL_A::APORT2YCH6),
163            9 => Val(VASEL_A::APORT2YCH8),
164            11 => Val(VASEL_A::APORT2YCH10),
165            13 => Val(VASEL_A::APORT2YCH12),
166            15 => Val(VASEL_A::APORT2YCH14),
167            17 => Val(VASEL_A::APORT2YCH16),
168            19 => Val(VASEL_A::APORT2YCH18),
169            21 => Val(VASEL_A::APORT2YCH20),
170            23 => Val(VASEL_A::APORT2YCH22),
171            25 => Val(VASEL_A::APORT2YCH24),
172            27 => Val(VASEL_A::APORT2YCH26),
173            29 => Val(VASEL_A::APORT2YCH28),
174            31 => Val(VASEL_A::APORT2YCH30),
175            32 => Val(VASEL_A::APORT1XCH0),
176            33 => Val(VASEL_A::APORT1YCH1),
177            34 => Val(VASEL_A::APORT1XCH2),
178            35 => Val(VASEL_A::APORT1YCH3),
179            36 => Val(VASEL_A::APORT1XCH4),
180            37 => Val(VASEL_A::APORT1YCH5),
181            38 => Val(VASEL_A::APORT1XCH6),
182            39 => Val(VASEL_A::APORT1YCH7),
183            40 => Val(VASEL_A::APORT1XCH8),
184            41 => Val(VASEL_A::APORT1YCH9),
185            42 => Val(VASEL_A::APORT1XCH10),
186            43 => Val(VASEL_A::APORT1YCH11),
187            44 => Val(VASEL_A::APORT1XCH12),
188            45 => Val(VASEL_A::APORT1YCH13),
189            46 => Val(VASEL_A::APORT1XCH14),
190            47 => Val(VASEL_A::APORT1YCH15),
191            48 => Val(VASEL_A::APORT1XCH16),
192            49 => Val(VASEL_A::APORT1YCH17),
193            50 => Val(VASEL_A::APORT1XCH18),
194            51 => Val(VASEL_A::APORT1YCH19),
195            52 => Val(VASEL_A::APORT1XCH20),
196            53 => Val(VASEL_A::APORT1YCH21),
197            54 => Val(VASEL_A::APORT1XCH22),
198            55 => Val(VASEL_A::APORT1YCH23),
199            56 => Val(VASEL_A::APORT1XCH24),
200            57 => Val(VASEL_A::APORT1YCH25),
201            58 => Val(VASEL_A::APORT1XCH26),
202            59 => Val(VASEL_A::APORT1YCH27),
203            60 => Val(VASEL_A::APORT1XCH28),
204            61 => Val(VASEL_A::APORT1YCH29),
205            62 => Val(VASEL_A::APORT1XCH30),
206            63 => Val(VASEL_A::APORT1YCH31),
207            i => Res(i),
208        }
209    }
210    #[doc = "Checks if the value of the field is `VDD`"]
211    #[inline(always)]
212    pub fn is_vdd(&self) -> bool {
213        *self == VASEL_A::VDD
214    }
215    #[doc = "Checks if the value of the field is `APORT2YCH0`"]
216    #[inline(always)]
217    pub fn is_aport2ych0(&self) -> bool {
218        *self == VASEL_A::APORT2YCH0
219    }
220    #[doc = "Checks if the value of the field is `APORT2YCH2`"]
221    #[inline(always)]
222    pub fn is_aport2ych2(&self) -> bool {
223        *self == VASEL_A::APORT2YCH2
224    }
225    #[doc = "Checks if the value of the field is `APORT2YCH4`"]
226    #[inline(always)]
227    pub fn is_aport2ych4(&self) -> bool {
228        *self == VASEL_A::APORT2YCH4
229    }
230    #[doc = "Checks if the value of the field is `APORT2YCH6`"]
231    #[inline(always)]
232    pub fn is_aport2ych6(&self) -> bool {
233        *self == VASEL_A::APORT2YCH6
234    }
235    #[doc = "Checks if the value of the field is `APORT2YCH8`"]
236    #[inline(always)]
237    pub fn is_aport2ych8(&self) -> bool {
238        *self == VASEL_A::APORT2YCH8
239    }
240    #[doc = "Checks if the value of the field is `APORT2YCH10`"]
241    #[inline(always)]
242    pub fn is_aport2ych10(&self) -> bool {
243        *self == VASEL_A::APORT2YCH10
244    }
245    #[doc = "Checks if the value of the field is `APORT2YCH12`"]
246    #[inline(always)]
247    pub fn is_aport2ych12(&self) -> bool {
248        *self == VASEL_A::APORT2YCH12
249    }
250    #[doc = "Checks if the value of the field is `APORT2YCH14`"]
251    #[inline(always)]
252    pub fn is_aport2ych14(&self) -> bool {
253        *self == VASEL_A::APORT2YCH14
254    }
255    #[doc = "Checks if the value of the field is `APORT2YCH16`"]
256    #[inline(always)]
257    pub fn is_aport2ych16(&self) -> bool {
258        *self == VASEL_A::APORT2YCH16
259    }
260    #[doc = "Checks if the value of the field is `APORT2YCH18`"]
261    #[inline(always)]
262    pub fn is_aport2ych18(&self) -> bool {
263        *self == VASEL_A::APORT2YCH18
264    }
265    #[doc = "Checks if the value of the field is `APORT2YCH20`"]
266    #[inline(always)]
267    pub fn is_aport2ych20(&self) -> bool {
268        *self == VASEL_A::APORT2YCH20
269    }
270    #[doc = "Checks if the value of the field is `APORT2YCH22`"]
271    #[inline(always)]
272    pub fn is_aport2ych22(&self) -> bool {
273        *self == VASEL_A::APORT2YCH22
274    }
275    #[doc = "Checks if the value of the field is `APORT2YCH24`"]
276    #[inline(always)]
277    pub fn is_aport2ych24(&self) -> bool {
278        *self == VASEL_A::APORT2YCH24
279    }
280    #[doc = "Checks if the value of the field is `APORT2YCH26`"]
281    #[inline(always)]
282    pub fn is_aport2ych26(&self) -> bool {
283        *self == VASEL_A::APORT2YCH26
284    }
285    #[doc = "Checks if the value of the field is `APORT2YCH28`"]
286    #[inline(always)]
287    pub fn is_aport2ych28(&self) -> bool {
288        *self == VASEL_A::APORT2YCH28
289    }
290    #[doc = "Checks if the value of the field is `APORT2YCH30`"]
291    #[inline(always)]
292    pub fn is_aport2ych30(&self) -> bool {
293        *self == VASEL_A::APORT2YCH30
294    }
295    #[doc = "Checks if the value of the field is `APORT1XCH0`"]
296    #[inline(always)]
297    pub fn is_aport1xch0(&self) -> bool {
298        *self == VASEL_A::APORT1XCH0
299    }
300    #[doc = "Checks if the value of the field is `APORT1YCH1`"]
301    #[inline(always)]
302    pub fn is_aport1ych1(&self) -> bool {
303        *self == VASEL_A::APORT1YCH1
304    }
305    #[doc = "Checks if the value of the field is `APORT1XCH2`"]
306    #[inline(always)]
307    pub fn is_aport1xch2(&self) -> bool {
308        *self == VASEL_A::APORT1XCH2
309    }
310    #[doc = "Checks if the value of the field is `APORT1YCH3`"]
311    #[inline(always)]
312    pub fn is_aport1ych3(&self) -> bool {
313        *self == VASEL_A::APORT1YCH3
314    }
315    #[doc = "Checks if the value of the field is `APORT1XCH4`"]
316    #[inline(always)]
317    pub fn is_aport1xch4(&self) -> bool {
318        *self == VASEL_A::APORT1XCH4
319    }
320    #[doc = "Checks if the value of the field is `APORT1YCH5`"]
321    #[inline(always)]
322    pub fn is_aport1ych5(&self) -> bool {
323        *self == VASEL_A::APORT1YCH5
324    }
325    #[doc = "Checks if the value of the field is `APORT1XCH6`"]
326    #[inline(always)]
327    pub fn is_aport1xch6(&self) -> bool {
328        *self == VASEL_A::APORT1XCH6
329    }
330    #[doc = "Checks if the value of the field is `APORT1YCH7`"]
331    #[inline(always)]
332    pub fn is_aport1ych7(&self) -> bool {
333        *self == VASEL_A::APORT1YCH7
334    }
335    #[doc = "Checks if the value of the field is `APORT1XCH8`"]
336    #[inline(always)]
337    pub fn is_aport1xch8(&self) -> bool {
338        *self == VASEL_A::APORT1XCH8
339    }
340    #[doc = "Checks if the value of the field is `APORT1YCH9`"]
341    #[inline(always)]
342    pub fn is_aport1ych9(&self) -> bool {
343        *self == VASEL_A::APORT1YCH9
344    }
345    #[doc = "Checks if the value of the field is `APORT1XCH10`"]
346    #[inline(always)]
347    pub fn is_aport1xch10(&self) -> bool {
348        *self == VASEL_A::APORT1XCH10
349    }
350    #[doc = "Checks if the value of the field is `APORT1YCH11`"]
351    #[inline(always)]
352    pub fn is_aport1ych11(&self) -> bool {
353        *self == VASEL_A::APORT1YCH11
354    }
355    #[doc = "Checks if the value of the field is `APORT1XCH12`"]
356    #[inline(always)]
357    pub fn is_aport1xch12(&self) -> bool {
358        *self == VASEL_A::APORT1XCH12
359    }
360    #[doc = "Checks if the value of the field is `APORT1YCH13`"]
361    #[inline(always)]
362    pub fn is_aport1ych13(&self) -> bool {
363        *self == VASEL_A::APORT1YCH13
364    }
365    #[doc = "Checks if the value of the field is `APORT1XCH14`"]
366    #[inline(always)]
367    pub fn is_aport1xch14(&self) -> bool {
368        *self == VASEL_A::APORT1XCH14
369    }
370    #[doc = "Checks if the value of the field is `APORT1YCH15`"]
371    #[inline(always)]
372    pub fn is_aport1ych15(&self) -> bool {
373        *self == VASEL_A::APORT1YCH15
374    }
375    #[doc = "Checks if the value of the field is `APORT1XCH16`"]
376    #[inline(always)]
377    pub fn is_aport1xch16(&self) -> bool {
378        *self == VASEL_A::APORT1XCH16
379    }
380    #[doc = "Checks if the value of the field is `APORT1YCH17`"]
381    #[inline(always)]
382    pub fn is_aport1ych17(&self) -> bool {
383        *self == VASEL_A::APORT1YCH17
384    }
385    #[doc = "Checks if the value of the field is `APORT1XCH18`"]
386    #[inline(always)]
387    pub fn is_aport1xch18(&self) -> bool {
388        *self == VASEL_A::APORT1XCH18
389    }
390    #[doc = "Checks if the value of the field is `APORT1YCH19`"]
391    #[inline(always)]
392    pub fn is_aport1ych19(&self) -> bool {
393        *self == VASEL_A::APORT1YCH19
394    }
395    #[doc = "Checks if the value of the field is `APORT1XCH20`"]
396    #[inline(always)]
397    pub fn is_aport1xch20(&self) -> bool {
398        *self == VASEL_A::APORT1XCH20
399    }
400    #[doc = "Checks if the value of the field is `APORT1YCH21`"]
401    #[inline(always)]
402    pub fn is_aport1ych21(&self) -> bool {
403        *self == VASEL_A::APORT1YCH21
404    }
405    #[doc = "Checks if the value of the field is `APORT1XCH22`"]
406    #[inline(always)]
407    pub fn is_aport1xch22(&self) -> bool {
408        *self == VASEL_A::APORT1XCH22
409    }
410    #[doc = "Checks if the value of the field is `APORT1YCH23`"]
411    #[inline(always)]
412    pub fn is_aport1ych23(&self) -> bool {
413        *self == VASEL_A::APORT1YCH23
414    }
415    #[doc = "Checks if the value of the field is `APORT1XCH24`"]
416    #[inline(always)]
417    pub fn is_aport1xch24(&self) -> bool {
418        *self == VASEL_A::APORT1XCH24
419    }
420    #[doc = "Checks if the value of the field is `APORT1YCH25`"]
421    #[inline(always)]
422    pub fn is_aport1ych25(&self) -> bool {
423        *self == VASEL_A::APORT1YCH25
424    }
425    #[doc = "Checks if the value of the field is `APORT1XCH26`"]
426    #[inline(always)]
427    pub fn is_aport1xch26(&self) -> bool {
428        *self == VASEL_A::APORT1XCH26
429    }
430    #[doc = "Checks if the value of the field is `APORT1YCH27`"]
431    #[inline(always)]
432    pub fn is_aport1ych27(&self) -> bool {
433        *self == VASEL_A::APORT1YCH27
434    }
435    #[doc = "Checks if the value of the field is `APORT1XCH28`"]
436    #[inline(always)]
437    pub fn is_aport1xch28(&self) -> bool {
438        *self == VASEL_A::APORT1XCH28
439    }
440    #[doc = "Checks if the value of the field is `APORT1YCH29`"]
441    #[inline(always)]
442    pub fn is_aport1ych29(&self) -> bool {
443        *self == VASEL_A::APORT1YCH29
444    }
445    #[doc = "Checks if the value of the field is `APORT1XCH30`"]
446    #[inline(always)]
447    pub fn is_aport1xch30(&self) -> bool {
448        *self == VASEL_A::APORT1XCH30
449    }
450    #[doc = "Checks if the value of the field is `APORT1YCH31`"]
451    #[inline(always)]
452    pub fn is_aport1ych31(&self) -> bool {
453        *self == VASEL_A::APORT1YCH31
454    }
455}
456#[doc = "Write proxy for field `VASEL`"]
457pub struct VASEL_W<'a> {
458    w: &'a mut W,
459}
460impl<'a> VASEL_W<'a> {
461    #[doc = r"Writes `variant` to the field"]
462    #[inline(always)]
463    pub fn variant(self, variant: VASEL_A) -> &'a mut W {
464        unsafe { self.bits(variant.into()) }
465    }
466    #[doc = "ACMPVDD"]
467    #[inline(always)]
468    pub fn vdd(self) -> &'a mut W {
469        self.variant(VASEL_A::VDD)
470    }
471    #[doc = "APORT2Y Channel 0"]
472    #[inline(always)]
473    pub fn aport2ych0(self) -> &'a mut W {
474        self.variant(VASEL_A::APORT2YCH0)
475    }
476    #[doc = "APORT2Y Channel 2"]
477    #[inline(always)]
478    pub fn aport2ych2(self) -> &'a mut W {
479        self.variant(VASEL_A::APORT2YCH2)
480    }
481    #[doc = "APORT2Y Channel 4"]
482    #[inline(always)]
483    pub fn aport2ych4(self) -> &'a mut W {
484        self.variant(VASEL_A::APORT2YCH4)
485    }
486    #[doc = "APORT2Y Channel 6"]
487    #[inline(always)]
488    pub fn aport2ych6(self) -> &'a mut W {
489        self.variant(VASEL_A::APORT2YCH6)
490    }
491    #[doc = "APORT2Y Channel 8"]
492    #[inline(always)]
493    pub fn aport2ych8(self) -> &'a mut W {
494        self.variant(VASEL_A::APORT2YCH8)
495    }
496    #[doc = "APORT2Y Channel 10"]
497    #[inline(always)]
498    pub fn aport2ych10(self) -> &'a mut W {
499        self.variant(VASEL_A::APORT2YCH10)
500    }
501    #[doc = "APORT2Y Channel 12"]
502    #[inline(always)]
503    pub fn aport2ych12(self) -> &'a mut W {
504        self.variant(VASEL_A::APORT2YCH12)
505    }
506    #[doc = "APORT2Y Channel 14"]
507    #[inline(always)]
508    pub fn aport2ych14(self) -> &'a mut W {
509        self.variant(VASEL_A::APORT2YCH14)
510    }
511    #[doc = "APORT2Y Channel 16"]
512    #[inline(always)]
513    pub fn aport2ych16(self) -> &'a mut W {
514        self.variant(VASEL_A::APORT2YCH16)
515    }
516    #[doc = "APORT2Y Channel 18"]
517    #[inline(always)]
518    pub fn aport2ych18(self) -> &'a mut W {
519        self.variant(VASEL_A::APORT2YCH18)
520    }
521    #[doc = "APORT2Y Channel 20"]
522    #[inline(always)]
523    pub fn aport2ych20(self) -> &'a mut W {
524        self.variant(VASEL_A::APORT2YCH20)
525    }
526    #[doc = "APORT2Y Channel 22"]
527    #[inline(always)]
528    pub fn aport2ych22(self) -> &'a mut W {
529        self.variant(VASEL_A::APORT2YCH22)
530    }
531    #[doc = "APORT2Y Channel 24"]
532    #[inline(always)]
533    pub fn aport2ych24(self) -> &'a mut W {
534        self.variant(VASEL_A::APORT2YCH24)
535    }
536    #[doc = "APORT2Y Channel 26"]
537    #[inline(always)]
538    pub fn aport2ych26(self) -> &'a mut W {
539        self.variant(VASEL_A::APORT2YCH26)
540    }
541    #[doc = "APORT2Y Channel 28"]
542    #[inline(always)]
543    pub fn aport2ych28(self) -> &'a mut W {
544        self.variant(VASEL_A::APORT2YCH28)
545    }
546    #[doc = "APORT2Y Channel 30"]
547    #[inline(always)]
548    pub fn aport2ych30(self) -> &'a mut W {
549        self.variant(VASEL_A::APORT2YCH30)
550    }
551    #[doc = "APORT1X Channel 0"]
552    #[inline(always)]
553    pub fn aport1xch0(self) -> &'a mut W {
554        self.variant(VASEL_A::APORT1XCH0)
555    }
556    #[doc = "APORT1Y Channel 1"]
557    #[inline(always)]
558    pub fn aport1ych1(self) -> &'a mut W {
559        self.variant(VASEL_A::APORT1YCH1)
560    }
561    #[doc = "APORT1X Channel 2"]
562    #[inline(always)]
563    pub fn aport1xch2(self) -> &'a mut W {
564        self.variant(VASEL_A::APORT1XCH2)
565    }
566    #[doc = "APORT1Y Channel 3"]
567    #[inline(always)]
568    pub fn aport1ych3(self) -> &'a mut W {
569        self.variant(VASEL_A::APORT1YCH3)
570    }
571    #[doc = "APORT1X Channel 4"]
572    #[inline(always)]
573    pub fn aport1xch4(self) -> &'a mut W {
574        self.variant(VASEL_A::APORT1XCH4)
575    }
576    #[doc = "APORT1Y Channel 5"]
577    #[inline(always)]
578    pub fn aport1ych5(self) -> &'a mut W {
579        self.variant(VASEL_A::APORT1YCH5)
580    }
581    #[doc = "APORT1X Channel 6"]
582    #[inline(always)]
583    pub fn aport1xch6(self) -> &'a mut W {
584        self.variant(VASEL_A::APORT1XCH6)
585    }
586    #[doc = "APORT1Y Channel 7"]
587    #[inline(always)]
588    pub fn aport1ych7(self) -> &'a mut W {
589        self.variant(VASEL_A::APORT1YCH7)
590    }
591    #[doc = "APORT1X Channel 8"]
592    #[inline(always)]
593    pub fn aport1xch8(self) -> &'a mut W {
594        self.variant(VASEL_A::APORT1XCH8)
595    }
596    #[doc = "APORT1Y Channel 9"]
597    #[inline(always)]
598    pub fn aport1ych9(self) -> &'a mut W {
599        self.variant(VASEL_A::APORT1YCH9)
600    }
601    #[doc = "APORT1X Channel 10"]
602    #[inline(always)]
603    pub fn aport1xch10(self) -> &'a mut W {
604        self.variant(VASEL_A::APORT1XCH10)
605    }
606    #[doc = "APORT1Y Channel 11"]
607    #[inline(always)]
608    pub fn aport1ych11(self) -> &'a mut W {
609        self.variant(VASEL_A::APORT1YCH11)
610    }
611    #[doc = "APORT1X Channel 12"]
612    #[inline(always)]
613    pub fn aport1xch12(self) -> &'a mut W {
614        self.variant(VASEL_A::APORT1XCH12)
615    }
616    #[doc = "APORT1Y Channel 13"]
617    #[inline(always)]
618    pub fn aport1ych13(self) -> &'a mut W {
619        self.variant(VASEL_A::APORT1YCH13)
620    }
621    #[doc = "APORT1X Channel 14"]
622    #[inline(always)]
623    pub fn aport1xch14(self) -> &'a mut W {
624        self.variant(VASEL_A::APORT1XCH14)
625    }
626    #[doc = "APORT1Y Channel 15"]
627    #[inline(always)]
628    pub fn aport1ych15(self) -> &'a mut W {
629        self.variant(VASEL_A::APORT1YCH15)
630    }
631    #[doc = "APORT1X Channel 16"]
632    #[inline(always)]
633    pub fn aport1xch16(self) -> &'a mut W {
634        self.variant(VASEL_A::APORT1XCH16)
635    }
636    #[doc = "APORT1Y Channel 17"]
637    #[inline(always)]
638    pub fn aport1ych17(self) -> &'a mut W {
639        self.variant(VASEL_A::APORT1YCH17)
640    }
641    #[doc = "APORT1X Channel 18"]
642    #[inline(always)]
643    pub fn aport1xch18(self) -> &'a mut W {
644        self.variant(VASEL_A::APORT1XCH18)
645    }
646    #[doc = "APORT1Y Channel 19"]
647    #[inline(always)]
648    pub fn aport1ych19(self) -> &'a mut W {
649        self.variant(VASEL_A::APORT1YCH19)
650    }
651    #[doc = "APORT1X Channel 20"]
652    #[inline(always)]
653    pub fn aport1xch20(self) -> &'a mut W {
654        self.variant(VASEL_A::APORT1XCH20)
655    }
656    #[doc = "APORT1Y Channel 21"]
657    #[inline(always)]
658    pub fn aport1ych21(self) -> &'a mut W {
659        self.variant(VASEL_A::APORT1YCH21)
660    }
661    #[doc = "APORT1X Channel 22"]
662    #[inline(always)]
663    pub fn aport1xch22(self) -> &'a mut W {
664        self.variant(VASEL_A::APORT1XCH22)
665    }
666    #[doc = "APORT1Y Channel 23"]
667    #[inline(always)]
668    pub fn aport1ych23(self) -> &'a mut W {
669        self.variant(VASEL_A::APORT1YCH23)
670    }
671    #[doc = "APORT1X Channel 24"]
672    #[inline(always)]
673    pub fn aport1xch24(self) -> &'a mut W {
674        self.variant(VASEL_A::APORT1XCH24)
675    }
676    #[doc = "APORT1Y Channel 25"]
677    #[inline(always)]
678    pub fn aport1ych25(self) -> &'a mut W {
679        self.variant(VASEL_A::APORT1YCH25)
680    }
681    #[doc = "APORT1X Channel 26"]
682    #[inline(always)]
683    pub fn aport1xch26(self) -> &'a mut W {
684        self.variant(VASEL_A::APORT1XCH26)
685    }
686    #[doc = "APORT1Y Channel 27"]
687    #[inline(always)]
688    pub fn aport1ych27(self) -> &'a mut W {
689        self.variant(VASEL_A::APORT1YCH27)
690    }
691    #[doc = "APORT1X Channel 28"]
692    #[inline(always)]
693    pub fn aport1xch28(self) -> &'a mut W {
694        self.variant(VASEL_A::APORT1XCH28)
695    }
696    #[doc = "APORT1Y Channel 29"]
697    #[inline(always)]
698    pub fn aport1ych29(self) -> &'a mut W {
699        self.variant(VASEL_A::APORT1YCH29)
700    }
701    #[doc = "APORT1X Channel 30"]
702    #[inline(always)]
703    pub fn aport1xch30(self) -> &'a mut W {
704        self.variant(VASEL_A::APORT1XCH30)
705    }
706    #[doc = "APORT1Y Channel 31"]
707    #[inline(always)]
708    pub fn aport1ych31(self) -> &'a mut W {
709        self.variant(VASEL_A::APORT1YCH31)
710    }
711    #[doc = r"Writes raw bits to the field"]
712    #[inline(always)]
713    pub unsafe fn bits(self, value: u8) -> &'a mut W {
714        self.w.bits = (self.w.bits & !(0x3f << 16)) | (((value as u32) & 0x3f) << 16);
715        self.w
716    }
717}
718#[doc = "Reader of field `VBSEL`"]
719pub type VBSEL_R = crate::R<bool, bool>;
720#[doc = "Write proxy for field `VBSEL`"]
721pub struct VBSEL_W<'a> {
722    w: &'a mut W,
723}
724impl<'a> VBSEL_W<'a> {
725    #[doc = r"Sets the field bit"]
726    #[inline(always)]
727    pub fn set_bit(self) -> &'a mut W {
728        self.bit(true)
729    }
730    #[doc = r"Clears the field bit"]
731    #[inline(always)]
732    pub fn clear_bit(self) -> &'a mut W {
733        self.bit(false)
734    }
735    #[doc = r"Writes raw bits to the field"]
736    #[inline(always)]
737    pub fn bit(self, value: bool) -> &'a mut W {
738        self.w.bits = (self.w.bits & !(0x01 << 22)) | (((value as u32) & 0x01) << 22);
739        self.w
740    }
741}
742#[doc = "Reader of field `VLPSEL`"]
743pub type VLPSEL_R = crate::R<bool, bool>;
744#[doc = "Write proxy for field `VLPSEL`"]
745pub struct VLPSEL_W<'a> {
746    w: &'a mut W,
747}
748impl<'a> VLPSEL_W<'a> {
749    #[doc = r"Sets the field bit"]
750    #[inline(always)]
751    pub fn set_bit(self) -> &'a mut W {
752        self.bit(true)
753    }
754    #[doc = r"Clears the field bit"]
755    #[inline(always)]
756    pub fn clear_bit(self) -> &'a mut W {
757        self.bit(false)
758    }
759    #[doc = r"Writes raw bits to the field"]
760    #[inline(always)]
761    pub fn bit(self, value: bool) -> &'a mut W {
762        self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24);
763        self.w
764    }
765}
766#[doc = "Reader of field `CSRESEN`"]
767pub type CSRESEN_R = crate::R<bool, bool>;
768#[doc = "Write proxy for field `CSRESEN`"]
769pub struct CSRESEN_W<'a> {
770    w: &'a mut W,
771}
772impl<'a> CSRESEN_W<'a> {
773    #[doc = r"Sets the field bit"]
774    #[inline(always)]
775    pub fn set_bit(self) -> &'a mut W {
776        self.bit(true)
777    }
778    #[doc = r"Clears the field bit"]
779    #[inline(always)]
780    pub fn clear_bit(self) -> &'a mut W {
781        self.bit(false)
782    }
783    #[doc = r"Writes raw bits to the field"]
784    #[inline(always)]
785    pub fn bit(self, value: bool) -> &'a mut W {
786        self.w.bits = (self.w.bits & !(0x01 << 26)) | (((value as u32) & 0x01) << 26);
787        self.w
788    }
789}
790#[doc = "Capacitive Sense Mode Internal Resistor Select\n\nValue on reset: 0"]
791#[derive(Clone, Copy, Debug, PartialEq)]
792#[repr(u8)]
793pub enum CSRESSEL_A {
794    #[doc = "0: Internal capacitive sense resistor value 0"]
795    RES0 = 0,
796    #[doc = "1: Internal capacitive sense resistor value 1"]
797    RES1 = 1,
798    #[doc = "2: Internal capacitive sense resistor value 2"]
799    RES2 = 2,
800    #[doc = "3: Internal capacitive sense resistor value 3"]
801    RES3 = 3,
802    #[doc = "4: Internal capacitive sense resistor value 4"]
803    RES4 = 4,
804    #[doc = "5: Internal capacitive sense resistor value 5"]
805    RES5 = 5,
806    #[doc = "6: Internal capacitive sense resistor value 6"]
807    RES6 = 6,
808    #[doc = "7: Internal capacitive sense resistor value 7"]
809    RES7 = 7,
810}
811impl From<CSRESSEL_A> for u8 {
812    #[inline(always)]
813    fn from(variant: CSRESSEL_A) -> Self {
814        variant as _
815    }
816}
817#[doc = "Reader of field `CSRESSEL`"]
818pub type CSRESSEL_R = crate::R<u8, CSRESSEL_A>;
819impl CSRESSEL_R {
820    #[doc = r"Get enumerated values variant"]
821    #[inline(always)]
822    pub fn variant(&self) -> CSRESSEL_A {
823        match self.bits {
824            0 => CSRESSEL_A::RES0,
825            1 => CSRESSEL_A::RES1,
826            2 => CSRESSEL_A::RES2,
827            3 => CSRESSEL_A::RES3,
828            4 => CSRESSEL_A::RES4,
829            5 => CSRESSEL_A::RES5,
830            6 => CSRESSEL_A::RES6,
831            7 => CSRESSEL_A::RES7,
832            _ => unreachable!(),
833        }
834    }
835    #[doc = "Checks if the value of the field is `RES0`"]
836    #[inline(always)]
837    pub fn is_res0(&self) -> bool {
838        *self == CSRESSEL_A::RES0
839    }
840    #[doc = "Checks if the value of the field is `RES1`"]
841    #[inline(always)]
842    pub fn is_res1(&self) -> bool {
843        *self == CSRESSEL_A::RES1
844    }
845    #[doc = "Checks if the value of the field is `RES2`"]
846    #[inline(always)]
847    pub fn is_res2(&self) -> bool {
848        *self == CSRESSEL_A::RES2
849    }
850    #[doc = "Checks if the value of the field is `RES3`"]
851    #[inline(always)]
852    pub fn is_res3(&self) -> bool {
853        *self == CSRESSEL_A::RES3
854    }
855    #[doc = "Checks if the value of the field is `RES4`"]
856    #[inline(always)]
857    pub fn is_res4(&self) -> bool {
858        *self == CSRESSEL_A::RES4
859    }
860    #[doc = "Checks if the value of the field is `RES5`"]
861    #[inline(always)]
862    pub fn is_res5(&self) -> bool {
863        *self == CSRESSEL_A::RES5
864    }
865    #[doc = "Checks if the value of the field is `RES6`"]
866    #[inline(always)]
867    pub fn is_res6(&self) -> bool {
868        *self == CSRESSEL_A::RES6
869    }
870    #[doc = "Checks if the value of the field is `RES7`"]
871    #[inline(always)]
872    pub fn is_res7(&self) -> bool {
873        *self == CSRESSEL_A::RES7
874    }
875}
876#[doc = "Write proxy for field `CSRESSEL`"]
877pub struct CSRESSEL_W<'a> {
878    w: &'a mut W,
879}
880impl<'a> CSRESSEL_W<'a> {
881    #[doc = r"Writes `variant` to the field"]
882    #[inline(always)]
883    pub fn variant(self, variant: CSRESSEL_A) -> &'a mut W {
884        {
885            self.bits(variant.into())
886        }
887    }
888    #[doc = "Internal capacitive sense resistor value 0"]
889    #[inline(always)]
890    pub fn res0(self) -> &'a mut W {
891        self.variant(CSRESSEL_A::RES0)
892    }
893    #[doc = "Internal capacitive sense resistor value 1"]
894    #[inline(always)]
895    pub fn res1(self) -> &'a mut W {
896        self.variant(CSRESSEL_A::RES1)
897    }
898    #[doc = "Internal capacitive sense resistor value 2"]
899    #[inline(always)]
900    pub fn res2(self) -> &'a mut W {
901        self.variant(CSRESSEL_A::RES2)
902    }
903    #[doc = "Internal capacitive sense resistor value 3"]
904    #[inline(always)]
905    pub fn res3(self) -> &'a mut W {
906        self.variant(CSRESSEL_A::RES3)
907    }
908    #[doc = "Internal capacitive sense resistor value 4"]
909    #[inline(always)]
910    pub fn res4(self) -> &'a mut W {
911        self.variant(CSRESSEL_A::RES4)
912    }
913    #[doc = "Internal capacitive sense resistor value 5"]
914    #[inline(always)]
915    pub fn res5(self) -> &'a mut W {
916        self.variant(CSRESSEL_A::RES5)
917    }
918    #[doc = "Internal capacitive sense resistor value 6"]
919    #[inline(always)]
920    pub fn res6(self) -> &'a mut W {
921        self.variant(CSRESSEL_A::RES6)
922    }
923    #[doc = "Internal capacitive sense resistor value 7"]
924    #[inline(always)]
925    pub fn res7(self) -> &'a mut W {
926        self.variant(CSRESSEL_A::RES7)
927    }
928    #[doc = r"Writes raw bits to the field"]
929    #[inline(always)]
930    pub fn bits(self, value: u8) -> &'a mut W {
931        self.w.bits = (self.w.bits & !(0x07 << 28)) | (((value as u32) & 0x07) << 28);
932        self.w
933    }
934}
935impl R {
936    #[doc = "Bits 0:7 - Positive Input Select"]
937    #[inline(always)]
938    pub fn possel(&self) -> POSSEL_R {
939        POSSEL_R::new((self.bits & 0xff) as u8)
940    }
941    #[doc = "Bits 8:15 - Negative Input Select"]
942    #[inline(always)]
943    pub fn negsel(&self) -> NEGSEL_R {
944        NEGSEL_R::new(((self.bits >> 8) & 0xff) as u8)
945    }
946    #[doc = "Bits 16:21 - VA Selection"]
947    #[inline(always)]
948    pub fn vasel(&self) -> VASEL_R {
949        VASEL_R::new(((self.bits >> 16) & 0x3f) as u8)
950    }
951    #[doc = "Bit 22 - VB Selection"]
952    #[inline(always)]
953    pub fn vbsel(&self) -> VBSEL_R {
954        VBSEL_R::new(((self.bits >> 22) & 0x01) != 0)
955    }
956    #[doc = "Bit 24 - Low-Power Sampled Voltage Selection"]
957    #[inline(always)]
958    pub fn vlpsel(&self) -> VLPSEL_R {
959        VLPSEL_R::new(((self.bits >> 24) & 0x01) != 0)
960    }
961    #[doc = "Bit 26 - Capacitive Sense Mode Internal Resistor Enable"]
962    #[inline(always)]
963    pub fn csresen(&self) -> CSRESEN_R {
964        CSRESEN_R::new(((self.bits >> 26) & 0x01) != 0)
965    }
966    #[doc = "Bits 28:30 - Capacitive Sense Mode Internal Resistor Select"]
967    #[inline(always)]
968    pub fn csressel(&self) -> CSRESSEL_R {
969        CSRESSEL_R::new(((self.bits >> 28) & 0x07) as u8)
970    }
971}
972impl W {
973    #[doc = "Bits 0:7 - Positive Input Select"]
974    #[inline(always)]
975    pub fn possel(&mut self) -> POSSEL_W {
976        POSSEL_W { w: self }
977    }
978    #[doc = "Bits 8:15 - Negative Input Select"]
979    #[inline(always)]
980    pub fn negsel(&mut self) -> NEGSEL_W {
981        NEGSEL_W { w: self }
982    }
983    #[doc = "Bits 16:21 - VA Selection"]
984    #[inline(always)]
985    pub fn vasel(&mut self) -> VASEL_W {
986        VASEL_W { w: self }
987    }
988    #[doc = "Bit 22 - VB Selection"]
989    #[inline(always)]
990    pub fn vbsel(&mut self) -> VBSEL_W {
991        VBSEL_W { w: self }
992    }
993    #[doc = "Bit 24 - Low-Power Sampled Voltage Selection"]
994    #[inline(always)]
995    pub fn vlpsel(&mut self) -> VLPSEL_W {
996        VLPSEL_W { w: self }
997    }
998    #[doc = "Bit 26 - Capacitive Sense Mode Internal Resistor Enable"]
999    #[inline(always)]
1000    pub fn csresen(&mut self) -> CSRESEN_W {
1001        CSRESEN_W { w: self }
1002    }
1003    #[doc = "Bits 28:30 - Capacitive Sense Mode Internal Resistor Select"]
1004    #[inline(always)]
1005    pub fn csressel(&mut self) -> CSRESSEL_W {
1006        CSRESSEL_W { w: self }
1007    }
1008}