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, const O: u8> = crate::FieldWriter<'a, u32, INPUTSEL_SPEC, u8, u8, 8, O>;
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, const O: u8> = crate::FieldWriter<'a, u32, INPUTSEL_SPEC, u8, u8, 8, O>;
45#[doc = "Field `VASEL` reader - VA Selection"]
46pub type VASEL_R = crate::FieldReader<u8, VASEL_A>;
47#[doc = "VA Selection\n\nValue on reset: 0"]
48#[derive(Clone, Copy, Debug, PartialEq, Eq)]
49#[repr(u8)]
50pub enum VASEL_A {
51 #[doc = "0: ACMPVDD"]
52 VDD = 0,
53 #[doc = "1: APORT2Y Channel 0"]
54 APORT2YCH0 = 1,
55 #[doc = "3: APORT2Y Channel 2"]
56 APORT2YCH2 = 3,
57 #[doc = "5: APORT2Y Channel 4"]
58 APORT2YCH4 = 5,
59 #[doc = "7: APORT2Y Channel 6"]
60 APORT2YCH6 = 7,
61 #[doc = "9: APORT2Y Channel 8"]
62 APORT2YCH8 = 9,
63 #[doc = "11: APORT2Y Channel 10"]
64 APORT2YCH10 = 11,
65 #[doc = "13: APORT2Y Channel 12"]
66 APORT2YCH12 = 13,
67 #[doc = "15: APORT2Y Channel 14"]
68 APORT2YCH14 = 15,
69 #[doc = "17: APORT2Y Channel 16"]
70 APORT2YCH16 = 17,
71 #[doc = "19: APORT2Y Channel 18"]
72 APORT2YCH18 = 19,
73 #[doc = "21: APORT2Y Channel 20"]
74 APORT2YCH20 = 21,
75 #[doc = "23: APORT2Y Channel 22"]
76 APORT2YCH22 = 23,
77 #[doc = "25: APORT2Y Channel 24"]
78 APORT2YCH24 = 25,
79 #[doc = "27: APORT2Y Channel 26"]
80 APORT2YCH26 = 27,
81 #[doc = "29: APORT2Y Channel 28"]
82 APORT2YCH28 = 29,
83 #[doc = "31: APORT2Y Channel 30"]
84 APORT2YCH30 = 31,
85 #[doc = "32: APORT1X Channel 0"]
86 APORT1XCH0 = 32,
87 #[doc = "33: APORT1Y Channel 1"]
88 APORT1YCH1 = 33,
89 #[doc = "34: APORT1X Channel 2"]
90 APORT1XCH2 = 34,
91 #[doc = "35: APORT1Y Channel 3"]
92 APORT1YCH3 = 35,
93 #[doc = "36: APORT1X Channel 4"]
94 APORT1XCH4 = 36,
95 #[doc = "37: APORT1Y Channel 5"]
96 APORT1YCH5 = 37,
97 #[doc = "38: APORT1X Channel 6"]
98 APORT1XCH6 = 38,
99 #[doc = "39: APORT1Y Channel 7"]
100 APORT1YCH7 = 39,
101 #[doc = "40: APORT1X Channel 8"]
102 APORT1XCH8 = 40,
103 #[doc = "41: APORT1Y Channel 9"]
104 APORT1YCH9 = 41,
105 #[doc = "42: APORT1X Channel 10"]
106 APORT1XCH10 = 42,
107 #[doc = "43: APORT1Y Channel 11"]
108 APORT1YCH11 = 43,
109 #[doc = "44: APORT1X Channel 12"]
110 APORT1XCH12 = 44,
111 #[doc = "45: APORT1Y Channel 13"]
112 APORT1YCH13 = 45,
113 #[doc = "46: APORT1X Channel 14"]
114 APORT1XCH14 = 46,
115 #[doc = "47: APORT1Y Channel 15"]
116 APORT1YCH15 = 47,
117 #[doc = "48: APORT1X Channel 16"]
118 APORT1XCH16 = 48,
119 #[doc = "49: APORT1Y Channel 17"]
120 APORT1YCH17 = 49,
121 #[doc = "50: APORT1X Channel 18"]
122 APORT1XCH18 = 50,
123 #[doc = "51: APORT1Y Channel 19"]
124 APORT1YCH19 = 51,
125 #[doc = "52: APORT1X Channel 20"]
126 APORT1XCH20 = 52,
127 #[doc = "53: APORT1Y Channel 21"]
128 APORT1YCH21 = 53,
129 #[doc = "54: APORT1X Channel 22"]
130 APORT1XCH22 = 54,
131 #[doc = "55: APORT1Y Channel 23"]
132 APORT1YCH23 = 55,
133 #[doc = "56: APORT1X Channel 24"]
134 APORT1XCH24 = 56,
135 #[doc = "57: APORT1Y Channel 25"]
136 APORT1YCH25 = 57,
137 #[doc = "58: APORT1X Channel 26"]
138 APORT1XCH26 = 58,
139 #[doc = "59: APORT1Y Channel 27"]
140 APORT1YCH27 = 59,
141 #[doc = "60: APORT1X Channel 28"]
142 APORT1XCH28 = 60,
143 #[doc = "61: APORT1Y Channel 29"]
144 APORT1YCH29 = 61,
145 #[doc = "62: APORT1X Channel 30"]
146 APORT1XCH30 = 62,
147 #[doc = "63: APORT1Y Channel 31"]
148 APORT1YCH31 = 63,
149}
150impl From<VASEL_A> for u8 {
151 #[inline(always)]
152 fn from(variant: VASEL_A) -> Self {
153 variant as _
154 }
155}
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, const O: u8> = crate::FieldWriter<'a, u32, INPUTSEL_SPEC, u8, VASEL_A, 6, O>;
461impl<'a, const O: u8> VASEL_W<'a, O> {
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, const O: u8> = crate::BitWriter<'a, u32, INPUTSEL_SPEC, bool, O>;
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, const O: u8> = crate::BitWriter<'a, u32, INPUTSEL_SPEC, bool, O>;
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, const O: u8> = crate::BitWriter<'a, u32, INPUTSEL_SPEC, bool, O>;
720#[doc = "Field `CSRESSEL` reader - Capacitive Sense Mode Internal Resistor Select"]
721pub type CSRESSEL_R = crate::FieldReader<u8, CSRESSEL_A>;
722#[doc = "Capacitive Sense Mode Internal Resistor Select\n\nValue on reset: 0"]
723#[derive(Clone, Copy, Debug, PartialEq, Eq)]
724#[repr(u8)]
725pub enum CSRESSEL_A {
726 #[doc = "0: Internal capacitive sense resistor value 0"]
727 RES0 = 0,
728 #[doc = "1: Internal capacitive sense resistor value 1"]
729 RES1 = 1,
730 #[doc = "2: Internal capacitive sense resistor value 2"]
731 RES2 = 2,
732 #[doc = "3: Internal capacitive sense resistor value 3"]
733 RES3 = 3,
734 #[doc = "4: Internal capacitive sense resistor value 4"]
735 RES4 = 4,
736 #[doc = "5: Internal capacitive sense resistor value 5"]
737 RES5 = 5,
738 #[doc = "6: Internal capacitive sense resistor value 6"]
739 RES6 = 6,
740 #[doc = "7: Internal capacitive sense resistor value 7"]
741 RES7 = 7,
742}
743impl From<CSRESSEL_A> for u8 {
744 #[inline(always)]
745 fn from(variant: CSRESSEL_A) -> Self {
746 variant as _
747 }
748}
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, const O: u8> =
808 crate::FieldWriterSafe<'a, u32, INPUTSEL_SPEC, u8, CSRESSEL_A, 3, O>;
809impl<'a, const O: u8> CSRESSEL_W<'a, O> {
810 #[doc = "Internal capacitive sense resistor value 0"]
811 #[inline(always)]
812 pub fn res0(self) -> &'a mut W {
813 self.variant(CSRESSEL_A::RES0)
814 }
815 #[doc = "Internal capacitive sense resistor value 1"]
816 #[inline(always)]
817 pub fn res1(self) -> &'a mut W {
818 self.variant(CSRESSEL_A::RES1)
819 }
820 #[doc = "Internal capacitive sense resistor value 2"]
821 #[inline(always)]
822 pub fn res2(self) -> &'a mut W {
823 self.variant(CSRESSEL_A::RES2)
824 }
825 #[doc = "Internal capacitive sense resistor value 3"]
826 #[inline(always)]
827 pub fn res3(self) -> &'a mut W {
828 self.variant(CSRESSEL_A::RES3)
829 }
830 #[doc = "Internal capacitive sense resistor value 4"]
831 #[inline(always)]
832 pub fn res4(self) -> &'a mut W {
833 self.variant(CSRESSEL_A::RES4)
834 }
835 #[doc = "Internal capacitive sense resistor value 5"]
836 #[inline(always)]
837 pub fn res5(self) -> &'a mut W {
838 self.variant(CSRESSEL_A::RES5)
839 }
840 #[doc = "Internal capacitive sense resistor value 6"]
841 #[inline(always)]
842 pub fn res6(self) -> &'a mut W {
843 self.variant(CSRESSEL_A::RES6)
844 }
845 #[doc = "Internal capacitive sense resistor value 7"]
846 #[inline(always)]
847 pub fn res7(self) -> &'a mut W {
848 self.variant(CSRESSEL_A::RES7)
849 }
850}
851impl R {
852 #[doc = "Bits 0:7 - Positive Input Select"]
853 #[inline(always)]
854 pub fn possel(&self) -> POSSEL_R {
855 POSSEL_R::new((self.bits & 0xff) as u8)
856 }
857 #[doc = "Bits 8:15 - Negative Input Select"]
858 #[inline(always)]
859 pub fn negsel(&self) -> NEGSEL_R {
860 NEGSEL_R::new(((self.bits >> 8) & 0xff) as u8)
861 }
862 #[doc = "Bits 16:21 - VA Selection"]
863 #[inline(always)]
864 pub fn vasel(&self) -> VASEL_R {
865 VASEL_R::new(((self.bits >> 16) & 0x3f) as u8)
866 }
867 #[doc = "Bit 22 - VB Selection"]
868 #[inline(always)]
869 pub fn vbsel(&self) -> VBSEL_R {
870 VBSEL_R::new(((self.bits >> 22) & 1) != 0)
871 }
872 #[doc = "Bit 24 - Low-Power Sampled Voltage Selection"]
873 #[inline(always)]
874 pub fn vlpsel(&self) -> VLPSEL_R {
875 VLPSEL_R::new(((self.bits >> 24) & 1) != 0)
876 }
877 #[doc = "Bit 26 - Capacitive Sense Mode Internal Resistor Enable"]
878 #[inline(always)]
879 pub fn csresen(&self) -> CSRESEN_R {
880 CSRESEN_R::new(((self.bits >> 26) & 1) != 0)
881 }
882 #[doc = "Bits 28:30 - Capacitive Sense Mode Internal Resistor Select"]
883 #[inline(always)]
884 pub fn csressel(&self) -> CSRESSEL_R {
885 CSRESSEL_R::new(((self.bits >> 28) & 7) as u8)
886 }
887}
888impl W {
889 #[doc = "Bits 0:7 - Positive Input Select"]
890 #[inline(always)]
891 #[must_use]
892 pub fn possel(&mut self) -> POSSEL_W<0> {
893 POSSEL_W::new(self)
894 }
895 #[doc = "Bits 8:15 - Negative Input Select"]
896 #[inline(always)]
897 #[must_use]
898 pub fn negsel(&mut self) -> NEGSEL_W<8> {
899 NEGSEL_W::new(self)
900 }
901 #[doc = "Bits 16:21 - VA Selection"]
902 #[inline(always)]
903 #[must_use]
904 pub fn vasel(&mut self) -> VASEL_W<16> {
905 VASEL_W::new(self)
906 }
907 #[doc = "Bit 22 - VB Selection"]
908 #[inline(always)]
909 #[must_use]
910 pub fn vbsel(&mut self) -> VBSEL_W<22> {
911 VBSEL_W::new(self)
912 }
913 #[doc = "Bit 24 - Low-Power Sampled Voltage Selection"]
914 #[inline(always)]
915 #[must_use]
916 pub fn vlpsel(&mut self) -> VLPSEL_W<24> {
917 VLPSEL_W::new(self)
918 }
919 #[doc = "Bit 26 - Capacitive Sense Mode Internal Resistor Enable"]
920 #[inline(always)]
921 #[must_use]
922 pub fn csresen(&mut self) -> CSRESEN_W<26> {
923 CSRESEN_W::new(self)
924 }
925 #[doc = "Bits 28:30 - Capacitive Sense Mode Internal Resistor Select"]
926 #[inline(always)]
927 #[must_use]
928 pub fn csressel(&mut self) -> CSRESSEL_W<28> {
929 CSRESSEL_W::new(self)
930 }
931 #[doc = "Writes raw bits to the register."]
932 #[inline(always)]
933 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
934 self.0.bits(bits);
935 self
936 }
937}
938#[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"]
939pub struct INPUTSEL_SPEC;
940impl crate::RegisterSpec for INPUTSEL_SPEC {
941 type Ux = u32;
942}
943#[doc = "`read()` method returns [inputsel::R](R) reader structure"]
944impl crate::Readable for INPUTSEL_SPEC {
945 type Reader = R;
946}
947#[doc = "`write(|w| ..)` method takes [inputsel::W](W) writer structure"]
948impl crate::Writable for INPUTSEL_SPEC {
949 type Writer = W;
950 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
951 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
952}
953#[doc = "`reset()` method sets INPUTSEL to value 0"]
954impl crate::Resettable for INPUTSEL_SPEC {
955 const RESET_VALUE: Self::Ux = 0;
956}