efm32tg11b540_pac/letimer0/
prssel.rs

1#[doc = "Register `PRSSEL` reader"]
2pub struct R(crate::R<PRSSEL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PRSSEL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PRSSEL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PRSSEL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `PRSSEL` writer"]
17pub struct W(crate::W<PRSSEL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<PRSSEL_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<PRSSEL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<PRSSEL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "PRS Start Select\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39#[repr(u8)]
40pub enum PRSSTARTSEL_A {
41    #[doc = "0: PRS Channel 0 selected as input"]
42    PRSCH0 = 0,
43    #[doc = "1: PRS Channel 1 selected as input"]
44    PRSCH1 = 1,
45    #[doc = "2: PRS Channel 2 selected as input"]
46    PRSCH2 = 2,
47    #[doc = "3: PRS Channel 3 selected as input"]
48    PRSCH3 = 3,
49    #[doc = "4: PRS Channel 4 selected as input"]
50    PRSCH4 = 4,
51    #[doc = "5: PRS Channel 5 selected as input"]
52    PRSCH5 = 5,
53    #[doc = "6: PRS Channel 6 selected as input"]
54    PRSCH6 = 6,
55    #[doc = "7: PRS Channel 7 selected as input"]
56    PRSCH7 = 7,
57}
58impl From<PRSSTARTSEL_A> for u8 {
59    #[inline(always)]
60    fn from(variant: PRSSTARTSEL_A) -> Self {
61        variant as _
62    }
63}
64#[doc = "Field `PRSSTARTSEL` reader - PRS Start Select"]
65pub type PRSSTARTSEL_R = crate::FieldReader<u8, PRSSTARTSEL_A>;
66impl PRSSTARTSEL_R {
67    #[doc = "Get enumerated values variant"]
68    #[inline(always)]
69    pub fn variant(&self) -> PRSSTARTSEL_A {
70        match self.bits {
71            0 => PRSSTARTSEL_A::PRSCH0,
72            1 => PRSSTARTSEL_A::PRSCH1,
73            2 => PRSSTARTSEL_A::PRSCH2,
74            3 => PRSSTARTSEL_A::PRSCH3,
75            4 => PRSSTARTSEL_A::PRSCH4,
76            5 => PRSSTARTSEL_A::PRSCH5,
77            6 => PRSSTARTSEL_A::PRSCH6,
78            7 => PRSSTARTSEL_A::PRSCH7,
79            _ => unreachable!(),
80        }
81    }
82    #[doc = "Checks if the value of the field is `PRSCH0`"]
83    #[inline(always)]
84    pub fn is_prsch0(&self) -> bool {
85        *self == PRSSTARTSEL_A::PRSCH0
86    }
87    #[doc = "Checks if the value of the field is `PRSCH1`"]
88    #[inline(always)]
89    pub fn is_prsch1(&self) -> bool {
90        *self == PRSSTARTSEL_A::PRSCH1
91    }
92    #[doc = "Checks if the value of the field is `PRSCH2`"]
93    #[inline(always)]
94    pub fn is_prsch2(&self) -> bool {
95        *self == PRSSTARTSEL_A::PRSCH2
96    }
97    #[doc = "Checks if the value of the field is `PRSCH3`"]
98    #[inline(always)]
99    pub fn is_prsch3(&self) -> bool {
100        *self == PRSSTARTSEL_A::PRSCH3
101    }
102    #[doc = "Checks if the value of the field is `PRSCH4`"]
103    #[inline(always)]
104    pub fn is_prsch4(&self) -> bool {
105        *self == PRSSTARTSEL_A::PRSCH4
106    }
107    #[doc = "Checks if the value of the field is `PRSCH5`"]
108    #[inline(always)]
109    pub fn is_prsch5(&self) -> bool {
110        *self == PRSSTARTSEL_A::PRSCH5
111    }
112    #[doc = "Checks if the value of the field is `PRSCH6`"]
113    #[inline(always)]
114    pub fn is_prsch6(&self) -> bool {
115        *self == PRSSTARTSEL_A::PRSCH6
116    }
117    #[doc = "Checks if the value of the field is `PRSCH7`"]
118    #[inline(always)]
119    pub fn is_prsch7(&self) -> bool {
120        *self == PRSSTARTSEL_A::PRSCH7
121    }
122}
123#[doc = "Field `PRSSTARTSEL` writer - PRS Start Select"]
124pub type PRSSTARTSEL_W<'a> = crate::FieldWriterSafe<'a, u32, PRSSEL_SPEC, u8, PRSSTARTSEL_A, 3, 0>;
125impl<'a> PRSSTARTSEL_W<'a> {
126    #[doc = "PRS Channel 0 selected as input"]
127    #[inline(always)]
128    pub fn prsch0(self) -> &'a mut W {
129        self.variant(PRSSTARTSEL_A::PRSCH0)
130    }
131    #[doc = "PRS Channel 1 selected as input"]
132    #[inline(always)]
133    pub fn prsch1(self) -> &'a mut W {
134        self.variant(PRSSTARTSEL_A::PRSCH1)
135    }
136    #[doc = "PRS Channel 2 selected as input"]
137    #[inline(always)]
138    pub fn prsch2(self) -> &'a mut W {
139        self.variant(PRSSTARTSEL_A::PRSCH2)
140    }
141    #[doc = "PRS Channel 3 selected as input"]
142    #[inline(always)]
143    pub fn prsch3(self) -> &'a mut W {
144        self.variant(PRSSTARTSEL_A::PRSCH3)
145    }
146    #[doc = "PRS Channel 4 selected as input"]
147    #[inline(always)]
148    pub fn prsch4(self) -> &'a mut W {
149        self.variant(PRSSTARTSEL_A::PRSCH4)
150    }
151    #[doc = "PRS Channel 5 selected as input"]
152    #[inline(always)]
153    pub fn prsch5(self) -> &'a mut W {
154        self.variant(PRSSTARTSEL_A::PRSCH5)
155    }
156    #[doc = "PRS Channel 6 selected as input"]
157    #[inline(always)]
158    pub fn prsch6(self) -> &'a mut W {
159        self.variant(PRSSTARTSEL_A::PRSCH6)
160    }
161    #[doc = "PRS Channel 7 selected as input"]
162    #[inline(always)]
163    pub fn prsch7(self) -> &'a mut W {
164        self.variant(PRSSTARTSEL_A::PRSCH7)
165    }
166}
167#[doc = "PRS Stop Select\n\nValue on reset: 0"]
168#[derive(Clone, Copy, Debug, PartialEq)]
169#[repr(u8)]
170pub enum PRSSTOPSEL_A {
171    #[doc = "0: PRS Channel 0 selected as input"]
172    PRSCH0 = 0,
173    #[doc = "1: PRS Channel 1 selected as input"]
174    PRSCH1 = 1,
175    #[doc = "2: PRS Channel 2 selected as input"]
176    PRSCH2 = 2,
177    #[doc = "3: PRS Channel 3 selected as input"]
178    PRSCH3 = 3,
179    #[doc = "4: PRS Channel 4 selected as input"]
180    PRSCH4 = 4,
181    #[doc = "5: PRS Channel 5 selected as input"]
182    PRSCH5 = 5,
183    #[doc = "6: PRS Channel 6 selected as input"]
184    PRSCH6 = 6,
185    #[doc = "7: PRS Channel 7 selected as input"]
186    PRSCH7 = 7,
187}
188impl From<PRSSTOPSEL_A> for u8 {
189    #[inline(always)]
190    fn from(variant: PRSSTOPSEL_A) -> Self {
191        variant as _
192    }
193}
194#[doc = "Field `PRSSTOPSEL` reader - PRS Stop Select"]
195pub type PRSSTOPSEL_R = crate::FieldReader<u8, PRSSTOPSEL_A>;
196impl PRSSTOPSEL_R {
197    #[doc = "Get enumerated values variant"]
198    #[inline(always)]
199    pub fn variant(&self) -> PRSSTOPSEL_A {
200        match self.bits {
201            0 => PRSSTOPSEL_A::PRSCH0,
202            1 => PRSSTOPSEL_A::PRSCH1,
203            2 => PRSSTOPSEL_A::PRSCH2,
204            3 => PRSSTOPSEL_A::PRSCH3,
205            4 => PRSSTOPSEL_A::PRSCH4,
206            5 => PRSSTOPSEL_A::PRSCH5,
207            6 => PRSSTOPSEL_A::PRSCH6,
208            7 => PRSSTOPSEL_A::PRSCH7,
209            _ => unreachable!(),
210        }
211    }
212    #[doc = "Checks if the value of the field is `PRSCH0`"]
213    #[inline(always)]
214    pub fn is_prsch0(&self) -> bool {
215        *self == PRSSTOPSEL_A::PRSCH0
216    }
217    #[doc = "Checks if the value of the field is `PRSCH1`"]
218    #[inline(always)]
219    pub fn is_prsch1(&self) -> bool {
220        *self == PRSSTOPSEL_A::PRSCH1
221    }
222    #[doc = "Checks if the value of the field is `PRSCH2`"]
223    #[inline(always)]
224    pub fn is_prsch2(&self) -> bool {
225        *self == PRSSTOPSEL_A::PRSCH2
226    }
227    #[doc = "Checks if the value of the field is `PRSCH3`"]
228    #[inline(always)]
229    pub fn is_prsch3(&self) -> bool {
230        *self == PRSSTOPSEL_A::PRSCH3
231    }
232    #[doc = "Checks if the value of the field is `PRSCH4`"]
233    #[inline(always)]
234    pub fn is_prsch4(&self) -> bool {
235        *self == PRSSTOPSEL_A::PRSCH4
236    }
237    #[doc = "Checks if the value of the field is `PRSCH5`"]
238    #[inline(always)]
239    pub fn is_prsch5(&self) -> bool {
240        *self == PRSSTOPSEL_A::PRSCH5
241    }
242    #[doc = "Checks if the value of the field is `PRSCH6`"]
243    #[inline(always)]
244    pub fn is_prsch6(&self) -> bool {
245        *self == PRSSTOPSEL_A::PRSCH6
246    }
247    #[doc = "Checks if the value of the field is `PRSCH7`"]
248    #[inline(always)]
249    pub fn is_prsch7(&self) -> bool {
250        *self == PRSSTOPSEL_A::PRSCH7
251    }
252}
253#[doc = "Field `PRSSTOPSEL` writer - PRS Stop Select"]
254pub type PRSSTOPSEL_W<'a> = crate::FieldWriterSafe<'a, u32, PRSSEL_SPEC, u8, PRSSTOPSEL_A, 3, 6>;
255impl<'a> PRSSTOPSEL_W<'a> {
256    #[doc = "PRS Channel 0 selected as input"]
257    #[inline(always)]
258    pub fn prsch0(self) -> &'a mut W {
259        self.variant(PRSSTOPSEL_A::PRSCH0)
260    }
261    #[doc = "PRS Channel 1 selected as input"]
262    #[inline(always)]
263    pub fn prsch1(self) -> &'a mut W {
264        self.variant(PRSSTOPSEL_A::PRSCH1)
265    }
266    #[doc = "PRS Channel 2 selected as input"]
267    #[inline(always)]
268    pub fn prsch2(self) -> &'a mut W {
269        self.variant(PRSSTOPSEL_A::PRSCH2)
270    }
271    #[doc = "PRS Channel 3 selected as input"]
272    #[inline(always)]
273    pub fn prsch3(self) -> &'a mut W {
274        self.variant(PRSSTOPSEL_A::PRSCH3)
275    }
276    #[doc = "PRS Channel 4 selected as input"]
277    #[inline(always)]
278    pub fn prsch4(self) -> &'a mut W {
279        self.variant(PRSSTOPSEL_A::PRSCH4)
280    }
281    #[doc = "PRS Channel 5 selected as input"]
282    #[inline(always)]
283    pub fn prsch5(self) -> &'a mut W {
284        self.variant(PRSSTOPSEL_A::PRSCH5)
285    }
286    #[doc = "PRS Channel 6 selected as input"]
287    #[inline(always)]
288    pub fn prsch6(self) -> &'a mut W {
289        self.variant(PRSSTOPSEL_A::PRSCH6)
290    }
291    #[doc = "PRS Channel 7 selected as input"]
292    #[inline(always)]
293    pub fn prsch7(self) -> &'a mut W {
294        self.variant(PRSSTOPSEL_A::PRSCH7)
295    }
296}
297#[doc = "PRS Clear Select\n\nValue on reset: 0"]
298#[derive(Clone, Copy, Debug, PartialEq)]
299#[repr(u8)]
300pub enum PRSCLEARSEL_A {
301    #[doc = "0: PRS Channel 0 selected as input"]
302    PRSCH0 = 0,
303    #[doc = "1: PRS Channel 1 selected as input"]
304    PRSCH1 = 1,
305    #[doc = "2: PRS Channel 2 selected as input"]
306    PRSCH2 = 2,
307    #[doc = "3: PRS Channel 3 selected as input"]
308    PRSCH3 = 3,
309    #[doc = "4: PRS Channel 4 selected as input"]
310    PRSCH4 = 4,
311    #[doc = "5: PRS Channel 5 selected as input"]
312    PRSCH5 = 5,
313    #[doc = "6: PRS Channel 6 selected as input"]
314    PRSCH6 = 6,
315    #[doc = "7: PRS Channel 7 selected as input"]
316    PRSCH7 = 7,
317}
318impl From<PRSCLEARSEL_A> for u8 {
319    #[inline(always)]
320    fn from(variant: PRSCLEARSEL_A) -> Self {
321        variant as _
322    }
323}
324#[doc = "Field `PRSCLEARSEL` reader - PRS Clear Select"]
325pub type PRSCLEARSEL_R = crate::FieldReader<u8, PRSCLEARSEL_A>;
326impl PRSCLEARSEL_R {
327    #[doc = "Get enumerated values variant"]
328    #[inline(always)]
329    pub fn variant(&self) -> PRSCLEARSEL_A {
330        match self.bits {
331            0 => PRSCLEARSEL_A::PRSCH0,
332            1 => PRSCLEARSEL_A::PRSCH1,
333            2 => PRSCLEARSEL_A::PRSCH2,
334            3 => PRSCLEARSEL_A::PRSCH3,
335            4 => PRSCLEARSEL_A::PRSCH4,
336            5 => PRSCLEARSEL_A::PRSCH5,
337            6 => PRSCLEARSEL_A::PRSCH6,
338            7 => PRSCLEARSEL_A::PRSCH7,
339            _ => unreachable!(),
340        }
341    }
342    #[doc = "Checks if the value of the field is `PRSCH0`"]
343    #[inline(always)]
344    pub fn is_prsch0(&self) -> bool {
345        *self == PRSCLEARSEL_A::PRSCH0
346    }
347    #[doc = "Checks if the value of the field is `PRSCH1`"]
348    #[inline(always)]
349    pub fn is_prsch1(&self) -> bool {
350        *self == PRSCLEARSEL_A::PRSCH1
351    }
352    #[doc = "Checks if the value of the field is `PRSCH2`"]
353    #[inline(always)]
354    pub fn is_prsch2(&self) -> bool {
355        *self == PRSCLEARSEL_A::PRSCH2
356    }
357    #[doc = "Checks if the value of the field is `PRSCH3`"]
358    #[inline(always)]
359    pub fn is_prsch3(&self) -> bool {
360        *self == PRSCLEARSEL_A::PRSCH3
361    }
362    #[doc = "Checks if the value of the field is `PRSCH4`"]
363    #[inline(always)]
364    pub fn is_prsch4(&self) -> bool {
365        *self == PRSCLEARSEL_A::PRSCH4
366    }
367    #[doc = "Checks if the value of the field is `PRSCH5`"]
368    #[inline(always)]
369    pub fn is_prsch5(&self) -> bool {
370        *self == PRSCLEARSEL_A::PRSCH5
371    }
372    #[doc = "Checks if the value of the field is `PRSCH6`"]
373    #[inline(always)]
374    pub fn is_prsch6(&self) -> bool {
375        *self == PRSCLEARSEL_A::PRSCH6
376    }
377    #[doc = "Checks if the value of the field is `PRSCH7`"]
378    #[inline(always)]
379    pub fn is_prsch7(&self) -> bool {
380        *self == PRSCLEARSEL_A::PRSCH7
381    }
382}
383#[doc = "Field `PRSCLEARSEL` writer - PRS Clear Select"]
384pub type PRSCLEARSEL_W<'a> = crate::FieldWriterSafe<'a, u32, PRSSEL_SPEC, u8, PRSCLEARSEL_A, 3, 12>;
385impl<'a> PRSCLEARSEL_W<'a> {
386    #[doc = "PRS Channel 0 selected as input"]
387    #[inline(always)]
388    pub fn prsch0(self) -> &'a mut W {
389        self.variant(PRSCLEARSEL_A::PRSCH0)
390    }
391    #[doc = "PRS Channel 1 selected as input"]
392    #[inline(always)]
393    pub fn prsch1(self) -> &'a mut W {
394        self.variant(PRSCLEARSEL_A::PRSCH1)
395    }
396    #[doc = "PRS Channel 2 selected as input"]
397    #[inline(always)]
398    pub fn prsch2(self) -> &'a mut W {
399        self.variant(PRSCLEARSEL_A::PRSCH2)
400    }
401    #[doc = "PRS Channel 3 selected as input"]
402    #[inline(always)]
403    pub fn prsch3(self) -> &'a mut W {
404        self.variant(PRSCLEARSEL_A::PRSCH3)
405    }
406    #[doc = "PRS Channel 4 selected as input"]
407    #[inline(always)]
408    pub fn prsch4(self) -> &'a mut W {
409        self.variant(PRSCLEARSEL_A::PRSCH4)
410    }
411    #[doc = "PRS Channel 5 selected as input"]
412    #[inline(always)]
413    pub fn prsch5(self) -> &'a mut W {
414        self.variant(PRSCLEARSEL_A::PRSCH5)
415    }
416    #[doc = "PRS Channel 6 selected as input"]
417    #[inline(always)]
418    pub fn prsch6(self) -> &'a mut W {
419        self.variant(PRSCLEARSEL_A::PRSCH6)
420    }
421    #[doc = "PRS Channel 7 selected as input"]
422    #[inline(always)]
423    pub fn prsch7(self) -> &'a mut W {
424        self.variant(PRSCLEARSEL_A::PRSCH7)
425    }
426}
427#[doc = "PRS Start Mode\n\nValue on reset: 0"]
428#[derive(Clone, Copy, Debug, PartialEq)]
429#[repr(u8)]
430pub enum PRSSTARTMODE_A {
431    #[doc = "0: PRS cannot start the LETIMER"]
432    NONE = 0,
433    #[doc = "1: Rising edge of selected PRS input can start the LETIMER"]
434    RISING = 1,
435    #[doc = "2: Falling edge of selected PRS input can start the LETIMER"]
436    FALLING = 2,
437    #[doc = "3: Both the rising or falling edge of the selected PRS input can start the LETIMER"]
438    BOTH = 3,
439}
440impl From<PRSSTARTMODE_A> for u8 {
441    #[inline(always)]
442    fn from(variant: PRSSTARTMODE_A) -> Self {
443        variant as _
444    }
445}
446#[doc = "Field `PRSSTARTMODE` reader - PRS Start Mode"]
447pub type PRSSTARTMODE_R = crate::FieldReader<u8, PRSSTARTMODE_A>;
448impl PRSSTARTMODE_R {
449    #[doc = "Get enumerated values variant"]
450    #[inline(always)]
451    pub fn variant(&self) -> PRSSTARTMODE_A {
452        match self.bits {
453            0 => PRSSTARTMODE_A::NONE,
454            1 => PRSSTARTMODE_A::RISING,
455            2 => PRSSTARTMODE_A::FALLING,
456            3 => PRSSTARTMODE_A::BOTH,
457            _ => unreachable!(),
458        }
459    }
460    #[doc = "Checks if the value of the field is `NONE`"]
461    #[inline(always)]
462    pub fn is_none(&self) -> bool {
463        *self == PRSSTARTMODE_A::NONE
464    }
465    #[doc = "Checks if the value of the field is `RISING`"]
466    #[inline(always)]
467    pub fn is_rising(&self) -> bool {
468        *self == PRSSTARTMODE_A::RISING
469    }
470    #[doc = "Checks if the value of the field is `FALLING`"]
471    #[inline(always)]
472    pub fn is_falling(&self) -> bool {
473        *self == PRSSTARTMODE_A::FALLING
474    }
475    #[doc = "Checks if the value of the field is `BOTH`"]
476    #[inline(always)]
477    pub fn is_both(&self) -> bool {
478        *self == PRSSTARTMODE_A::BOTH
479    }
480}
481#[doc = "Field `PRSSTARTMODE` writer - PRS Start Mode"]
482pub type PRSSTARTMODE_W<'a> =
483    crate::FieldWriterSafe<'a, u32, PRSSEL_SPEC, u8, PRSSTARTMODE_A, 2, 18>;
484impl<'a> PRSSTARTMODE_W<'a> {
485    #[doc = "PRS cannot start the LETIMER"]
486    #[inline(always)]
487    pub fn none(self) -> &'a mut W {
488        self.variant(PRSSTARTMODE_A::NONE)
489    }
490    #[doc = "Rising edge of selected PRS input can start the LETIMER"]
491    #[inline(always)]
492    pub fn rising(self) -> &'a mut W {
493        self.variant(PRSSTARTMODE_A::RISING)
494    }
495    #[doc = "Falling edge of selected PRS input can start the LETIMER"]
496    #[inline(always)]
497    pub fn falling(self) -> &'a mut W {
498        self.variant(PRSSTARTMODE_A::FALLING)
499    }
500    #[doc = "Both the rising or falling edge of the selected PRS input can start the LETIMER"]
501    #[inline(always)]
502    pub fn both(self) -> &'a mut W {
503        self.variant(PRSSTARTMODE_A::BOTH)
504    }
505}
506#[doc = "PRS Stop Mode\n\nValue on reset: 0"]
507#[derive(Clone, Copy, Debug, PartialEq)]
508#[repr(u8)]
509pub enum PRSSTOPMODE_A {
510    #[doc = "0: PRS cannot stop the LETIMER"]
511    NONE = 0,
512    #[doc = "1: Rising edge of selected PRS input can stop the LETIMER"]
513    RISING = 1,
514    #[doc = "2: Falling edge of selected PRS input can stop the LETIMER"]
515    FALLING = 2,
516    #[doc = "3: Both the rising or falling edge of the selected PRS input can stop the LETIMER"]
517    BOTH = 3,
518}
519impl From<PRSSTOPMODE_A> for u8 {
520    #[inline(always)]
521    fn from(variant: PRSSTOPMODE_A) -> Self {
522        variant as _
523    }
524}
525#[doc = "Field `PRSSTOPMODE` reader - PRS Stop Mode"]
526pub type PRSSTOPMODE_R = crate::FieldReader<u8, PRSSTOPMODE_A>;
527impl PRSSTOPMODE_R {
528    #[doc = "Get enumerated values variant"]
529    #[inline(always)]
530    pub fn variant(&self) -> PRSSTOPMODE_A {
531        match self.bits {
532            0 => PRSSTOPMODE_A::NONE,
533            1 => PRSSTOPMODE_A::RISING,
534            2 => PRSSTOPMODE_A::FALLING,
535            3 => PRSSTOPMODE_A::BOTH,
536            _ => unreachable!(),
537        }
538    }
539    #[doc = "Checks if the value of the field is `NONE`"]
540    #[inline(always)]
541    pub fn is_none(&self) -> bool {
542        *self == PRSSTOPMODE_A::NONE
543    }
544    #[doc = "Checks if the value of the field is `RISING`"]
545    #[inline(always)]
546    pub fn is_rising(&self) -> bool {
547        *self == PRSSTOPMODE_A::RISING
548    }
549    #[doc = "Checks if the value of the field is `FALLING`"]
550    #[inline(always)]
551    pub fn is_falling(&self) -> bool {
552        *self == PRSSTOPMODE_A::FALLING
553    }
554    #[doc = "Checks if the value of the field is `BOTH`"]
555    #[inline(always)]
556    pub fn is_both(&self) -> bool {
557        *self == PRSSTOPMODE_A::BOTH
558    }
559}
560#[doc = "Field `PRSSTOPMODE` writer - PRS Stop Mode"]
561pub type PRSSTOPMODE_W<'a> = crate::FieldWriterSafe<'a, u32, PRSSEL_SPEC, u8, PRSSTOPMODE_A, 2, 22>;
562impl<'a> PRSSTOPMODE_W<'a> {
563    #[doc = "PRS cannot stop the LETIMER"]
564    #[inline(always)]
565    pub fn none(self) -> &'a mut W {
566        self.variant(PRSSTOPMODE_A::NONE)
567    }
568    #[doc = "Rising edge of selected PRS input can stop the LETIMER"]
569    #[inline(always)]
570    pub fn rising(self) -> &'a mut W {
571        self.variant(PRSSTOPMODE_A::RISING)
572    }
573    #[doc = "Falling edge of selected PRS input can stop the LETIMER"]
574    #[inline(always)]
575    pub fn falling(self) -> &'a mut W {
576        self.variant(PRSSTOPMODE_A::FALLING)
577    }
578    #[doc = "Both the rising or falling edge of the selected PRS input can stop the LETIMER"]
579    #[inline(always)]
580    pub fn both(self) -> &'a mut W {
581        self.variant(PRSSTOPMODE_A::BOTH)
582    }
583}
584#[doc = "PRS Clear Mode\n\nValue on reset: 0"]
585#[derive(Clone, Copy, Debug, PartialEq)]
586#[repr(u8)]
587pub enum PRSCLEARMODE_A {
588    #[doc = "0: PRS cannot clear the LETIMER"]
589    NONE = 0,
590    #[doc = "1: Rising edge of selected PRS input can clear the LETIMER"]
591    RISING = 1,
592    #[doc = "2: Falling edge of selected PRS input can clear the LETIMER"]
593    FALLING = 2,
594    #[doc = "3: Both the rising or falling edge of the selected PRS input can clear the LETIMER"]
595    BOTH = 3,
596}
597impl From<PRSCLEARMODE_A> for u8 {
598    #[inline(always)]
599    fn from(variant: PRSCLEARMODE_A) -> Self {
600        variant as _
601    }
602}
603#[doc = "Field `PRSCLEARMODE` reader - PRS Clear Mode"]
604pub type PRSCLEARMODE_R = crate::FieldReader<u8, PRSCLEARMODE_A>;
605impl PRSCLEARMODE_R {
606    #[doc = "Get enumerated values variant"]
607    #[inline(always)]
608    pub fn variant(&self) -> PRSCLEARMODE_A {
609        match self.bits {
610            0 => PRSCLEARMODE_A::NONE,
611            1 => PRSCLEARMODE_A::RISING,
612            2 => PRSCLEARMODE_A::FALLING,
613            3 => PRSCLEARMODE_A::BOTH,
614            _ => unreachable!(),
615        }
616    }
617    #[doc = "Checks if the value of the field is `NONE`"]
618    #[inline(always)]
619    pub fn is_none(&self) -> bool {
620        *self == PRSCLEARMODE_A::NONE
621    }
622    #[doc = "Checks if the value of the field is `RISING`"]
623    #[inline(always)]
624    pub fn is_rising(&self) -> bool {
625        *self == PRSCLEARMODE_A::RISING
626    }
627    #[doc = "Checks if the value of the field is `FALLING`"]
628    #[inline(always)]
629    pub fn is_falling(&self) -> bool {
630        *self == PRSCLEARMODE_A::FALLING
631    }
632    #[doc = "Checks if the value of the field is `BOTH`"]
633    #[inline(always)]
634    pub fn is_both(&self) -> bool {
635        *self == PRSCLEARMODE_A::BOTH
636    }
637}
638#[doc = "Field `PRSCLEARMODE` writer - PRS Clear Mode"]
639pub type PRSCLEARMODE_W<'a> =
640    crate::FieldWriterSafe<'a, u32, PRSSEL_SPEC, u8, PRSCLEARMODE_A, 2, 26>;
641impl<'a> PRSCLEARMODE_W<'a> {
642    #[doc = "PRS cannot clear the LETIMER"]
643    #[inline(always)]
644    pub fn none(self) -> &'a mut W {
645        self.variant(PRSCLEARMODE_A::NONE)
646    }
647    #[doc = "Rising edge of selected PRS input can clear the LETIMER"]
648    #[inline(always)]
649    pub fn rising(self) -> &'a mut W {
650        self.variant(PRSCLEARMODE_A::RISING)
651    }
652    #[doc = "Falling edge of selected PRS input can clear the LETIMER"]
653    #[inline(always)]
654    pub fn falling(self) -> &'a mut W {
655        self.variant(PRSCLEARMODE_A::FALLING)
656    }
657    #[doc = "Both the rising or falling edge of the selected PRS input can clear the LETIMER"]
658    #[inline(always)]
659    pub fn both(self) -> &'a mut W {
660        self.variant(PRSCLEARMODE_A::BOTH)
661    }
662}
663impl R {
664    #[doc = "Bits 0:2 - PRS Start Select"]
665    #[inline(always)]
666    pub fn prsstartsel(&self) -> PRSSTARTSEL_R {
667        PRSSTARTSEL_R::new((self.bits & 7) as u8)
668    }
669    #[doc = "Bits 6:8 - PRS Stop Select"]
670    #[inline(always)]
671    pub fn prsstopsel(&self) -> PRSSTOPSEL_R {
672        PRSSTOPSEL_R::new(((self.bits >> 6) & 7) as u8)
673    }
674    #[doc = "Bits 12:14 - PRS Clear Select"]
675    #[inline(always)]
676    pub fn prsclearsel(&self) -> PRSCLEARSEL_R {
677        PRSCLEARSEL_R::new(((self.bits >> 12) & 7) as u8)
678    }
679    #[doc = "Bits 18:19 - PRS Start Mode"]
680    #[inline(always)]
681    pub fn prsstartmode(&self) -> PRSSTARTMODE_R {
682        PRSSTARTMODE_R::new(((self.bits >> 18) & 3) as u8)
683    }
684    #[doc = "Bits 22:23 - PRS Stop Mode"]
685    #[inline(always)]
686    pub fn prsstopmode(&self) -> PRSSTOPMODE_R {
687        PRSSTOPMODE_R::new(((self.bits >> 22) & 3) as u8)
688    }
689    #[doc = "Bits 26:27 - PRS Clear Mode"]
690    #[inline(always)]
691    pub fn prsclearmode(&self) -> PRSCLEARMODE_R {
692        PRSCLEARMODE_R::new(((self.bits >> 26) & 3) as u8)
693    }
694}
695impl W {
696    #[doc = "Bits 0:2 - PRS Start Select"]
697    #[inline(always)]
698    pub fn prsstartsel(&mut self) -> PRSSTARTSEL_W {
699        PRSSTARTSEL_W::new(self)
700    }
701    #[doc = "Bits 6:8 - PRS Stop Select"]
702    #[inline(always)]
703    pub fn prsstopsel(&mut self) -> PRSSTOPSEL_W {
704        PRSSTOPSEL_W::new(self)
705    }
706    #[doc = "Bits 12:14 - PRS Clear Select"]
707    #[inline(always)]
708    pub fn prsclearsel(&mut self) -> PRSCLEARSEL_W {
709        PRSCLEARSEL_W::new(self)
710    }
711    #[doc = "Bits 18:19 - PRS Start Mode"]
712    #[inline(always)]
713    pub fn prsstartmode(&mut self) -> PRSSTARTMODE_W {
714        PRSSTARTMODE_W::new(self)
715    }
716    #[doc = "Bits 22:23 - PRS Stop Mode"]
717    #[inline(always)]
718    pub fn prsstopmode(&mut self) -> PRSSTOPMODE_W {
719        PRSSTOPMODE_W::new(self)
720    }
721    #[doc = "Bits 26:27 - PRS Clear Mode"]
722    #[inline(always)]
723    pub fn prsclearmode(&mut self) -> PRSCLEARMODE_W {
724        PRSCLEARMODE_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 = "PRS Input Select 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 [prssel](index.html) module"]
734pub struct PRSSEL_SPEC;
735impl crate::RegisterSpec for PRSSEL_SPEC {
736    type Ux = u32;
737}
738#[doc = "`read()` method returns [prssel::R](R) reader structure"]
739impl crate::Readable for PRSSEL_SPEC {
740    type Reader = R;
741}
742#[doc = "`write(|w| ..)` method takes [prssel::W](W) writer structure"]
743impl crate::Writable for PRSSEL_SPEC {
744    type Writer = W;
745}
746#[doc = "`reset()` method sets PRSSEL to value 0"]
747impl crate::Resettable for PRSSEL_SPEC {
748    #[inline(always)]
749    fn reset_value() -> Self::Ux {
750        0
751    }
752}