efm32tg11b540_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 - LESENSE Decoder Input Configuration"]
70pub type INPUT_R = crate::BitReader<bool>;
71#[doc = "Field `INPUT` writer - LESENSE Decoder Input Configuration"]
72pub type INPUT_W<'a> = crate::BitWriter<'a, u32, DECCTRL_SPEC, bool, 8>;
73#[doc = "LESENSE Decoder PRS Input 0 Configuration\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}
94impl From<PRSSEL0_A> for u8 {
95    #[inline(always)]
96    fn from(variant: PRSSEL0_A) -> Self {
97        variant as _
98    }
99}
100#[doc = "Field `PRSSEL0` reader - LESENSE Decoder PRS Input 0 Configuration"]
101pub type PRSSEL0_R = crate::FieldReader<u8, PRSSEL0_A>;
102impl PRSSEL0_R {
103    #[doc = "Get enumerated values variant"]
104    #[inline(always)]
105    pub fn variant(&self) -> PRSSEL0_A {
106        match self.bits {
107            0 => PRSSEL0_A::PRSCH0,
108            1 => PRSSEL0_A::PRSCH1,
109            2 => PRSSEL0_A::PRSCH2,
110            3 => PRSSEL0_A::PRSCH3,
111            4 => PRSSEL0_A::PRSCH4,
112            5 => PRSSEL0_A::PRSCH5,
113            6 => PRSSEL0_A::PRSCH6,
114            7 => PRSSEL0_A::PRSCH7,
115            _ => unreachable!(),
116        }
117    }
118    #[doc = "Checks if the value of the field is `PRSCH0`"]
119    #[inline(always)]
120    pub fn is_prsch0(&self) -> bool {
121        *self == PRSSEL0_A::PRSCH0
122    }
123    #[doc = "Checks if the value of the field is `PRSCH1`"]
124    #[inline(always)]
125    pub fn is_prsch1(&self) -> bool {
126        *self == PRSSEL0_A::PRSCH1
127    }
128    #[doc = "Checks if the value of the field is `PRSCH2`"]
129    #[inline(always)]
130    pub fn is_prsch2(&self) -> bool {
131        *self == PRSSEL0_A::PRSCH2
132    }
133    #[doc = "Checks if the value of the field is `PRSCH3`"]
134    #[inline(always)]
135    pub fn is_prsch3(&self) -> bool {
136        *self == PRSSEL0_A::PRSCH3
137    }
138    #[doc = "Checks if the value of the field is `PRSCH4`"]
139    #[inline(always)]
140    pub fn is_prsch4(&self) -> bool {
141        *self == PRSSEL0_A::PRSCH4
142    }
143    #[doc = "Checks if the value of the field is `PRSCH5`"]
144    #[inline(always)]
145    pub fn is_prsch5(&self) -> bool {
146        *self == PRSSEL0_A::PRSCH5
147    }
148    #[doc = "Checks if the value of the field is `PRSCH6`"]
149    #[inline(always)]
150    pub fn is_prsch6(&self) -> bool {
151        *self == PRSSEL0_A::PRSCH6
152    }
153    #[doc = "Checks if the value of the field is `PRSCH7`"]
154    #[inline(always)]
155    pub fn is_prsch7(&self) -> bool {
156        *self == PRSSEL0_A::PRSCH7
157    }
158}
159#[doc = "Field `PRSSEL0` writer - LESENSE Decoder PRS Input 0 Configuration"]
160pub type PRSSEL0_W<'a> = crate::FieldWriterSafe<'a, u32, DECCTRL_SPEC, u8, PRSSEL0_A, 3, 10>;
161impl<'a> PRSSEL0_W<'a> {
162    #[doc = "PRS Channel 0 selected as input"]
163    #[inline(always)]
164    pub fn prsch0(self) -> &'a mut W {
165        self.variant(PRSSEL0_A::PRSCH0)
166    }
167    #[doc = "PRS Channel 1 selected as input"]
168    #[inline(always)]
169    pub fn prsch1(self) -> &'a mut W {
170        self.variant(PRSSEL0_A::PRSCH1)
171    }
172    #[doc = "PRS Channel 2 selected as input"]
173    #[inline(always)]
174    pub fn prsch2(self) -> &'a mut W {
175        self.variant(PRSSEL0_A::PRSCH2)
176    }
177    #[doc = "PRS Channel 3 selected as input"]
178    #[inline(always)]
179    pub fn prsch3(self) -> &'a mut W {
180        self.variant(PRSSEL0_A::PRSCH3)
181    }
182    #[doc = "PRS Channel 4 selected as input"]
183    #[inline(always)]
184    pub fn prsch4(self) -> &'a mut W {
185        self.variant(PRSSEL0_A::PRSCH4)
186    }
187    #[doc = "PRS Channel 5 selected as input"]
188    #[inline(always)]
189    pub fn prsch5(self) -> &'a mut W {
190        self.variant(PRSSEL0_A::PRSCH5)
191    }
192    #[doc = "PRS Channel 6 selected as input"]
193    #[inline(always)]
194    pub fn prsch6(self) -> &'a mut W {
195        self.variant(PRSSEL0_A::PRSCH6)
196    }
197    #[doc = "PRS Channel 7 selected as input"]
198    #[inline(always)]
199    pub fn prsch7(self) -> &'a mut W {
200        self.variant(PRSSEL0_A::PRSCH7)
201    }
202}
203#[doc = "LESENSE Decoder PRS Input 1 Configuration\n\nValue on reset: 0"]
204#[derive(Clone, Copy, Debug, PartialEq)]
205#[repr(u8)]
206pub enum PRSSEL1_A {
207    #[doc = "0: PRS Channel 0 selected as input"]
208    PRSCH0 = 0,
209    #[doc = "1: PRS Channel 1 selected as input"]
210    PRSCH1 = 1,
211    #[doc = "2: PRS Channel 2 selected as input"]
212    PRSCH2 = 2,
213    #[doc = "3: PRS Channel 3 selected as input"]
214    PRSCH3 = 3,
215    #[doc = "4: PRS Channel 4 selected as input"]
216    PRSCH4 = 4,
217    #[doc = "5: PRS Channel 5 selected as input"]
218    PRSCH5 = 5,
219    #[doc = "6: PRS Channel 6 selected as input"]
220    PRSCH6 = 6,
221    #[doc = "7: PRS Channel 7 selected as input"]
222    PRSCH7 = 7,
223}
224impl From<PRSSEL1_A> for u8 {
225    #[inline(always)]
226    fn from(variant: PRSSEL1_A) -> Self {
227        variant as _
228    }
229}
230#[doc = "Field `PRSSEL1` reader - LESENSE Decoder PRS Input 1 Configuration"]
231pub type PRSSEL1_R = crate::FieldReader<u8, PRSSEL1_A>;
232impl PRSSEL1_R {
233    #[doc = "Get enumerated values variant"]
234    #[inline(always)]
235    pub fn variant(&self) -> PRSSEL1_A {
236        match self.bits {
237            0 => PRSSEL1_A::PRSCH0,
238            1 => PRSSEL1_A::PRSCH1,
239            2 => PRSSEL1_A::PRSCH2,
240            3 => PRSSEL1_A::PRSCH3,
241            4 => PRSSEL1_A::PRSCH4,
242            5 => PRSSEL1_A::PRSCH5,
243            6 => PRSSEL1_A::PRSCH6,
244            7 => PRSSEL1_A::PRSCH7,
245            _ => unreachable!(),
246        }
247    }
248    #[doc = "Checks if the value of the field is `PRSCH0`"]
249    #[inline(always)]
250    pub fn is_prsch0(&self) -> bool {
251        *self == PRSSEL1_A::PRSCH0
252    }
253    #[doc = "Checks if the value of the field is `PRSCH1`"]
254    #[inline(always)]
255    pub fn is_prsch1(&self) -> bool {
256        *self == PRSSEL1_A::PRSCH1
257    }
258    #[doc = "Checks if the value of the field is `PRSCH2`"]
259    #[inline(always)]
260    pub fn is_prsch2(&self) -> bool {
261        *self == PRSSEL1_A::PRSCH2
262    }
263    #[doc = "Checks if the value of the field is `PRSCH3`"]
264    #[inline(always)]
265    pub fn is_prsch3(&self) -> bool {
266        *self == PRSSEL1_A::PRSCH3
267    }
268    #[doc = "Checks if the value of the field is `PRSCH4`"]
269    #[inline(always)]
270    pub fn is_prsch4(&self) -> bool {
271        *self == PRSSEL1_A::PRSCH4
272    }
273    #[doc = "Checks if the value of the field is `PRSCH5`"]
274    #[inline(always)]
275    pub fn is_prsch5(&self) -> bool {
276        *self == PRSSEL1_A::PRSCH5
277    }
278    #[doc = "Checks if the value of the field is `PRSCH6`"]
279    #[inline(always)]
280    pub fn is_prsch6(&self) -> bool {
281        *self == PRSSEL1_A::PRSCH6
282    }
283    #[doc = "Checks if the value of the field is `PRSCH7`"]
284    #[inline(always)]
285    pub fn is_prsch7(&self) -> bool {
286        *self == PRSSEL1_A::PRSCH7
287    }
288}
289#[doc = "Field `PRSSEL1` writer - LESENSE Decoder PRS Input 1 Configuration"]
290pub type PRSSEL1_W<'a> = crate::FieldWriterSafe<'a, u32, DECCTRL_SPEC, u8, PRSSEL1_A, 3, 15>;
291impl<'a> PRSSEL1_W<'a> {
292    #[doc = "PRS Channel 0 selected as input"]
293    #[inline(always)]
294    pub fn prsch0(self) -> &'a mut W {
295        self.variant(PRSSEL1_A::PRSCH0)
296    }
297    #[doc = "PRS Channel 1 selected as input"]
298    #[inline(always)]
299    pub fn prsch1(self) -> &'a mut W {
300        self.variant(PRSSEL1_A::PRSCH1)
301    }
302    #[doc = "PRS Channel 2 selected as input"]
303    #[inline(always)]
304    pub fn prsch2(self) -> &'a mut W {
305        self.variant(PRSSEL1_A::PRSCH2)
306    }
307    #[doc = "PRS Channel 3 selected as input"]
308    #[inline(always)]
309    pub fn prsch3(self) -> &'a mut W {
310        self.variant(PRSSEL1_A::PRSCH3)
311    }
312    #[doc = "PRS Channel 4 selected as input"]
313    #[inline(always)]
314    pub fn prsch4(self) -> &'a mut W {
315        self.variant(PRSSEL1_A::PRSCH4)
316    }
317    #[doc = "PRS Channel 5 selected as input"]
318    #[inline(always)]
319    pub fn prsch5(self) -> &'a mut W {
320        self.variant(PRSSEL1_A::PRSCH5)
321    }
322    #[doc = "PRS Channel 6 selected as input"]
323    #[inline(always)]
324    pub fn prsch6(self) -> &'a mut W {
325        self.variant(PRSSEL1_A::PRSCH6)
326    }
327    #[doc = "PRS Channel 7 selected as input"]
328    #[inline(always)]
329    pub fn prsch7(self) -> &'a mut W {
330        self.variant(PRSSEL1_A::PRSCH7)
331    }
332}
333#[doc = "LESENSE Decoder PRS Input 2 Configuration\n\nValue on reset: 0"]
334#[derive(Clone, Copy, Debug, PartialEq)]
335#[repr(u8)]
336pub enum PRSSEL2_A {
337    #[doc = "0: PRS Channel 0 selected as input"]
338    PRSCH0 = 0,
339    #[doc = "1: PRS Channel 1 selected as input"]
340    PRSCH1 = 1,
341    #[doc = "2: PRS Channel 2 selected as input"]
342    PRSCH2 = 2,
343    #[doc = "3: PRS Channel 3 selected as input"]
344    PRSCH3 = 3,
345    #[doc = "4: PRS Channel 4 selected as input"]
346    PRSCH4 = 4,
347    #[doc = "5: PRS Channel 5 selected as input"]
348    PRSCH5 = 5,
349    #[doc = "6: PRS Channel 6 selected as input"]
350    PRSCH6 = 6,
351    #[doc = "7: PRS Channel 7 selected as input"]
352    PRSCH7 = 7,
353}
354impl From<PRSSEL2_A> for u8 {
355    #[inline(always)]
356    fn from(variant: PRSSEL2_A) -> Self {
357        variant as _
358    }
359}
360#[doc = "Field `PRSSEL2` reader - LESENSE Decoder PRS Input 2 Configuration"]
361pub type PRSSEL2_R = crate::FieldReader<u8, PRSSEL2_A>;
362impl PRSSEL2_R {
363    #[doc = "Get enumerated values variant"]
364    #[inline(always)]
365    pub fn variant(&self) -> PRSSEL2_A {
366        match self.bits {
367            0 => PRSSEL2_A::PRSCH0,
368            1 => PRSSEL2_A::PRSCH1,
369            2 => PRSSEL2_A::PRSCH2,
370            3 => PRSSEL2_A::PRSCH3,
371            4 => PRSSEL2_A::PRSCH4,
372            5 => PRSSEL2_A::PRSCH5,
373            6 => PRSSEL2_A::PRSCH6,
374            7 => PRSSEL2_A::PRSCH7,
375            _ => unreachable!(),
376        }
377    }
378    #[doc = "Checks if the value of the field is `PRSCH0`"]
379    #[inline(always)]
380    pub fn is_prsch0(&self) -> bool {
381        *self == PRSSEL2_A::PRSCH0
382    }
383    #[doc = "Checks if the value of the field is `PRSCH1`"]
384    #[inline(always)]
385    pub fn is_prsch1(&self) -> bool {
386        *self == PRSSEL2_A::PRSCH1
387    }
388    #[doc = "Checks if the value of the field is `PRSCH2`"]
389    #[inline(always)]
390    pub fn is_prsch2(&self) -> bool {
391        *self == PRSSEL2_A::PRSCH2
392    }
393    #[doc = "Checks if the value of the field is `PRSCH3`"]
394    #[inline(always)]
395    pub fn is_prsch3(&self) -> bool {
396        *self == PRSSEL2_A::PRSCH3
397    }
398    #[doc = "Checks if the value of the field is `PRSCH4`"]
399    #[inline(always)]
400    pub fn is_prsch4(&self) -> bool {
401        *self == PRSSEL2_A::PRSCH4
402    }
403    #[doc = "Checks if the value of the field is `PRSCH5`"]
404    #[inline(always)]
405    pub fn is_prsch5(&self) -> bool {
406        *self == PRSSEL2_A::PRSCH5
407    }
408    #[doc = "Checks if the value of the field is `PRSCH6`"]
409    #[inline(always)]
410    pub fn is_prsch6(&self) -> bool {
411        *self == PRSSEL2_A::PRSCH6
412    }
413    #[doc = "Checks if the value of the field is `PRSCH7`"]
414    #[inline(always)]
415    pub fn is_prsch7(&self) -> bool {
416        *self == PRSSEL2_A::PRSCH7
417    }
418}
419#[doc = "Field `PRSSEL2` writer - LESENSE Decoder PRS Input 2 Configuration"]
420pub type PRSSEL2_W<'a> = crate::FieldWriterSafe<'a, u32, DECCTRL_SPEC, u8, PRSSEL2_A, 3, 20>;
421impl<'a> PRSSEL2_W<'a> {
422    #[doc = "PRS Channel 0 selected as input"]
423    #[inline(always)]
424    pub fn prsch0(self) -> &'a mut W {
425        self.variant(PRSSEL2_A::PRSCH0)
426    }
427    #[doc = "PRS Channel 1 selected as input"]
428    #[inline(always)]
429    pub fn prsch1(self) -> &'a mut W {
430        self.variant(PRSSEL2_A::PRSCH1)
431    }
432    #[doc = "PRS Channel 2 selected as input"]
433    #[inline(always)]
434    pub fn prsch2(self) -> &'a mut W {
435        self.variant(PRSSEL2_A::PRSCH2)
436    }
437    #[doc = "PRS Channel 3 selected as input"]
438    #[inline(always)]
439    pub fn prsch3(self) -> &'a mut W {
440        self.variant(PRSSEL2_A::PRSCH3)
441    }
442    #[doc = "PRS Channel 4 selected as input"]
443    #[inline(always)]
444    pub fn prsch4(self) -> &'a mut W {
445        self.variant(PRSSEL2_A::PRSCH4)
446    }
447    #[doc = "PRS Channel 5 selected as input"]
448    #[inline(always)]
449    pub fn prsch5(self) -> &'a mut W {
450        self.variant(PRSSEL2_A::PRSCH5)
451    }
452    #[doc = "PRS Channel 6 selected as input"]
453    #[inline(always)]
454    pub fn prsch6(self) -> &'a mut W {
455        self.variant(PRSSEL2_A::PRSCH6)
456    }
457    #[doc = "PRS Channel 7 selected as input"]
458    #[inline(always)]
459    pub fn prsch7(self) -> &'a mut W {
460        self.variant(PRSSEL2_A::PRSCH7)
461    }
462}
463#[doc = "LESENSE Decoder PRS Input 3 Configuration\n\nValue on reset: 0"]
464#[derive(Clone, Copy, Debug, PartialEq)]
465#[repr(u8)]
466pub enum PRSSEL3_A {
467    #[doc = "0: PRS Channel 0 selected as input"]
468    PRSCH0 = 0,
469    #[doc = "1: PRS Channel 1 selected as input"]
470    PRSCH1 = 1,
471    #[doc = "2: PRS Channel 2 selected as input"]
472    PRSCH2 = 2,
473    #[doc = "3: PRS Channel 3 selected as input"]
474    PRSCH3 = 3,
475    #[doc = "4: PRS Channel 4 selected as input"]
476    PRSCH4 = 4,
477    #[doc = "5: PRS Channel 5 selected as input"]
478    PRSCH5 = 5,
479    #[doc = "6: PRS Channel 6 selected as input"]
480    PRSCH6 = 6,
481    #[doc = "7: PRS Channel 7 selected as input"]
482    PRSCH7 = 7,
483}
484impl From<PRSSEL3_A> for u8 {
485    #[inline(always)]
486    fn from(variant: PRSSEL3_A) -> Self {
487        variant as _
488    }
489}
490#[doc = "Field `PRSSEL3` reader - LESENSE Decoder PRS Input 3 Configuration"]
491pub type PRSSEL3_R = crate::FieldReader<u8, PRSSEL3_A>;
492impl PRSSEL3_R {
493    #[doc = "Get enumerated values variant"]
494    #[inline(always)]
495    pub fn variant(&self) -> PRSSEL3_A {
496        match self.bits {
497            0 => PRSSEL3_A::PRSCH0,
498            1 => PRSSEL3_A::PRSCH1,
499            2 => PRSSEL3_A::PRSCH2,
500            3 => PRSSEL3_A::PRSCH3,
501            4 => PRSSEL3_A::PRSCH4,
502            5 => PRSSEL3_A::PRSCH5,
503            6 => PRSSEL3_A::PRSCH6,
504            7 => PRSSEL3_A::PRSCH7,
505            _ => unreachable!(),
506        }
507    }
508    #[doc = "Checks if the value of the field is `PRSCH0`"]
509    #[inline(always)]
510    pub fn is_prsch0(&self) -> bool {
511        *self == PRSSEL3_A::PRSCH0
512    }
513    #[doc = "Checks if the value of the field is `PRSCH1`"]
514    #[inline(always)]
515    pub fn is_prsch1(&self) -> bool {
516        *self == PRSSEL3_A::PRSCH1
517    }
518    #[doc = "Checks if the value of the field is `PRSCH2`"]
519    #[inline(always)]
520    pub fn is_prsch2(&self) -> bool {
521        *self == PRSSEL3_A::PRSCH2
522    }
523    #[doc = "Checks if the value of the field is `PRSCH3`"]
524    #[inline(always)]
525    pub fn is_prsch3(&self) -> bool {
526        *self == PRSSEL3_A::PRSCH3
527    }
528    #[doc = "Checks if the value of the field is `PRSCH4`"]
529    #[inline(always)]
530    pub fn is_prsch4(&self) -> bool {
531        *self == PRSSEL3_A::PRSCH4
532    }
533    #[doc = "Checks if the value of the field is `PRSCH5`"]
534    #[inline(always)]
535    pub fn is_prsch5(&self) -> bool {
536        *self == PRSSEL3_A::PRSCH5
537    }
538    #[doc = "Checks if the value of the field is `PRSCH6`"]
539    #[inline(always)]
540    pub fn is_prsch6(&self) -> bool {
541        *self == PRSSEL3_A::PRSCH6
542    }
543    #[doc = "Checks if the value of the field is `PRSCH7`"]
544    #[inline(always)]
545    pub fn is_prsch7(&self) -> bool {
546        *self == PRSSEL3_A::PRSCH7
547    }
548}
549#[doc = "Field `PRSSEL3` writer - LESENSE Decoder PRS Input 3 Configuration"]
550pub type PRSSEL3_W<'a> = crate::FieldWriterSafe<'a, u32, DECCTRL_SPEC, u8, PRSSEL3_A, 3, 25>;
551impl<'a> PRSSEL3_W<'a> {
552    #[doc = "PRS Channel 0 selected as input"]
553    #[inline(always)]
554    pub fn prsch0(self) -> &'a mut W {
555        self.variant(PRSSEL3_A::PRSCH0)
556    }
557    #[doc = "PRS Channel 1 selected as input"]
558    #[inline(always)]
559    pub fn prsch1(self) -> &'a mut W {
560        self.variant(PRSSEL3_A::PRSCH1)
561    }
562    #[doc = "PRS Channel 2 selected as input"]
563    #[inline(always)]
564    pub fn prsch2(self) -> &'a mut W {
565        self.variant(PRSSEL3_A::PRSCH2)
566    }
567    #[doc = "PRS Channel 3 selected as input"]
568    #[inline(always)]
569    pub fn prsch3(self) -> &'a mut W {
570        self.variant(PRSSEL3_A::PRSCH3)
571    }
572    #[doc = "PRS Channel 4 selected as input"]
573    #[inline(always)]
574    pub fn prsch4(self) -> &'a mut W {
575        self.variant(PRSSEL3_A::PRSCH4)
576    }
577    #[doc = "PRS Channel 5 selected as input"]
578    #[inline(always)]
579    pub fn prsch5(self) -> &'a mut W {
580        self.variant(PRSSEL3_A::PRSCH5)
581    }
582    #[doc = "PRS Channel 6 selected as input"]
583    #[inline(always)]
584    pub fn prsch6(self) -> &'a mut W {
585        self.variant(PRSSEL3_A::PRSCH6)
586    }
587    #[doc = "PRS Channel 7 selected as input"]
588    #[inline(always)]
589    pub fn prsch7(self) -> &'a mut W {
590        self.variant(PRSSEL3_A::PRSCH7)
591    }
592}
593impl R {
594    #[doc = "Bit 0 - Disable the Decoder"]
595    #[inline(always)]
596    pub fn disable(&self) -> DISABLE_R {
597        DISABLE_R::new((self.bits & 1) != 0)
598    }
599    #[doc = "Bit 1 - Enable Check of Current State"]
600    #[inline(always)]
601    pub fn errchk(&self) -> ERRCHK_R {
602        ERRCHK_R::new(((self.bits >> 1) & 1) != 0)
603    }
604    #[doc = "Bit 2 - Enable Decoder to Channel Interrupt Mapping"]
605    #[inline(always)]
606    pub fn intmap(&self) -> INTMAP_R {
607        INTMAP_R::new(((self.bits >> 2) & 1) != 0)
608    }
609    #[doc = "Bit 3 - Enable Decoder Hysteresis on PRS0 Output"]
610    #[inline(always)]
611    pub fn hystprs0(&self) -> HYSTPRS0_R {
612        HYSTPRS0_R::new(((self.bits >> 3) & 1) != 0)
613    }
614    #[doc = "Bit 4 - Enable Decoder Hysteresis on PRS1 Output"]
615    #[inline(always)]
616    pub fn hystprs1(&self) -> HYSTPRS1_R {
617        HYSTPRS1_R::new(((self.bits >> 4) & 1) != 0)
618    }
619    #[doc = "Bit 5 - Enable Decoder Hysteresis on PRS2 Output"]
620    #[inline(always)]
621    pub fn hystprs2(&self) -> HYSTPRS2_R {
622        HYSTPRS2_R::new(((self.bits >> 5) & 1) != 0)
623    }
624    #[doc = "Bit 6 - Enable Decoder Hysteresis on Interrupt Requests"]
625    #[inline(always)]
626    pub fn hystirq(&self) -> HYSTIRQ_R {
627        HYSTIRQ_R::new(((self.bits >> 6) & 1) != 0)
628    }
629    #[doc = "Bit 7 - Enable Count Mode on Decoder PRS Channels 0 and 1"]
630    #[inline(always)]
631    pub fn prscnt(&self) -> PRSCNT_R {
632        PRSCNT_R::new(((self.bits >> 7) & 1) != 0)
633    }
634    #[doc = "Bit 8 - LESENSE Decoder Input Configuration"]
635    #[inline(always)]
636    pub fn input(&self) -> INPUT_R {
637        INPUT_R::new(((self.bits >> 8) & 1) != 0)
638    }
639    #[doc = "Bits 10:12 - LESENSE Decoder PRS Input 0 Configuration"]
640    #[inline(always)]
641    pub fn prssel0(&self) -> PRSSEL0_R {
642        PRSSEL0_R::new(((self.bits >> 10) & 7) as u8)
643    }
644    #[doc = "Bits 15:17 - LESENSE Decoder PRS Input 1 Configuration"]
645    #[inline(always)]
646    pub fn prssel1(&self) -> PRSSEL1_R {
647        PRSSEL1_R::new(((self.bits >> 15) & 7) as u8)
648    }
649    #[doc = "Bits 20:22 - LESENSE Decoder PRS Input 2 Configuration"]
650    #[inline(always)]
651    pub fn prssel2(&self) -> PRSSEL2_R {
652        PRSSEL2_R::new(((self.bits >> 20) & 7) as u8)
653    }
654    #[doc = "Bits 25:27 - LESENSE Decoder PRS Input 3 Configuration"]
655    #[inline(always)]
656    pub fn prssel3(&self) -> PRSSEL3_R {
657        PRSSEL3_R::new(((self.bits >> 25) & 7) as u8)
658    }
659}
660impl W {
661    #[doc = "Bit 0 - Disable the Decoder"]
662    #[inline(always)]
663    pub fn disable(&mut self) -> DISABLE_W {
664        DISABLE_W::new(self)
665    }
666    #[doc = "Bit 1 - Enable Check of Current State"]
667    #[inline(always)]
668    pub fn errchk(&mut self) -> ERRCHK_W {
669        ERRCHK_W::new(self)
670    }
671    #[doc = "Bit 2 - Enable Decoder to Channel Interrupt Mapping"]
672    #[inline(always)]
673    pub fn intmap(&mut self) -> INTMAP_W {
674        INTMAP_W::new(self)
675    }
676    #[doc = "Bit 3 - Enable Decoder Hysteresis on PRS0 Output"]
677    #[inline(always)]
678    pub fn hystprs0(&mut self) -> HYSTPRS0_W {
679        HYSTPRS0_W::new(self)
680    }
681    #[doc = "Bit 4 - Enable Decoder Hysteresis on PRS1 Output"]
682    #[inline(always)]
683    pub fn hystprs1(&mut self) -> HYSTPRS1_W {
684        HYSTPRS1_W::new(self)
685    }
686    #[doc = "Bit 5 - Enable Decoder Hysteresis on PRS2 Output"]
687    #[inline(always)]
688    pub fn hystprs2(&mut self) -> HYSTPRS2_W {
689        HYSTPRS2_W::new(self)
690    }
691    #[doc = "Bit 6 - Enable Decoder Hysteresis on Interrupt Requests"]
692    #[inline(always)]
693    pub fn hystirq(&mut self) -> HYSTIRQ_W {
694        HYSTIRQ_W::new(self)
695    }
696    #[doc = "Bit 7 - Enable Count Mode on Decoder PRS Channels 0 and 1"]
697    #[inline(always)]
698    pub fn prscnt(&mut self) -> PRSCNT_W {
699        PRSCNT_W::new(self)
700    }
701    #[doc = "Bit 8 - LESENSE Decoder Input Configuration"]
702    #[inline(always)]
703    pub fn input(&mut self) -> INPUT_W {
704        INPUT_W::new(self)
705    }
706    #[doc = "Bits 10:12 - LESENSE Decoder PRS Input 0 Configuration"]
707    #[inline(always)]
708    pub fn prssel0(&mut self) -> PRSSEL0_W {
709        PRSSEL0_W::new(self)
710    }
711    #[doc = "Bits 15:17 - LESENSE Decoder PRS Input 1 Configuration"]
712    #[inline(always)]
713    pub fn prssel1(&mut self) -> PRSSEL1_W {
714        PRSSEL1_W::new(self)
715    }
716    #[doc = "Bits 20:22 - LESENSE Decoder PRS Input 2 Configuration"]
717    #[inline(always)]
718    pub fn prssel2(&mut self) -> PRSSEL2_W {
719        PRSSEL2_W::new(self)
720    }
721    #[doc = "Bits 25:27 - LESENSE Decoder PRS Input 3 Configuration"]
722    #[inline(always)]
723    pub fn prssel3(&mut self) -> PRSSEL3_W {
724        PRSSEL3_W::new(self)
725    }
726    #[doc = "Writes raw bits to the register."]
727    #[inline(always)]
728    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
729        self.0.bits(bits);
730        self
731    }
732}
733#[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"]
734pub struct DECCTRL_SPEC;
735impl crate::RegisterSpec for DECCTRL_SPEC {
736    type Ux = u32;
737}
738#[doc = "`read()` method returns [decctrl::R](R) reader structure"]
739impl crate::Readable for DECCTRL_SPEC {
740    type Reader = R;
741}
742#[doc = "`write(|w| ..)` method takes [decctrl::W](W) writer structure"]
743impl crate::Writable for DECCTRL_SPEC {
744    type Writer = W;
745}
746#[doc = "`reset()` method sets DECCTRL to value 0"]
747impl crate::Resettable for DECCTRL_SPEC {
748    #[inline(always)]
749    fn reset_value() -> Self::Ux {
750        0
751    }
752}