efm32gg12b410_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    #[doc = "12: PRS Channel 12 selected as input"]
131    PRSCH12 = 12,
132    #[doc = "13: PRS Channel 13 selected as input"]
133    PRSCH13 = 13,
134    #[doc = "14: PRS Channel 14 selected as input"]
135    PRSCH14 = 14,
136    #[doc = "15: PRS Channel 15 selected as input"]
137    PRSCH15 = 15,
138}
139impl From<PRSSEL_A> for u8 {
140    #[inline(always)]
141    fn from(variant: PRSSEL_A) -> Self {
142        variant as _
143    }
144}
145#[doc = "Field `PRSSEL` reader - Scan Start PRS Select"]
146pub type PRSSEL_R = crate::FieldReader<u8, PRSSEL_A>;
147impl PRSSEL_R {
148    #[doc = "Get enumerated values variant"]
149    #[inline(always)]
150    pub fn variant(&self) -> PRSSEL_A {
151        match self.bits {
152            0 => PRSSEL_A::PRSCH0,
153            1 => PRSSEL_A::PRSCH1,
154            2 => PRSSEL_A::PRSCH2,
155            3 => PRSSEL_A::PRSCH3,
156            4 => PRSSEL_A::PRSCH4,
157            5 => PRSSEL_A::PRSCH5,
158            6 => PRSSEL_A::PRSCH6,
159            7 => PRSSEL_A::PRSCH7,
160            8 => PRSSEL_A::PRSCH8,
161            9 => PRSSEL_A::PRSCH9,
162            10 => PRSSEL_A::PRSCH10,
163            11 => PRSSEL_A::PRSCH11,
164            12 => PRSSEL_A::PRSCH12,
165            13 => PRSSEL_A::PRSCH13,
166            14 => PRSSEL_A::PRSCH14,
167            15 => PRSSEL_A::PRSCH15,
168            _ => unreachable!(),
169        }
170    }
171    #[doc = "Checks if the value of the field is `PRSCH0`"]
172    #[inline(always)]
173    pub fn is_prsch0(&self) -> bool {
174        *self == PRSSEL_A::PRSCH0
175    }
176    #[doc = "Checks if the value of the field is `PRSCH1`"]
177    #[inline(always)]
178    pub fn is_prsch1(&self) -> bool {
179        *self == PRSSEL_A::PRSCH1
180    }
181    #[doc = "Checks if the value of the field is `PRSCH2`"]
182    #[inline(always)]
183    pub fn is_prsch2(&self) -> bool {
184        *self == PRSSEL_A::PRSCH2
185    }
186    #[doc = "Checks if the value of the field is `PRSCH3`"]
187    #[inline(always)]
188    pub fn is_prsch3(&self) -> bool {
189        *self == PRSSEL_A::PRSCH3
190    }
191    #[doc = "Checks if the value of the field is `PRSCH4`"]
192    #[inline(always)]
193    pub fn is_prsch4(&self) -> bool {
194        *self == PRSSEL_A::PRSCH4
195    }
196    #[doc = "Checks if the value of the field is `PRSCH5`"]
197    #[inline(always)]
198    pub fn is_prsch5(&self) -> bool {
199        *self == PRSSEL_A::PRSCH5
200    }
201    #[doc = "Checks if the value of the field is `PRSCH6`"]
202    #[inline(always)]
203    pub fn is_prsch6(&self) -> bool {
204        *self == PRSSEL_A::PRSCH6
205    }
206    #[doc = "Checks if the value of the field is `PRSCH7`"]
207    #[inline(always)]
208    pub fn is_prsch7(&self) -> bool {
209        *self == PRSSEL_A::PRSCH7
210    }
211    #[doc = "Checks if the value of the field is `PRSCH8`"]
212    #[inline(always)]
213    pub fn is_prsch8(&self) -> bool {
214        *self == PRSSEL_A::PRSCH8
215    }
216    #[doc = "Checks if the value of the field is `PRSCH9`"]
217    #[inline(always)]
218    pub fn is_prsch9(&self) -> bool {
219        *self == PRSSEL_A::PRSCH9
220    }
221    #[doc = "Checks if the value of the field is `PRSCH10`"]
222    #[inline(always)]
223    pub fn is_prsch10(&self) -> bool {
224        *self == PRSSEL_A::PRSCH10
225    }
226    #[doc = "Checks if the value of the field is `PRSCH11`"]
227    #[inline(always)]
228    pub fn is_prsch11(&self) -> bool {
229        *self == PRSSEL_A::PRSCH11
230    }
231    #[doc = "Checks if the value of the field is `PRSCH12`"]
232    #[inline(always)]
233    pub fn is_prsch12(&self) -> bool {
234        *self == PRSSEL_A::PRSCH12
235    }
236    #[doc = "Checks if the value of the field is `PRSCH13`"]
237    #[inline(always)]
238    pub fn is_prsch13(&self) -> bool {
239        *self == PRSSEL_A::PRSCH13
240    }
241    #[doc = "Checks if the value of the field is `PRSCH14`"]
242    #[inline(always)]
243    pub fn is_prsch14(&self) -> bool {
244        *self == PRSSEL_A::PRSCH14
245    }
246    #[doc = "Checks if the value of the field is `PRSCH15`"]
247    #[inline(always)]
248    pub fn is_prsch15(&self) -> bool {
249        *self == PRSSEL_A::PRSCH15
250    }
251}
252#[doc = "Field `PRSSEL` writer - Scan Start PRS Select"]
253pub type PRSSEL_W<'a> = crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, PRSSEL_A, 4, 2>;
254impl<'a> PRSSEL_W<'a> {
255    #[doc = "PRS Channel 0 selected as input"]
256    #[inline(always)]
257    pub fn prsch0(self) -> &'a mut W {
258        self.variant(PRSSEL_A::PRSCH0)
259    }
260    #[doc = "PRS Channel 1 selected as input"]
261    #[inline(always)]
262    pub fn prsch1(self) -> &'a mut W {
263        self.variant(PRSSEL_A::PRSCH1)
264    }
265    #[doc = "PRS Channel 2 selected as input"]
266    #[inline(always)]
267    pub fn prsch2(self) -> &'a mut W {
268        self.variant(PRSSEL_A::PRSCH2)
269    }
270    #[doc = "PRS Channel 3 selected as input"]
271    #[inline(always)]
272    pub fn prsch3(self) -> &'a mut W {
273        self.variant(PRSSEL_A::PRSCH3)
274    }
275    #[doc = "PRS Channel 4 selected as input"]
276    #[inline(always)]
277    pub fn prsch4(self) -> &'a mut W {
278        self.variant(PRSSEL_A::PRSCH4)
279    }
280    #[doc = "PRS Channel 5 selected as input"]
281    #[inline(always)]
282    pub fn prsch5(self) -> &'a mut W {
283        self.variant(PRSSEL_A::PRSCH5)
284    }
285    #[doc = "PRS Channel 6 selected as input"]
286    #[inline(always)]
287    pub fn prsch6(self) -> &'a mut W {
288        self.variant(PRSSEL_A::PRSCH6)
289    }
290    #[doc = "PRS Channel 7 selected as input"]
291    #[inline(always)]
292    pub fn prsch7(self) -> &'a mut W {
293        self.variant(PRSSEL_A::PRSCH7)
294    }
295    #[doc = "PRS Channel 8 selected as input"]
296    #[inline(always)]
297    pub fn prsch8(self) -> &'a mut W {
298        self.variant(PRSSEL_A::PRSCH8)
299    }
300    #[doc = "PRS Channel 9 selected as input"]
301    #[inline(always)]
302    pub fn prsch9(self) -> &'a mut W {
303        self.variant(PRSSEL_A::PRSCH9)
304    }
305    #[doc = "PRS Channel 10 selected as input"]
306    #[inline(always)]
307    pub fn prsch10(self) -> &'a mut W {
308        self.variant(PRSSEL_A::PRSCH10)
309    }
310    #[doc = "PRS Channel 11 selected as input"]
311    #[inline(always)]
312    pub fn prsch11(self) -> &'a mut W {
313        self.variant(PRSSEL_A::PRSCH11)
314    }
315    #[doc = "PRS Channel 12 selected as input"]
316    #[inline(always)]
317    pub fn prsch12(self) -> &'a mut W {
318        self.variant(PRSSEL_A::PRSCH12)
319    }
320    #[doc = "PRS Channel 13 selected as input"]
321    #[inline(always)]
322    pub fn prsch13(self) -> &'a mut W {
323        self.variant(PRSSEL_A::PRSCH13)
324    }
325    #[doc = "PRS Channel 14 selected as input"]
326    #[inline(always)]
327    pub fn prsch14(self) -> &'a mut W {
328        self.variant(PRSSEL_A::PRSCH14)
329    }
330    #[doc = "PRS Channel 15 selected as input"]
331    #[inline(always)]
332    pub fn prsch15(self) -> &'a mut W {
333        self.variant(PRSSEL_A::PRSCH15)
334    }
335}
336#[doc = "Select Scan Configuration\n\nValue on reset: 0"]
337#[derive(Clone, Copy, Debug, PartialEq)]
338#[repr(u8)]
339pub enum SCANCONF_A {
340    #[doc = "0: The channel configuration register registers used are directly mapped to the channel number."]
341    DIRMAP = 0,
342    #[doc = "1: The channel configuration register registers used are CHX+8_CONF for channels 0-7 and CHX-8_CONF for channels 8-15."]
343    INVMAP = 1,
344    #[doc = "2: The channel configuration register registers used toggles between CHX_CONF and CHX+8_CONF when channel x triggers"]
345    TOGGLE = 2,
346    #[doc = "3: The decoder state defines the CONF registers to be used."]
347    DECDEF = 3,
348}
349impl From<SCANCONF_A> for u8 {
350    #[inline(always)]
351    fn from(variant: SCANCONF_A) -> Self {
352        variant as _
353    }
354}
355#[doc = "Field `SCANCONF` reader - Select Scan Configuration"]
356pub type SCANCONF_R = crate::FieldReader<u8, SCANCONF_A>;
357impl SCANCONF_R {
358    #[doc = "Get enumerated values variant"]
359    #[inline(always)]
360    pub fn variant(&self) -> SCANCONF_A {
361        match self.bits {
362            0 => SCANCONF_A::DIRMAP,
363            1 => SCANCONF_A::INVMAP,
364            2 => SCANCONF_A::TOGGLE,
365            3 => SCANCONF_A::DECDEF,
366            _ => unreachable!(),
367        }
368    }
369    #[doc = "Checks if the value of the field is `DIRMAP`"]
370    #[inline(always)]
371    pub fn is_dirmap(&self) -> bool {
372        *self == SCANCONF_A::DIRMAP
373    }
374    #[doc = "Checks if the value of the field is `INVMAP`"]
375    #[inline(always)]
376    pub fn is_invmap(&self) -> bool {
377        *self == SCANCONF_A::INVMAP
378    }
379    #[doc = "Checks if the value of the field is `TOGGLE`"]
380    #[inline(always)]
381    pub fn is_toggle(&self) -> bool {
382        *self == SCANCONF_A::TOGGLE
383    }
384    #[doc = "Checks if the value of the field is `DECDEF`"]
385    #[inline(always)]
386    pub fn is_decdef(&self) -> bool {
387        *self == SCANCONF_A::DECDEF
388    }
389}
390#[doc = "Field `SCANCONF` writer - Select Scan Configuration"]
391pub type SCANCONF_W<'a> = crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, SCANCONF_A, 2, 7>;
392impl<'a> SCANCONF_W<'a> {
393    #[doc = "The channel configuration register registers used are directly mapped to the channel number."]
394    #[inline(always)]
395    pub fn dirmap(self) -> &'a mut W {
396        self.variant(SCANCONF_A::DIRMAP)
397    }
398    #[doc = "The channel configuration register registers used are CHX+8_CONF for channels 0-7 and CHX-8_CONF for channels 8-15."]
399    #[inline(always)]
400    pub fn invmap(self) -> &'a mut W {
401        self.variant(SCANCONF_A::INVMAP)
402    }
403    #[doc = "The channel configuration register registers used toggles between CHX_CONF and CHX+8_CONF when channel x triggers"]
404    #[inline(always)]
405    pub fn toggle(self) -> &'a mut W {
406        self.variant(SCANCONF_A::TOGGLE)
407    }
408    #[doc = "The decoder state defines the CONF registers to be used."]
409    #[inline(always)]
410    pub fn decdef(self) -> &'a mut W {
411        self.variant(SCANCONF_A::DECDEF)
412    }
413}
414#[doc = "Field `ALTEXMAP` reader - Alternative Excitation Map"]
415pub type ALTEXMAP_R = crate::BitReader<bool>;
416#[doc = "Field `ALTEXMAP` writer - Alternative Excitation Map"]
417pub type ALTEXMAP_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 11>;
418#[doc = "Field `DUALSAMPLE` reader - Enable Dual Sample Mode"]
419pub type DUALSAMPLE_R = crate::BitReader<bool>;
420#[doc = "Field `DUALSAMPLE` writer - Enable Dual Sample Mode"]
421pub type DUALSAMPLE_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 13>;
422#[doc = "Field `BUFOW` reader - Result Buffer Overwrite"]
423pub type BUFOW_R = crate::BitReader<bool>;
424#[doc = "Field `BUFOW` writer - Result Buffer Overwrite"]
425pub type BUFOW_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 16>;
426#[doc = "Field `STRSCANRES` reader - Enable Storing of SCANRES"]
427pub type STRSCANRES_R = crate::BitReader<bool>;
428#[doc = "Field `STRSCANRES` writer - Enable Storing of SCANRES"]
429pub type STRSCANRES_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 17>;
430#[doc = "Field `BUFIDL` reader - Result Buffer Interrupt and DMA Trigger Level"]
431pub type BUFIDL_R = crate::BitReader<bool>;
432#[doc = "Field `BUFIDL` writer - Result Buffer Interrupt and DMA Trigger Level"]
433pub type BUFIDL_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 19>;
434#[doc = "DMA Wake-up From EM2\n\nValue on reset: 0"]
435#[derive(Clone, Copy, Debug, PartialEq)]
436#[repr(u8)]
437pub enum DMAWU_A {
438    #[doc = "0: No DMA wake-up from EM2"]
439    DISABLE = 0,
440    #[doc = "1: DMA wake-up from EM2 when data is valid in the result buffer"]
441    BUFDATAV = 1,
442    #[doc = "2: DMA wake-up from EM2 when the result buffer is full/half-full depending on BUFIDL configuration"]
443    BUFLEVEL = 2,
444}
445impl From<DMAWU_A> for u8 {
446    #[inline(always)]
447    fn from(variant: DMAWU_A) -> Self {
448        variant as _
449    }
450}
451#[doc = "Field `DMAWU` reader - DMA Wake-up From EM2"]
452pub type DMAWU_R = crate::FieldReader<u8, DMAWU_A>;
453impl DMAWU_R {
454    #[doc = "Get enumerated values variant"]
455    #[inline(always)]
456    pub fn variant(&self) -> Option<DMAWU_A> {
457        match self.bits {
458            0 => Some(DMAWU_A::DISABLE),
459            1 => Some(DMAWU_A::BUFDATAV),
460            2 => Some(DMAWU_A::BUFLEVEL),
461            _ => None,
462        }
463    }
464    #[doc = "Checks if the value of the field is `DISABLE`"]
465    #[inline(always)]
466    pub fn is_disable(&self) -> bool {
467        *self == DMAWU_A::DISABLE
468    }
469    #[doc = "Checks if the value of the field is `BUFDATAV`"]
470    #[inline(always)]
471    pub fn is_bufdatav(&self) -> bool {
472        *self == DMAWU_A::BUFDATAV
473    }
474    #[doc = "Checks if the value of the field is `BUFLEVEL`"]
475    #[inline(always)]
476    pub fn is_buflevel(&self) -> bool {
477        *self == DMAWU_A::BUFLEVEL
478    }
479}
480#[doc = "Field `DMAWU` writer - DMA Wake-up From EM2"]
481pub type DMAWU_W<'a> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, DMAWU_A, 2, 20>;
482impl<'a> DMAWU_W<'a> {
483    #[doc = "No DMA wake-up from EM2"]
484    #[inline(always)]
485    pub fn disable(self) -> &'a mut W {
486        self.variant(DMAWU_A::DISABLE)
487    }
488    #[doc = "DMA wake-up from EM2 when data is valid in the result buffer"]
489    #[inline(always)]
490    pub fn bufdatav(self) -> &'a mut W {
491        self.variant(DMAWU_A::BUFDATAV)
492    }
493    #[doc = "DMA wake-up from EM2 when the result buffer is full/half-full depending on BUFIDL configuration"]
494    #[inline(always)]
495    pub fn buflevel(self) -> &'a mut W {
496        self.variant(DMAWU_A::BUFLEVEL)
497    }
498}
499#[doc = "Field `DEBUGRUN` reader - Debug Mode Run Enable"]
500pub type DEBUGRUN_R = crate::BitReader<bool>;
501#[doc = "Field `DEBUGRUN` writer - Debug Mode Run Enable"]
502pub type DEBUGRUN_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 22>;
503impl R {
504    #[doc = "Bits 0:1 - Configure Scan Mode"]
505    #[inline(always)]
506    pub fn scanmode(&self) -> SCANMODE_R {
507        SCANMODE_R::new((self.bits & 3) as u8)
508    }
509    #[doc = "Bits 2:5 - Scan Start PRS Select"]
510    #[inline(always)]
511    pub fn prssel(&self) -> PRSSEL_R {
512        PRSSEL_R::new(((self.bits >> 2) & 0x0f) as u8)
513    }
514    #[doc = "Bits 7:8 - Select Scan Configuration"]
515    #[inline(always)]
516    pub fn scanconf(&self) -> SCANCONF_R {
517        SCANCONF_R::new(((self.bits >> 7) & 3) as u8)
518    }
519    #[doc = "Bit 11 - Alternative Excitation Map"]
520    #[inline(always)]
521    pub fn altexmap(&self) -> ALTEXMAP_R {
522        ALTEXMAP_R::new(((self.bits >> 11) & 1) != 0)
523    }
524    #[doc = "Bit 13 - Enable Dual Sample Mode"]
525    #[inline(always)]
526    pub fn dualsample(&self) -> DUALSAMPLE_R {
527        DUALSAMPLE_R::new(((self.bits >> 13) & 1) != 0)
528    }
529    #[doc = "Bit 16 - Result Buffer Overwrite"]
530    #[inline(always)]
531    pub fn bufow(&self) -> BUFOW_R {
532        BUFOW_R::new(((self.bits >> 16) & 1) != 0)
533    }
534    #[doc = "Bit 17 - Enable Storing of SCANRES"]
535    #[inline(always)]
536    pub fn strscanres(&self) -> STRSCANRES_R {
537        STRSCANRES_R::new(((self.bits >> 17) & 1) != 0)
538    }
539    #[doc = "Bit 19 - Result Buffer Interrupt and DMA Trigger Level"]
540    #[inline(always)]
541    pub fn bufidl(&self) -> BUFIDL_R {
542        BUFIDL_R::new(((self.bits >> 19) & 1) != 0)
543    }
544    #[doc = "Bits 20:21 - DMA Wake-up From EM2"]
545    #[inline(always)]
546    pub fn dmawu(&self) -> DMAWU_R {
547        DMAWU_R::new(((self.bits >> 20) & 3) as u8)
548    }
549    #[doc = "Bit 22 - Debug Mode Run Enable"]
550    #[inline(always)]
551    pub fn debugrun(&self) -> DEBUGRUN_R {
552        DEBUGRUN_R::new(((self.bits >> 22) & 1) != 0)
553    }
554}
555impl W {
556    #[doc = "Bits 0:1 - Configure Scan Mode"]
557    #[inline(always)]
558    pub fn scanmode(&mut self) -> SCANMODE_W {
559        SCANMODE_W::new(self)
560    }
561    #[doc = "Bits 2:5 - Scan Start PRS Select"]
562    #[inline(always)]
563    pub fn prssel(&mut self) -> PRSSEL_W {
564        PRSSEL_W::new(self)
565    }
566    #[doc = "Bits 7:8 - Select Scan Configuration"]
567    #[inline(always)]
568    pub fn scanconf(&mut self) -> SCANCONF_W {
569        SCANCONF_W::new(self)
570    }
571    #[doc = "Bit 11 - Alternative Excitation Map"]
572    #[inline(always)]
573    pub fn altexmap(&mut self) -> ALTEXMAP_W {
574        ALTEXMAP_W::new(self)
575    }
576    #[doc = "Bit 13 - Enable Dual Sample Mode"]
577    #[inline(always)]
578    pub fn dualsample(&mut self) -> DUALSAMPLE_W {
579        DUALSAMPLE_W::new(self)
580    }
581    #[doc = "Bit 16 - Result Buffer Overwrite"]
582    #[inline(always)]
583    pub fn bufow(&mut self) -> BUFOW_W {
584        BUFOW_W::new(self)
585    }
586    #[doc = "Bit 17 - Enable Storing of SCANRES"]
587    #[inline(always)]
588    pub fn strscanres(&mut self) -> STRSCANRES_W {
589        STRSCANRES_W::new(self)
590    }
591    #[doc = "Bit 19 - Result Buffer Interrupt and DMA Trigger Level"]
592    #[inline(always)]
593    pub fn bufidl(&mut self) -> BUFIDL_W {
594        BUFIDL_W::new(self)
595    }
596    #[doc = "Bits 20:21 - DMA Wake-up From EM2"]
597    #[inline(always)]
598    pub fn dmawu(&mut self) -> DMAWU_W {
599        DMAWU_W::new(self)
600    }
601    #[doc = "Bit 22 - Debug Mode Run Enable"]
602    #[inline(always)]
603    pub fn debugrun(&mut self) -> DEBUGRUN_W {
604        DEBUGRUN_W::new(self)
605    }
606    #[doc = "Writes raw bits to the register."]
607    #[inline(always)]
608    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
609        self.0.bits(bits);
610        self
611    }
612}
613#[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"]
614pub struct CTRL_SPEC;
615impl crate::RegisterSpec for CTRL_SPEC {
616    type Ux = u32;
617}
618#[doc = "`read()` method returns [ctrl::R](R) reader structure"]
619impl crate::Readable for CTRL_SPEC {
620    type Reader = R;
621}
622#[doc = "`write(|w| ..)` method takes [ctrl::W](W) writer structure"]
623impl crate::Writable for CTRL_SPEC {
624    type Writer = W;
625}
626#[doc = "`reset()` method sets CTRL to value 0"]
627impl crate::Resettable for CTRL_SPEC {
628    #[inline(always)]
629    fn reset_value() -> Self::Ux {
630        0
631    }
632}