efm32wg230_pac/lesense/
decctrl.rs

1#[doc = "Register `DECCTRL` reader"]
2pub struct R(crate::R<DECCTRL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<DECCTRL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<DECCTRL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<DECCTRL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `DECCTRL` writer"]
17pub struct W(crate::W<DECCTRL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<DECCTRL_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<DECCTRL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<DECCTRL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `DISABLE` reader - Disable the decoder"]
38pub type DISABLE_R = crate::BitReader<bool>;
39#[doc = "Field `DISABLE` writer - Disable the decoder"]
40pub type DISABLE_W<'a> = crate::BitWriter<'a, u32, DECCTRL_SPEC, bool, 0>;
41#[doc = "Field `ERRCHK` reader - Enable check of current state"]
42pub type ERRCHK_R = crate::BitReader<bool>;
43#[doc = "Field `ERRCHK` writer - Enable check of current state"]
44pub type ERRCHK_W<'a> = crate::BitWriter<'a, u32, DECCTRL_SPEC, bool, 1>;
45#[doc = "Field `INTMAP` reader - Enable decoder to channel interrupt mapping"]
46pub type INTMAP_R = crate::BitReader<bool>;
47#[doc = "Field `INTMAP` writer - Enable decoder to channel interrupt mapping"]
48pub type INTMAP_W<'a> = crate::BitWriter<'a, u32, DECCTRL_SPEC, bool, 2>;
49#[doc = "Field `HYSTPRS0` reader - Enable decoder hysteresis on PRS0 output"]
50pub type HYSTPRS0_R = crate::BitReader<bool>;
51#[doc = "Field `HYSTPRS0` writer - Enable decoder hysteresis on PRS0 output"]
52pub type HYSTPRS0_W<'a> = crate::BitWriter<'a, u32, DECCTRL_SPEC, bool, 3>;
53#[doc = "Field `HYSTPRS1` reader - Enable decoder hysteresis on PRS1 output"]
54pub type HYSTPRS1_R = crate::BitReader<bool>;
55#[doc = "Field `HYSTPRS1` writer - Enable decoder hysteresis on PRS1 output"]
56pub type HYSTPRS1_W<'a> = crate::BitWriter<'a, u32, DECCTRL_SPEC, bool, 4>;
57#[doc = "Field `HYSTPRS2` reader - Enable decoder hysteresis on PRS2 output"]
58pub type HYSTPRS2_R = crate::BitReader<bool>;
59#[doc = "Field `HYSTPRS2` writer - Enable decoder hysteresis on PRS2 output"]
60pub type HYSTPRS2_W<'a> = crate::BitWriter<'a, u32, DECCTRL_SPEC, bool, 5>;
61#[doc = "Field `HYSTIRQ` reader - Enable decoder hysteresis on interrupt requests"]
62pub type HYSTIRQ_R = crate::BitReader<bool>;
63#[doc = "Field `HYSTIRQ` writer - Enable decoder hysteresis on interrupt requests"]
64pub type HYSTIRQ_W<'a> = crate::BitWriter<'a, u32, DECCTRL_SPEC, bool, 6>;
65#[doc = "Field `PRSCNT` reader - Enable count mode on decoder PRS channels 0 and 1"]
66pub type PRSCNT_R = crate::BitReader<bool>;
67#[doc = "Field `PRSCNT` writer - Enable count mode on decoder PRS channels 0 and 1"]
68pub type PRSCNT_W<'a> = crate::BitWriter<'a, u32, DECCTRL_SPEC, bool, 7>;
69#[doc = "Field `INPUT` reader - "]
70pub type INPUT_R = crate::BitReader<bool>;
71#[doc = "Field `INPUT` writer - "]
72pub type INPUT_W<'a> = crate::BitWriter<'a, u32, DECCTRL_SPEC, bool, 8>;
73#[doc = "\n\nValue on reset: 0"]
74#[derive(Clone, Copy, Debug, PartialEq)]
75#[repr(u8)]
76pub enum PRSSEL0_A {
77    #[doc = "0: PRS Channel 0 selected as input"]
78    PRSCH0 = 0,
79    #[doc = "1: PRS Channel 1 selected as input"]
80    PRSCH1 = 1,
81    #[doc = "2: PRS Channel 2 selected as input"]
82    PRSCH2 = 2,
83    #[doc = "3: PRS Channel 3 selected as input"]
84    PRSCH3 = 3,
85    #[doc = "4: PRS Channel 4 selected as input"]
86    PRSCH4 = 4,
87    #[doc = "5: PRS Channel 5 selected as input"]
88    PRSCH5 = 5,
89    #[doc = "6: PRS Channel 6 selected as input"]
90    PRSCH6 = 6,
91    #[doc = "7: PRS Channel 7 selected as input"]
92    PRSCH7 = 7,
93    #[doc = "8: PRS Channel 8 selected as input"]
94    PRSCH8 = 8,
95    #[doc = "9: PRS Channel 9 selected as input"]
96    PRSCH9 = 9,
97    #[doc = "10: PRS Channel 10 selected as input"]
98    PRSCH10 = 10,
99    #[doc = "11: PRS Channel 11 selected as input"]
100    PRSCH11 = 11,
101}
102impl From<PRSSEL0_A> for u8 {
103    #[inline(always)]
104    fn from(variant: PRSSEL0_A) -> Self {
105        variant as _
106    }
107}
108#[doc = "Field `PRSSEL0` reader - "]
109pub type PRSSEL0_R = crate::FieldReader<u8, PRSSEL0_A>;
110impl PRSSEL0_R {
111    #[doc = "Get enumerated values variant"]
112    #[inline(always)]
113    pub fn variant(&self) -> Option<PRSSEL0_A> {
114        match self.bits {
115            0 => Some(PRSSEL0_A::PRSCH0),
116            1 => Some(PRSSEL0_A::PRSCH1),
117            2 => Some(PRSSEL0_A::PRSCH2),
118            3 => Some(PRSSEL0_A::PRSCH3),
119            4 => Some(PRSSEL0_A::PRSCH4),
120            5 => Some(PRSSEL0_A::PRSCH5),
121            6 => Some(PRSSEL0_A::PRSCH6),
122            7 => Some(PRSSEL0_A::PRSCH7),
123            8 => Some(PRSSEL0_A::PRSCH8),
124            9 => Some(PRSSEL0_A::PRSCH9),
125            10 => Some(PRSSEL0_A::PRSCH10),
126            11 => Some(PRSSEL0_A::PRSCH11),
127            _ => None,
128        }
129    }
130    #[doc = "Checks if the value of the field is `PRSCH0`"]
131    #[inline(always)]
132    pub fn is_prsch0(&self) -> bool {
133        *self == PRSSEL0_A::PRSCH0
134    }
135    #[doc = "Checks if the value of the field is `PRSCH1`"]
136    #[inline(always)]
137    pub fn is_prsch1(&self) -> bool {
138        *self == PRSSEL0_A::PRSCH1
139    }
140    #[doc = "Checks if the value of the field is `PRSCH2`"]
141    #[inline(always)]
142    pub fn is_prsch2(&self) -> bool {
143        *self == PRSSEL0_A::PRSCH2
144    }
145    #[doc = "Checks if the value of the field is `PRSCH3`"]
146    #[inline(always)]
147    pub fn is_prsch3(&self) -> bool {
148        *self == PRSSEL0_A::PRSCH3
149    }
150    #[doc = "Checks if the value of the field is `PRSCH4`"]
151    #[inline(always)]
152    pub fn is_prsch4(&self) -> bool {
153        *self == PRSSEL0_A::PRSCH4
154    }
155    #[doc = "Checks if the value of the field is `PRSCH5`"]
156    #[inline(always)]
157    pub fn is_prsch5(&self) -> bool {
158        *self == PRSSEL0_A::PRSCH5
159    }
160    #[doc = "Checks if the value of the field is `PRSCH6`"]
161    #[inline(always)]
162    pub fn is_prsch6(&self) -> bool {
163        *self == PRSSEL0_A::PRSCH6
164    }
165    #[doc = "Checks if the value of the field is `PRSCH7`"]
166    #[inline(always)]
167    pub fn is_prsch7(&self) -> bool {
168        *self == PRSSEL0_A::PRSCH7
169    }
170    #[doc = "Checks if the value of the field is `PRSCH8`"]
171    #[inline(always)]
172    pub fn is_prsch8(&self) -> bool {
173        *self == PRSSEL0_A::PRSCH8
174    }
175    #[doc = "Checks if the value of the field is `PRSCH9`"]
176    #[inline(always)]
177    pub fn is_prsch9(&self) -> bool {
178        *self == PRSSEL0_A::PRSCH9
179    }
180    #[doc = "Checks if the value of the field is `PRSCH10`"]
181    #[inline(always)]
182    pub fn is_prsch10(&self) -> bool {
183        *self == PRSSEL0_A::PRSCH10
184    }
185    #[doc = "Checks if the value of the field is `PRSCH11`"]
186    #[inline(always)]
187    pub fn is_prsch11(&self) -> bool {
188        *self == PRSSEL0_A::PRSCH11
189    }
190}
191#[doc = "Field `PRSSEL0` writer - "]
192pub type PRSSEL0_W<'a> = crate::FieldWriter<'a, u32, DECCTRL_SPEC, u8, PRSSEL0_A, 4, 10>;
193impl<'a> PRSSEL0_W<'a> {
194    #[doc = "PRS Channel 0 selected as input"]
195    #[inline(always)]
196    pub fn prsch0(self) -> &'a mut W {
197        self.variant(PRSSEL0_A::PRSCH0)
198    }
199    #[doc = "PRS Channel 1 selected as input"]
200    #[inline(always)]
201    pub fn prsch1(self) -> &'a mut W {
202        self.variant(PRSSEL0_A::PRSCH1)
203    }
204    #[doc = "PRS Channel 2 selected as input"]
205    #[inline(always)]
206    pub fn prsch2(self) -> &'a mut W {
207        self.variant(PRSSEL0_A::PRSCH2)
208    }
209    #[doc = "PRS Channel 3 selected as input"]
210    #[inline(always)]
211    pub fn prsch3(self) -> &'a mut W {
212        self.variant(PRSSEL0_A::PRSCH3)
213    }
214    #[doc = "PRS Channel 4 selected as input"]
215    #[inline(always)]
216    pub fn prsch4(self) -> &'a mut W {
217        self.variant(PRSSEL0_A::PRSCH4)
218    }
219    #[doc = "PRS Channel 5 selected as input"]
220    #[inline(always)]
221    pub fn prsch5(self) -> &'a mut W {
222        self.variant(PRSSEL0_A::PRSCH5)
223    }
224    #[doc = "PRS Channel 6 selected as input"]
225    #[inline(always)]
226    pub fn prsch6(self) -> &'a mut W {
227        self.variant(PRSSEL0_A::PRSCH6)
228    }
229    #[doc = "PRS Channel 7 selected as input"]
230    #[inline(always)]
231    pub fn prsch7(self) -> &'a mut W {
232        self.variant(PRSSEL0_A::PRSCH7)
233    }
234    #[doc = "PRS Channel 8 selected as input"]
235    #[inline(always)]
236    pub fn prsch8(self) -> &'a mut W {
237        self.variant(PRSSEL0_A::PRSCH8)
238    }
239    #[doc = "PRS Channel 9 selected as input"]
240    #[inline(always)]
241    pub fn prsch9(self) -> &'a mut W {
242        self.variant(PRSSEL0_A::PRSCH9)
243    }
244    #[doc = "PRS Channel 10 selected as input"]
245    #[inline(always)]
246    pub fn prsch10(self) -> &'a mut W {
247        self.variant(PRSSEL0_A::PRSCH10)
248    }
249    #[doc = "PRS Channel 11 selected as input"]
250    #[inline(always)]
251    pub fn prsch11(self) -> &'a mut W {
252        self.variant(PRSSEL0_A::PRSCH11)
253    }
254}
255#[doc = "\n\nValue on reset: 0"]
256#[derive(Clone, Copy, Debug, PartialEq)]
257#[repr(u8)]
258pub enum PRSSEL1_A {
259    #[doc = "0: PRS Channel 0 selected as input"]
260    PRSCH0 = 0,
261    #[doc = "1: PRS Channel 1 selected as input"]
262    PRSCH1 = 1,
263    #[doc = "2: PRS Channel 2 selected as input"]
264    PRSCH2 = 2,
265    #[doc = "3: PRS Channel 3 selected as input"]
266    PRSCH3 = 3,
267    #[doc = "4: PRS Channel 4 selected as input"]
268    PRSCH4 = 4,
269    #[doc = "5: PRS Channel 5 selected as input"]
270    PRSCH5 = 5,
271    #[doc = "6: PRS Channel 6 selected as input"]
272    PRSCH6 = 6,
273    #[doc = "7: PRS Channel 7 selected as input"]
274    PRSCH7 = 7,
275    #[doc = "8: PRS Channel 8 selected as input"]
276    PRSCH8 = 8,
277    #[doc = "9: PRS Channel 9 selected as input"]
278    PRSCH9 = 9,
279    #[doc = "10: PRS Channel 10 selected as input"]
280    PRSCH10 = 10,
281    #[doc = "11: PRS Channel 11 selected as input"]
282    PRSCH11 = 11,
283}
284impl From<PRSSEL1_A> for u8 {
285    #[inline(always)]
286    fn from(variant: PRSSEL1_A) -> Self {
287        variant as _
288    }
289}
290#[doc = "Field `PRSSEL1` reader - "]
291pub type PRSSEL1_R = crate::FieldReader<u8, PRSSEL1_A>;
292impl PRSSEL1_R {
293    #[doc = "Get enumerated values variant"]
294    #[inline(always)]
295    pub fn variant(&self) -> Option<PRSSEL1_A> {
296        match self.bits {
297            0 => Some(PRSSEL1_A::PRSCH0),
298            1 => Some(PRSSEL1_A::PRSCH1),
299            2 => Some(PRSSEL1_A::PRSCH2),
300            3 => Some(PRSSEL1_A::PRSCH3),
301            4 => Some(PRSSEL1_A::PRSCH4),
302            5 => Some(PRSSEL1_A::PRSCH5),
303            6 => Some(PRSSEL1_A::PRSCH6),
304            7 => Some(PRSSEL1_A::PRSCH7),
305            8 => Some(PRSSEL1_A::PRSCH8),
306            9 => Some(PRSSEL1_A::PRSCH9),
307            10 => Some(PRSSEL1_A::PRSCH10),
308            11 => Some(PRSSEL1_A::PRSCH11),
309            _ => None,
310        }
311    }
312    #[doc = "Checks if the value of the field is `PRSCH0`"]
313    #[inline(always)]
314    pub fn is_prsch0(&self) -> bool {
315        *self == PRSSEL1_A::PRSCH0
316    }
317    #[doc = "Checks if the value of the field is `PRSCH1`"]
318    #[inline(always)]
319    pub fn is_prsch1(&self) -> bool {
320        *self == PRSSEL1_A::PRSCH1
321    }
322    #[doc = "Checks if the value of the field is `PRSCH2`"]
323    #[inline(always)]
324    pub fn is_prsch2(&self) -> bool {
325        *self == PRSSEL1_A::PRSCH2
326    }
327    #[doc = "Checks if the value of the field is `PRSCH3`"]
328    #[inline(always)]
329    pub fn is_prsch3(&self) -> bool {
330        *self == PRSSEL1_A::PRSCH3
331    }
332    #[doc = "Checks if the value of the field is `PRSCH4`"]
333    #[inline(always)]
334    pub fn is_prsch4(&self) -> bool {
335        *self == PRSSEL1_A::PRSCH4
336    }
337    #[doc = "Checks if the value of the field is `PRSCH5`"]
338    #[inline(always)]
339    pub fn is_prsch5(&self) -> bool {
340        *self == PRSSEL1_A::PRSCH5
341    }
342    #[doc = "Checks if the value of the field is `PRSCH6`"]
343    #[inline(always)]
344    pub fn is_prsch6(&self) -> bool {
345        *self == PRSSEL1_A::PRSCH6
346    }
347    #[doc = "Checks if the value of the field is `PRSCH7`"]
348    #[inline(always)]
349    pub fn is_prsch7(&self) -> bool {
350        *self == PRSSEL1_A::PRSCH7
351    }
352    #[doc = "Checks if the value of the field is `PRSCH8`"]
353    #[inline(always)]
354    pub fn is_prsch8(&self) -> bool {
355        *self == PRSSEL1_A::PRSCH8
356    }
357    #[doc = "Checks if the value of the field is `PRSCH9`"]
358    #[inline(always)]
359    pub fn is_prsch9(&self) -> bool {
360        *self == PRSSEL1_A::PRSCH9
361    }
362    #[doc = "Checks if the value of the field is `PRSCH10`"]
363    #[inline(always)]
364    pub fn is_prsch10(&self) -> bool {
365        *self == PRSSEL1_A::PRSCH10
366    }
367    #[doc = "Checks if the value of the field is `PRSCH11`"]
368    #[inline(always)]
369    pub fn is_prsch11(&self) -> bool {
370        *self == PRSSEL1_A::PRSCH11
371    }
372}
373#[doc = "Field `PRSSEL1` writer - "]
374pub type PRSSEL1_W<'a> = crate::FieldWriter<'a, u32, DECCTRL_SPEC, u8, PRSSEL1_A, 4, 14>;
375impl<'a> PRSSEL1_W<'a> {
376    #[doc = "PRS Channel 0 selected as input"]
377    #[inline(always)]
378    pub fn prsch0(self) -> &'a mut W {
379        self.variant(PRSSEL1_A::PRSCH0)
380    }
381    #[doc = "PRS Channel 1 selected as input"]
382    #[inline(always)]
383    pub fn prsch1(self) -> &'a mut W {
384        self.variant(PRSSEL1_A::PRSCH1)
385    }
386    #[doc = "PRS Channel 2 selected as input"]
387    #[inline(always)]
388    pub fn prsch2(self) -> &'a mut W {
389        self.variant(PRSSEL1_A::PRSCH2)
390    }
391    #[doc = "PRS Channel 3 selected as input"]
392    #[inline(always)]
393    pub fn prsch3(self) -> &'a mut W {
394        self.variant(PRSSEL1_A::PRSCH3)
395    }
396    #[doc = "PRS Channel 4 selected as input"]
397    #[inline(always)]
398    pub fn prsch4(self) -> &'a mut W {
399        self.variant(PRSSEL1_A::PRSCH4)
400    }
401    #[doc = "PRS Channel 5 selected as input"]
402    #[inline(always)]
403    pub fn prsch5(self) -> &'a mut W {
404        self.variant(PRSSEL1_A::PRSCH5)
405    }
406    #[doc = "PRS Channel 6 selected as input"]
407    #[inline(always)]
408    pub fn prsch6(self) -> &'a mut W {
409        self.variant(PRSSEL1_A::PRSCH6)
410    }
411    #[doc = "PRS Channel 7 selected as input"]
412    #[inline(always)]
413    pub fn prsch7(self) -> &'a mut W {
414        self.variant(PRSSEL1_A::PRSCH7)
415    }
416    #[doc = "PRS Channel 8 selected as input"]
417    #[inline(always)]
418    pub fn prsch8(self) -> &'a mut W {
419        self.variant(PRSSEL1_A::PRSCH8)
420    }
421    #[doc = "PRS Channel 9 selected as input"]
422    #[inline(always)]
423    pub fn prsch9(self) -> &'a mut W {
424        self.variant(PRSSEL1_A::PRSCH9)
425    }
426    #[doc = "PRS Channel 10 selected as input"]
427    #[inline(always)]
428    pub fn prsch10(self) -> &'a mut W {
429        self.variant(PRSSEL1_A::PRSCH10)
430    }
431    #[doc = "PRS Channel 11 selected as input"]
432    #[inline(always)]
433    pub fn prsch11(self) -> &'a mut W {
434        self.variant(PRSSEL1_A::PRSCH11)
435    }
436}
437#[doc = "\n\nValue on reset: 0"]
438#[derive(Clone, Copy, Debug, PartialEq)]
439#[repr(u8)]
440pub enum PRSSEL2_A {
441    #[doc = "0: PRS Channel 0 selected as input"]
442    PRSCH0 = 0,
443    #[doc = "1: PRS Channel 1 selected as input"]
444    PRSCH1 = 1,
445    #[doc = "2: PRS Channel 2 selected as input"]
446    PRSCH2 = 2,
447    #[doc = "3: PRS Channel 3 selected as input"]
448    PRSCH3 = 3,
449    #[doc = "4: PRS Channel 4 selected as input"]
450    PRSCH4 = 4,
451    #[doc = "5: PRS Channel 5 selected as input"]
452    PRSCH5 = 5,
453    #[doc = "6: PRS Channel 6 selected as input"]
454    PRSCH6 = 6,
455    #[doc = "7: PRS Channel 7 selected as input"]
456    PRSCH7 = 7,
457    #[doc = "8: PRS Channel 8 selected as input"]
458    PRSCH8 = 8,
459    #[doc = "9: PRS Channel 9 selected as input"]
460    PRSCH9 = 9,
461    #[doc = "10: PRS Channel 10 selected as input"]
462    PRSCH10 = 10,
463    #[doc = "11: PRS Channel 11 selected as input"]
464    PRSCH11 = 11,
465}
466impl From<PRSSEL2_A> for u8 {
467    #[inline(always)]
468    fn from(variant: PRSSEL2_A) -> Self {
469        variant as _
470    }
471}
472#[doc = "Field `PRSSEL2` reader - "]
473pub type PRSSEL2_R = crate::FieldReader<u8, PRSSEL2_A>;
474impl PRSSEL2_R {
475    #[doc = "Get enumerated values variant"]
476    #[inline(always)]
477    pub fn variant(&self) -> Option<PRSSEL2_A> {
478        match self.bits {
479            0 => Some(PRSSEL2_A::PRSCH0),
480            1 => Some(PRSSEL2_A::PRSCH1),
481            2 => Some(PRSSEL2_A::PRSCH2),
482            3 => Some(PRSSEL2_A::PRSCH3),
483            4 => Some(PRSSEL2_A::PRSCH4),
484            5 => Some(PRSSEL2_A::PRSCH5),
485            6 => Some(PRSSEL2_A::PRSCH6),
486            7 => Some(PRSSEL2_A::PRSCH7),
487            8 => Some(PRSSEL2_A::PRSCH8),
488            9 => Some(PRSSEL2_A::PRSCH9),
489            10 => Some(PRSSEL2_A::PRSCH10),
490            11 => Some(PRSSEL2_A::PRSCH11),
491            _ => None,
492        }
493    }
494    #[doc = "Checks if the value of the field is `PRSCH0`"]
495    #[inline(always)]
496    pub fn is_prsch0(&self) -> bool {
497        *self == PRSSEL2_A::PRSCH0
498    }
499    #[doc = "Checks if the value of the field is `PRSCH1`"]
500    #[inline(always)]
501    pub fn is_prsch1(&self) -> bool {
502        *self == PRSSEL2_A::PRSCH1
503    }
504    #[doc = "Checks if the value of the field is `PRSCH2`"]
505    #[inline(always)]
506    pub fn is_prsch2(&self) -> bool {
507        *self == PRSSEL2_A::PRSCH2
508    }
509    #[doc = "Checks if the value of the field is `PRSCH3`"]
510    #[inline(always)]
511    pub fn is_prsch3(&self) -> bool {
512        *self == PRSSEL2_A::PRSCH3
513    }
514    #[doc = "Checks if the value of the field is `PRSCH4`"]
515    #[inline(always)]
516    pub fn is_prsch4(&self) -> bool {
517        *self == PRSSEL2_A::PRSCH4
518    }
519    #[doc = "Checks if the value of the field is `PRSCH5`"]
520    #[inline(always)]
521    pub fn is_prsch5(&self) -> bool {
522        *self == PRSSEL2_A::PRSCH5
523    }
524    #[doc = "Checks if the value of the field is `PRSCH6`"]
525    #[inline(always)]
526    pub fn is_prsch6(&self) -> bool {
527        *self == PRSSEL2_A::PRSCH6
528    }
529    #[doc = "Checks if the value of the field is `PRSCH7`"]
530    #[inline(always)]
531    pub fn is_prsch7(&self) -> bool {
532        *self == PRSSEL2_A::PRSCH7
533    }
534    #[doc = "Checks if the value of the field is `PRSCH8`"]
535    #[inline(always)]
536    pub fn is_prsch8(&self) -> bool {
537        *self == PRSSEL2_A::PRSCH8
538    }
539    #[doc = "Checks if the value of the field is `PRSCH9`"]
540    #[inline(always)]
541    pub fn is_prsch9(&self) -> bool {
542        *self == PRSSEL2_A::PRSCH9
543    }
544    #[doc = "Checks if the value of the field is `PRSCH10`"]
545    #[inline(always)]
546    pub fn is_prsch10(&self) -> bool {
547        *self == PRSSEL2_A::PRSCH10
548    }
549    #[doc = "Checks if the value of the field is `PRSCH11`"]
550    #[inline(always)]
551    pub fn is_prsch11(&self) -> bool {
552        *self == PRSSEL2_A::PRSCH11
553    }
554}
555#[doc = "Field `PRSSEL2` writer - "]
556pub type PRSSEL2_W<'a> = crate::FieldWriter<'a, u32, DECCTRL_SPEC, u8, PRSSEL2_A, 4, 18>;
557impl<'a> PRSSEL2_W<'a> {
558    #[doc = "PRS Channel 0 selected as input"]
559    #[inline(always)]
560    pub fn prsch0(self) -> &'a mut W {
561        self.variant(PRSSEL2_A::PRSCH0)
562    }
563    #[doc = "PRS Channel 1 selected as input"]
564    #[inline(always)]
565    pub fn prsch1(self) -> &'a mut W {
566        self.variant(PRSSEL2_A::PRSCH1)
567    }
568    #[doc = "PRS Channel 2 selected as input"]
569    #[inline(always)]
570    pub fn prsch2(self) -> &'a mut W {
571        self.variant(PRSSEL2_A::PRSCH2)
572    }
573    #[doc = "PRS Channel 3 selected as input"]
574    #[inline(always)]
575    pub fn prsch3(self) -> &'a mut W {
576        self.variant(PRSSEL2_A::PRSCH3)
577    }
578    #[doc = "PRS Channel 4 selected as input"]
579    #[inline(always)]
580    pub fn prsch4(self) -> &'a mut W {
581        self.variant(PRSSEL2_A::PRSCH4)
582    }
583    #[doc = "PRS Channel 5 selected as input"]
584    #[inline(always)]
585    pub fn prsch5(self) -> &'a mut W {
586        self.variant(PRSSEL2_A::PRSCH5)
587    }
588    #[doc = "PRS Channel 6 selected as input"]
589    #[inline(always)]
590    pub fn prsch6(self) -> &'a mut W {
591        self.variant(PRSSEL2_A::PRSCH6)
592    }
593    #[doc = "PRS Channel 7 selected as input"]
594    #[inline(always)]
595    pub fn prsch7(self) -> &'a mut W {
596        self.variant(PRSSEL2_A::PRSCH7)
597    }
598    #[doc = "PRS Channel 8 selected as input"]
599    #[inline(always)]
600    pub fn prsch8(self) -> &'a mut W {
601        self.variant(PRSSEL2_A::PRSCH8)
602    }
603    #[doc = "PRS Channel 9 selected as input"]
604    #[inline(always)]
605    pub fn prsch9(self) -> &'a mut W {
606        self.variant(PRSSEL2_A::PRSCH9)
607    }
608    #[doc = "PRS Channel 10 selected as input"]
609    #[inline(always)]
610    pub fn prsch10(self) -> &'a mut W {
611        self.variant(PRSSEL2_A::PRSCH10)
612    }
613    #[doc = "PRS Channel 11 selected as input"]
614    #[inline(always)]
615    pub fn prsch11(self) -> &'a mut W {
616        self.variant(PRSSEL2_A::PRSCH11)
617    }
618}
619#[doc = "\n\nValue on reset: 0"]
620#[derive(Clone, Copy, Debug, PartialEq)]
621#[repr(u8)]
622pub enum PRSSEL3_A {
623    #[doc = "0: PRS Channel 0 selected as input"]
624    PRSCH0 = 0,
625    #[doc = "1: PRS Channel 1 selected as input"]
626    PRSCH1 = 1,
627    #[doc = "2: PRS Channel 2 selected as input"]
628    PRSCH2 = 2,
629    #[doc = "3: PRS Channel 3 selected as input"]
630    PRSCH3 = 3,
631    #[doc = "4: PRS Channel 4 selected as input"]
632    PRSCH4 = 4,
633    #[doc = "5: PRS Channel 5 selected as input"]
634    PRSCH5 = 5,
635    #[doc = "6: PRS Channel 6 selected as input"]
636    PRSCH6 = 6,
637    #[doc = "7: PRS Channel 7 selected as input"]
638    PRSCH7 = 7,
639    #[doc = "8: PRS Channel 8 selected as input"]
640    PRSCH8 = 8,
641    #[doc = "9: PRS Channel 9 selected as input"]
642    PRSCH9 = 9,
643    #[doc = "10: PRS Channel 10 selected as input"]
644    PRSCH10 = 10,
645    #[doc = "11: PRS Channel 11 selected as input"]
646    PRSCH11 = 11,
647}
648impl From<PRSSEL3_A> for u8 {
649    #[inline(always)]
650    fn from(variant: PRSSEL3_A) -> Self {
651        variant as _
652    }
653}
654#[doc = "Field `PRSSEL3` reader - "]
655pub type PRSSEL3_R = crate::FieldReader<u8, PRSSEL3_A>;
656impl PRSSEL3_R {
657    #[doc = "Get enumerated values variant"]
658    #[inline(always)]
659    pub fn variant(&self) -> Option<PRSSEL3_A> {
660        match self.bits {
661            0 => Some(PRSSEL3_A::PRSCH0),
662            1 => Some(PRSSEL3_A::PRSCH1),
663            2 => Some(PRSSEL3_A::PRSCH2),
664            3 => Some(PRSSEL3_A::PRSCH3),
665            4 => Some(PRSSEL3_A::PRSCH4),
666            5 => Some(PRSSEL3_A::PRSCH5),
667            6 => Some(PRSSEL3_A::PRSCH6),
668            7 => Some(PRSSEL3_A::PRSCH7),
669            8 => Some(PRSSEL3_A::PRSCH8),
670            9 => Some(PRSSEL3_A::PRSCH9),
671            10 => Some(PRSSEL3_A::PRSCH10),
672            11 => Some(PRSSEL3_A::PRSCH11),
673            _ => None,
674        }
675    }
676    #[doc = "Checks if the value of the field is `PRSCH0`"]
677    #[inline(always)]
678    pub fn is_prsch0(&self) -> bool {
679        *self == PRSSEL3_A::PRSCH0
680    }
681    #[doc = "Checks if the value of the field is `PRSCH1`"]
682    #[inline(always)]
683    pub fn is_prsch1(&self) -> bool {
684        *self == PRSSEL3_A::PRSCH1
685    }
686    #[doc = "Checks if the value of the field is `PRSCH2`"]
687    #[inline(always)]
688    pub fn is_prsch2(&self) -> bool {
689        *self == PRSSEL3_A::PRSCH2
690    }
691    #[doc = "Checks if the value of the field is `PRSCH3`"]
692    #[inline(always)]
693    pub fn is_prsch3(&self) -> bool {
694        *self == PRSSEL3_A::PRSCH3
695    }
696    #[doc = "Checks if the value of the field is `PRSCH4`"]
697    #[inline(always)]
698    pub fn is_prsch4(&self) -> bool {
699        *self == PRSSEL3_A::PRSCH4
700    }
701    #[doc = "Checks if the value of the field is `PRSCH5`"]
702    #[inline(always)]
703    pub fn is_prsch5(&self) -> bool {
704        *self == PRSSEL3_A::PRSCH5
705    }
706    #[doc = "Checks if the value of the field is `PRSCH6`"]
707    #[inline(always)]
708    pub fn is_prsch6(&self) -> bool {
709        *self == PRSSEL3_A::PRSCH6
710    }
711    #[doc = "Checks if the value of the field is `PRSCH7`"]
712    #[inline(always)]
713    pub fn is_prsch7(&self) -> bool {
714        *self == PRSSEL3_A::PRSCH7
715    }
716    #[doc = "Checks if the value of the field is `PRSCH8`"]
717    #[inline(always)]
718    pub fn is_prsch8(&self) -> bool {
719        *self == PRSSEL3_A::PRSCH8
720    }
721    #[doc = "Checks if the value of the field is `PRSCH9`"]
722    #[inline(always)]
723    pub fn is_prsch9(&self) -> bool {
724        *self == PRSSEL3_A::PRSCH9
725    }
726    #[doc = "Checks if the value of the field is `PRSCH10`"]
727    #[inline(always)]
728    pub fn is_prsch10(&self) -> bool {
729        *self == PRSSEL3_A::PRSCH10
730    }
731    #[doc = "Checks if the value of the field is `PRSCH11`"]
732    #[inline(always)]
733    pub fn is_prsch11(&self) -> bool {
734        *self == PRSSEL3_A::PRSCH11
735    }
736}
737#[doc = "Field `PRSSEL3` writer - "]
738pub type PRSSEL3_W<'a> = crate::FieldWriter<'a, u32, DECCTRL_SPEC, u8, PRSSEL3_A, 4, 22>;
739impl<'a> PRSSEL3_W<'a> {
740    #[doc = "PRS Channel 0 selected as input"]
741    #[inline(always)]
742    pub fn prsch0(self) -> &'a mut W {
743        self.variant(PRSSEL3_A::PRSCH0)
744    }
745    #[doc = "PRS Channel 1 selected as input"]
746    #[inline(always)]
747    pub fn prsch1(self) -> &'a mut W {
748        self.variant(PRSSEL3_A::PRSCH1)
749    }
750    #[doc = "PRS Channel 2 selected as input"]
751    #[inline(always)]
752    pub fn prsch2(self) -> &'a mut W {
753        self.variant(PRSSEL3_A::PRSCH2)
754    }
755    #[doc = "PRS Channel 3 selected as input"]
756    #[inline(always)]
757    pub fn prsch3(self) -> &'a mut W {
758        self.variant(PRSSEL3_A::PRSCH3)
759    }
760    #[doc = "PRS Channel 4 selected as input"]
761    #[inline(always)]
762    pub fn prsch4(self) -> &'a mut W {
763        self.variant(PRSSEL3_A::PRSCH4)
764    }
765    #[doc = "PRS Channel 5 selected as input"]
766    #[inline(always)]
767    pub fn prsch5(self) -> &'a mut W {
768        self.variant(PRSSEL3_A::PRSCH5)
769    }
770    #[doc = "PRS Channel 6 selected as input"]
771    #[inline(always)]
772    pub fn prsch6(self) -> &'a mut W {
773        self.variant(PRSSEL3_A::PRSCH6)
774    }
775    #[doc = "PRS Channel 7 selected as input"]
776    #[inline(always)]
777    pub fn prsch7(self) -> &'a mut W {
778        self.variant(PRSSEL3_A::PRSCH7)
779    }
780    #[doc = "PRS Channel 8 selected as input"]
781    #[inline(always)]
782    pub fn prsch8(self) -> &'a mut W {
783        self.variant(PRSSEL3_A::PRSCH8)
784    }
785    #[doc = "PRS Channel 9 selected as input"]
786    #[inline(always)]
787    pub fn prsch9(self) -> &'a mut W {
788        self.variant(PRSSEL3_A::PRSCH9)
789    }
790    #[doc = "PRS Channel 10 selected as input"]
791    #[inline(always)]
792    pub fn prsch10(self) -> &'a mut W {
793        self.variant(PRSSEL3_A::PRSCH10)
794    }
795    #[doc = "PRS Channel 11 selected as input"]
796    #[inline(always)]
797    pub fn prsch11(self) -> &'a mut W {
798        self.variant(PRSSEL3_A::PRSCH11)
799    }
800}
801impl R {
802    #[doc = "Bit 0 - Disable the decoder"]
803    #[inline(always)]
804    pub fn disable(&self) -> DISABLE_R {
805        DISABLE_R::new((self.bits & 1) != 0)
806    }
807    #[doc = "Bit 1 - Enable check of current state"]
808    #[inline(always)]
809    pub fn errchk(&self) -> ERRCHK_R {
810        ERRCHK_R::new(((self.bits >> 1) & 1) != 0)
811    }
812    #[doc = "Bit 2 - Enable decoder to channel interrupt mapping"]
813    #[inline(always)]
814    pub fn intmap(&self) -> INTMAP_R {
815        INTMAP_R::new(((self.bits >> 2) & 1) != 0)
816    }
817    #[doc = "Bit 3 - Enable decoder hysteresis on PRS0 output"]
818    #[inline(always)]
819    pub fn hystprs0(&self) -> HYSTPRS0_R {
820        HYSTPRS0_R::new(((self.bits >> 3) & 1) != 0)
821    }
822    #[doc = "Bit 4 - Enable decoder hysteresis on PRS1 output"]
823    #[inline(always)]
824    pub fn hystprs1(&self) -> HYSTPRS1_R {
825        HYSTPRS1_R::new(((self.bits >> 4) & 1) != 0)
826    }
827    #[doc = "Bit 5 - Enable decoder hysteresis on PRS2 output"]
828    #[inline(always)]
829    pub fn hystprs2(&self) -> HYSTPRS2_R {
830        HYSTPRS2_R::new(((self.bits >> 5) & 1) != 0)
831    }
832    #[doc = "Bit 6 - Enable decoder hysteresis on interrupt requests"]
833    #[inline(always)]
834    pub fn hystirq(&self) -> HYSTIRQ_R {
835        HYSTIRQ_R::new(((self.bits >> 6) & 1) != 0)
836    }
837    #[doc = "Bit 7 - Enable count mode on decoder PRS channels 0 and 1"]
838    #[inline(always)]
839    pub fn prscnt(&self) -> PRSCNT_R {
840        PRSCNT_R::new(((self.bits >> 7) & 1) != 0)
841    }
842    #[doc = "Bit 8"]
843    #[inline(always)]
844    pub fn input(&self) -> INPUT_R {
845        INPUT_R::new(((self.bits >> 8) & 1) != 0)
846    }
847    #[doc = "Bits 10:13"]
848    #[inline(always)]
849    pub fn prssel0(&self) -> PRSSEL0_R {
850        PRSSEL0_R::new(((self.bits >> 10) & 0x0f) as u8)
851    }
852    #[doc = "Bits 14:17"]
853    #[inline(always)]
854    pub fn prssel1(&self) -> PRSSEL1_R {
855        PRSSEL1_R::new(((self.bits >> 14) & 0x0f) as u8)
856    }
857    #[doc = "Bits 18:21"]
858    #[inline(always)]
859    pub fn prssel2(&self) -> PRSSEL2_R {
860        PRSSEL2_R::new(((self.bits >> 18) & 0x0f) as u8)
861    }
862    #[doc = "Bits 22:25"]
863    #[inline(always)]
864    pub fn prssel3(&self) -> PRSSEL3_R {
865        PRSSEL3_R::new(((self.bits >> 22) & 0x0f) as u8)
866    }
867}
868impl W {
869    #[doc = "Bit 0 - Disable the decoder"]
870    #[inline(always)]
871    pub fn disable(&mut self) -> DISABLE_W {
872        DISABLE_W::new(self)
873    }
874    #[doc = "Bit 1 - Enable check of current state"]
875    #[inline(always)]
876    pub fn errchk(&mut self) -> ERRCHK_W {
877        ERRCHK_W::new(self)
878    }
879    #[doc = "Bit 2 - Enable decoder to channel interrupt mapping"]
880    #[inline(always)]
881    pub fn intmap(&mut self) -> INTMAP_W {
882        INTMAP_W::new(self)
883    }
884    #[doc = "Bit 3 - Enable decoder hysteresis on PRS0 output"]
885    #[inline(always)]
886    pub fn hystprs0(&mut self) -> HYSTPRS0_W {
887        HYSTPRS0_W::new(self)
888    }
889    #[doc = "Bit 4 - Enable decoder hysteresis on PRS1 output"]
890    #[inline(always)]
891    pub fn hystprs1(&mut self) -> HYSTPRS1_W {
892        HYSTPRS1_W::new(self)
893    }
894    #[doc = "Bit 5 - Enable decoder hysteresis on PRS2 output"]
895    #[inline(always)]
896    pub fn hystprs2(&mut self) -> HYSTPRS2_W {
897        HYSTPRS2_W::new(self)
898    }
899    #[doc = "Bit 6 - Enable decoder hysteresis on interrupt requests"]
900    #[inline(always)]
901    pub fn hystirq(&mut self) -> HYSTIRQ_W {
902        HYSTIRQ_W::new(self)
903    }
904    #[doc = "Bit 7 - Enable count mode on decoder PRS channels 0 and 1"]
905    #[inline(always)]
906    pub fn prscnt(&mut self) -> PRSCNT_W {
907        PRSCNT_W::new(self)
908    }
909    #[doc = "Bit 8"]
910    #[inline(always)]
911    pub fn input(&mut self) -> INPUT_W {
912        INPUT_W::new(self)
913    }
914    #[doc = "Bits 10:13"]
915    #[inline(always)]
916    pub fn prssel0(&mut self) -> PRSSEL0_W {
917        PRSSEL0_W::new(self)
918    }
919    #[doc = "Bits 14:17"]
920    #[inline(always)]
921    pub fn prssel1(&mut self) -> PRSSEL1_W {
922        PRSSEL1_W::new(self)
923    }
924    #[doc = "Bits 18:21"]
925    #[inline(always)]
926    pub fn prssel2(&mut self) -> PRSSEL2_W {
927        PRSSEL2_W::new(self)
928    }
929    #[doc = "Bits 22:25"]
930    #[inline(always)]
931    pub fn prssel3(&mut self) -> PRSSEL3_W {
932        PRSSEL3_W::new(self)
933    }
934    #[doc = "Writes raw bits to the register."]
935    #[inline(always)]
936    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
937        self.0.bits(bits);
938        self
939    }
940}
941#[doc = "Decoder 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 [decctrl](index.html) module"]
942pub struct DECCTRL_SPEC;
943impl crate::RegisterSpec for DECCTRL_SPEC {
944    type Ux = u32;
945}
946#[doc = "`read()` method returns [decctrl::R](R) reader structure"]
947impl crate::Readable for DECCTRL_SPEC {
948    type Reader = R;
949}
950#[doc = "`write(|w| ..)` method takes [decctrl::W](W) writer structure"]
951impl crate::Writable for DECCTRL_SPEC {
952    type Writer = W;
953}
954#[doc = "`reset()` method sets DECCTRL to value 0"]
955impl crate::Resettable for DECCTRL_SPEC {
956    #[inline(always)]
957    fn reset_value() -> Self::Ux {
958        0
959    }
960}