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