efm32wg230_pac/lesense/
ctrl.rs

1#[doc = "Register `CTRL` reader"]
2pub struct R(crate::R<CTRL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CTRL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CTRL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CTRL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CTRL` writer"]
17pub struct W(crate::W<CTRL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CTRL_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<CTRL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CTRL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Configure scan mode\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39#[repr(u8)]
40pub enum SCANMODE_A {
41    #[doc = "0: A new scan is started each time the period counter overflows"]
42    PERIODIC = 0,
43    #[doc = "1: A single scan is performed when START in CMD is set"]
44    ONESHOT = 1,
45    #[doc = "2: Pulse on PRS channel"]
46    PRS = 2,
47}
48impl From<SCANMODE_A> for u8 {
49    #[inline(always)]
50    fn from(variant: SCANMODE_A) -> Self {
51        variant as _
52    }
53}
54#[doc = "Field `SCANMODE` reader - Configure scan mode"]
55pub type SCANMODE_R = crate::FieldReader<u8, SCANMODE_A>;
56impl SCANMODE_R {
57    #[doc = "Get enumerated values variant"]
58    #[inline(always)]
59    pub fn variant(&self) -> Option<SCANMODE_A> {
60        match self.bits {
61            0 => Some(SCANMODE_A::PERIODIC),
62            1 => Some(SCANMODE_A::ONESHOT),
63            2 => Some(SCANMODE_A::PRS),
64            _ => None,
65        }
66    }
67    #[doc = "Checks if the value of the field is `PERIODIC`"]
68    #[inline(always)]
69    pub fn is_periodic(&self) -> bool {
70        *self == SCANMODE_A::PERIODIC
71    }
72    #[doc = "Checks if the value of the field is `ONESHOT`"]
73    #[inline(always)]
74    pub fn is_oneshot(&self) -> bool {
75        *self == SCANMODE_A::ONESHOT
76    }
77    #[doc = "Checks if the value of the field is `PRS`"]
78    #[inline(always)]
79    pub fn is_prs(&self) -> bool {
80        *self == SCANMODE_A::PRS
81    }
82}
83#[doc = "Field `SCANMODE` writer - Configure scan mode"]
84pub type SCANMODE_W<'a> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, SCANMODE_A, 2, 0>;
85impl<'a> SCANMODE_W<'a> {
86    #[doc = "A new scan is started each time the period counter overflows"]
87    #[inline(always)]
88    pub fn periodic(self) -> &'a mut W {
89        self.variant(SCANMODE_A::PERIODIC)
90    }
91    #[doc = "A single scan is performed when START in CMD is set"]
92    #[inline(always)]
93    pub fn oneshot(self) -> &'a mut W {
94        self.variant(SCANMODE_A::ONESHOT)
95    }
96    #[doc = "Pulse on PRS channel"]
97    #[inline(always)]
98    pub fn prs(self) -> &'a mut W {
99        self.variant(SCANMODE_A::PRS)
100    }
101}
102#[doc = "Scan start PRS select\n\nValue on reset: 0"]
103#[derive(Clone, Copy, Debug, PartialEq)]
104#[repr(u8)]
105pub enum PRSSEL_A {
106    #[doc = "0: PRS Channel 0 selected as input"]
107    PRSCH0 = 0,
108    #[doc = "1: PRS Channel 1 selected as input"]
109    PRSCH1 = 1,
110    #[doc = "2: PRS Channel 2 selected as input"]
111    PRSCH2 = 2,
112    #[doc = "3: PRS Channel 3 selected as input"]
113    PRSCH3 = 3,
114    #[doc = "4: PRS Channel 4 selected as input"]
115    PRSCH4 = 4,
116    #[doc = "5: PRS Channel 5 selected as input"]
117    PRSCH5 = 5,
118    #[doc = "6: PRS Channel 6 selected as input"]
119    PRSCH6 = 6,
120    #[doc = "7: PRS Channel 7 selected as input"]
121    PRSCH7 = 7,
122    #[doc = "8: PRS Channel 8 selected as input"]
123    PRSCH8 = 8,
124    #[doc = "9: PRS Channel 9 selected as input"]
125    PRSCH9 = 9,
126    #[doc = "10: PRS Channel 10 selected as input"]
127    PRSCH10 = 10,
128    #[doc = "11: PRS Channel 11 selected as input"]
129    PRSCH11 = 11,
130}
131impl From<PRSSEL_A> for u8 {
132    #[inline(always)]
133    fn from(variant: PRSSEL_A) -> Self {
134        variant as _
135    }
136}
137#[doc = "Field `PRSSEL` reader - Scan start PRS select"]
138pub type PRSSEL_R = crate::FieldReader<u8, PRSSEL_A>;
139impl PRSSEL_R {
140    #[doc = "Get enumerated values variant"]
141    #[inline(always)]
142    pub fn variant(&self) -> Option<PRSSEL_A> {
143        match self.bits {
144            0 => Some(PRSSEL_A::PRSCH0),
145            1 => Some(PRSSEL_A::PRSCH1),
146            2 => Some(PRSSEL_A::PRSCH2),
147            3 => Some(PRSSEL_A::PRSCH3),
148            4 => Some(PRSSEL_A::PRSCH4),
149            5 => Some(PRSSEL_A::PRSCH5),
150            6 => Some(PRSSEL_A::PRSCH6),
151            7 => Some(PRSSEL_A::PRSCH7),
152            8 => Some(PRSSEL_A::PRSCH8),
153            9 => Some(PRSSEL_A::PRSCH9),
154            10 => Some(PRSSEL_A::PRSCH10),
155            11 => Some(PRSSEL_A::PRSCH11),
156            _ => None,
157        }
158    }
159    #[doc = "Checks if the value of the field is `PRSCH0`"]
160    #[inline(always)]
161    pub fn is_prsch0(&self) -> bool {
162        *self == PRSSEL_A::PRSCH0
163    }
164    #[doc = "Checks if the value of the field is `PRSCH1`"]
165    #[inline(always)]
166    pub fn is_prsch1(&self) -> bool {
167        *self == PRSSEL_A::PRSCH1
168    }
169    #[doc = "Checks if the value of the field is `PRSCH2`"]
170    #[inline(always)]
171    pub fn is_prsch2(&self) -> bool {
172        *self == PRSSEL_A::PRSCH2
173    }
174    #[doc = "Checks if the value of the field is `PRSCH3`"]
175    #[inline(always)]
176    pub fn is_prsch3(&self) -> bool {
177        *self == PRSSEL_A::PRSCH3
178    }
179    #[doc = "Checks if the value of the field is `PRSCH4`"]
180    #[inline(always)]
181    pub fn is_prsch4(&self) -> bool {
182        *self == PRSSEL_A::PRSCH4
183    }
184    #[doc = "Checks if the value of the field is `PRSCH5`"]
185    #[inline(always)]
186    pub fn is_prsch5(&self) -> bool {
187        *self == PRSSEL_A::PRSCH5
188    }
189    #[doc = "Checks if the value of the field is `PRSCH6`"]
190    #[inline(always)]
191    pub fn is_prsch6(&self) -> bool {
192        *self == PRSSEL_A::PRSCH6
193    }
194    #[doc = "Checks if the value of the field is `PRSCH7`"]
195    #[inline(always)]
196    pub fn is_prsch7(&self) -> bool {
197        *self == PRSSEL_A::PRSCH7
198    }
199    #[doc = "Checks if the value of the field is `PRSCH8`"]
200    #[inline(always)]
201    pub fn is_prsch8(&self) -> bool {
202        *self == PRSSEL_A::PRSCH8
203    }
204    #[doc = "Checks if the value of the field is `PRSCH9`"]
205    #[inline(always)]
206    pub fn is_prsch9(&self) -> bool {
207        *self == PRSSEL_A::PRSCH9
208    }
209    #[doc = "Checks if the value of the field is `PRSCH10`"]
210    #[inline(always)]
211    pub fn is_prsch10(&self) -> bool {
212        *self == PRSSEL_A::PRSCH10
213    }
214    #[doc = "Checks if the value of the field is `PRSCH11`"]
215    #[inline(always)]
216    pub fn is_prsch11(&self) -> bool {
217        *self == PRSSEL_A::PRSCH11
218    }
219}
220#[doc = "Field `PRSSEL` writer - Scan start PRS select"]
221pub type PRSSEL_W<'a> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, PRSSEL_A, 4, 2>;
222impl<'a> PRSSEL_W<'a> {
223    #[doc = "PRS Channel 0 selected as input"]
224    #[inline(always)]
225    pub fn prsch0(self) -> &'a mut W {
226        self.variant(PRSSEL_A::PRSCH0)
227    }
228    #[doc = "PRS Channel 1 selected as input"]
229    #[inline(always)]
230    pub fn prsch1(self) -> &'a mut W {
231        self.variant(PRSSEL_A::PRSCH1)
232    }
233    #[doc = "PRS Channel 2 selected as input"]
234    #[inline(always)]
235    pub fn prsch2(self) -> &'a mut W {
236        self.variant(PRSSEL_A::PRSCH2)
237    }
238    #[doc = "PRS Channel 3 selected as input"]
239    #[inline(always)]
240    pub fn prsch3(self) -> &'a mut W {
241        self.variant(PRSSEL_A::PRSCH3)
242    }
243    #[doc = "PRS Channel 4 selected as input"]
244    #[inline(always)]
245    pub fn prsch4(self) -> &'a mut W {
246        self.variant(PRSSEL_A::PRSCH4)
247    }
248    #[doc = "PRS Channel 5 selected as input"]
249    #[inline(always)]
250    pub fn prsch5(self) -> &'a mut W {
251        self.variant(PRSSEL_A::PRSCH5)
252    }
253    #[doc = "PRS Channel 6 selected as input"]
254    #[inline(always)]
255    pub fn prsch6(self) -> &'a mut W {
256        self.variant(PRSSEL_A::PRSCH6)
257    }
258    #[doc = "PRS Channel 7 selected as input"]
259    #[inline(always)]
260    pub fn prsch7(self) -> &'a mut W {
261        self.variant(PRSSEL_A::PRSCH7)
262    }
263    #[doc = "PRS Channel 8 selected as input"]
264    #[inline(always)]
265    pub fn prsch8(self) -> &'a mut W {
266        self.variant(PRSSEL_A::PRSCH8)
267    }
268    #[doc = "PRS Channel 9 selected as input"]
269    #[inline(always)]
270    pub fn prsch9(self) -> &'a mut W {
271        self.variant(PRSSEL_A::PRSCH9)
272    }
273    #[doc = "PRS Channel 10 selected as input"]
274    #[inline(always)]
275    pub fn prsch10(self) -> &'a mut W {
276        self.variant(PRSSEL_A::PRSCH10)
277    }
278    #[doc = "PRS Channel 11 selected as input"]
279    #[inline(always)]
280    pub fn prsch11(self) -> &'a mut W {
281        self.variant(PRSSEL_A::PRSCH11)
282    }
283}
284#[doc = "Select scan configuration\n\nValue on reset: 0"]
285#[derive(Clone, Copy, Debug, PartialEq)]
286#[repr(u8)]
287pub enum SCANCONF_A {
288    #[doc = "0: The channel configuration register registers used are directly mapped to the channel number."]
289    DIRMAP = 0,
290    #[doc = "1: The channel configuration register registers used are CHX+8_CONF for channels 0-7 and CHX-8_CONF for channels 8-15."]
291    INVMAP = 1,
292    #[doc = "2: The channel configuration register registers used toggles between CHX_CONF and CHX+8_CONF when channel x triggers"]
293    TOGGLE = 2,
294    #[doc = "3: The decoder state defines the CONF registers to be used."]
295    DECDEF = 3,
296}
297impl From<SCANCONF_A> for u8 {
298    #[inline(always)]
299    fn from(variant: SCANCONF_A) -> Self {
300        variant as _
301    }
302}
303#[doc = "Field `SCANCONF` reader - Select scan configuration"]
304pub type SCANCONF_R = crate::FieldReader<u8, SCANCONF_A>;
305impl SCANCONF_R {
306    #[doc = "Get enumerated values variant"]
307    #[inline(always)]
308    pub fn variant(&self) -> SCANCONF_A {
309        match self.bits {
310            0 => SCANCONF_A::DIRMAP,
311            1 => SCANCONF_A::INVMAP,
312            2 => SCANCONF_A::TOGGLE,
313            3 => SCANCONF_A::DECDEF,
314            _ => unreachable!(),
315        }
316    }
317    #[doc = "Checks if the value of the field is `DIRMAP`"]
318    #[inline(always)]
319    pub fn is_dirmap(&self) -> bool {
320        *self == SCANCONF_A::DIRMAP
321    }
322    #[doc = "Checks if the value of the field is `INVMAP`"]
323    #[inline(always)]
324    pub fn is_invmap(&self) -> bool {
325        *self == SCANCONF_A::INVMAP
326    }
327    #[doc = "Checks if the value of the field is `TOGGLE`"]
328    #[inline(always)]
329    pub fn is_toggle(&self) -> bool {
330        *self == SCANCONF_A::TOGGLE
331    }
332    #[doc = "Checks if the value of the field is `DECDEF`"]
333    #[inline(always)]
334    pub fn is_decdef(&self) -> bool {
335        *self == SCANCONF_A::DECDEF
336    }
337}
338#[doc = "Field `SCANCONF` writer - Select scan configuration"]
339pub type SCANCONF_W<'a> = crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, SCANCONF_A, 2, 6>;
340impl<'a> SCANCONF_W<'a> {
341    #[doc = "The channel configuration register registers used are directly mapped to the channel number."]
342    #[inline(always)]
343    pub fn dirmap(self) -> &'a mut W {
344        self.variant(SCANCONF_A::DIRMAP)
345    }
346    #[doc = "The channel configuration register registers used are CHX+8_CONF for channels 0-7 and CHX-8_CONF for channels 8-15."]
347    #[inline(always)]
348    pub fn invmap(self) -> &'a mut W {
349        self.variant(SCANCONF_A::INVMAP)
350    }
351    #[doc = "The channel configuration register registers used toggles between CHX_CONF and CHX+8_CONF when channel x triggers"]
352    #[inline(always)]
353    pub fn toggle(self) -> &'a mut W {
354        self.variant(SCANCONF_A::TOGGLE)
355    }
356    #[doc = "The decoder state defines the CONF registers to be used."]
357    #[inline(always)]
358    pub fn decdef(self) -> &'a mut W {
359        self.variant(SCANCONF_A::DECDEF)
360    }
361}
362#[doc = "Field `ACMP0INV` reader - Invert analog comparator 0 output"]
363pub type ACMP0INV_R = crate::BitReader<bool>;
364#[doc = "Field `ACMP0INV` writer - Invert analog comparator 0 output"]
365pub type ACMP0INV_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 9>;
366#[doc = "Field `ACMP1INV` reader - Invert analog comparator 1 output"]
367pub type ACMP1INV_R = crate::BitReader<bool>;
368#[doc = "Field `ACMP1INV` writer - Invert analog comparator 1 output"]
369pub type ACMP1INV_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 10>;
370#[doc = "Field `ALTEXMAP` reader - Alternative excitation map"]
371pub type ALTEXMAP_R = crate::BitReader<bool>;
372#[doc = "Field `ALTEXMAP` writer - Alternative excitation map"]
373pub type ALTEXMAP_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 11>;
374#[doc = "Field `DUALSAMPLE` reader - Enable dual sample mode"]
375pub type DUALSAMPLE_R = crate::BitReader<bool>;
376#[doc = "Field `DUALSAMPLE` writer - Enable dual sample mode"]
377pub type DUALSAMPLE_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 13>;
378#[doc = "Field `BUFOW` reader - Result buffer overwrite"]
379pub type BUFOW_R = crate::BitReader<bool>;
380#[doc = "Field `BUFOW` writer - Result buffer overwrite"]
381pub type BUFOW_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 16>;
382#[doc = "Field `STRSCANRES` reader - Enable storing of SCANRES"]
383pub type STRSCANRES_R = crate::BitReader<bool>;
384#[doc = "Field `STRSCANRES` writer - Enable storing of SCANRES"]
385pub type STRSCANRES_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 17>;
386#[doc = "Field `BUFIDL` reader - Result buffer interrupt and DMA trigger level"]
387pub type BUFIDL_R = crate::BitReader<bool>;
388#[doc = "Field `BUFIDL` writer - Result buffer interrupt and DMA trigger level"]
389pub type BUFIDL_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 18>;
390#[doc = "DMA wake-up from EM2\n\nValue on reset: 0"]
391#[derive(Clone, Copy, Debug, PartialEq)]
392#[repr(u8)]
393pub enum DMAWU_A {
394    #[doc = "0: No DMA wake-up from EM2"]
395    DISABLE = 0,
396    #[doc = "1: DMA wake-up from EM2 when data is valid in the result buffer"]
397    BUFDATAV = 1,
398    #[doc = "2: DMA wake-up from EM2 when the result buffer is full/half-full depending on BUFIDL configuration"]
399    BUFLEVEL = 2,
400}
401impl From<DMAWU_A> for u8 {
402    #[inline(always)]
403    fn from(variant: DMAWU_A) -> Self {
404        variant as _
405    }
406}
407#[doc = "Field `DMAWU` reader - DMA wake-up from EM2"]
408pub type DMAWU_R = crate::FieldReader<u8, DMAWU_A>;
409impl DMAWU_R {
410    #[doc = "Get enumerated values variant"]
411    #[inline(always)]
412    pub fn variant(&self) -> Option<DMAWU_A> {
413        match self.bits {
414            0 => Some(DMAWU_A::DISABLE),
415            1 => Some(DMAWU_A::BUFDATAV),
416            2 => Some(DMAWU_A::BUFLEVEL),
417            _ => None,
418        }
419    }
420    #[doc = "Checks if the value of the field is `DISABLE`"]
421    #[inline(always)]
422    pub fn is_disable(&self) -> bool {
423        *self == DMAWU_A::DISABLE
424    }
425    #[doc = "Checks if the value of the field is `BUFDATAV`"]
426    #[inline(always)]
427    pub fn is_bufdatav(&self) -> bool {
428        *self == DMAWU_A::BUFDATAV
429    }
430    #[doc = "Checks if the value of the field is `BUFLEVEL`"]
431    #[inline(always)]
432    pub fn is_buflevel(&self) -> bool {
433        *self == DMAWU_A::BUFLEVEL
434    }
435}
436#[doc = "Field `DMAWU` writer - DMA wake-up from EM2"]
437pub type DMAWU_W<'a> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, DMAWU_A, 2, 20>;
438impl<'a> DMAWU_W<'a> {
439    #[doc = "No DMA wake-up from EM2"]
440    #[inline(always)]
441    pub fn disable(self) -> &'a mut W {
442        self.variant(DMAWU_A::DISABLE)
443    }
444    #[doc = "DMA wake-up from EM2 when data is valid in the result buffer"]
445    #[inline(always)]
446    pub fn bufdatav(self) -> &'a mut W {
447        self.variant(DMAWU_A::BUFDATAV)
448    }
449    #[doc = "DMA wake-up from EM2 when the result buffer is full/half-full depending on BUFIDL configuration"]
450    #[inline(always)]
451    pub fn buflevel(self) -> &'a mut W {
452        self.variant(DMAWU_A::BUFLEVEL)
453    }
454}
455#[doc = "Field `DEBUGRUN` reader - Debug Mode Run Enable"]
456pub type DEBUGRUN_R = crate::BitReader<bool>;
457#[doc = "Field `DEBUGRUN` writer - Debug Mode Run Enable"]
458pub type DEBUGRUN_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 22>;
459impl R {
460    #[doc = "Bits 0:1 - Configure scan mode"]
461    #[inline(always)]
462    pub fn scanmode(&self) -> SCANMODE_R {
463        SCANMODE_R::new((self.bits & 3) as u8)
464    }
465    #[doc = "Bits 2:5 - Scan start PRS select"]
466    #[inline(always)]
467    pub fn prssel(&self) -> PRSSEL_R {
468        PRSSEL_R::new(((self.bits >> 2) & 0x0f) as u8)
469    }
470    #[doc = "Bits 6:7 - Select scan configuration"]
471    #[inline(always)]
472    pub fn scanconf(&self) -> SCANCONF_R {
473        SCANCONF_R::new(((self.bits >> 6) & 3) as u8)
474    }
475    #[doc = "Bit 9 - Invert analog comparator 0 output"]
476    #[inline(always)]
477    pub fn acmp0inv(&self) -> ACMP0INV_R {
478        ACMP0INV_R::new(((self.bits >> 9) & 1) != 0)
479    }
480    #[doc = "Bit 10 - Invert analog comparator 1 output"]
481    #[inline(always)]
482    pub fn acmp1inv(&self) -> ACMP1INV_R {
483        ACMP1INV_R::new(((self.bits >> 10) & 1) != 0)
484    }
485    #[doc = "Bit 11 - Alternative excitation map"]
486    #[inline(always)]
487    pub fn altexmap(&self) -> ALTEXMAP_R {
488        ALTEXMAP_R::new(((self.bits >> 11) & 1) != 0)
489    }
490    #[doc = "Bit 13 - Enable dual sample mode"]
491    #[inline(always)]
492    pub fn dualsample(&self) -> DUALSAMPLE_R {
493        DUALSAMPLE_R::new(((self.bits >> 13) & 1) != 0)
494    }
495    #[doc = "Bit 16 - Result buffer overwrite"]
496    #[inline(always)]
497    pub fn bufow(&self) -> BUFOW_R {
498        BUFOW_R::new(((self.bits >> 16) & 1) != 0)
499    }
500    #[doc = "Bit 17 - Enable storing of SCANRES"]
501    #[inline(always)]
502    pub fn strscanres(&self) -> STRSCANRES_R {
503        STRSCANRES_R::new(((self.bits >> 17) & 1) != 0)
504    }
505    #[doc = "Bit 18 - Result buffer interrupt and DMA trigger level"]
506    #[inline(always)]
507    pub fn bufidl(&self) -> BUFIDL_R {
508        BUFIDL_R::new(((self.bits >> 18) & 1) != 0)
509    }
510    #[doc = "Bits 20:21 - DMA wake-up from EM2"]
511    #[inline(always)]
512    pub fn dmawu(&self) -> DMAWU_R {
513        DMAWU_R::new(((self.bits >> 20) & 3) as u8)
514    }
515    #[doc = "Bit 22 - Debug Mode Run Enable"]
516    #[inline(always)]
517    pub fn debugrun(&self) -> DEBUGRUN_R {
518        DEBUGRUN_R::new(((self.bits >> 22) & 1) != 0)
519    }
520}
521impl W {
522    #[doc = "Bits 0:1 - Configure scan mode"]
523    #[inline(always)]
524    pub fn scanmode(&mut self) -> SCANMODE_W {
525        SCANMODE_W::new(self)
526    }
527    #[doc = "Bits 2:5 - Scan start PRS select"]
528    #[inline(always)]
529    pub fn prssel(&mut self) -> PRSSEL_W {
530        PRSSEL_W::new(self)
531    }
532    #[doc = "Bits 6:7 - Select scan configuration"]
533    #[inline(always)]
534    pub fn scanconf(&mut self) -> SCANCONF_W {
535        SCANCONF_W::new(self)
536    }
537    #[doc = "Bit 9 - Invert analog comparator 0 output"]
538    #[inline(always)]
539    pub fn acmp0inv(&mut self) -> ACMP0INV_W {
540        ACMP0INV_W::new(self)
541    }
542    #[doc = "Bit 10 - Invert analog comparator 1 output"]
543    #[inline(always)]
544    pub fn acmp1inv(&mut self) -> ACMP1INV_W {
545        ACMP1INV_W::new(self)
546    }
547    #[doc = "Bit 11 - Alternative excitation map"]
548    #[inline(always)]
549    pub fn altexmap(&mut self) -> ALTEXMAP_W {
550        ALTEXMAP_W::new(self)
551    }
552    #[doc = "Bit 13 - Enable dual sample mode"]
553    #[inline(always)]
554    pub fn dualsample(&mut self) -> DUALSAMPLE_W {
555        DUALSAMPLE_W::new(self)
556    }
557    #[doc = "Bit 16 - Result buffer overwrite"]
558    #[inline(always)]
559    pub fn bufow(&mut self) -> BUFOW_W {
560        BUFOW_W::new(self)
561    }
562    #[doc = "Bit 17 - Enable storing of SCANRES"]
563    #[inline(always)]
564    pub fn strscanres(&mut self) -> STRSCANRES_W {
565        STRSCANRES_W::new(self)
566    }
567    #[doc = "Bit 18 - Result buffer interrupt and DMA trigger level"]
568    #[inline(always)]
569    pub fn bufidl(&mut self) -> BUFIDL_W {
570        BUFIDL_W::new(self)
571    }
572    #[doc = "Bits 20:21 - DMA wake-up from EM2"]
573    #[inline(always)]
574    pub fn dmawu(&mut self) -> DMAWU_W {
575        DMAWU_W::new(self)
576    }
577    #[doc = "Bit 22 - Debug Mode Run Enable"]
578    #[inline(always)]
579    pub fn debugrun(&mut self) -> DEBUGRUN_W {
580        DEBUGRUN_W::new(self)
581    }
582    #[doc = "Writes raw bits to the register."]
583    #[inline(always)]
584    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
585        self.0.bits(bits);
586        self
587    }
588}
589#[doc = "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 [ctrl](index.html) module"]
590pub struct CTRL_SPEC;
591impl crate::RegisterSpec for CTRL_SPEC {
592    type Ux = u32;
593}
594#[doc = "`read()` method returns [ctrl::R](R) reader structure"]
595impl crate::Readable for CTRL_SPEC {
596    type Reader = R;
597}
598#[doc = "`write(|w| ..)` method takes [ctrl::W](W) writer structure"]
599impl crate::Writable for CTRL_SPEC {
600    type Writer = W;
601}
602#[doc = "`reset()` method sets CTRL to value 0"]
603impl crate::Resettable for CTRL_SPEC {
604    #[inline(always)]
605    fn reset_value() -> Self::Ux {
606        0
607    }
608}