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