efm32wg230_pac/adc0/
scanctrl.rs

1#[doc = "Register `SCANCTRL` reader"]
2pub struct R(crate::R<SCANCTRL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SCANCTRL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SCANCTRL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SCANCTRL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `SCANCTRL` writer"]
17pub struct W(crate::W<SCANCTRL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<SCANCTRL_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<SCANCTRL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<SCANCTRL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `REP` reader - Scan Sequence Repetitive Mode"]
38pub type REP_R = crate::BitReader<bool>;
39#[doc = "Field `REP` writer - Scan Sequence Repetitive Mode"]
40pub type REP_W<'a> = crate::BitWriter<'a, u32, SCANCTRL_SPEC, bool, 0>;
41#[doc = "Field `DIFF` reader - Scan Sequence Differential Mode"]
42pub type DIFF_R = crate::BitReader<bool>;
43#[doc = "Field `DIFF` writer - Scan Sequence Differential Mode"]
44pub type DIFF_W<'a> = crate::BitWriter<'a, u32, SCANCTRL_SPEC, bool, 1>;
45#[doc = "Field `ADJ` reader - Scan Sequence Result Adjustment"]
46pub type ADJ_R = crate::BitReader<bool>;
47#[doc = "Field `ADJ` writer - Scan Sequence Result Adjustment"]
48pub type ADJ_W<'a> = crate::BitWriter<'a, u32, SCANCTRL_SPEC, bool, 2>;
49#[doc = "Scan Sequence Resolution Select\n\nValue on reset: 0"]
50#[derive(Clone, Copy, Debug, PartialEq)]
51#[repr(u8)]
52pub enum RES_A {
53    #[doc = "0: 12-bit resolution"]
54    _12BIT = 0,
55    #[doc = "1: 8-bit resolution"]
56    _8BIT = 1,
57    #[doc = "2: 6-bit resolution"]
58    _6BIT = 2,
59    #[doc = "3: Oversampling enabled. Oversampling rate is set in OVSRSEL"]
60    OVS = 3,
61}
62impl From<RES_A> for u8 {
63    #[inline(always)]
64    fn from(variant: RES_A) -> Self {
65        variant as _
66    }
67}
68#[doc = "Field `RES` reader - Scan Sequence Resolution Select"]
69pub type RES_R = crate::FieldReader<u8, RES_A>;
70impl RES_R {
71    #[doc = "Get enumerated values variant"]
72    #[inline(always)]
73    pub fn variant(&self) -> RES_A {
74        match self.bits {
75            0 => RES_A::_12BIT,
76            1 => RES_A::_8BIT,
77            2 => RES_A::_6BIT,
78            3 => RES_A::OVS,
79            _ => unreachable!(),
80        }
81    }
82    #[doc = "Checks if the value of the field is `_12BIT`"]
83    #[inline(always)]
84    pub fn is_12bit(&self) -> bool {
85        *self == RES_A::_12BIT
86    }
87    #[doc = "Checks if the value of the field is `_8BIT`"]
88    #[inline(always)]
89    pub fn is_8bit(&self) -> bool {
90        *self == RES_A::_8BIT
91    }
92    #[doc = "Checks if the value of the field is `_6BIT`"]
93    #[inline(always)]
94    pub fn is_6bit(&self) -> bool {
95        *self == RES_A::_6BIT
96    }
97    #[doc = "Checks if the value of the field is `OVS`"]
98    #[inline(always)]
99    pub fn is_ovs(&self) -> bool {
100        *self == RES_A::OVS
101    }
102}
103#[doc = "Field `RES` writer - Scan Sequence Resolution Select"]
104pub type RES_W<'a> = crate::FieldWriterSafe<'a, u32, SCANCTRL_SPEC, u8, RES_A, 2, 4>;
105impl<'a> RES_W<'a> {
106    #[doc = "12-bit resolution"]
107    #[inline(always)]
108    pub fn _12bit(self) -> &'a mut W {
109        self.variant(RES_A::_12BIT)
110    }
111    #[doc = "8-bit resolution"]
112    #[inline(always)]
113    pub fn _8bit(self) -> &'a mut W {
114        self.variant(RES_A::_8BIT)
115    }
116    #[doc = "6-bit resolution"]
117    #[inline(always)]
118    pub fn _6bit(self) -> &'a mut W {
119        self.variant(RES_A::_6BIT)
120    }
121    #[doc = "Oversampling enabled. Oversampling rate is set in OVSRSEL"]
122    #[inline(always)]
123    pub fn ovs(self) -> &'a mut W {
124        self.variant(RES_A::OVS)
125    }
126}
127#[doc = "Field `INPUTMASK` reader - Scan Sequence Input Mask"]
128pub type INPUTMASK_R = crate::FieldReader<u8, u8>;
129#[doc = "Field `INPUTMASK` writer - Scan Sequence Input Mask"]
130pub type INPUTMASK_W<'a> = crate::FieldWriter<'a, u32, SCANCTRL_SPEC, u8, u8, 8, 8>;
131#[doc = "Scan Sequence Reference Selection\n\nValue on reset: 0"]
132#[derive(Clone, Copy, Debug, PartialEq)]
133#[repr(u8)]
134pub enum REF_A {
135    #[doc = "0: Internal 1.25 V reference"]
136    _1V25 = 0,
137    #[doc = "1: Internal 2.5 V reference"]
138    _2V5 = 1,
139    #[doc = "2: VDD"]
140    VDD = 2,
141    #[doc = "3: Internal differential 5 V reference"]
142    _5VDIFF = 3,
143    #[doc = "4: Single ended external reference from ADCn_CH6"]
144    EXTSINGLE = 4,
145    #[doc = "5: Differential external reference, 2x(ADCn_CH6 - ADCn_CH7)"]
146    _2XEXTDIFF = 5,
147    #[doc = "6: Unbuffered 2xVDD"]
148    _2XVDD = 6,
149}
150impl From<REF_A> for u8 {
151    #[inline(always)]
152    fn from(variant: REF_A) -> Self {
153        variant as _
154    }
155}
156#[doc = "Field `REF` reader - Scan Sequence Reference Selection"]
157pub type REF_R = crate::FieldReader<u8, REF_A>;
158impl REF_R {
159    #[doc = "Get enumerated values variant"]
160    #[inline(always)]
161    pub fn variant(&self) -> Option<REF_A> {
162        match self.bits {
163            0 => Some(REF_A::_1V25),
164            1 => Some(REF_A::_2V5),
165            2 => Some(REF_A::VDD),
166            3 => Some(REF_A::_5VDIFF),
167            4 => Some(REF_A::EXTSINGLE),
168            5 => Some(REF_A::_2XEXTDIFF),
169            6 => Some(REF_A::_2XVDD),
170            _ => None,
171        }
172    }
173    #[doc = "Checks if the value of the field is `_1V25`"]
174    #[inline(always)]
175    pub fn is_1v25(&self) -> bool {
176        *self == REF_A::_1V25
177    }
178    #[doc = "Checks if the value of the field is `_2V5`"]
179    #[inline(always)]
180    pub fn is_2v5(&self) -> bool {
181        *self == REF_A::_2V5
182    }
183    #[doc = "Checks if the value of the field is `VDD`"]
184    #[inline(always)]
185    pub fn is_vdd(&self) -> bool {
186        *self == REF_A::VDD
187    }
188    #[doc = "Checks if the value of the field is `_5VDIFF`"]
189    #[inline(always)]
190    pub fn is_5vdiff(&self) -> bool {
191        *self == REF_A::_5VDIFF
192    }
193    #[doc = "Checks if the value of the field is `EXTSINGLE`"]
194    #[inline(always)]
195    pub fn is_extsingle(&self) -> bool {
196        *self == REF_A::EXTSINGLE
197    }
198    #[doc = "Checks if the value of the field is `_2XEXTDIFF`"]
199    #[inline(always)]
200    pub fn is_2xextdiff(&self) -> bool {
201        *self == REF_A::_2XEXTDIFF
202    }
203    #[doc = "Checks if the value of the field is `_2XVDD`"]
204    #[inline(always)]
205    pub fn is_2xvdd(&self) -> bool {
206        *self == REF_A::_2XVDD
207    }
208}
209#[doc = "Field `REF` writer - Scan Sequence Reference Selection"]
210pub type REF_W<'a> = crate::FieldWriter<'a, u32, SCANCTRL_SPEC, u8, REF_A, 3, 16>;
211impl<'a> REF_W<'a> {
212    #[doc = "Internal 1.25 V reference"]
213    #[inline(always)]
214    pub fn _1v25(self) -> &'a mut W {
215        self.variant(REF_A::_1V25)
216    }
217    #[doc = "Internal 2.5 V reference"]
218    #[inline(always)]
219    pub fn _2v5(self) -> &'a mut W {
220        self.variant(REF_A::_2V5)
221    }
222    #[doc = "VDD"]
223    #[inline(always)]
224    pub fn vdd(self) -> &'a mut W {
225        self.variant(REF_A::VDD)
226    }
227    #[doc = "Internal differential 5 V reference"]
228    #[inline(always)]
229    pub fn _5vdiff(self) -> &'a mut W {
230        self.variant(REF_A::_5VDIFF)
231    }
232    #[doc = "Single ended external reference from ADCn_CH6"]
233    #[inline(always)]
234    pub fn extsingle(self) -> &'a mut W {
235        self.variant(REF_A::EXTSINGLE)
236    }
237    #[doc = "Differential external reference, 2x(ADCn_CH6 - ADCn_CH7)"]
238    #[inline(always)]
239    pub fn _2xextdiff(self) -> &'a mut W {
240        self.variant(REF_A::_2XEXTDIFF)
241    }
242    #[doc = "Unbuffered 2xVDD"]
243    #[inline(always)]
244    pub fn _2xvdd(self) -> &'a mut W {
245        self.variant(REF_A::_2XVDD)
246    }
247}
248#[doc = "Scan Sample Acquisition Time\n\nValue on reset: 0"]
249#[derive(Clone, Copy, Debug, PartialEq)]
250#[repr(u8)]
251pub enum AT_A {
252    #[doc = "0: 1 ADC_CLK cycle acquisition time for scan samples"]
253    _1CYCLE = 0,
254    #[doc = "1: 2 ADC_CLK cycles acquisition time for scan samples"]
255    _2CYCLES = 1,
256    #[doc = "2: 4 ADC_CLK cycles acquisition time for scan samples"]
257    _4CYCLES = 2,
258    #[doc = "3: 8 ADC_CLK cycles acquisition time for scan samples"]
259    _8CYCLES = 3,
260    #[doc = "4: 16 ADC_CLK cycles acquisition time for scan samples"]
261    _16CYCLES = 4,
262    #[doc = "5: 32 ADC_CLK cycles acquisition time for scan samples"]
263    _32CYCLES = 5,
264    #[doc = "6: 64 ADC_CLK cycles acquisition time for scan samples"]
265    _64CYCLES = 6,
266    #[doc = "7: 128 ADC_CLK cycles acquisition time for scan samples"]
267    _128CYCLES = 7,
268    #[doc = "8: 256 ADC_CLK cycles acquisition time for scan samples"]
269    _256CYCLES = 8,
270}
271impl From<AT_A> for u8 {
272    #[inline(always)]
273    fn from(variant: AT_A) -> Self {
274        variant as _
275    }
276}
277#[doc = "Field `AT` reader - Scan Sample Acquisition Time"]
278pub type AT_R = crate::FieldReader<u8, AT_A>;
279impl AT_R {
280    #[doc = "Get enumerated values variant"]
281    #[inline(always)]
282    pub fn variant(&self) -> Option<AT_A> {
283        match self.bits {
284            0 => Some(AT_A::_1CYCLE),
285            1 => Some(AT_A::_2CYCLES),
286            2 => Some(AT_A::_4CYCLES),
287            3 => Some(AT_A::_8CYCLES),
288            4 => Some(AT_A::_16CYCLES),
289            5 => Some(AT_A::_32CYCLES),
290            6 => Some(AT_A::_64CYCLES),
291            7 => Some(AT_A::_128CYCLES),
292            8 => Some(AT_A::_256CYCLES),
293            _ => None,
294        }
295    }
296    #[doc = "Checks if the value of the field is `_1CYCLE`"]
297    #[inline(always)]
298    pub fn is_1cycle(&self) -> bool {
299        *self == AT_A::_1CYCLE
300    }
301    #[doc = "Checks if the value of the field is `_2CYCLES`"]
302    #[inline(always)]
303    pub fn is_2cycles(&self) -> bool {
304        *self == AT_A::_2CYCLES
305    }
306    #[doc = "Checks if the value of the field is `_4CYCLES`"]
307    #[inline(always)]
308    pub fn is_4cycles(&self) -> bool {
309        *self == AT_A::_4CYCLES
310    }
311    #[doc = "Checks if the value of the field is `_8CYCLES`"]
312    #[inline(always)]
313    pub fn is_8cycles(&self) -> bool {
314        *self == AT_A::_8CYCLES
315    }
316    #[doc = "Checks if the value of the field is `_16CYCLES`"]
317    #[inline(always)]
318    pub fn is_16cycles(&self) -> bool {
319        *self == AT_A::_16CYCLES
320    }
321    #[doc = "Checks if the value of the field is `_32CYCLES`"]
322    #[inline(always)]
323    pub fn is_32cycles(&self) -> bool {
324        *self == AT_A::_32CYCLES
325    }
326    #[doc = "Checks if the value of the field is `_64CYCLES`"]
327    #[inline(always)]
328    pub fn is_64cycles(&self) -> bool {
329        *self == AT_A::_64CYCLES
330    }
331    #[doc = "Checks if the value of the field is `_128CYCLES`"]
332    #[inline(always)]
333    pub fn is_128cycles(&self) -> bool {
334        *self == AT_A::_128CYCLES
335    }
336    #[doc = "Checks if the value of the field is `_256CYCLES`"]
337    #[inline(always)]
338    pub fn is_256cycles(&self) -> bool {
339        *self == AT_A::_256CYCLES
340    }
341}
342#[doc = "Field `AT` writer - Scan Sample Acquisition Time"]
343pub type AT_W<'a> = crate::FieldWriter<'a, u32, SCANCTRL_SPEC, u8, AT_A, 4, 20>;
344impl<'a> AT_W<'a> {
345    #[doc = "1 ADC_CLK cycle acquisition time for scan samples"]
346    #[inline(always)]
347    pub fn _1cycle(self) -> &'a mut W {
348        self.variant(AT_A::_1CYCLE)
349    }
350    #[doc = "2 ADC_CLK cycles acquisition time for scan samples"]
351    #[inline(always)]
352    pub fn _2cycles(self) -> &'a mut W {
353        self.variant(AT_A::_2CYCLES)
354    }
355    #[doc = "4 ADC_CLK cycles acquisition time for scan samples"]
356    #[inline(always)]
357    pub fn _4cycles(self) -> &'a mut W {
358        self.variant(AT_A::_4CYCLES)
359    }
360    #[doc = "8 ADC_CLK cycles acquisition time for scan samples"]
361    #[inline(always)]
362    pub fn _8cycles(self) -> &'a mut W {
363        self.variant(AT_A::_8CYCLES)
364    }
365    #[doc = "16 ADC_CLK cycles acquisition time for scan samples"]
366    #[inline(always)]
367    pub fn _16cycles(self) -> &'a mut W {
368        self.variant(AT_A::_16CYCLES)
369    }
370    #[doc = "32 ADC_CLK cycles acquisition time for scan samples"]
371    #[inline(always)]
372    pub fn _32cycles(self) -> &'a mut W {
373        self.variant(AT_A::_32CYCLES)
374    }
375    #[doc = "64 ADC_CLK cycles acquisition time for scan samples"]
376    #[inline(always)]
377    pub fn _64cycles(self) -> &'a mut W {
378        self.variant(AT_A::_64CYCLES)
379    }
380    #[doc = "128 ADC_CLK cycles acquisition time for scan samples"]
381    #[inline(always)]
382    pub fn _128cycles(self) -> &'a mut W {
383        self.variant(AT_A::_128CYCLES)
384    }
385    #[doc = "256 ADC_CLK cycles acquisition time for scan samples"]
386    #[inline(always)]
387    pub fn _256cycles(self) -> &'a mut W {
388        self.variant(AT_A::_256CYCLES)
389    }
390}
391#[doc = "Field `PRSEN` reader - Scan Sequence PRS Trigger Enable"]
392pub type PRSEN_R = crate::BitReader<bool>;
393#[doc = "Field `PRSEN` writer - Scan Sequence PRS Trigger Enable"]
394pub type PRSEN_W<'a> = crate::BitWriter<'a, u32, SCANCTRL_SPEC, bool, 24>;
395#[doc = "Scan Sequence PRS Trigger Select\n\nValue on reset: 0"]
396#[derive(Clone, Copy, Debug, PartialEq)]
397#[repr(u8)]
398pub enum PRSSEL_A {
399    #[doc = "0: PRS ch 0 triggers scan sequence"]
400    PRSCH0 = 0,
401    #[doc = "1: PRS ch 1 triggers scan sequence"]
402    PRSCH1 = 1,
403    #[doc = "2: PRS ch 2 triggers scan sequence"]
404    PRSCH2 = 2,
405    #[doc = "3: PRS ch 3 triggers scan sequence"]
406    PRSCH3 = 3,
407    #[doc = "4: PRS ch 4 triggers scan sequence"]
408    PRSCH4 = 4,
409    #[doc = "5: PRS ch 5 triggers scan sequence"]
410    PRSCH5 = 5,
411    #[doc = "6: PRS ch 6 triggers scan sequence"]
412    PRSCH6 = 6,
413    #[doc = "7: PRS ch 7 triggers scan sequence"]
414    PRSCH7 = 7,
415    #[doc = "8: PRS ch 8 triggers scan sequence"]
416    PRSCH8 = 8,
417    #[doc = "9: PRS ch 9 triggers scan sequence"]
418    PRSCH9 = 9,
419    #[doc = "10: PRS ch 10 triggers scan sequence"]
420    PRSCH10 = 10,
421    #[doc = "11: PRS ch 11 triggers scan sequence"]
422    PRSCH11 = 11,
423}
424impl From<PRSSEL_A> for u8 {
425    #[inline(always)]
426    fn from(variant: PRSSEL_A) -> Self {
427        variant as _
428    }
429}
430#[doc = "Field `PRSSEL` reader - Scan Sequence PRS Trigger Select"]
431pub type PRSSEL_R = crate::FieldReader<u8, PRSSEL_A>;
432impl PRSSEL_R {
433    #[doc = "Get enumerated values variant"]
434    #[inline(always)]
435    pub fn variant(&self) -> Option<PRSSEL_A> {
436        match self.bits {
437            0 => Some(PRSSEL_A::PRSCH0),
438            1 => Some(PRSSEL_A::PRSCH1),
439            2 => Some(PRSSEL_A::PRSCH2),
440            3 => Some(PRSSEL_A::PRSCH3),
441            4 => Some(PRSSEL_A::PRSCH4),
442            5 => Some(PRSSEL_A::PRSCH5),
443            6 => Some(PRSSEL_A::PRSCH6),
444            7 => Some(PRSSEL_A::PRSCH7),
445            8 => Some(PRSSEL_A::PRSCH8),
446            9 => Some(PRSSEL_A::PRSCH9),
447            10 => Some(PRSSEL_A::PRSCH10),
448            11 => Some(PRSSEL_A::PRSCH11),
449            _ => None,
450        }
451    }
452    #[doc = "Checks if the value of the field is `PRSCH0`"]
453    #[inline(always)]
454    pub fn is_prsch0(&self) -> bool {
455        *self == PRSSEL_A::PRSCH0
456    }
457    #[doc = "Checks if the value of the field is `PRSCH1`"]
458    #[inline(always)]
459    pub fn is_prsch1(&self) -> bool {
460        *self == PRSSEL_A::PRSCH1
461    }
462    #[doc = "Checks if the value of the field is `PRSCH2`"]
463    #[inline(always)]
464    pub fn is_prsch2(&self) -> bool {
465        *self == PRSSEL_A::PRSCH2
466    }
467    #[doc = "Checks if the value of the field is `PRSCH3`"]
468    #[inline(always)]
469    pub fn is_prsch3(&self) -> bool {
470        *self == PRSSEL_A::PRSCH3
471    }
472    #[doc = "Checks if the value of the field is `PRSCH4`"]
473    #[inline(always)]
474    pub fn is_prsch4(&self) -> bool {
475        *self == PRSSEL_A::PRSCH4
476    }
477    #[doc = "Checks if the value of the field is `PRSCH5`"]
478    #[inline(always)]
479    pub fn is_prsch5(&self) -> bool {
480        *self == PRSSEL_A::PRSCH5
481    }
482    #[doc = "Checks if the value of the field is `PRSCH6`"]
483    #[inline(always)]
484    pub fn is_prsch6(&self) -> bool {
485        *self == PRSSEL_A::PRSCH6
486    }
487    #[doc = "Checks if the value of the field is `PRSCH7`"]
488    #[inline(always)]
489    pub fn is_prsch7(&self) -> bool {
490        *self == PRSSEL_A::PRSCH7
491    }
492    #[doc = "Checks if the value of the field is `PRSCH8`"]
493    #[inline(always)]
494    pub fn is_prsch8(&self) -> bool {
495        *self == PRSSEL_A::PRSCH8
496    }
497    #[doc = "Checks if the value of the field is `PRSCH9`"]
498    #[inline(always)]
499    pub fn is_prsch9(&self) -> bool {
500        *self == PRSSEL_A::PRSCH9
501    }
502    #[doc = "Checks if the value of the field is `PRSCH10`"]
503    #[inline(always)]
504    pub fn is_prsch10(&self) -> bool {
505        *self == PRSSEL_A::PRSCH10
506    }
507    #[doc = "Checks if the value of the field is `PRSCH11`"]
508    #[inline(always)]
509    pub fn is_prsch11(&self) -> bool {
510        *self == PRSSEL_A::PRSCH11
511    }
512}
513#[doc = "Field `PRSSEL` writer - Scan Sequence PRS Trigger Select"]
514pub type PRSSEL_W<'a> = crate::FieldWriter<'a, u32, SCANCTRL_SPEC, u8, PRSSEL_A, 4, 28>;
515impl<'a> PRSSEL_W<'a> {
516    #[doc = "PRS ch 0 triggers scan sequence"]
517    #[inline(always)]
518    pub fn prsch0(self) -> &'a mut W {
519        self.variant(PRSSEL_A::PRSCH0)
520    }
521    #[doc = "PRS ch 1 triggers scan sequence"]
522    #[inline(always)]
523    pub fn prsch1(self) -> &'a mut W {
524        self.variant(PRSSEL_A::PRSCH1)
525    }
526    #[doc = "PRS ch 2 triggers scan sequence"]
527    #[inline(always)]
528    pub fn prsch2(self) -> &'a mut W {
529        self.variant(PRSSEL_A::PRSCH2)
530    }
531    #[doc = "PRS ch 3 triggers scan sequence"]
532    #[inline(always)]
533    pub fn prsch3(self) -> &'a mut W {
534        self.variant(PRSSEL_A::PRSCH3)
535    }
536    #[doc = "PRS ch 4 triggers scan sequence"]
537    #[inline(always)]
538    pub fn prsch4(self) -> &'a mut W {
539        self.variant(PRSSEL_A::PRSCH4)
540    }
541    #[doc = "PRS ch 5 triggers scan sequence"]
542    #[inline(always)]
543    pub fn prsch5(self) -> &'a mut W {
544        self.variant(PRSSEL_A::PRSCH5)
545    }
546    #[doc = "PRS ch 6 triggers scan sequence"]
547    #[inline(always)]
548    pub fn prsch6(self) -> &'a mut W {
549        self.variant(PRSSEL_A::PRSCH6)
550    }
551    #[doc = "PRS ch 7 triggers scan sequence"]
552    #[inline(always)]
553    pub fn prsch7(self) -> &'a mut W {
554        self.variant(PRSSEL_A::PRSCH7)
555    }
556    #[doc = "PRS ch 8 triggers scan sequence"]
557    #[inline(always)]
558    pub fn prsch8(self) -> &'a mut W {
559        self.variant(PRSSEL_A::PRSCH8)
560    }
561    #[doc = "PRS ch 9 triggers scan sequence"]
562    #[inline(always)]
563    pub fn prsch9(self) -> &'a mut W {
564        self.variant(PRSSEL_A::PRSCH9)
565    }
566    #[doc = "PRS ch 10 triggers scan sequence"]
567    #[inline(always)]
568    pub fn prsch10(self) -> &'a mut W {
569        self.variant(PRSSEL_A::PRSCH10)
570    }
571    #[doc = "PRS ch 11 triggers scan sequence"]
572    #[inline(always)]
573    pub fn prsch11(self) -> &'a mut W {
574        self.variant(PRSSEL_A::PRSCH11)
575    }
576}
577impl R {
578    #[doc = "Bit 0 - Scan Sequence Repetitive Mode"]
579    #[inline(always)]
580    pub fn rep(&self) -> REP_R {
581        REP_R::new((self.bits & 1) != 0)
582    }
583    #[doc = "Bit 1 - Scan Sequence Differential Mode"]
584    #[inline(always)]
585    pub fn diff(&self) -> DIFF_R {
586        DIFF_R::new(((self.bits >> 1) & 1) != 0)
587    }
588    #[doc = "Bit 2 - Scan Sequence Result Adjustment"]
589    #[inline(always)]
590    pub fn adj(&self) -> ADJ_R {
591        ADJ_R::new(((self.bits >> 2) & 1) != 0)
592    }
593    #[doc = "Bits 4:5 - Scan Sequence Resolution Select"]
594    #[inline(always)]
595    pub fn res(&self) -> RES_R {
596        RES_R::new(((self.bits >> 4) & 3) as u8)
597    }
598    #[doc = "Bits 8:15 - Scan Sequence Input Mask"]
599    #[inline(always)]
600    pub fn inputmask(&self) -> INPUTMASK_R {
601        INPUTMASK_R::new(((self.bits >> 8) & 0xff) as u8)
602    }
603    #[doc = "Bits 16:18 - Scan Sequence Reference Selection"]
604    #[inline(always)]
605    pub fn ref_(&self) -> REF_R {
606        REF_R::new(((self.bits >> 16) & 7) as u8)
607    }
608    #[doc = "Bits 20:23 - Scan Sample Acquisition Time"]
609    #[inline(always)]
610    pub fn at(&self) -> AT_R {
611        AT_R::new(((self.bits >> 20) & 0x0f) as u8)
612    }
613    #[doc = "Bit 24 - Scan Sequence PRS Trigger Enable"]
614    #[inline(always)]
615    pub fn prsen(&self) -> PRSEN_R {
616        PRSEN_R::new(((self.bits >> 24) & 1) != 0)
617    }
618    #[doc = "Bits 28:31 - Scan Sequence PRS Trigger Select"]
619    #[inline(always)]
620    pub fn prssel(&self) -> PRSSEL_R {
621        PRSSEL_R::new(((self.bits >> 28) & 0x0f) as u8)
622    }
623}
624impl W {
625    #[doc = "Bit 0 - Scan Sequence Repetitive Mode"]
626    #[inline(always)]
627    pub fn rep(&mut self) -> REP_W {
628        REP_W::new(self)
629    }
630    #[doc = "Bit 1 - Scan Sequence Differential Mode"]
631    #[inline(always)]
632    pub fn diff(&mut self) -> DIFF_W {
633        DIFF_W::new(self)
634    }
635    #[doc = "Bit 2 - Scan Sequence Result Adjustment"]
636    #[inline(always)]
637    pub fn adj(&mut self) -> ADJ_W {
638        ADJ_W::new(self)
639    }
640    #[doc = "Bits 4:5 - Scan Sequence Resolution Select"]
641    #[inline(always)]
642    pub fn res(&mut self) -> RES_W {
643        RES_W::new(self)
644    }
645    #[doc = "Bits 8:15 - Scan Sequence Input Mask"]
646    #[inline(always)]
647    pub fn inputmask(&mut self) -> INPUTMASK_W {
648        INPUTMASK_W::new(self)
649    }
650    #[doc = "Bits 16:18 - Scan Sequence Reference Selection"]
651    #[inline(always)]
652    pub fn ref_(&mut self) -> REF_W {
653        REF_W::new(self)
654    }
655    #[doc = "Bits 20:23 - Scan Sample Acquisition Time"]
656    #[inline(always)]
657    pub fn at(&mut self) -> AT_W {
658        AT_W::new(self)
659    }
660    #[doc = "Bit 24 - Scan Sequence PRS Trigger Enable"]
661    #[inline(always)]
662    pub fn prsen(&mut self) -> PRSEN_W {
663        PRSEN_W::new(self)
664    }
665    #[doc = "Bits 28:31 - Scan Sequence PRS Trigger Select"]
666    #[inline(always)]
667    pub fn prssel(&mut self) -> PRSSEL_W {
668        PRSSEL_W::new(self)
669    }
670    #[doc = "Writes raw bits to the register."]
671    #[inline(always)]
672    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
673        self.0.bits(bits);
674        self
675    }
676}
677#[doc = "Scan Control 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 [scanctrl](index.html) module"]
678pub struct SCANCTRL_SPEC;
679impl crate::RegisterSpec for SCANCTRL_SPEC {
680    type Ux = u32;
681}
682#[doc = "`read()` method returns [scanctrl::R](R) reader structure"]
683impl crate::Readable for SCANCTRL_SPEC {
684    type Reader = R;
685}
686#[doc = "`write(|w| ..)` method takes [scanctrl::W](W) writer structure"]
687impl crate::Writable for SCANCTRL_SPEC {
688    type Writer = W;
689}
690#[doc = "`reset()` method sets SCANCTRL to value 0"]
691impl crate::Resettable for SCANCTRL_SPEC {
692    #[inline(always)]
693    fn reset_value() -> Self::Ux {
694        0
695    }
696}