efm32gg11b120_pac/adc1/
scannegsel.rs

1#[doc = "Register `SCANNEGSEL` reader"]
2pub struct R(crate::R<SCANNEGSEL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SCANNEGSEL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SCANNEGSEL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SCANNEGSEL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `SCANNEGSEL` writer"]
17pub struct W(crate::W<SCANNEGSEL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<SCANNEGSEL_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<SCANNEGSEL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<SCANNEGSEL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Negative Input Select Register for ADCn_INPUT0 in Differential Scan Mode\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39#[repr(u8)]
40pub enum INPUT0NEGSEL_A {
41    #[doc = "0: Selects ADCn_INPUT1 as negative channel input"]
42    INPUT1 = 0,
43    #[doc = "1: Selects ADCn_INPUT3 as negative channel input"]
44    INPUT3 = 1,
45    #[doc = "2: Selects ADCn_INPUT5 as negative channel input"]
46    INPUT5 = 2,
47    #[doc = "3: Selects ADCn_INPUT7 as negative channel input"]
48    INPUT7 = 3,
49}
50impl From<INPUT0NEGSEL_A> for u8 {
51    #[inline(always)]
52    fn from(variant: INPUT0NEGSEL_A) -> Self {
53        variant as _
54    }
55}
56#[doc = "Field `INPUT0NEGSEL` reader - Negative Input Select Register for ADCn_INPUT0 in Differential Scan Mode"]
57pub type INPUT0NEGSEL_R = crate::FieldReader<u8, INPUT0NEGSEL_A>;
58impl INPUT0NEGSEL_R {
59    #[doc = "Get enumerated values variant"]
60    #[inline(always)]
61    pub fn variant(&self) -> INPUT0NEGSEL_A {
62        match self.bits {
63            0 => INPUT0NEGSEL_A::INPUT1,
64            1 => INPUT0NEGSEL_A::INPUT3,
65            2 => INPUT0NEGSEL_A::INPUT5,
66            3 => INPUT0NEGSEL_A::INPUT7,
67            _ => unreachable!(),
68        }
69    }
70    #[doc = "Checks if the value of the field is `INPUT1`"]
71    #[inline(always)]
72    pub fn is_input1(&self) -> bool {
73        *self == INPUT0NEGSEL_A::INPUT1
74    }
75    #[doc = "Checks if the value of the field is `INPUT3`"]
76    #[inline(always)]
77    pub fn is_input3(&self) -> bool {
78        *self == INPUT0NEGSEL_A::INPUT3
79    }
80    #[doc = "Checks if the value of the field is `INPUT5`"]
81    #[inline(always)]
82    pub fn is_input5(&self) -> bool {
83        *self == INPUT0NEGSEL_A::INPUT5
84    }
85    #[doc = "Checks if the value of the field is `INPUT7`"]
86    #[inline(always)]
87    pub fn is_input7(&self) -> bool {
88        *self == INPUT0NEGSEL_A::INPUT7
89    }
90}
91#[doc = "Field `INPUT0NEGSEL` writer - Negative Input Select Register for ADCn_INPUT0 in Differential Scan Mode"]
92pub type INPUT0NEGSEL_W<'a> =
93    crate::FieldWriterSafe<'a, u32, SCANNEGSEL_SPEC, u8, INPUT0NEGSEL_A, 2, 0>;
94impl<'a> INPUT0NEGSEL_W<'a> {
95    #[doc = "Selects ADCn_INPUT1 as negative channel input"]
96    #[inline(always)]
97    pub fn input1(self) -> &'a mut W {
98        self.variant(INPUT0NEGSEL_A::INPUT1)
99    }
100    #[doc = "Selects ADCn_INPUT3 as negative channel input"]
101    #[inline(always)]
102    pub fn input3(self) -> &'a mut W {
103        self.variant(INPUT0NEGSEL_A::INPUT3)
104    }
105    #[doc = "Selects ADCn_INPUT5 as negative channel input"]
106    #[inline(always)]
107    pub fn input5(self) -> &'a mut W {
108        self.variant(INPUT0NEGSEL_A::INPUT5)
109    }
110    #[doc = "Selects ADCn_INPUT7 as negative channel input"]
111    #[inline(always)]
112    pub fn input7(self) -> &'a mut W {
113        self.variant(INPUT0NEGSEL_A::INPUT7)
114    }
115}
116#[doc = "Negative Input Select Register for ADCn_INPUT2 in Differential Scan Mode\n\nValue on reset: 1"]
117#[derive(Clone, Copy, Debug, PartialEq)]
118#[repr(u8)]
119pub enum INPUT2NEGSEL_A {
120    #[doc = "0: Selects ADCn_INPUT1 as negative channel input"]
121    INPUT1 = 0,
122    #[doc = "1: Selects ADCn_INPUT3 as negative channel input"]
123    INPUT3 = 1,
124    #[doc = "2: Selects ADCn_INPUT5 as negative channel input"]
125    INPUT5 = 2,
126    #[doc = "3: Selects ADCn_INPUT7 as negative channel input"]
127    INPUT7 = 3,
128}
129impl From<INPUT2NEGSEL_A> for u8 {
130    #[inline(always)]
131    fn from(variant: INPUT2NEGSEL_A) -> Self {
132        variant as _
133    }
134}
135#[doc = "Field `INPUT2NEGSEL` reader - Negative Input Select Register for ADCn_INPUT2 in Differential Scan Mode"]
136pub type INPUT2NEGSEL_R = crate::FieldReader<u8, INPUT2NEGSEL_A>;
137impl INPUT2NEGSEL_R {
138    #[doc = "Get enumerated values variant"]
139    #[inline(always)]
140    pub fn variant(&self) -> INPUT2NEGSEL_A {
141        match self.bits {
142            0 => INPUT2NEGSEL_A::INPUT1,
143            1 => INPUT2NEGSEL_A::INPUT3,
144            2 => INPUT2NEGSEL_A::INPUT5,
145            3 => INPUT2NEGSEL_A::INPUT7,
146            _ => unreachable!(),
147        }
148    }
149    #[doc = "Checks if the value of the field is `INPUT1`"]
150    #[inline(always)]
151    pub fn is_input1(&self) -> bool {
152        *self == INPUT2NEGSEL_A::INPUT1
153    }
154    #[doc = "Checks if the value of the field is `INPUT3`"]
155    #[inline(always)]
156    pub fn is_input3(&self) -> bool {
157        *self == INPUT2NEGSEL_A::INPUT3
158    }
159    #[doc = "Checks if the value of the field is `INPUT5`"]
160    #[inline(always)]
161    pub fn is_input5(&self) -> bool {
162        *self == INPUT2NEGSEL_A::INPUT5
163    }
164    #[doc = "Checks if the value of the field is `INPUT7`"]
165    #[inline(always)]
166    pub fn is_input7(&self) -> bool {
167        *self == INPUT2NEGSEL_A::INPUT7
168    }
169}
170#[doc = "Field `INPUT2NEGSEL` writer - Negative Input Select Register for ADCn_INPUT2 in Differential Scan Mode"]
171pub type INPUT2NEGSEL_W<'a> =
172    crate::FieldWriterSafe<'a, u32, SCANNEGSEL_SPEC, u8, INPUT2NEGSEL_A, 2, 2>;
173impl<'a> INPUT2NEGSEL_W<'a> {
174    #[doc = "Selects ADCn_INPUT1 as negative channel input"]
175    #[inline(always)]
176    pub fn input1(self) -> &'a mut W {
177        self.variant(INPUT2NEGSEL_A::INPUT1)
178    }
179    #[doc = "Selects ADCn_INPUT3 as negative channel input"]
180    #[inline(always)]
181    pub fn input3(self) -> &'a mut W {
182        self.variant(INPUT2NEGSEL_A::INPUT3)
183    }
184    #[doc = "Selects ADCn_INPUT5 as negative channel input"]
185    #[inline(always)]
186    pub fn input5(self) -> &'a mut W {
187        self.variant(INPUT2NEGSEL_A::INPUT5)
188    }
189    #[doc = "Selects ADCn_INPUT7 as negative channel input"]
190    #[inline(always)]
191    pub fn input7(self) -> &'a mut W {
192        self.variant(INPUT2NEGSEL_A::INPUT7)
193    }
194}
195#[doc = "Negative Input Select Register for ADCn_INPUT4 in Differential Scan Mode\n\nValue on reset: 2"]
196#[derive(Clone, Copy, Debug, PartialEq)]
197#[repr(u8)]
198pub enum INPUT4NEGSEL_A {
199    #[doc = "0: Selects ADCn_INPUT1 as negative channel input"]
200    INPUT1 = 0,
201    #[doc = "1: Selects ADCn_INPUT3 as negative channel input"]
202    INPUT3 = 1,
203    #[doc = "2: Selects ADCn_INPUT5 as negative channel input"]
204    INPUT5 = 2,
205    #[doc = "3: Selects ADCn_INPUT7 as negative channel input"]
206    INPUT7 = 3,
207}
208impl From<INPUT4NEGSEL_A> for u8 {
209    #[inline(always)]
210    fn from(variant: INPUT4NEGSEL_A) -> Self {
211        variant as _
212    }
213}
214#[doc = "Field `INPUT4NEGSEL` reader - Negative Input Select Register for ADCn_INPUT4 in Differential Scan Mode"]
215pub type INPUT4NEGSEL_R = crate::FieldReader<u8, INPUT4NEGSEL_A>;
216impl INPUT4NEGSEL_R {
217    #[doc = "Get enumerated values variant"]
218    #[inline(always)]
219    pub fn variant(&self) -> INPUT4NEGSEL_A {
220        match self.bits {
221            0 => INPUT4NEGSEL_A::INPUT1,
222            1 => INPUT4NEGSEL_A::INPUT3,
223            2 => INPUT4NEGSEL_A::INPUT5,
224            3 => INPUT4NEGSEL_A::INPUT7,
225            _ => unreachable!(),
226        }
227    }
228    #[doc = "Checks if the value of the field is `INPUT1`"]
229    #[inline(always)]
230    pub fn is_input1(&self) -> bool {
231        *self == INPUT4NEGSEL_A::INPUT1
232    }
233    #[doc = "Checks if the value of the field is `INPUT3`"]
234    #[inline(always)]
235    pub fn is_input3(&self) -> bool {
236        *self == INPUT4NEGSEL_A::INPUT3
237    }
238    #[doc = "Checks if the value of the field is `INPUT5`"]
239    #[inline(always)]
240    pub fn is_input5(&self) -> bool {
241        *self == INPUT4NEGSEL_A::INPUT5
242    }
243    #[doc = "Checks if the value of the field is `INPUT7`"]
244    #[inline(always)]
245    pub fn is_input7(&self) -> bool {
246        *self == INPUT4NEGSEL_A::INPUT7
247    }
248}
249#[doc = "Field `INPUT4NEGSEL` writer - Negative Input Select Register for ADCn_INPUT4 in Differential Scan Mode"]
250pub type INPUT4NEGSEL_W<'a> =
251    crate::FieldWriterSafe<'a, u32, SCANNEGSEL_SPEC, u8, INPUT4NEGSEL_A, 2, 4>;
252impl<'a> INPUT4NEGSEL_W<'a> {
253    #[doc = "Selects ADCn_INPUT1 as negative channel input"]
254    #[inline(always)]
255    pub fn input1(self) -> &'a mut W {
256        self.variant(INPUT4NEGSEL_A::INPUT1)
257    }
258    #[doc = "Selects ADCn_INPUT3 as negative channel input"]
259    #[inline(always)]
260    pub fn input3(self) -> &'a mut W {
261        self.variant(INPUT4NEGSEL_A::INPUT3)
262    }
263    #[doc = "Selects ADCn_INPUT5 as negative channel input"]
264    #[inline(always)]
265    pub fn input5(self) -> &'a mut W {
266        self.variant(INPUT4NEGSEL_A::INPUT5)
267    }
268    #[doc = "Selects ADCn_INPUT7 as negative channel input"]
269    #[inline(always)]
270    pub fn input7(self) -> &'a mut W {
271        self.variant(INPUT4NEGSEL_A::INPUT7)
272    }
273}
274#[doc = "Negative Input Select Register for ADCn_INPUT1 in Differential Scan Mode\n\nValue on reset: 3"]
275#[derive(Clone, Copy, Debug, PartialEq)]
276#[repr(u8)]
277pub enum INPUT6NEGSEL_A {
278    #[doc = "0: Selects ADCn_INPUT1 as negative channel input"]
279    INPUT1 = 0,
280    #[doc = "1: Selects ADCn_INPUT3 as negative channel input"]
281    INPUT3 = 1,
282    #[doc = "2: Selects ADCn_INPUT5 as negative channel input"]
283    INPUT5 = 2,
284    #[doc = "3: Selects ADCn_INPUT7 as negative channel input"]
285    INPUT7 = 3,
286}
287impl From<INPUT6NEGSEL_A> for u8 {
288    #[inline(always)]
289    fn from(variant: INPUT6NEGSEL_A) -> Self {
290        variant as _
291    }
292}
293#[doc = "Field `INPUT6NEGSEL` reader - Negative Input Select Register for ADCn_INPUT1 in Differential Scan Mode"]
294pub type INPUT6NEGSEL_R = crate::FieldReader<u8, INPUT6NEGSEL_A>;
295impl INPUT6NEGSEL_R {
296    #[doc = "Get enumerated values variant"]
297    #[inline(always)]
298    pub fn variant(&self) -> INPUT6NEGSEL_A {
299        match self.bits {
300            0 => INPUT6NEGSEL_A::INPUT1,
301            1 => INPUT6NEGSEL_A::INPUT3,
302            2 => INPUT6NEGSEL_A::INPUT5,
303            3 => INPUT6NEGSEL_A::INPUT7,
304            _ => unreachable!(),
305        }
306    }
307    #[doc = "Checks if the value of the field is `INPUT1`"]
308    #[inline(always)]
309    pub fn is_input1(&self) -> bool {
310        *self == INPUT6NEGSEL_A::INPUT1
311    }
312    #[doc = "Checks if the value of the field is `INPUT3`"]
313    #[inline(always)]
314    pub fn is_input3(&self) -> bool {
315        *self == INPUT6NEGSEL_A::INPUT3
316    }
317    #[doc = "Checks if the value of the field is `INPUT5`"]
318    #[inline(always)]
319    pub fn is_input5(&self) -> bool {
320        *self == INPUT6NEGSEL_A::INPUT5
321    }
322    #[doc = "Checks if the value of the field is `INPUT7`"]
323    #[inline(always)]
324    pub fn is_input7(&self) -> bool {
325        *self == INPUT6NEGSEL_A::INPUT7
326    }
327}
328#[doc = "Field `INPUT6NEGSEL` writer - Negative Input Select Register for ADCn_INPUT1 in Differential Scan Mode"]
329pub type INPUT6NEGSEL_W<'a> =
330    crate::FieldWriterSafe<'a, u32, SCANNEGSEL_SPEC, u8, INPUT6NEGSEL_A, 2, 6>;
331impl<'a> INPUT6NEGSEL_W<'a> {
332    #[doc = "Selects ADCn_INPUT1 as negative channel input"]
333    #[inline(always)]
334    pub fn input1(self) -> &'a mut W {
335        self.variant(INPUT6NEGSEL_A::INPUT1)
336    }
337    #[doc = "Selects ADCn_INPUT3 as negative channel input"]
338    #[inline(always)]
339    pub fn input3(self) -> &'a mut W {
340        self.variant(INPUT6NEGSEL_A::INPUT3)
341    }
342    #[doc = "Selects ADCn_INPUT5 as negative channel input"]
343    #[inline(always)]
344    pub fn input5(self) -> &'a mut W {
345        self.variant(INPUT6NEGSEL_A::INPUT5)
346    }
347    #[doc = "Selects ADCn_INPUT7 as negative channel input"]
348    #[inline(always)]
349    pub fn input7(self) -> &'a mut W {
350        self.variant(INPUT6NEGSEL_A::INPUT7)
351    }
352}
353#[doc = "Negative Input Select Register for ADCn_INPUT9 in Differential Scan Mode\n\nValue on reset: 1"]
354#[derive(Clone, Copy, Debug, PartialEq)]
355#[repr(u8)]
356pub enum INPUT9NEGSEL_A {
357    #[doc = "0: Selects ADCn_INPUT8 as negative channel input"]
358    INPUT8 = 0,
359    #[doc = "1: Selects ADCn_INPUT10 as negative channel input"]
360    INPUT10 = 1,
361    #[doc = "2: Selects ADCn_INPUT12 as negative channel input"]
362    INPUT12 = 2,
363    #[doc = "3: Selects ADCn_INPUT14 as negative channel input"]
364    INPUT14 = 3,
365}
366impl From<INPUT9NEGSEL_A> for u8 {
367    #[inline(always)]
368    fn from(variant: INPUT9NEGSEL_A) -> Self {
369        variant as _
370    }
371}
372#[doc = "Field `INPUT9NEGSEL` reader - Negative Input Select Register for ADCn_INPUT9 in Differential Scan Mode"]
373pub type INPUT9NEGSEL_R = crate::FieldReader<u8, INPUT9NEGSEL_A>;
374impl INPUT9NEGSEL_R {
375    #[doc = "Get enumerated values variant"]
376    #[inline(always)]
377    pub fn variant(&self) -> INPUT9NEGSEL_A {
378        match self.bits {
379            0 => INPUT9NEGSEL_A::INPUT8,
380            1 => INPUT9NEGSEL_A::INPUT10,
381            2 => INPUT9NEGSEL_A::INPUT12,
382            3 => INPUT9NEGSEL_A::INPUT14,
383            _ => unreachable!(),
384        }
385    }
386    #[doc = "Checks if the value of the field is `INPUT8`"]
387    #[inline(always)]
388    pub fn is_input8(&self) -> bool {
389        *self == INPUT9NEGSEL_A::INPUT8
390    }
391    #[doc = "Checks if the value of the field is `INPUT10`"]
392    #[inline(always)]
393    pub fn is_input10(&self) -> bool {
394        *self == INPUT9NEGSEL_A::INPUT10
395    }
396    #[doc = "Checks if the value of the field is `INPUT12`"]
397    #[inline(always)]
398    pub fn is_input12(&self) -> bool {
399        *self == INPUT9NEGSEL_A::INPUT12
400    }
401    #[doc = "Checks if the value of the field is `INPUT14`"]
402    #[inline(always)]
403    pub fn is_input14(&self) -> bool {
404        *self == INPUT9NEGSEL_A::INPUT14
405    }
406}
407#[doc = "Field `INPUT9NEGSEL` writer - Negative Input Select Register for ADCn_INPUT9 in Differential Scan Mode"]
408pub type INPUT9NEGSEL_W<'a> =
409    crate::FieldWriterSafe<'a, u32, SCANNEGSEL_SPEC, u8, INPUT9NEGSEL_A, 2, 8>;
410impl<'a> INPUT9NEGSEL_W<'a> {
411    #[doc = "Selects ADCn_INPUT8 as negative channel input"]
412    #[inline(always)]
413    pub fn input8(self) -> &'a mut W {
414        self.variant(INPUT9NEGSEL_A::INPUT8)
415    }
416    #[doc = "Selects ADCn_INPUT10 as negative channel input"]
417    #[inline(always)]
418    pub fn input10(self) -> &'a mut W {
419        self.variant(INPUT9NEGSEL_A::INPUT10)
420    }
421    #[doc = "Selects ADCn_INPUT12 as negative channel input"]
422    #[inline(always)]
423    pub fn input12(self) -> &'a mut W {
424        self.variant(INPUT9NEGSEL_A::INPUT12)
425    }
426    #[doc = "Selects ADCn_INPUT14 as negative channel input"]
427    #[inline(always)]
428    pub fn input14(self) -> &'a mut W {
429        self.variant(INPUT9NEGSEL_A::INPUT14)
430    }
431}
432#[doc = "Negative Input Select Register for ADCn_INPUT11 in Differential Scan Mode\n\nValue on reset: 2"]
433#[derive(Clone, Copy, Debug, PartialEq)]
434#[repr(u8)]
435pub enum INPUT11NEGSEL_A {
436    #[doc = "0: Selects ADCn_INPUT8 as negative channel input"]
437    INPUT8 = 0,
438    #[doc = "1: Selects ADCn_INPUT10 as negative channel input"]
439    INPUT10 = 1,
440    #[doc = "2: Selects ADCn_INPUT12 as negative channel input"]
441    INPUT12 = 2,
442    #[doc = "3: Selects ADCn_INPUT14 as negative channel input"]
443    INPUT14 = 3,
444}
445impl From<INPUT11NEGSEL_A> for u8 {
446    #[inline(always)]
447    fn from(variant: INPUT11NEGSEL_A) -> Self {
448        variant as _
449    }
450}
451#[doc = "Field `INPUT11NEGSEL` reader - Negative Input Select Register for ADCn_INPUT11 in Differential Scan Mode"]
452pub type INPUT11NEGSEL_R = crate::FieldReader<u8, INPUT11NEGSEL_A>;
453impl INPUT11NEGSEL_R {
454    #[doc = "Get enumerated values variant"]
455    #[inline(always)]
456    pub fn variant(&self) -> INPUT11NEGSEL_A {
457        match self.bits {
458            0 => INPUT11NEGSEL_A::INPUT8,
459            1 => INPUT11NEGSEL_A::INPUT10,
460            2 => INPUT11NEGSEL_A::INPUT12,
461            3 => INPUT11NEGSEL_A::INPUT14,
462            _ => unreachable!(),
463        }
464    }
465    #[doc = "Checks if the value of the field is `INPUT8`"]
466    #[inline(always)]
467    pub fn is_input8(&self) -> bool {
468        *self == INPUT11NEGSEL_A::INPUT8
469    }
470    #[doc = "Checks if the value of the field is `INPUT10`"]
471    #[inline(always)]
472    pub fn is_input10(&self) -> bool {
473        *self == INPUT11NEGSEL_A::INPUT10
474    }
475    #[doc = "Checks if the value of the field is `INPUT12`"]
476    #[inline(always)]
477    pub fn is_input12(&self) -> bool {
478        *self == INPUT11NEGSEL_A::INPUT12
479    }
480    #[doc = "Checks if the value of the field is `INPUT14`"]
481    #[inline(always)]
482    pub fn is_input14(&self) -> bool {
483        *self == INPUT11NEGSEL_A::INPUT14
484    }
485}
486#[doc = "Field `INPUT11NEGSEL` writer - Negative Input Select Register for ADCn_INPUT11 in Differential Scan Mode"]
487pub type INPUT11NEGSEL_W<'a> =
488    crate::FieldWriterSafe<'a, u32, SCANNEGSEL_SPEC, u8, INPUT11NEGSEL_A, 2, 10>;
489impl<'a> INPUT11NEGSEL_W<'a> {
490    #[doc = "Selects ADCn_INPUT8 as negative channel input"]
491    #[inline(always)]
492    pub fn input8(self) -> &'a mut W {
493        self.variant(INPUT11NEGSEL_A::INPUT8)
494    }
495    #[doc = "Selects ADCn_INPUT10 as negative channel input"]
496    #[inline(always)]
497    pub fn input10(self) -> &'a mut W {
498        self.variant(INPUT11NEGSEL_A::INPUT10)
499    }
500    #[doc = "Selects ADCn_INPUT12 as negative channel input"]
501    #[inline(always)]
502    pub fn input12(self) -> &'a mut W {
503        self.variant(INPUT11NEGSEL_A::INPUT12)
504    }
505    #[doc = "Selects ADCn_INPUT14 as negative channel input"]
506    #[inline(always)]
507    pub fn input14(self) -> &'a mut W {
508        self.variant(INPUT11NEGSEL_A::INPUT14)
509    }
510}
511#[doc = "Negative Input Select Register for ADCn_INPUT13 in Differential Scan Mode\n\nValue on reset: 3"]
512#[derive(Clone, Copy, Debug, PartialEq)]
513#[repr(u8)]
514pub enum INPUT13NEGSEL_A {
515    #[doc = "0: Selects ADCn_INPUT8 as negative channel input"]
516    INPUT8 = 0,
517    #[doc = "1: Selects ADCn_INPUT10 as negative channel input"]
518    INPUT10 = 1,
519    #[doc = "2: Selects ADCn_INPUT12 as negative channel input"]
520    INPUT12 = 2,
521    #[doc = "3: Selects ADCn_INPUT14 as negative channel input"]
522    INPUT14 = 3,
523}
524impl From<INPUT13NEGSEL_A> for u8 {
525    #[inline(always)]
526    fn from(variant: INPUT13NEGSEL_A) -> Self {
527        variant as _
528    }
529}
530#[doc = "Field `INPUT13NEGSEL` reader - Negative Input Select Register for ADCn_INPUT13 in Differential Scan Mode"]
531pub type INPUT13NEGSEL_R = crate::FieldReader<u8, INPUT13NEGSEL_A>;
532impl INPUT13NEGSEL_R {
533    #[doc = "Get enumerated values variant"]
534    #[inline(always)]
535    pub fn variant(&self) -> INPUT13NEGSEL_A {
536        match self.bits {
537            0 => INPUT13NEGSEL_A::INPUT8,
538            1 => INPUT13NEGSEL_A::INPUT10,
539            2 => INPUT13NEGSEL_A::INPUT12,
540            3 => INPUT13NEGSEL_A::INPUT14,
541            _ => unreachable!(),
542        }
543    }
544    #[doc = "Checks if the value of the field is `INPUT8`"]
545    #[inline(always)]
546    pub fn is_input8(&self) -> bool {
547        *self == INPUT13NEGSEL_A::INPUT8
548    }
549    #[doc = "Checks if the value of the field is `INPUT10`"]
550    #[inline(always)]
551    pub fn is_input10(&self) -> bool {
552        *self == INPUT13NEGSEL_A::INPUT10
553    }
554    #[doc = "Checks if the value of the field is `INPUT12`"]
555    #[inline(always)]
556    pub fn is_input12(&self) -> bool {
557        *self == INPUT13NEGSEL_A::INPUT12
558    }
559    #[doc = "Checks if the value of the field is `INPUT14`"]
560    #[inline(always)]
561    pub fn is_input14(&self) -> bool {
562        *self == INPUT13NEGSEL_A::INPUT14
563    }
564}
565#[doc = "Field `INPUT13NEGSEL` writer - Negative Input Select Register for ADCn_INPUT13 in Differential Scan Mode"]
566pub type INPUT13NEGSEL_W<'a> =
567    crate::FieldWriterSafe<'a, u32, SCANNEGSEL_SPEC, u8, INPUT13NEGSEL_A, 2, 12>;
568impl<'a> INPUT13NEGSEL_W<'a> {
569    #[doc = "Selects ADCn_INPUT8 as negative channel input"]
570    #[inline(always)]
571    pub fn input8(self) -> &'a mut W {
572        self.variant(INPUT13NEGSEL_A::INPUT8)
573    }
574    #[doc = "Selects ADCn_INPUT10 as negative channel input"]
575    #[inline(always)]
576    pub fn input10(self) -> &'a mut W {
577        self.variant(INPUT13NEGSEL_A::INPUT10)
578    }
579    #[doc = "Selects ADCn_INPUT12 as negative channel input"]
580    #[inline(always)]
581    pub fn input12(self) -> &'a mut W {
582        self.variant(INPUT13NEGSEL_A::INPUT12)
583    }
584    #[doc = "Selects ADCn_INPUT14 as negative channel input"]
585    #[inline(always)]
586    pub fn input14(self) -> &'a mut W {
587        self.variant(INPUT13NEGSEL_A::INPUT14)
588    }
589}
590#[doc = "Negative Input Select Register for ADCn_INPUT15 in Differential Scan Mode\n\nValue on reset: 0"]
591#[derive(Clone, Copy, Debug, PartialEq)]
592#[repr(u8)]
593pub enum INPUT15NEGSEL_A {
594    #[doc = "0: Selects ADCn_INPUT8 as negative channel input"]
595    INPUT8 = 0,
596    #[doc = "1: Selects ADCn_INPUT10 as negative channel input"]
597    INPUT10 = 1,
598    #[doc = "2: Selects ADCn_INPUT12 as negative channel input"]
599    INPUT12 = 2,
600    #[doc = "3: Selects ADCn_INPUT14 as negative channel input"]
601    INPUT14 = 3,
602}
603impl From<INPUT15NEGSEL_A> for u8 {
604    #[inline(always)]
605    fn from(variant: INPUT15NEGSEL_A) -> Self {
606        variant as _
607    }
608}
609#[doc = "Field `INPUT15NEGSEL` reader - Negative Input Select Register for ADCn_INPUT15 in Differential Scan Mode"]
610pub type INPUT15NEGSEL_R = crate::FieldReader<u8, INPUT15NEGSEL_A>;
611impl INPUT15NEGSEL_R {
612    #[doc = "Get enumerated values variant"]
613    #[inline(always)]
614    pub fn variant(&self) -> INPUT15NEGSEL_A {
615        match self.bits {
616            0 => INPUT15NEGSEL_A::INPUT8,
617            1 => INPUT15NEGSEL_A::INPUT10,
618            2 => INPUT15NEGSEL_A::INPUT12,
619            3 => INPUT15NEGSEL_A::INPUT14,
620            _ => unreachable!(),
621        }
622    }
623    #[doc = "Checks if the value of the field is `INPUT8`"]
624    #[inline(always)]
625    pub fn is_input8(&self) -> bool {
626        *self == INPUT15NEGSEL_A::INPUT8
627    }
628    #[doc = "Checks if the value of the field is `INPUT10`"]
629    #[inline(always)]
630    pub fn is_input10(&self) -> bool {
631        *self == INPUT15NEGSEL_A::INPUT10
632    }
633    #[doc = "Checks if the value of the field is `INPUT12`"]
634    #[inline(always)]
635    pub fn is_input12(&self) -> bool {
636        *self == INPUT15NEGSEL_A::INPUT12
637    }
638    #[doc = "Checks if the value of the field is `INPUT14`"]
639    #[inline(always)]
640    pub fn is_input14(&self) -> bool {
641        *self == INPUT15NEGSEL_A::INPUT14
642    }
643}
644#[doc = "Field `INPUT15NEGSEL` writer - Negative Input Select Register for ADCn_INPUT15 in Differential Scan Mode"]
645pub type INPUT15NEGSEL_W<'a> =
646    crate::FieldWriterSafe<'a, u32, SCANNEGSEL_SPEC, u8, INPUT15NEGSEL_A, 2, 14>;
647impl<'a> INPUT15NEGSEL_W<'a> {
648    #[doc = "Selects ADCn_INPUT8 as negative channel input"]
649    #[inline(always)]
650    pub fn input8(self) -> &'a mut W {
651        self.variant(INPUT15NEGSEL_A::INPUT8)
652    }
653    #[doc = "Selects ADCn_INPUT10 as negative channel input"]
654    #[inline(always)]
655    pub fn input10(self) -> &'a mut W {
656        self.variant(INPUT15NEGSEL_A::INPUT10)
657    }
658    #[doc = "Selects ADCn_INPUT12 as negative channel input"]
659    #[inline(always)]
660    pub fn input12(self) -> &'a mut W {
661        self.variant(INPUT15NEGSEL_A::INPUT12)
662    }
663    #[doc = "Selects ADCn_INPUT14 as negative channel input"]
664    #[inline(always)]
665    pub fn input14(self) -> &'a mut W {
666        self.variant(INPUT15NEGSEL_A::INPUT14)
667    }
668}
669impl R {
670    #[doc = "Bits 0:1 - Negative Input Select Register for ADCn_INPUT0 in Differential Scan Mode"]
671    #[inline(always)]
672    pub fn input0negsel(&self) -> INPUT0NEGSEL_R {
673        INPUT0NEGSEL_R::new((self.bits & 3) as u8)
674    }
675    #[doc = "Bits 2:3 - Negative Input Select Register for ADCn_INPUT2 in Differential Scan Mode"]
676    #[inline(always)]
677    pub fn input2negsel(&self) -> INPUT2NEGSEL_R {
678        INPUT2NEGSEL_R::new(((self.bits >> 2) & 3) as u8)
679    }
680    #[doc = "Bits 4:5 - Negative Input Select Register for ADCn_INPUT4 in Differential Scan Mode"]
681    #[inline(always)]
682    pub fn input4negsel(&self) -> INPUT4NEGSEL_R {
683        INPUT4NEGSEL_R::new(((self.bits >> 4) & 3) as u8)
684    }
685    #[doc = "Bits 6:7 - Negative Input Select Register for ADCn_INPUT1 in Differential Scan Mode"]
686    #[inline(always)]
687    pub fn input6negsel(&self) -> INPUT6NEGSEL_R {
688        INPUT6NEGSEL_R::new(((self.bits >> 6) & 3) as u8)
689    }
690    #[doc = "Bits 8:9 - Negative Input Select Register for ADCn_INPUT9 in Differential Scan Mode"]
691    #[inline(always)]
692    pub fn input9negsel(&self) -> INPUT9NEGSEL_R {
693        INPUT9NEGSEL_R::new(((self.bits >> 8) & 3) as u8)
694    }
695    #[doc = "Bits 10:11 - Negative Input Select Register for ADCn_INPUT11 in Differential Scan Mode"]
696    #[inline(always)]
697    pub fn input11negsel(&self) -> INPUT11NEGSEL_R {
698        INPUT11NEGSEL_R::new(((self.bits >> 10) & 3) as u8)
699    }
700    #[doc = "Bits 12:13 - Negative Input Select Register for ADCn_INPUT13 in Differential Scan Mode"]
701    #[inline(always)]
702    pub fn input13negsel(&self) -> INPUT13NEGSEL_R {
703        INPUT13NEGSEL_R::new(((self.bits >> 12) & 3) as u8)
704    }
705    #[doc = "Bits 14:15 - Negative Input Select Register for ADCn_INPUT15 in Differential Scan Mode"]
706    #[inline(always)]
707    pub fn input15negsel(&self) -> INPUT15NEGSEL_R {
708        INPUT15NEGSEL_R::new(((self.bits >> 14) & 3) as u8)
709    }
710}
711impl W {
712    #[doc = "Bits 0:1 - Negative Input Select Register for ADCn_INPUT0 in Differential Scan Mode"]
713    #[inline(always)]
714    pub fn input0negsel(&mut self) -> INPUT0NEGSEL_W {
715        INPUT0NEGSEL_W::new(self)
716    }
717    #[doc = "Bits 2:3 - Negative Input Select Register for ADCn_INPUT2 in Differential Scan Mode"]
718    #[inline(always)]
719    pub fn input2negsel(&mut self) -> INPUT2NEGSEL_W {
720        INPUT2NEGSEL_W::new(self)
721    }
722    #[doc = "Bits 4:5 - Negative Input Select Register for ADCn_INPUT4 in Differential Scan Mode"]
723    #[inline(always)]
724    pub fn input4negsel(&mut self) -> INPUT4NEGSEL_W {
725        INPUT4NEGSEL_W::new(self)
726    }
727    #[doc = "Bits 6:7 - Negative Input Select Register for ADCn_INPUT1 in Differential Scan Mode"]
728    #[inline(always)]
729    pub fn input6negsel(&mut self) -> INPUT6NEGSEL_W {
730        INPUT6NEGSEL_W::new(self)
731    }
732    #[doc = "Bits 8:9 - Negative Input Select Register for ADCn_INPUT9 in Differential Scan Mode"]
733    #[inline(always)]
734    pub fn input9negsel(&mut self) -> INPUT9NEGSEL_W {
735        INPUT9NEGSEL_W::new(self)
736    }
737    #[doc = "Bits 10:11 - Negative Input Select Register for ADCn_INPUT11 in Differential Scan Mode"]
738    #[inline(always)]
739    pub fn input11negsel(&mut self) -> INPUT11NEGSEL_W {
740        INPUT11NEGSEL_W::new(self)
741    }
742    #[doc = "Bits 12:13 - Negative Input Select Register for ADCn_INPUT13 in Differential Scan Mode"]
743    #[inline(always)]
744    pub fn input13negsel(&mut self) -> INPUT13NEGSEL_W {
745        INPUT13NEGSEL_W::new(self)
746    }
747    #[doc = "Bits 14:15 - Negative Input Select Register for ADCn_INPUT15 in Differential Scan Mode"]
748    #[inline(always)]
749    pub fn input15negsel(&mut self) -> INPUT15NEGSEL_W {
750        INPUT15NEGSEL_W::new(self)
751    }
752    #[doc = "Writes raw bits to the register."]
753    #[inline(always)]
754    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
755        self.0.bits(bits);
756        self
757    }
758}
759#[doc = "Negative Input Select Register for Scan\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 [scannegsel](index.html) module"]
760pub struct SCANNEGSEL_SPEC;
761impl crate::RegisterSpec for SCANNEGSEL_SPEC {
762    type Ux = u32;
763}
764#[doc = "`read()` method returns [scannegsel::R](R) reader structure"]
765impl crate::Readable for SCANNEGSEL_SPEC {
766    type Reader = R;
767}
768#[doc = "`write(|w| ..)` method takes [scannegsel::W](W) writer structure"]
769impl crate::Writable for SCANNEGSEL_SPEC {
770    type Writer = W;
771}
772#[doc = "`reset()` method sets SCANNEGSEL to value 0x39e4"]
773impl crate::Resettable for SCANNEGSEL_SPEC {
774    #[inline(always)]
775    fn reset_value() -> Self::Ux {
776        0x39e4
777    }
778}