efm32pg22_pac/efm32pg22c200/letimer0_s/
ctrl.rs

1#[doc = "Register `CTRL` reader"]
2pub struct R(crate::R<CTRL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CTRL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CTRL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CTRL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CTRL` writer"]
17pub struct W(crate::W<CTRL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CTRL_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<CTRL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CTRL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `REPMODE` reader - Repeat Mode"]
38pub type REPMODE_R = crate::FieldReader<u8, REPMODE_A>;
39#[doc = "Repeat Mode\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41#[repr(u8)]
42pub enum REPMODE_A {
43    #[doc = "0: When started, the LETIMER counts down until it is stopped by software"]
44    FREE = 0,
45    #[doc = "1: The counter counts REP0 times. When REP0 reaches zero, the counter stops"]
46    ONESHOT = 1,
47    #[doc = "2: The counter counts REP0 times. If REP1 has been written, it is loaded into REP0 when REP0 reaches zero, otherwise the counter stops"]
48    BUFFERED = 2,
49    #[doc = "3: Both REP0 and REP1 are decremented when the LETIMER wraps around. The LETIMER counts until both REP0 and REP1 are zero"]
50    DOUBLE = 3,
51}
52impl From<REPMODE_A> for u8 {
53    #[inline(always)]
54    fn from(variant: REPMODE_A) -> Self {
55        variant as _
56    }
57}
58impl REPMODE_R {
59    #[doc = "Get enumerated values variant"]
60    #[inline(always)]
61    pub fn variant(&self) -> REPMODE_A {
62        match self.bits {
63            0 => REPMODE_A::FREE,
64            1 => REPMODE_A::ONESHOT,
65            2 => REPMODE_A::BUFFERED,
66            3 => REPMODE_A::DOUBLE,
67            _ => unreachable!(),
68        }
69    }
70    #[doc = "Checks if the value of the field is `FREE`"]
71    #[inline(always)]
72    pub fn is_free(&self) -> bool {
73        *self == REPMODE_A::FREE
74    }
75    #[doc = "Checks if the value of the field is `ONESHOT`"]
76    #[inline(always)]
77    pub fn is_oneshot(&self) -> bool {
78        *self == REPMODE_A::ONESHOT
79    }
80    #[doc = "Checks if the value of the field is `BUFFERED`"]
81    #[inline(always)]
82    pub fn is_buffered(&self) -> bool {
83        *self == REPMODE_A::BUFFERED
84    }
85    #[doc = "Checks if the value of the field is `DOUBLE`"]
86    #[inline(always)]
87    pub fn is_double(&self) -> bool {
88        *self == REPMODE_A::DOUBLE
89    }
90}
91#[doc = "Field `REPMODE` writer - Repeat Mode"]
92pub type REPMODE_W<'a, const O: u8> =
93    crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, REPMODE_A, 2, O>;
94impl<'a, const O: u8> REPMODE_W<'a, O> {
95    #[doc = "When started, the LETIMER counts down until it is stopped by software"]
96    #[inline(always)]
97    pub fn free(self) -> &'a mut W {
98        self.variant(REPMODE_A::FREE)
99    }
100    #[doc = "The counter counts REP0 times. When REP0 reaches zero, the counter stops"]
101    #[inline(always)]
102    pub fn oneshot(self) -> &'a mut W {
103        self.variant(REPMODE_A::ONESHOT)
104    }
105    #[doc = "The counter counts REP0 times. If REP1 has been written, it is loaded into REP0 when REP0 reaches zero, otherwise the counter stops"]
106    #[inline(always)]
107    pub fn buffered(self) -> &'a mut W {
108        self.variant(REPMODE_A::BUFFERED)
109    }
110    #[doc = "Both REP0 and REP1 are decremented when the LETIMER wraps around. The LETIMER counts until both REP0 and REP1 are zero"]
111    #[inline(always)]
112    pub fn double(self) -> &'a mut W {
113        self.variant(REPMODE_A::DOUBLE)
114    }
115}
116#[doc = "Field `UFOA0` reader - Underflow Output Action 0"]
117pub type UFOA0_R = crate::FieldReader<u8, UFOA0_A>;
118#[doc = "Underflow Output Action 0\n\nValue on reset: 0"]
119#[derive(Clone, Copy, Debug, PartialEq, Eq)]
120#[repr(u8)]
121pub enum UFOA0_A {
122    #[doc = "0: LETIMERn_OUT0 is held at its idle value as defined by OPOL0"]
123    NONE = 0,
124    #[doc = "1: LETIMERn_OUT0 is toggled on CNT underflow"]
125    TOGGLE = 1,
126    #[doc = "2: LETIMERn_OUT0 is held active for one LETIMER0 clock cycle on CNT underflow. The output then returns to its idle value as defined by OPOL0"]
127    PULSE = 2,
128    #[doc = "3: LETIMERn_OUT0 is set idle on CNT underflow, and active on compare match with COMP1"]
129    PWM = 3,
130}
131impl From<UFOA0_A> for u8 {
132    #[inline(always)]
133    fn from(variant: UFOA0_A) -> Self {
134        variant as _
135    }
136}
137impl UFOA0_R {
138    #[doc = "Get enumerated values variant"]
139    #[inline(always)]
140    pub fn variant(&self) -> UFOA0_A {
141        match self.bits {
142            0 => UFOA0_A::NONE,
143            1 => UFOA0_A::TOGGLE,
144            2 => UFOA0_A::PULSE,
145            3 => UFOA0_A::PWM,
146            _ => unreachable!(),
147        }
148    }
149    #[doc = "Checks if the value of the field is `NONE`"]
150    #[inline(always)]
151    pub fn is_none(&self) -> bool {
152        *self == UFOA0_A::NONE
153    }
154    #[doc = "Checks if the value of the field is `TOGGLE`"]
155    #[inline(always)]
156    pub fn is_toggle(&self) -> bool {
157        *self == UFOA0_A::TOGGLE
158    }
159    #[doc = "Checks if the value of the field is `PULSE`"]
160    #[inline(always)]
161    pub fn is_pulse(&self) -> bool {
162        *self == UFOA0_A::PULSE
163    }
164    #[doc = "Checks if the value of the field is `PWM`"]
165    #[inline(always)]
166    pub fn is_pwm(&self) -> bool {
167        *self == UFOA0_A::PWM
168    }
169}
170#[doc = "Field `UFOA0` writer - Underflow Output Action 0"]
171pub type UFOA0_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, UFOA0_A, 2, O>;
172impl<'a, const O: u8> UFOA0_W<'a, O> {
173    #[doc = "LETIMERn_OUT0 is held at its idle value as defined by OPOL0"]
174    #[inline(always)]
175    pub fn none(self) -> &'a mut W {
176        self.variant(UFOA0_A::NONE)
177    }
178    #[doc = "LETIMERn_OUT0 is toggled on CNT underflow"]
179    #[inline(always)]
180    pub fn toggle(self) -> &'a mut W {
181        self.variant(UFOA0_A::TOGGLE)
182    }
183    #[doc = "LETIMERn_OUT0 is held active for one LETIMER0 clock cycle on CNT underflow. The output then returns to its idle value as defined by OPOL0"]
184    #[inline(always)]
185    pub fn pulse(self) -> &'a mut W {
186        self.variant(UFOA0_A::PULSE)
187    }
188    #[doc = "LETIMERn_OUT0 is set idle on CNT underflow, and active on compare match with COMP1"]
189    #[inline(always)]
190    pub fn pwm(self) -> &'a mut W {
191        self.variant(UFOA0_A::PWM)
192    }
193}
194#[doc = "Field `UFOA1` reader - Underflow Output Action 1"]
195pub type UFOA1_R = crate::FieldReader<u8, UFOA1_A>;
196#[doc = "Underflow Output Action 1\n\nValue on reset: 0"]
197#[derive(Clone, Copy, Debug, PartialEq, Eq)]
198#[repr(u8)]
199pub enum UFOA1_A {
200    #[doc = "0: LETIMERn_OUT1 is held at its idle value as defined by OPOL1"]
201    NONE = 0,
202    #[doc = "1: LETIMERn_OUT1 is toggled on CNT underflow"]
203    TOGGLE = 1,
204    #[doc = "2: LETIMERn_OUT1 is held active for one LETIMER0 clock cycle on CNT underflow. The output then returns to its idle value as defined by OPOL1"]
205    PULSE = 2,
206    #[doc = "3: LETIMERn_OUT1 is set idle on CNT underflow, and active on compare match with COMP1"]
207    PWM = 3,
208}
209impl From<UFOA1_A> for u8 {
210    #[inline(always)]
211    fn from(variant: UFOA1_A) -> Self {
212        variant as _
213    }
214}
215impl UFOA1_R {
216    #[doc = "Get enumerated values variant"]
217    #[inline(always)]
218    pub fn variant(&self) -> UFOA1_A {
219        match self.bits {
220            0 => UFOA1_A::NONE,
221            1 => UFOA1_A::TOGGLE,
222            2 => UFOA1_A::PULSE,
223            3 => UFOA1_A::PWM,
224            _ => unreachable!(),
225        }
226    }
227    #[doc = "Checks if the value of the field is `NONE`"]
228    #[inline(always)]
229    pub fn is_none(&self) -> bool {
230        *self == UFOA1_A::NONE
231    }
232    #[doc = "Checks if the value of the field is `TOGGLE`"]
233    #[inline(always)]
234    pub fn is_toggle(&self) -> bool {
235        *self == UFOA1_A::TOGGLE
236    }
237    #[doc = "Checks if the value of the field is `PULSE`"]
238    #[inline(always)]
239    pub fn is_pulse(&self) -> bool {
240        *self == UFOA1_A::PULSE
241    }
242    #[doc = "Checks if the value of the field is `PWM`"]
243    #[inline(always)]
244    pub fn is_pwm(&self) -> bool {
245        *self == UFOA1_A::PWM
246    }
247}
248#[doc = "Field `UFOA1` writer - Underflow Output Action 1"]
249pub type UFOA1_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, UFOA1_A, 2, O>;
250impl<'a, const O: u8> UFOA1_W<'a, O> {
251    #[doc = "LETIMERn_OUT1 is held at its idle value as defined by OPOL1"]
252    #[inline(always)]
253    pub fn none(self) -> &'a mut W {
254        self.variant(UFOA1_A::NONE)
255    }
256    #[doc = "LETIMERn_OUT1 is toggled on CNT underflow"]
257    #[inline(always)]
258    pub fn toggle(self) -> &'a mut W {
259        self.variant(UFOA1_A::TOGGLE)
260    }
261    #[doc = "LETIMERn_OUT1 is held active for one LETIMER0 clock cycle on CNT underflow. The output then returns to its idle value as defined by OPOL1"]
262    #[inline(always)]
263    pub fn pulse(self) -> &'a mut W {
264        self.variant(UFOA1_A::PULSE)
265    }
266    #[doc = "LETIMERn_OUT1 is set idle on CNT underflow, and active on compare match with COMP1"]
267    #[inline(always)]
268    pub fn pwm(self) -> &'a mut W {
269        self.variant(UFOA1_A::PWM)
270    }
271}
272#[doc = "Field `OPOL0` reader - Output 0 Polarity"]
273pub type OPOL0_R = crate::BitReader<bool>;
274#[doc = "Field `OPOL0` writer - Output 0 Polarity"]
275pub type OPOL0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
276#[doc = "Field `OPOL1` reader - Output 1 Polarity"]
277pub type OPOL1_R = crate::BitReader<bool>;
278#[doc = "Field `OPOL1` writer - Output 1 Polarity"]
279pub type OPOL1_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
280#[doc = "Field `BUFTOP` reader - Buffered Top"]
281pub type BUFTOP_R = crate::BitReader<BUFTOP_A>;
282#[doc = "Buffered Top\n\nValue on reset: 0"]
283#[derive(Clone, Copy, Debug, PartialEq, Eq)]
284pub enum BUFTOP_A {
285    #[doc = "0: TOP is only written by software"]
286    DISABLE = 0,
287    #[doc = "1: TOP is set to TOPBUFF value when REP0 reaches 0"]
288    ENABLE = 1,
289}
290impl From<BUFTOP_A> for bool {
291    #[inline(always)]
292    fn from(variant: BUFTOP_A) -> Self {
293        variant as u8 != 0
294    }
295}
296impl BUFTOP_R {
297    #[doc = "Get enumerated values variant"]
298    #[inline(always)]
299    pub fn variant(&self) -> BUFTOP_A {
300        match self.bits {
301            false => BUFTOP_A::DISABLE,
302            true => BUFTOP_A::ENABLE,
303        }
304    }
305    #[doc = "Checks if the value of the field is `DISABLE`"]
306    #[inline(always)]
307    pub fn is_disable(&self) -> bool {
308        *self == BUFTOP_A::DISABLE
309    }
310    #[doc = "Checks if the value of the field is `ENABLE`"]
311    #[inline(always)]
312    pub fn is_enable(&self) -> bool {
313        *self == BUFTOP_A::ENABLE
314    }
315}
316#[doc = "Field `BUFTOP` writer - Buffered Top"]
317pub type BUFTOP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, BUFTOP_A, O>;
318impl<'a, const O: u8> BUFTOP_W<'a, O> {
319    #[doc = "TOP is only written by software"]
320    #[inline(always)]
321    pub fn disable(self) -> &'a mut W {
322        self.variant(BUFTOP_A::DISABLE)
323    }
324    #[doc = "TOP is set to TOPBUFF value when REP0 reaches 0"]
325    #[inline(always)]
326    pub fn enable(self) -> &'a mut W {
327        self.variant(BUFTOP_A::ENABLE)
328    }
329}
330#[doc = "Field `CNTTOPEN` reader - Compare Value 0 Is Top Value"]
331pub type CNTTOPEN_R = crate::BitReader<CNTTOPEN_A>;
332#[doc = "Compare Value 0 Is Top Value\n\nValue on reset: 0"]
333#[derive(Clone, Copy, Debug, PartialEq, Eq)]
334pub enum CNTTOPEN_A {
335    #[doc = "0: The top value of the LETIMER is 16777215 (0xFFFFFF)"]
336    DISABLE = 0,
337    #[doc = "1: The top value of the LETIMER is given by TOP"]
338    ENABLE = 1,
339}
340impl From<CNTTOPEN_A> for bool {
341    #[inline(always)]
342    fn from(variant: CNTTOPEN_A) -> Self {
343        variant as u8 != 0
344    }
345}
346impl CNTTOPEN_R {
347    #[doc = "Get enumerated values variant"]
348    #[inline(always)]
349    pub fn variant(&self) -> CNTTOPEN_A {
350        match self.bits {
351            false => CNTTOPEN_A::DISABLE,
352            true => CNTTOPEN_A::ENABLE,
353        }
354    }
355    #[doc = "Checks if the value of the field is `DISABLE`"]
356    #[inline(always)]
357    pub fn is_disable(&self) -> bool {
358        *self == CNTTOPEN_A::DISABLE
359    }
360    #[doc = "Checks if the value of the field is `ENABLE`"]
361    #[inline(always)]
362    pub fn is_enable(&self) -> bool {
363        *self == CNTTOPEN_A::ENABLE
364    }
365}
366#[doc = "Field `CNTTOPEN` writer - Compare Value 0 Is Top Value"]
367pub type CNTTOPEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, CNTTOPEN_A, O>;
368impl<'a, const O: u8> CNTTOPEN_W<'a, O> {
369    #[doc = "The top value of the LETIMER is 16777215 (0xFFFFFF)"]
370    #[inline(always)]
371    pub fn disable(self) -> &'a mut W {
372        self.variant(CNTTOPEN_A::DISABLE)
373    }
374    #[doc = "The top value of the LETIMER is given by TOP"]
375    #[inline(always)]
376    pub fn enable(self) -> &'a mut W {
377        self.variant(CNTTOPEN_A::ENABLE)
378    }
379}
380#[doc = "Field `DEBUGRUN` reader - Debug Mode Run Enable"]
381pub type DEBUGRUN_R = crate::BitReader<DEBUGRUN_A>;
382#[doc = "Debug Mode Run Enable\n\nValue on reset: 0"]
383#[derive(Clone, Copy, Debug, PartialEq, Eq)]
384pub enum DEBUGRUN_A {
385    #[doc = "0: LETIMER is frozen in debug mode"]
386    DISABLE = 0,
387    #[doc = "1: LETIMER is running in debug mode"]
388    ENABLE = 1,
389}
390impl From<DEBUGRUN_A> for bool {
391    #[inline(always)]
392    fn from(variant: DEBUGRUN_A) -> Self {
393        variant as u8 != 0
394    }
395}
396impl DEBUGRUN_R {
397    #[doc = "Get enumerated values variant"]
398    #[inline(always)]
399    pub fn variant(&self) -> DEBUGRUN_A {
400        match self.bits {
401            false => DEBUGRUN_A::DISABLE,
402            true => DEBUGRUN_A::ENABLE,
403        }
404    }
405    #[doc = "Checks if the value of the field is `DISABLE`"]
406    #[inline(always)]
407    pub fn is_disable(&self) -> bool {
408        *self == DEBUGRUN_A::DISABLE
409    }
410    #[doc = "Checks if the value of the field is `ENABLE`"]
411    #[inline(always)]
412    pub fn is_enable(&self) -> bool {
413        *self == DEBUGRUN_A::ENABLE
414    }
415}
416#[doc = "Field `DEBUGRUN` writer - Debug Mode Run Enable"]
417pub type DEBUGRUN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, DEBUGRUN_A, O>;
418impl<'a, const O: u8> DEBUGRUN_W<'a, O> {
419    #[doc = "LETIMER is frozen in debug mode"]
420    #[inline(always)]
421    pub fn disable(self) -> &'a mut W {
422        self.variant(DEBUGRUN_A::DISABLE)
423    }
424    #[doc = "LETIMER is running in debug mode"]
425    #[inline(always)]
426    pub fn enable(self) -> &'a mut W {
427        self.variant(DEBUGRUN_A::ENABLE)
428    }
429}
430#[doc = "Field `CNTPRESC` reader - Counter prescaler value"]
431pub type CNTPRESC_R = crate::FieldReader<u8, CNTPRESC_A>;
432#[doc = "Counter prescaler value\n\nValue on reset: 0"]
433#[derive(Clone, Copy, Debug, PartialEq, Eq)]
434#[repr(u8)]
435pub enum CNTPRESC_A {
436    #[doc = "0: CLK_CNT = (LETIMER LF CLK)/1"]
437    DIV1 = 0,
438    #[doc = "1: CLK_CNT = (LETIMER LF CLK)/2"]
439    DIV2 = 1,
440    #[doc = "2: CLK_CNT = (LETIMER LF CLK)/4"]
441    DIV4 = 2,
442    #[doc = "3: CLK_CNT = (LETIMER LF CLK)/8"]
443    DIV8 = 3,
444    #[doc = "4: CLK_CNT = (LETIMER LF CLK)/16"]
445    DIV16 = 4,
446    #[doc = "5: CLK_CNT = (LETIMER LF CLK)/32"]
447    DIV32 = 5,
448    #[doc = "6: CLK_CNT = (LETIMER LF CLK)/64"]
449    DIV64 = 6,
450    #[doc = "7: CLK_CNT = (LETIMER LF CLK)/128"]
451    DIV128 = 7,
452    #[doc = "8: CLK_CNT = (LETIMER LF CLK)/256"]
453    DIV256 = 8,
454}
455impl From<CNTPRESC_A> for u8 {
456    #[inline(always)]
457    fn from(variant: CNTPRESC_A) -> Self {
458        variant as _
459    }
460}
461impl CNTPRESC_R {
462    #[doc = "Get enumerated values variant"]
463    #[inline(always)]
464    pub fn variant(&self) -> Option<CNTPRESC_A> {
465        match self.bits {
466            0 => Some(CNTPRESC_A::DIV1),
467            1 => Some(CNTPRESC_A::DIV2),
468            2 => Some(CNTPRESC_A::DIV4),
469            3 => Some(CNTPRESC_A::DIV8),
470            4 => Some(CNTPRESC_A::DIV16),
471            5 => Some(CNTPRESC_A::DIV32),
472            6 => Some(CNTPRESC_A::DIV64),
473            7 => Some(CNTPRESC_A::DIV128),
474            8 => Some(CNTPRESC_A::DIV256),
475            _ => None,
476        }
477    }
478    #[doc = "Checks if the value of the field is `DIV1`"]
479    #[inline(always)]
480    pub fn is_div1(&self) -> bool {
481        *self == CNTPRESC_A::DIV1
482    }
483    #[doc = "Checks if the value of the field is `DIV2`"]
484    #[inline(always)]
485    pub fn is_div2(&self) -> bool {
486        *self == CNTPRESC_A::DIV2
487    }
488    #[doc = "Checks if the value of the field is `DIV4`"]
489    #[inline(always)]
490    pub fn is_div4(&self) -> bool {
491        *self == CNTPRESC_A::DIV4
492    }
493    #[doc = "Checks if the value of the field is `DIV8`"]
494    #[inline(always)]
495    pub fn is_div8(&self) -> bool {
496        *self == CNTPRESC_A::DIV8
497    }
498    #[doc = "Checks if the value of the field is `DIV16`"]
499    #[inline(always)]
500    pub fn is_div16(&self) -> bool {
501        *self == CNTPRESC_A::DIV16
502    }
503    #[doc = "Checks if the value of the field is `DIV32`"]
504    #[inline(always)]
505    pub fn is_div32(&self) -> bool {
506        *self == CNTPRESC_A::DIV32
507    }
508    #[doc = "Checks if the value of the field is `DIV64`"]
509    #[inline(always)]
510    pub fn is_div64(&self) -> bool {
511        *self == CNTPRESC_A::DIV64
512    }
513    #[doc = "Checks if the value of the field is `DIV128`"]
514    #[inline(always)]
515    pub fn is_div128(&self) -> bool {
516        *self == CNTPRESC_A::DIV128
517    }
518    #[doc = "Checks if the value of the field is `DIV256`"]
519    #[inline(always)]
520    pub fn is_div256(&self) -> bool {
521        *self == CNTPRESC_A::DIV256
522    }
523}
524#[doc = "Field `CNTPRESC` writer - Counter prescaler value"]
525pub type CNTPRESC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, CNTPRESC_A, 4, O>;
526impl<'a, const O: u8> CNTPRESC_W<'a, O> {
527    #[doc = "CLK_CNT = (LETIMER LF CLK)/1"]
528    #[inline(always)]
529    pub fn div1(self) -> &'a mut W {
530        self.variant(CNTPRESC_A::DIV1)
531    }
532    #[doc = "CLK_CNT = (LETIMER LF CLK)/2"]
533    #[inline(always)]
534    pub fn div2(self) -> &'a mut W {
535        self.variant(CNTPRESC_A::DIV2)
536    }
537    #[doc = "CLK_CNT = (LETIMER LF CLK)/4"]
538    #[inline(always)]
539    pub fn div4(self) -> &'a mut W {
540        self.variant(CNTPRESC_A::DIV4)
541    }
542    #[doc = "CLK_CNT = (LETIMER LF CLK)/8"]
543    #[inline(always)]
544    pub fn div8(self) -> &'a mut W {
545        self.variant(CNTPRESC_A::DIV8)
546    }
547    #[doc = "CLK_CNT = (LETIMER LF CLK)/16"]
548    #[inline(always)]
549    pub fn div16(self) -> &'a mut W {
550        self.variant(CNTPRESC_A::DIV16)
551    }
552    #[doc = "CLK_CNT = (LETIMER LF CLK)/32"]
553    #[inline(always)]
554    pub fn div32(self) -> &'a mut W {
555        self.variant(CNTPRESC_A::DIV32)
556    }
557    #[doc = "CLK_CNT = (LETIMER LF CLK)/64"]
558    #[inline(always)]
559    pub fn div64(self) -> &'a mut W {
560        self.variant(CNTPRESC_A::DIV64)
561    }
562    #[doc = "CLK_CNT = (LETIMER LF CLK)/128"]
563    #[inline(always)]
564    pub fn div128(self) -> &'a mut W {
565        self.variant(CNTPRESC_A::DIV128)
566    }
567    #[doc = "CLK_CNT = (LETIMER LF CLK)/256"]
568    #[inline(always)]
569    pub fn div256(self) -> &'a mut W {
570        self.variant(CNTPRESC_A::DIV256)
571    }
572}
573impl R {
574    #[doc = "Bits 0:1 - Repeat Mode"]
575    #[inline(always)]
576    pub fn repmode(&self) -> REPMODE_R {
577        REPMODE_R::new((self.bits & 3) as u8)
578    }
579    #[doc = "Bits 2:3 - Underflow Output Action 0"]
580    #[inline(always)]
581    pub fn ufoa0(&self) -> UFOA0_R {
582        UFOA0_R::new(((self.bits >> 2) & 3) as u8)
583    }
584    #[doc = "Bits 4:5 - Underflow Output Action 1"]
585    #[inline(always)]
586    pub fn ufoa1(&self) -> UFOA1_R {
587        UFOA1_R::new(((self.bits >> 4) & 3) as u8)
588    }
589    #[doc = "Bit 6 - Output 0 Polarity"]
590    #[inline(always)]
591    pub fn opol0(&self) -> OPOL0_R {
592        OPOL0_R::new(((self.bits >> 6) & 1) != 0)
593    }
594    #[doc = "Bit 7 - Output 1 Polarity"]
595    #[inline(always)]
596    pub fn opol1(&self) -> OPOL1_R {
597        OPOL1_R::new(((self.bits >> 7) & 1) != 0)
598    }
599    #[doc = "Bit 8 - Buffered Top"]
600    #[inline(always)]
601    pub fn buftop(&self) -> BUFTOP_R {
602        BUFTOP_R::new(((self.bits >> 8) & 1) != 0)
603    }
604    #[doc = "Bit 9 - Compare Value 0 Is Top Value"]
605    #[inline(always)]
606    pub fn cnttopen(&self) -> CNTTOPEN_R {
607        CNTTOPEN_R::new(((self.bits >> 9) & 1) != 0)
608    }
609    #[doc = "Bit 12 - Debug Mode Run Enable"]
610    #[inline(always)]
611    pub fn debugrun(&self) -> DEBUGRUN_R {
612        DEBUGRUN_R::new(((self.bits >> 12) & 1) != 0)
613    }
614    #[doc = "Bits 16:19 - Counter prescaler value"]
615    #[inline(always)]
616    pub fn cntpresc(&self) -> CNTPRESC_R {
617        CNTPRESC_R::new(((self.bits >> 16) & 0x0f) as u8)
618    }
619}
620impl W {
621    #[doc = "Bits 0:1 - Repeat Mode"]
622    #[inline(always)]
623    #[must_use]
624    pub fn repmode(&mut self) -> REPMODE_W<0> {
625        REPMODE_W::new(self)
626    }
627    #[doc = "Bits 2:3 - Underflow Output Action 0"]
628    #[inline(always)]
629    #[must_use]
630    pub fn ufoa0(&mut self) -> UFOA0_W<2> {
631        UFOA0_W::new(self)
632    }
633    #[doc = "Bits 4:5 - Underflow Output Action 1"]
634    #[inline(always)]
635    #[must_use]
636    pub fn ufoa1(&mut self) -> UFOA1_W<4> {
637        UFOA1_W::new(self)
638    }
639    #[doc = "Bit 6 - Output 0 Polarity"]
640    #[inline(always)]
641    #[must_use]
642    pub fn opol0(&mut self) -> OPOL0_W<6> {
643        OPOL0_W::new(self)
644    }
645    #[doc = "Bit 7 - Output 1 Polarity"]
646    #[inline(always)]
647    #[must_use]
648    pub fn opol1(&mut self) -> OPOL1_W<7> {
649        OPOL1_W::new(self)
650    }
651    #[doc = "Bit 8 - Buffered Top"]
652    #[inline(always)]
653    #[must_use]
654    pub fn buftop(&mut self) -> BUFTOP_W<8> {
655        BUFTOP_W::new(self)
656    }
657    #[doc = "Bit 9 - Compare Value 0 Is Top Value"]
658    #[inline(always)]
659    #[must_use]
660    pub fn cnttopen(&mut self) -> CNTTOPEN_W<9> {
661        CNTTOPEN_W::new(self)
662    }
663    #[doc = "Bit 12 - Debug Mode Run Enable"]
664    #[inline(always)]
665    #[must_use]
666    pub fn debugrun(&mut self) -> DEBUGRUN_W<12> {
667        DEBUGRUN_W::new(self)
668    }
669    #[doc = "Bits 16:19 - Counter prescaler value"]
670    #[inline(always)]
671    #[must_use]
672    pub fn cntpresc(&mut self) -> CNTPRESC_W<16> {
673        CNTPRESC_W::new(self)
674    }
675    #[doc = "Writes raw bits to the register."]
676    #[inline(always)]
677    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
678        self.0.bits(bits);
679        self
680    }
681}
682#[doc = "No Description\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 [ctrl](index.html) module"]
683pub struct CTRL_SPEC;
684impl crate::RegisterSpec for CTRL_SPEC {
685    type Ux = u32;
686}
687#[doc = "`read()` method returns [ctrl::R](R) reader structure"]
688impl crate::Readable for CTRL_SPEC {
689    type Reader = R;
690}
691#[doc = "`write(|w| ..)` method takes [ctrl::W](W) writer structure"]
692impl crate::Writable for CTRL_SPEC {
693    type Writer = W;
694    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
695    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
696}
697#[doc = "`reset()` method sets CTRL to value 0"]
698impl crate::Resettable for CTRL_SPEC {
699    const RESET_VALUE: Self::Ux = 0;
700}