efm32gg_pac/efm32gg995/lesense/
ctrl.rs1#[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 = "Field `SCANMODE` reader - Configure scan mode"]
38pub type SCANMODE_R = crate::FieldReader<u8, SCANMODE_A>;
39#[doc = "Configure scan mode\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41#[repr(u8)]
42pub enum SCANMODE_A {
43 #[doc = "0: A new scan is started each time the period counter overflows"]
44 PERIODIC = 0,
45 #[doc = "1: A single scan is performed when START in CMD is set"]
46 ONESHOT = 1,
47 #[doc = "2: Pulse on PRS channel"]
48 PRS = 2,
49}
50impl From<SCANMODE_A> for u8 {
51 #[inline(always)]
52 fn from(variant: SCANMODE_A) -> Self {
53 variant as _
54 }
55}
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, const O: u8> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, SCANMODE_A, 2, O>;
85impl<'a, const O: u8> SCANMODE_W<'a, O> {
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 = "Field `PRSSEL` reader - Scan start PRS select"]
103pub type PRSSEL_R = crate::FieldReader<u8, PRSSEL_A>;
104#[doc = "Scan start PRS select\n\nValue on reset: 0"]
105#[derive(Clone, Copy, Debug, PartialEq, Eq)]
106#[repr(u8)]
107pub enum PRSSEL_A {
108 #[doc = "0: PRS Channel 0 selected as input"]
109 PRSCH0 = 0,
110 #[doc = "1: PRS Channel 1 selected as input"]
111 PRSCH1 = 1,
112 #[doc = "2: PRS Channel 2 selected as input"]
113 PRSCH2 = 2,
114 #[doc = "3: PRS Channel 3 selected as input"]
115 PRSCH3 = 3,
116 #[doc = "4: PRS Channel 4 selected as input"]
117 PRSCH4 = 4,
118 #[doc = "5: PRS Channel 5 selected as input"]
119 PRSCH5 = 5,
120 #[doc = "6: PRS Channel 6 selected as input"]
121 PRSCH6 = 6,
122 #[doc = "7: PRS Channel 7 selected as input"]
123 PRSCH7 = 7,
124 #[doc = "8: PRS Channel 8 selected as input"]
125 PRSCH8 = 8,
126 #[doc = "9: PRS Channel 9 selected as input"]
127 PRSCH9 = 9,
128 #[doc = "10: PRS Channel 10 selected as input"]
129 PRSCH10 = 10,
130 #[doc = "11: PRS Channel 11 selected as input"]
131 PRSCH11 = 11,
132}
133impl From<PRSSEL_A> for u8 {
134 #[inline(always)]
135 fn from(variant: PRSSEL_A) -> Self {
136 variant as _
137 }
138}
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, const O: u8> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, PRSSEL_A, 4, O>;
222impl<'a, const O: u8> PRSSEL_W<'a, O> {
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 = "Field `SCANCONF` reader - Select scan configuration"]
285pub type SCANCONF_R = crate::FieldReader<u8, SCANCONF_A>;
286#[doc = "Select scan configuration\n\nValue on reset: 0"]
287#[derive(Clone, Copy, Debug, PartialEq, Eq)]
288#[repr(u8)]
289pub enum SCANCONF_A {
290 #[doc = "0: The channel configuration register registers used are directly mapped to the channel number."]
291 DIRMAP = 0,
292 #[doc = "1: The channel configuration register registers used are CHX+8_CONF for channels 0-7 and CHX-8_CONF for channels 8-15."]
293 INVMAP = 1,
294 #[doc = "2: The channel configuration register registers used toggles between CHX_CONF and CHX+8_CONF when channel x triggers"]
295 TOGGLE = 2,
296 #[doc = "3: The decoder state defines the CONF registers to be used."]
297 DECDEF = 3,
298}
299impl From<SCANCONF_A> for u8 {
300 #[inline(always)]
301 fn from(variant: SCANCONF_A) -> Self {
302 variant as _
303 }
304}
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, const O: u8> =
340 crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, SCANCONF_A, 2, O>;
341impl<'a, const O: u8> SCANCONF_W<'a, O> {
342 #[doc = "The channel configuration register registers used are directly mapped to the channel number."]
343 #[inline(always)]
344 pub fn dirmap(self) -> &'a mut W {
345 self.variant(SCANCONF_A::DIRMAP)
346 }
347 #[doc = "The channel configuration register registers used are CHX+8_CONF for channels 0-7 and CHX-8_CONF for channels 8-15."]
348 #[inline(always)]
349 pub fn invmap(self) -> &'a mut W {
350 self.variant(SCANCONF_A::INVMAP)
351 }
352 #[doc = "The channel configuration register registers used toggles between CHX_CONF and CHX+8_CONF when channel x triggers"]
353 #[inline(always)]
354 pub fn toggle(self) -> &'a mut W {
355 self.variant(SCANCONF_A::TOGGLE)
356 }
357 #[doc = "The decoder state defines the CONF registers to be used."]
358 #[inline(always)]
359 pub fn decdef(self) -> &'a mut W {
360 self.variant(SCANCONF_A::DECDEF)
361 }
362}
363#[doc = "Field `ACMP0INV` reader - Invert analog comparator 0 output"]
364pub type ACMP0INV_R = crate::BitReader<bool>;
365#[doc = "Field `ACMP0INV` writer - Invert analog comparator 0 output"]
366pub type ACMP0INV_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
367#[doc = "Field `ACMP1INV` reader - Invert analog comparator 1 output"]
368pub type ACMP1INV_R = crate::BitReader<bool>;
369#[doc = "Field `ACMP1INV` writer - Invert analog comparator 1 output"]
370pub type ACMP1INV_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
371#[doc = "Field `ALTEXMAP` reader - Alternative excitation map"]
372pub type ALTEXMAP_R = crate::BitReader<bool>;
373#[doc = "Field `ALTEXMAP` writer - Alternative excitation map"]
374pub type ALTEXMAP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
375#[doc = "Field `DUALSAMPLE` reader - Enable dual sample mode"]
376pub type DUALSAMPLE_R = crate::BitReader<bool>;
377#[doc = "Field `DUALSAMPLE` writer - Enable dual sample mode"]
378pub type DUALSAMPLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
379#[doc = "Field `BUFOW` reader - Result buffer overwrite"]
380pub type BUFOW_R = crate::BitReader<bool>;
381#[doc = "Field `BUFOW` writer - Result buffer overwrite"]
382pub type BUFOW_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
383#[doc = "Field `STRSCANRES` reader - Enable storing of SCANRES"]
384pub type STRSCANRES_R = crate::BitReader<bool>;
385#[doc = "Field `STRSCANRES` writer - Enable storing of SCANRES"]
386pub type STRSCANRES_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
387#[doc = "Field `BUFIDL` reader - Result buffer interrupt and DMA trigger level"]
388pub type BUFIDL_R = crate::BitReader<bool>;
389#[doc = "Field `BUFIDL` writer - Result buffer interrupt and DMA trigger level"]
390pub type BUFIDL_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
391#[doc = "Field `DMAWU` reader - DMA wake-up from EM2"]
392pub type DMAWU_R = crate::FieldReader<u8, DMAWU_A>;
393#[doc = "DMA wake-up from EM2\n\nValue on reset: 0"]
394#[derive(Clone, Copy, Debug, PartialEq, Eq)]
395#[repr(u8)]
396pub enum DMAWU_A {
397 #[doc = "0: No DMA wake-up from EM2"]
398 DISABLE = 0,
399 #[doc = "1: DMA wake-up from EM2 when data is valid in the result buffer"]
400 BUFDATAV = 1,
401 #[doc = "2: DMA wake-up from EM2 when the result buffer is full/half-full depending on BUFIDL configuration"]
402 BUFLEVEL = 2,
403}
404impl From<DMAWU_A> for u8 {
405 #[inline(always)]
406 fn from(variant: DMAWU_A) -> Self {
407 variant as _
408 }
409}
410impl DMAWU_R {
411 #[doc = "Get enumerated values variant"]
412 #[inline(always)]
413 pub fn variant(&self) -> Option<DMAWU_A> {
414 match self.bits {
415 0 => Some(DMAWU_A::DISABLE),
416 1 => Some(DMAWU_A::BUFDATAV),
417 2 => Some(DMAWU_A::BUFLEVEL),
418 _ => None,
419 }
420 }
421 #[doc = "Checks if the value of the field is `DISABLE`"]
422 #[inline(always)]
423 pub fn is_disable(&self) -> bool {
424 *self == DMAWU_A::DISABLE
425 }
426 #[doc = "Checks if the value of the field is `BUFDATAV`"]
427 #[inline(always)]
428 pub fn is_bufdatav(&self) -> bool {
429 *self == DMAWU_A::BUFDATAV
430 }
431 #[doc = "Checks if the value of the field is `BUFLEVEL`"]
432 #[inline(always)]
433 pub fn is_buflevel(&self) -> bool {
434 *self == DMAWU_A::BUFLEVEL
435 }
436}
437#[doc = "Field `DMAWU` writer - DMA wake-up from EM2"]
438pub type DMAWU_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, DMAWU_A, 2, O>;
439impl<'a, const O: u8> DMAWU_W<'a, O> {
440 #[doc = "No DMA wake-up from EM2"]
441 #[inline(always)]
442 pub fn disable(self) -> &'a mut W {
443 self.variant(DMAWU_A::DISABLE)
444 }
445 #[doc = "DMA wake-up from EM2 when data is valid in the result buffer"]
446 #[inline(always)]
447 pub fn bufdatav(self) -> &'a mut W {
448 self.variant(DMAWU_A::BUFDATAV)
449 }
450 #[doc = "DMA wake-up from EM2 when the result buffer is full/half-full depending on BUFIDL configuration"]
451 #[inline(always)]
452 pub fn buflevel(self) -> &'a mut W {
453 self.variant(DMAWU_A::BUFLEVEL)
454 }
455}
456#[doc = "Field `DEBUGRUN` reader - Debug Mode Run Enable"]
457pub type DEBUGRUN_R = crate::BitReader<bool>;
458#[doc = "Field `DEBUGRUN` writer - Debug Mode Run Enable"]
459pub type DEBUGRUN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
460impl R {
461 #[doc = "Bits 0:1 - Configure scan mode"]
462 #[inline(always)]
463 pub fn scanmode(&self) -> SCANMODE_R {
464 SCANMODE_R::new((self.bits & 3) as u8)
465 }
466 #[doc = "Bits 2:5 - Scan start PRS select"]
467 #[inline(always)]
468 pub fn prssel(&self) -> PRSSEL_R {
469 PRSSEL_R::new(((self.bits >> 2) & 0x0f) as u8)
470 }
471 #[doc = "Bits 6:7 - Select scan configuration"]
472 #[inline(always)]
473 pub fn scanconf(&self) -> SCANCONF_R {
474 SCANCONF_R::new(((self.bits >> 6) & 3) as u8)
475 }
476 #[doc = "Bit 9 - Invert analog comparator 0 output"]
477 #[inline(always)]
478 pub fn acmp0inv(&self) -> ACMP0INV_R {
479 ACMP0INV_R::new(((self.bits >> 9) & 1) != 0)
480 }
481 #[doc = "Bit 10 - Invert analog comparator 1 output"]
482 #[inline(always)]
483 pub fn acmp1inv(&self) -> ACMP1INV_R {
484 ACMP1INV_R::new(((self.bits >> 10) & 1) != 0)
485 }
486 #[doc = "Bit 11 - Alternative excitation map"]
487 #[inline(always)]
488 pub fn altexmap(&self) -> ALTEXMAP_R {
489 ALTEXMAP_R::new(((self.bits >> 11) & 1) != 0)
490 }
491 #[doc = "Bit 13 - Enable dual sample mode"]
492 #[inline(always)]
493 pub fn dualsample(&self) -> DUALSAMPLE_R {
494 DUALSAMPLE_R::new(((self.bits >> 13) & 1) != 0)
495 }
496 #[doc = "Bit 16 - Result buffer overwrite"]
497 #[inline(always)]
498 pub fn bufow(&self) -> BUFOW_R {
499 BUFOW_R::new(((self.bits >> 16) & 1) != 0)
500 }
501 #[doc = "Bit 17 - Enable storing of SCANRES"]
502 #[inline(always)]
503 pub fn strscanres(&self) -> STRSCANRES_R {
504 STRSCANRES_R::new(((self.bits >> 17) & 1) != 0)
505 }
506 #[doc = "Bit 18 - Result buffer interrupt and DMA trigger level"]
507 #[inline(always)]
508 pub fn bufidl(&self) -> BUFIDL_R {
509 BUFIDL_R::new(((self.bits >> 18) & 1) != 0)
510 }
511 #[doc = "Bits 20:21 - DMA wake-up from EM2"]
512 #[inline(always)]
513 pub fn dmawu(&self) -> DMAWU_R {
514 DMAWU_R::new(((self.bits >> 20) & 3) as u8)
515 }
516 #[doc = "Bit 22 - Debug Mode Run Enable"]
517 #[inline(always)]
518 pub fn debugrun(&self) -> DEBUGRUN_R {
519 DEBUGRUN_R::new(((self.bits >> 22) & 1) != 0)
520 }
521}
522impl W {
523 #[doc = "Bits 0:1 - Configure scan mode"]
524 #[inline(always)]
525 #[must_use]
526 pub fn scanmode(&mut self) -> SCANMODE_W<0> {
527 SCANMODE_W::new(self)
528 }
529 #[doc = "Bits 2:5 - Scan start PRS select"]
530 #[inline(always)]
531 #[must_use]
532 pub fn prssel(&mut self) -> PRSSEL_W<2> {
533 PRSSEL_W::new(self)
534 }
535 #[doc = "Bits 6:7 - Select scan configuration"]
536 #[inline(always)]
537 #[must_use]
538 pub fn scanconf(&mut self) -> SCANCONF_W<6> {
539 SCANCONF_W::new(self)
540 }
541 #[doc = "Bit 9 - Invert analog comparator 0 output"]
542 #[inline(always)]
543 #[must_use]
544 pub fn acmp0inv(&mut self) -> ACMP0INV_W<9> {
545 ACMP0INV_W::new(self)
546 }
547 #[doc = "Bit 10 - Invert analog comparator 1 output"]
548 #[inline(always)]
549 #[must_use]
550 pub fn acmp1inv(&mut self) -> ACMP1INV_W<10> {
551 ACMP1INV_W::new(self)
552 }
553 #[doc = "Bit 11 - Alternative excitation map"]
554 #[inline(always)]
555 #[must_use]
556 pub fn altexmap(&mut self) -> ALTEXMAP_W<11> {
557 ALTEXMAP_W::new(self)
558 }
559 #[doc = "Bit 13 - Enable dual sample mode"]
560 #[inline(always)]
561 #[must_use]
562 pub fn dualsample(&mut self) -> DUALSAMPLE_W<13> {
563 DUALSAMPLE_W::new(self)
564 }
565 #[doc = "Bit 16 - Result buffer overwrite"]
566 #[inline(always)]
567 #[must_use]
568 pub fn bufow(&mut self) -> BUFOW_W<16> {
569 BUFOW_W::new(self)
570 }
571 #[doc = "Bit 17 - Enable storing of SCANRES"]
572 #[inline(always)]
573 #[must_use]
574 pub fn strscanres(&mut self) -> STRSCANRES_W<17> {
575 STRSCANRES_W::new(self)
576 }
577 #[doc = "Bit 18 - Result buffer interrupt and DMA trigger level"]
578 #[inline(always)]
579 #[must_use]
580 pub fn bufidl(&mut self) -> BUFIDL_W<18> {
581 BUFIDL_W::new(self)
582 }
583 #[doc = "Bits 20:21 - DMA wake-up from EM2"]
584 #[inline(always)]
585 #[must_use]
586 pub fn dmawu(&mut self) -> DMAWU_W<20> {
587 DMAWU_W::new(self)
588 }
589 #[doc = "Bit 22 - Debug Mode Run Enable"]
590 #[inline(always)]
591 #[must_use]
592 pub fn debugrun(&mut self) -> DEBUGRUN_W<22> {
593 DEBUGRUN_W::new(self)
594 }
595 #[doc = "Writes raw bits to the register."]
596 #[inline(always)]
597 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
598 self.0.bits(bits);
599 self
600 }
601}
602#[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"]
603pub struct CTRL_SPEC;
604impl crate::RegisterSpec for CTRL_SPEC {
605 type Ux = u32;
606}
607#[doc = "`read()` method returns [ctrl::R](R) reader structure"]
608impl crate::Readable for CTRL_SPEC {
609 type Reader = R;
610}
611#[doc = "`write(|w| ..)` method takes [ctrl::W](W) writer structure"]
612impl crate::Writable for CTRL_SPEC {
613 type Writer = W;
614 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
615 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
616}
617#[doc = "`reset()` method sets CTRL to value 0"]
618impl crate::Resettable for CTRL_SPEC {
619 const RESET_VALUE: Self::Ux = 0;
620}