efm32g230_pac/timer0/
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 = "Timer Mode\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39#[repr(u8)]
40pub enum MODE_A {
41    #[doc = "0: Up-count mode"]
42    UP = 0,
43    #[doc = "1: Down-count mode"]
44    DOWN = 1,
45    #[doc = "2: Up/down-count mode"]
46    UPDOWN = 2,
47    #[doc = "3: Quadrature decoder mode"]
48    QDEC = 3,
49}
50impl From<MODE_A> for u8 {
51    #[inline(always)]
52    fn from(variant: MODE_A) -> Self {
53        variant as _
54    }
55}
56#[doc = "Field `MODE` reader - Timer Mode"]
57pub type MODE_R = crate::FieldReader<u8, MODE_A>;
58impl MODE_R {
59    #[doc = "Get enumerated values variant"]
60    #[inline(always)]
61    pub fn variant(&self) -> MODE_A {
62        match self.bits {
63            0 => MODE_A::UP,
64            1 => MODE_A::DOWN,
65            2 => MODE_A::UPDOWN,
66            3 => MODE_A::QDEC,
67            _ => unreachable!(),
68        }
69    }
70    #[doc = "Checks if the value of the field is `UP`"]
71    #[inline(always)]
72    pub fn is_up(&self) -> bool {
73        *self == MODE_A::UP
74    }
75    #[doc = "Checks if the value of the field is `DOWN`"]
76    #[inline(always)]
77    pub fn is_down(&self) -> bool {
78        *self == MODE_A::DOWN
79    }
80    #[doc = "Checks if the value of the field is `UPDOWN`"]
81    #[inline(always)]
82    pub fn is_updown(&self) -> bool {
83        *self == MODE_A::UPDOWN
84    }
85    #[doc = "Checks if the value of the field is `QDEC`"]
86    #[inline(always)]
87    pub fn is_qdec(&self) -> bool {
88        *self == MODE_A::QDEC
89    }
90}
91#[doc = "Field `MODE` writer - Timer Mode"]
92pub type MODE_W<'a> = crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, MODE_A, 2, 0>;
93impl<'a> MODE_W<'a> {
94    #[doc = "Up-count mode"]
95    #[inline(always)]
96    pub fn up(self) -> &'a mut W {
97        self.variant(MODE_A::UP)
98    }
99    #[doc = "Down-count mode"]
100    #[inline(always)]
101    pub fn down(self) -> &'a mut W {
102        self.variant(MODE_A::DOWN)
103    }
104    #[doc = "Up/down-count mode"]
105    #[inline(always)]
106    pub fn updown(self) -> &'a mut W {
107        self.variant(MODE_A::UPDOWN)
108    }
109    #[doc = "Quadrature decoder mode"]
110    #[inline(always)]
111    pub fn qdec(self) -> &'a mut W {
112        self.variant(MODE_A::QDEC)
113    }
114}
115#[doc = "Field `SYNC` reader - Timer Start/Stop/Reload Synchronization"]
116pub type SYNC_R = crate::BitReader<bool>;
117#[doc = "Field `SYNC` writer - Timer Start/Stop/Reload Synchronization"]
118pub type SYNC_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 3>;
119#[doc = "Field `OSMEN` reader - One-shot Mode Enable"]
120pub type OSMEN_R = crate::BitReader<bool>;
121#[doc = "Field `OSMEN` writer - One-shot Mode Enable"]
122pub type OSMEN_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 4>;
123#[doc = "Field `QDM` reader - Quadrature Decoder Mode Selection"]
124pub type QDM_R = crate::BitReader<bool>;
125#[doc = "Field `QDM` writer - Quadrature Decoder Mode Selection"]
126pub type QDM_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 5>;
127#[doc = "Field `DEBUGRUN` reader - Debug Mode Run Enable"]
128pub type DEBUGRUN_R = crate::BitReader<bool>;
129#[doc = "Field `DEBUGRUN` writer - Debug Mode Run Enable"]
130pub type DEBUGRUN_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 6>;
131#[doc = "Field `DMACLRACT` reader - DMA Request Clear on Active"]
132pub type DMACLRACT_R = crate::BitReader<bool>;
133#[doc = "Field `DMACLRACT` writer - DMA Request Clear on Active"]
134pub type DMACLRACT_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 7>;
135#[doc = "Timer Rising Input Edge Action\n\nValue on reset: 0"]
136#[derive(Clone, Copy, Debug, PartialEq)]
137#[repr(u8)]
138pub enum RISEA_A {
139    #[doc = "0: No action"]
140    NONE = 0,
141    #[doc = "1: Start counter without reload"]
142    START = 1,
143    #[doc = "2: Stop counter without reload"]
144    STOP = 2,
145    #[doc = "3: Reload and start counter"]
146    RELOADSTART = 3,
147}
148impl From<RISEA_A> for u8 {
149    #[inline(always)]
150    fn from(variant: RISEA_A) -> Self {
151        variant as _
152    }
153}
154#[doc = "Field `RISEA` reader - Timer Rising Input Edge Action"]
155pub type RISEA_R = crate::FieldReader<u8, RISEA_A>;
156impl RISEA_R {
157    #[doc = "Get enumerated values variant"]
158    #[inline(always)]
159    pub fn variant(&self) -> RISEA_A {
160        match self.bits {
161            0 => RISEA_A::NONE,
162            1 => RISEA_A::START,
163            2 => RISEA_A::STOP,
164            3 => RISEA_A::RELOADSTART,
165            _ => unreachable!(),
166        }
167    }
168    #[doc = "Checks if the value of the field is `NONE`"]
169    #[inline(always)]
170    pub fn is_none(&self) -> bool {
171        *self == RISEA_A::NONE
172    }
173    #[doc = "Checks if the value of the field is `START`"]
174    #[inline(always)]
175    pub fn is_start(&self) -> bool {
176        *self == RISEA_A::START
177    }
178    #[doc = "Checks if the value of the field is `STOP`"]
179    #[inline(always)]
180    pub fn is_stop(&self) -> bool {
181        *self == RISEA_A::STOP
182    }
183    #[doc = "Checks if the value of the field is `RELOADSTART`"]
184    #[inline(always)]
185    pub fn is_reloadstart(&self) -> bool {
186        *self == RISEA_A::RELOADSTART
187    }
188}
189#[doc = "Field `RISEA` writer - Timer Rising Input Edge Action"]
190pub type RISEA_W<'a> = crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, RISEA_A, 2, 8>;
191impl<'a> RISEA_W<'a> {
192    #[doc = "No action"]
193    #[inline(always)]
194    pub fn none(self) -> &'a mut W {
195        self.variant(RISEA_A::NONE)
196    }
197    #[doc = "Start counter without reload"]
198    #[inline(always)]
199    pub fn start(self) -> &'a mut W {
200        self.variant(RISEA_A::START)
201    }
202    #[doc = "Stop counter without reload"]
203    #[inline(always)]
204    pub fn stop(self) -> &'a mut W {
205        self.variant(RISEA_A::STOP)
206    }
207    #[doc = "Reload and start counter"]
208    #[inline(always)]
209    pub fn reloadstart(self) -> &'a mut W {
210        self.variant(RISEA_A::RELOADSTART)
211    }
212}
213#[doc = "Timer Falling Input Edge Action\n\nValue on reset: 0"]
214#[derive(Clone, Copy, Debug, PartialEq)]
215#[repr(u8)]
216pub enum FALLA_A {
217    #[doc = "0: No action"]
218    NONE = 0,
219    #[doc = "1: Start counter without reload"]
220    START = 1,
221    #[doc = "2: Stop counter without reload"]
222    STOP = 2,
223    #[doc = "3: Reload and start counter"]
224    RELOADSTART = 3,
225}
226impl From<FALLA_A> for u8 {
227    #[inline(always)]
228    fn from(variant: FALLA_A) -> Self {
229        variant as _
230    }
231}
232#[doc = "Field `FALLA` reader - Timer Falling Input Edge Action"]
233pub type FALLA_R = crate::FieldReader<u8, FALLA_A>;
234impl FALLA_R {
235    #[doc = "Get enumerated values variant"]
236    #[inline(always)]
237    pub fn variant(&self) -> FALLA_A {
238        match self.bits {
239            0 => FALLA_A::NONE,
240            1 => FALLA_A::START,
241            2 => FALLA_A::STOP,
242            3 => FALLA_A::RELOADSTART,
243            _ => unreachable!(),
244        }
245    }
246    #[doc = "Checks if the value of the field is `NONE`"]
247    #[inline(always)]
248    pub fn is_none(&self) -> bool {
249        *self == FALLA_A::NONE
250    }
251    #[doc = "Checks if the value of the field is `START`"]
252    #[inline(always)]
253    pub fn is_start(&self) -> bool {
254        *self == FALLA_A::START
255    }
256    #[doc = "Checks if the value of the field is `STOP`"]
257    #[inline(always)]
258    pub fn is_stop(&self) -> bool {
259        *self == FALLA_A::STOP
260    }
261    #[doc = "Checks if the value of the field is `RELOADSTART`"]
262    #[inline(always)]
263    pub fn is_reloadstart(&self) -> bool {
264        *self == FALLA_A::RELOADSTART
265    }
266}
267#[doc = "Field `FALLA` writer - Timer Falling Input Edge Action"]
268pub type FALLA_W<'a> = crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, FALLA_A, 2, 10>;
269impl<'a> FALLA_W<'a> {
270    #[doc = "No action"]
271    #[inline(always)]
272    pub fn none(self) -> &'a mut W {
273        self.variant(FALLA_A::NONE)
274    }
275    #[doc = "Start counter without reload"]
276    #[inline(always)]
277    pub fn start(self) -> &'a mut W {
278        self.variant(FALLA_A::START)
279    }
280    #[doc = "Stop counter without reload"]
281    #[inline(always)]
282    pub fn stop(self) -> &'a mut W {
283        self.variant(FALLA_A::STOP)
284    }
285    #[doc = "Reload and start counter"]
286    #[inline(always)]
287    pub fn reloadstart(self) -> &'a mut W {
288        self.variant(FALLA_A::RELOADSTART)
289    }
290}
291#[doc = "Clock Source Select\n\nValue on reset: 0"]
292#[derive(Clone, Copy, Debug, PartialEq)]
293#[repr(u8)]
294pub enum CLKSEL_A {
295    #[doc = "0: Prescaled HFPERCLK"]
296    PRESCHFPERCLK = 0,
297    #[doc = "1: Compare/Capture Channel 1 Input"]
298    CC1 = 1,
299    #[doc = "2: Timer is clocked by underflow(down-count) or overflow(up-count) in the lower numbered neighbor Timer"]
300    TIMEROUF = 2,
301}
302impl From<CLKSEL_A> for u8 {
303    #[inline(always)]
304    fn from(variant: CLKSEL_A) -> Self {
305        variant as _
306    }
307}
308#[doc = "Field `CLKSEL` reader - Clock Source Select"]
309pub type CLKSEL_R = crate::FieldReader<u8, CLKSEL_A>;
310impl CLKSEL_R {
311    #[doc = "Get enumerated values variant"]
312    #[inline(always)]
313    pub fn variant(&self) -> Option<CLKSEL_A> {
314        match self.bits {
315            0 => Some(CLKSEL_A::PRESCHFPERCLK),
316            1 => Some(CLKSEL_A::CC1),
317            2 => Some(CLKSEL_A::TIMEROUF),
318            _ => None,
319        }
320    }
321    #[doc = "Checks if the value of the field is `PRESCHFPERCLK`"]
322    #[inline(always)]
323    pub fn is_preschfperclk(&self) -> bool {
324        *self == CLKSEL_A::PRESCHFPERCLK
325    }
326    #[doc = "Checks if the value of the field is `CC1`"]
327    #[inline(always)]
328    pub fn is_cc1(&self) -> bool {
329        *self == CLKSEL_A::CC1
330    }
331    #[doc = "Checks if the value of the field is `TIMEROUF`"]
332    #[inline(always)]
333    pub fn is_timerouf(&self) -> bool {
334        *self == CLKSEL_A::TIMEROUF
335    }
336}
337#[doc = "Field `CLKSEL` writer - Clock Source Select"]
338pub type CLKSEL_W<'a> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, CLKSEL_A, 2, 16>;
339impl<'a> CLKSEL_W<'a> {
340    #[doc = "Prescaled HFPERCLK"]
341    #[inline(always)]
342    pub fn preschfperclk(self) -> &'a mut W {
343        self.variant(CLKSEL_A::PRESCHFPERCLK)
344    }
345    #[doc = "Compare/Capture Channel 1 Input"]
346    #[inline(always)]
347    pub fn cc1(self) -> &'a mut W {
348        self.variant(CLKSEL_A::CC1)
349    }
350    #[doc = "Timer is clocked by underflow(down-count) or overflow(up-count) in the lower numbered neighbor Timer"]
351    #[inline(always)]
352    pub fn timerouf(self) -> &'a mut W {
353        self.variant(CLKSEL_A::TIMEROUF)
354    }
355}
356#[doc = "Prescaler Setting\n\nValue on reset: 0"]
357#[derive(Clone, Copy, Debug, PartialEq)]
358#[repr(u8)]
359pub enum PRESC_A {
360    #[doc = "0: The HFPERCLK is undivided"]
361    DIV1 = 0,
362    #[doc = "1: The HFPERCLK is divided by 2"]
363    DIV2 = 1,
364    #[doc = "2: The HFPERCLK is divided by 4"]
365    DIV4 = 2,
366    #[doc = "3: The HFPERCLK is divided by 8"]
367    DIV8 = 3,
368    #[doc = "4: The HFPERCLK is divided by 16"]
369    DIV16 = 4,
370    #[doc = "5: The HFPERCLK is divided by 32"]
371    DIV32 = 5,
372    #[doc = "6: The HFPERCLK is divided by 64"]
373    DIV64 = 6,
374    #[doc = "7: The HFPERCLK is divided by 128"]
375    DIV128 = 7,
376    #[doc = "8: The HFPERCLK is divided by 256"]
377    DIV256 = 8,
378    #[doc = "9: The HFPERCLK is divided by 512"]
379    DIV512 = 9,
380    #[doc = "10: The HFPERCLK is divided by 1024"]
381    DIV1024 = 10,
382}
383impl From<PRESC_A> for u8 {
384    #[inline(always)]
385    fn from(variant: PRESC_A) -> Self {
386        variant as _
387    }
388}
389#[doc = "Field `PRESC` reader - Prescaler Setting"]
390pub type PRESC_R = crate::FieldReader<u8, PRESC_A>;
391impl PRESC_R {
392    #[doc = "Get enumerated values variant"]
393    #[inline(always)]
394    pub fn variant(&self) -> Option<PRESC_A> {
395        match self.bits {
396            0 => Some(PRESC_A::DIV1),
397            1 => Some(PRESC_A::DIV2),
398            2 => Some(PRESC_A::DIV4),
399            3 => Some(PRESC_A::DIV8),
400            4 => Some(PRESC_A::DIV16),
401            5 => Some(PRESC_A::DIV32),
402            6 => Some(PRESC_A::DIV64),
403            7 => Some(PRESC_A::DIV128),
404            8 => Some(PRESC_A::DIV256),
405            9 => Some(PRESC_A::DIV512),
406            10 => Some(PRESC_A::DIV1024),
407            _ => None,
408        }
409    }
410    #[doc = "Checks if the value of the field is `DIV1`"]
411    #[inline(always)]
412    pub fn is_div1(&self) -> bool {
413        *self == PRESC_A::DIV1
414    }
415    #[doc = "Checks if the value of the field is `DIV2`"]
416    #[inline(always)]
417    pub fn is_div2(&self) -> bool {
418        *self == PRESC_A::DIV2
419    }
420    #[doc = "Checks if the value of the field is `DIV4`"]
421    #[inline(always)]
422    pub fn is_div4(&self) -> bool {
423        *self == PRESC_A::DIV4
424    }
425    #[doc = "Checks if the value of the field is `DIV8`"]
426    #[inline(always)]
427    pub fn is_div8(&self) -> bool {
428        *self == PRESC_A::DIV8
429    }
430    #[doc = "Checks if the value of the field is `DIV16`"]
431    #[inline(always)]
432    pub fn is_div16(&self) -> bool {
433        *self == PRESC_A::DIV16
434    }
435    #[doc = "Checks if the value of the field is `DIV32`"]
436    #[inline(always)]
437    pub fn is_div32(&self) -> bool {
438        *self == PRESC_A::DIV32
439    }
440    #[doc = "Checks if the value of the field is `DIV64`"]
441    #[inline(always)]
442    pub fn is_div64(&self) -> bool {
443        *self == PRESC_A::DIV64
444    }
445    #[doc = "Checks if the value of the field is `DIV128`"]
446    #[inline(always)]
447    pub fn is_div128(&self) -> bool {
448        *self == PRESC_A::DIV128
449    }
450    #[doc = "Checks if the value of the field is `DIV256`"]
451    #[inline(always)]
452    pub fn is_div256(&self) -> bool {
453        *self == PRESC_A::DIV256
454    }
455    #[doc = "Checks if the value of the field is `DIV512`"]
456    #[inline(always)]
457    pub fn is_div512(&self) -> bool {
458        *self == PRESC_A::DIV512
459    }
460    #[doc = "Checks if the value of the field is `DIV1024`"]
461    #[inline(always)]
462    pub fn is_div1024(&self) -> bool {
463        *self == PRESC_A::DIV1024
464    }
465}
466#[doc = "Field `PRESC` writer - Prescaler Setting"]
467pub type PRESC_W<'a> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, PRESC_A, 4, 24>;
468impl<'a> PRESC_W<'a> {
469    #[doc = "The HFPERCLK is undivided"]
470    #[inline(always)]
471    pub fn div1(self) -> &'a mut W {
472        self.variant(PRESC_A::DIV1)
473    }
474    #[doc = "The HFPERCLK is divided by 2"]
475    #[inline(always)]
476    pub fn div2(self) -> &'a mut W {
477        self.variant(PRESC_A::DIV2)
478    }
479    #[doc = "The HFPERCLK is divided by 4"]
480    #[inline(always)]
481    pub fn div4(self) -> &'a mut W {
482        self.variant(PRESC_A::DIV4)
483    }
484    #[doc = "The HFPERCLK is divided by 8"]
485    #[inline(always)]
486    pub fn div8(self) -> &'a mut W {
487        self.variant(PRESC_A::DIV8)
488    }
489    #[doc = "The HFPERCLK is divided by 16"]
490    #[inline(always)]
491    pub fn div16(self) -> &'a mut W {
492        self.variant(PRESC_A::DIV16)
493    }
494    #[doc = "The HFPERCLK is divided by 32"]
495    #[inline(always)]
496    pub fn div32(self) -> &'a mut W {
497        self.variant(PRESC_A::DIV32)
498    }
499    #[doc = "The HFPERCLK is divided by 64"]
500    #[inline(always)]
501    pub fn div64(self) -> &'a mut W {
502        self.variant(PRESC_A::DIV64)
503    }
504    #[doc = "The HFPERCLK is divided by 128"]
505    #[inline(always)]
506    pub fn div128(self) -> &'a mut W {
507        self.variant(PRESC_A::DIV128)
508    }
509    #[doc = "The HFPERCLK is divided by 256"]
510    #[inline(always)]
511    pub fn div256(self) -> &'a mut W {
512        self.variant(PRESC_A::DIV256)
513    }
514    #[doc = "The HFPERCLK is divided by 512"]
515    #[inline(always)]
516    pub fn div512(self) -> &'a mut W {
517        self.variant(PRESC_A::DIV512)
518    }
519    #[doc = "The HFPERCLK is divided by 1024"]
520    #[inline(always)]
521    pub fn div1024(self) -> &'a mut W {
522        self.variant(PRESC_A::DIV1024)
523    }
524}
525impl R {
526    #[doc = "Bits 0:1 - Timer Mode"]
527    #[inline(always)]
528    pub fn mode(&self) -> MODE_R {
529        MODE_R::new((self.bits & 3) as u8)
530    }
531    #[doc = "Bit 3 - Timer Start/Stop/Reload Synchronization"]
532    #[inline(always)]
533    pub fn sync(&self) -> SYNC_R {
534        SYNC_R::new(((self.bits >> 3) & 1) != 0)
535    }
536    #[doc = "Bit 4 - One-shot Mode Enable"]
537    #[inline(always)]
538    pub fn osmen(&self) -> OSMEN_R {
539        OSMEN_R::new(((self.bits >> 4) & 1) != 0)
540    }
541    #[doc = "Bit 5 - Quadrature Decoder Mode Selection"]
542    #[inline(always)]
543    pub fn qdm(&self) -> QDM_R {
544        QDM_R::new(((self.bits >> 5) & 1) != 0)
545    }
546    #[doc = "Bit 6 - Debug Mode Run Enable"]
547    #[inline(always)]
548    pub fn debugrun(&self) -> DEBUGRUN_R {
549        DEBUGRUN_R::new(((self.bits >> 6) & 1) != 0)
550    }
551    #[doc = "Bit 7 - DMA Request Clear on Active"]
552    #[inline(always)]
553    pub fn dmaclract(&self) -> DMACLRACT_R {
554        DMACLRACT_R::new(((self.bits >> 7) & 1) != 0)
555    }
556    #[doc = "Bits 8:9 - Timer Rising Input Edge Action"]
557    #[inline(always)]
558    pub fn risea(&self) -> RISEA_R {
559        RISEA_R::new(((self.bits >> 8) & 3) as u8)
560    }
561    #[doc = "Bits 10:11 - Timer Falling Input Edge Action"]
562    #[inline(always)]
563    pub fn falla(&self) -> FALLA_R {
564        FALLA_R::new(((self.bits >> 10) & 3) as u8)
565    }
566    #[doc = "Bits 16:17 - Clock Source Select"]
567    #[inline(always)]
568    pub fn clksel(&self) -> CLKSEL_R {
569        CLKSEL_R::new(((self.bits >> 16) & 3) as u8)
570    }
571    #[doc = "Bits 24:27 - Prescaler Setting"]
572    #[inline(always)]
573    pub fn presc(&self) -> PRESC_R {
574        PRESC_R::new(((self.bits >> 24) & 0x0f) as u8)
575    }
576}
577impl W {
578    #[doc = "Bits 0:1 - Timer Mode"]
579    #[inline(always)]
580    pub fn mode(&mut self) -> MODE_W {
581        MODE_W::new(self)
582    }
583    #[doc = "Bit 3 - Timer Start/Stop/Reload Synchronization"]
584    #[inline(always)]
585    pub fn sync(&mut self) -> SYNC_W {
586        SYNC_W::new(self)
587    }
588    #[doc = "Bit 4 - One-shot Mode Enable"]
589    #[inline(always)]
590    pub fn osmen(&mut self) -> OSMEN_W {
591        OSMEN_W::new(self)
592    }
593    #[doc = "Bit 5 - Quadrature Decoder Mode Selection"]
594    #[inline(always)]
595    pub fn qdm(&mut self) -> QDM_W {
596        QDM_W::new(self)
597    }
598    #[doc = "Bit 6 - Debug Mode Run Enable"]
599    #[inline(always)]
600    pub fn debugrun(&mut self) -> DEBUGRUN_W {
601        DEBUGRUN_W::new(self)
602    }
603    #[doc = "Bit 7 - DMA Request Clear on Active"]
604    #[inline(always)]
605    pub fn dmaclract(&mut self) -> DMACLRACT_W {
606        DMACLRACT_W::new(self)
607    }
608    #[doc = "Bits 8:9 - Timer Rising Input Edge Action"]
609    #[inline(always)]
610    pub fn risea(&mut self) -> RISEA_W {
611        RISEA_W::new(self)
612    }
613    #[doc = "Bits 10:11 - Timer Falling Input Edge Action"]
614    #[inline(always)]
615    pub fn falla(&mut self) -> FALLA_W {
616        FALLA_W::new(self)
617    }
618    #[doc = "Bits 16:17 - Clock Source Select"]
619    #[inline(always)]
620    pub fn clksel(&mut self) -> CLKSEL_W {
621        CLKSEL_W::new(self)
622    }
623    #[doc = "Bits 24:27 - Prescaler Setting"]
624    #[inline(always)]
625    pub fn presc(&mut self) -> PRESC_W {
626        PRESC_W::new(self)
627    }
628    #[doc = "Writes raw bits to the register."]
629    #[inline(always)]
630    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
631        self.0.bits(bits);
632        self
633    }
634}
635#[doc = "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 [ctrl](index.html) module"]
636pub struct CTRL_SPEC;
637impl crate::RegisterSpec for CTRL_SPEC {
638    type Ux = u32;
639}
640#[doc = "`read()` method returns [ctrl::R](R) reader structure"]
641impl crate::Readable for CTRL_SPEC {
642    type Reader = R;
643}
644#[doc = "`write(|w| ..)` method takes [ctrl::W](W) writer structure"]
645impl crate::Writable for CTRL_SPEC {
646    type Writer = W;
647}
648#[doc = "`reset()` method sets CTRL to value 0"]
649impl crate::Resettable for CTRL_SPEC {
650    #[inline(always)]
651    fn reset_value() -> Self::Ux {
652        0
653    }
654}