efm32pg12b500_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, 7>;
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 `ALTEXMAP` reader - Alternative Excitation Map"]
363pub type ALTEXMAP_R = crate::BitReader<bool>;
364#[doc = "Field `ALTEXMAP` writer - Alternative Excitation Map"]
365pub type ALTEXMAP_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 11>;
366#[doc = "Field `DUALSAMPLE` reader - Enable Dual Sample Mode"]
367pub type DUALSAMPLE_R = crate::BitReader<bool>;
368#[doc = "Field `DUALSAMPLE` writer - Enable Dual Sample Mode"]
369pub type DUALSAMPLE_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 13>;
370#[doc = "Field `BUFOW` reader - Result Buffer Overwrite"]
371pub type BUFOW_R = crate::BitReader<bool>;
372#[doc = "Field `BUFOW` writer - Result Buffer Overwrite"]
373pub type BUFOW_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 16>;
374#[doc = "Field `STRSCANRES` reader - Enable Storing of SCANRES"]
375pub type STRSCANRES_R = crate::BitReader<bool>;
376#[doc = "Field `STRSCANRES` writer - Enable Storing of SCANRES"]
377pub type STRSCANRES_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 17>;
378#[doc = "Field `BUFIDL` reader - Result Buffer Interrupt and DMA Trigger Level"]
379pub type BUFIDL_R = crate::BitReader<bool>;
380#[doc = "Field `BUFIDL` writer - Result Buffer Interrupt and DMA Trigger Level"]
381pub type BUFIDL_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 19>;
382#[doc = "DMA Wake-up From EM2\n\nValue on reset: 0"]
383#[derive(Clone, Copy, Debug, PartialEq)]
384#[repr(u8)]
385pub enum DMAWU_A {
386    #[doc = "0: No DMA wake-up from EM2"]
387    DISABLE = 0,
388    #[doc = "1: DMA wake-up from EM2 when data is valid in the result buffer"]
389    BUFDATAV = 1,
390    #[doc = "2: DMA wake-up from EM2 when the result buffer is full/half-full depending on BUFIDL configuration"]
391    BUFLEVEL = 2,
392}
393impl From<DMAWU_A> for u8 {
394    #[inline(always)]
395    fn from(variant: DMAWU_A) -> Self {
396        variant as _
397    }
398}
399#[doc = "Field `DMAWU` reader - DMA Wake-up From EM2"]
400pub type DMAWU_R = crate::FieldReader<u8, DMAWU_A>;
401impl DMAWU_R {
402    #[doc = "Get enumerated values variant"]
403    #[inline(always)]
404    pub fn variant(&self) -> Option<DMAWU_A> {
405        match self.bits {
406            0 => Some(DMAWU_A::DISABLE),
407            1 => Some(DMAWU_A::BUFDATAV),
408            2 => Some(DMAWU_A::BUFLEVEL),
409            _ => None,
410        }
411    }
412    #[doc = "Checks if the value of the field is `DISABLE`"]
413    #[inline(always)]
414    pub fn is_disable(&self) -> bool {
415        *self == DMAWU_A::DISABLE
416    }
417    #[doc = "Checks if the value of the field is `BUFDATAV`"]
418    #[inline(always)]
419    pub fn is_bufdatav(&self) -> bool {
420        *self == DMAWU_A::BUFDATAV
421    }
422    #[doc = "Checks if the value of the field is `BUFLEVEL`"]
423    #[inline(always)]
424    pub fn is_buflevel(&self) -> bool {
425        *self == DMAWU_A::BUFLEVEL
426    }
427}
428#[doc = "Field `DMAWU` writer - DMA Wake-up From EM2"]
429pub type DMAWU_W<'a> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, DMAWU_A, 2, 20>;
430impl<'a> DMAWU_W<'a> {
431    #[doc = "No DMA wake-up from EM2"]
432    #[inline(always)]
433    pub fn disable(self) -> &'a mut W {
434        self.variant(DMAWU_A::DISABLE)
435    }
436    #[doc = "DMA wake-up from EM2 when data is valid in the result buffer"]
437    #[inline(always)]
438    pub fn bufdatav(self) -> &'a mut W {
439        self.variant(DMAWU_A::BUFDATAV)
440    }
441    #[doc = "DMA wake-up from EM2 when the result buffer is full/half-full depending on BUFIDL configuration"]
442    #[inline(always)]
443    pub fn buflevel(self) -> &'a mut W {
444        self.variant(DMAWU_A::BUFLEVEL)
445    }
446}
447#[doc = "Field `DEBUGRUN` reader - Debug Mode Run Enable"]
448pub type DEBUGRUN_R = crate::BitReader<bool>;
449#[doc = "Field `DEBUGRUN` writer - Debug Mode Run Enable"]
450pub type DEBUGRUN_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 22>;
451impl R {
452    #[doc = "Bits 0:1 - Configure Scan Mode"]
453    #[inline(always)]
454    pub fn scanmode(&self) -> SCANMODE_R {
455        SCANMODE_R::new((self.bits & 3) as u8)
456    }
457    #[doc = "Bits 2:5 - Scan Start PRS Select"]
458    #[inline(always)]
459    pub fn prssel(&self) -> PRSSEL_R {
460        PRSSEL_R::new(((self.bits >> 2) & 0x0f) as u8)
461    }
462    #[doc = "Bits 7:8 - Select Scan Configuration"]
463    #[inline(always)]
464    pub fn scanconf(&self) -> SCANCONF_R {
465        SCANCONF_R::new(((self.bits >> 7) & 3) as u8)
466    }
467    #[doc = "Bit 11 - Alternative Excitation Map"]
468    #[inline(always)]
469    pub fn altexmap(&self) -> ALTEXMAP_R {
470        ALTEXMAP_R::new(((self.bits >> 11) & 1) != 0)
471    }
472    #[doc = "Bit 13 - Enable Dual Sample Mode"]
473    #[inline(always)]
474    pub fn dualsample(&self) -> DUALSAMPLE_R {
475        DUALSAMPLE_R::new(((self.bits >> 13) & 1) != 0)
476    }
477    #[doc = "Bit 16 - Result Buffer Overwrite"]
478    #[inline(always)]
479    pub fn bufow(&self) -> BUFOW_R {
480        BUFOW_R::new(((self.bits >> 16) & 1) != 0)
481    }
482    #[doc = "Bit 17 - Enable Storing of SCANRES"]
483    #[inline(always)]
484    pub fn strscanres(&self) -> STRSCANRES_R {
485        STRSCANRES_R::new(((self.bits >> 17) & 1) != 0)
486    }
487    #[doc = "Bit 19 - Result Buffer Interrupt and DMA Trigger Level"]
488    #[inline(always)]
489    pub fn bufidl(&self) -> BUFIDL_R {
490        BUFIDL_R::new(((self.bits >> 19) & 1) != 0)
491    }
492    #[doc = "Bits 20:21 - DMA Wake-up From EM2"]
493    #[inline(always)]
494    pub fn dmawu(&self) -> DMAWU_R {
495        DMAWU_R::new(((self.bits >> 20) & 3) as u8)
496    }
497    #[doc = "Bit 22 - Debug Mode Run Enable"]
498    #[inline(always)]
499    pub fn debugrun(&self) -> DEBUGRUN_R {
500        DEBUGRUN_R::new(((self.bits >> 22) & 1) != 0)
501    }
502}
503impl W {
504    #[doc = "Bits 0:1 - Configure Scan Mode"]
505    #[inline(always)]
506    pub fn scanmode(&mut self) -> SCANMODE_W {
507        SCANMODE_W::new(self)
508    }
509    #[doc = "Bits 2:5 - Scan Start PRS Select"]
510    #[inline(always)]
511    pub fn prssel(&mut self) -> PRSSEL_W {
512        PRSSEL_W::new(self)
513    }
514    #[doc = "Bits 7:8 - Select Scan Configuration"]
515    #[inline(always)]
516    pub fn scanconf(&mut self) -> SCANCONF_W {
517        SCANCONF_W::new(self)
518    }
519    #[doc = "Bit 11 - Alternative Excitation Map"]
520    #[inline(always)]
521    pub fn altexmap(&mut self) -> ALTEXMAP_W {
522        ALTEXMAP_W::new(self)
523    }
524    #[doc = "Bit 13 - Enable Dual Sample Mode"]
525    #[inline(always)]
526    pub fn dualsample(&mut self) -> DUALSAMPLE_W {
527        DUALSAMPLE_W::new(self)
528    }
529    #[doc = "Bit 16 - Result Buffer Overwrite"]
530    #[inline(always)]
531    pub fn bufow(&mut self) -> BUFOW_W {
532        BUFOW_W::new(self)
533    }
534    #[doc = "Bit 17 - Enable Storing of SCANRES"]
535    #[inline(always)]
536    pub fn strscanres(&mut self) -> STRSCANRES_W {
537        STRSCANRES_W::new(self)
538    }
539    #[doc = "Bit 19 - Result Buffer Interrupt and DMA Trigger Level"]
540    #[inline(always)]
541    pub fn bufidl(&mut self) -> BUFIDL_W {
542        BUFIDL_W::new(self)
543    }
544    #[doc = "Bits 20:21 - DMA Wake-up From EM2"]
545    #[inline(always)]
546    pub fn dmawu(&mut self) -> DMAWU_W {
547        DMAWU_W::new(self)
548    }
549    #[doc = "Bit 22 - Debug Mode Run Enable"]
550    #[inline(always)]
551    pub fn debugrun(&mut self) -> DEBUGRUN_W {
552        DEBUGRUN_W::new(self)
553    }
554    #[doc = "Writes raw bits to the register."]
555    #[inline(always)]
556    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
557        self.0.bits(bits);
558        self
559    }
560}
561#[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"]
562pub struct CTRL_SPEC;
563impl crate::RegisterSpec for CTRL_SPEC {
564    type Ux = u32;
565}
566#[doc = "`read()` method returns [ctrl::R](R) reader structure"]
567impl crate::Readable for CTRL_SPEC {
568    type Reader = R;
569}
570#[doc = "`write(|w| ..)` method takes [ctrl::W](W) writer structure"]
571impl crate::Writable for CTRL_SPEC {
572    type Writer = W;
573}
574#[doc = "`reset()` method sets CTRL to value 0"]
575impl crate::Resettable for CTRL_SPEC {
576    #[inline(always)]
577    fn reset_value() -> Self::Ux {
578        0
579    }
580}