efm32pg12_pac/letimer0/
prssel.rs

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