efm32wg230_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 = "Field `X2CNT` reader - 2x Count Mode"]
292pub type X2CNT_R = crate::BitReader<bool>;
293#[doc = "Field `X2CNT` writer - 2x Count Mode"]
294pub type X2CNT_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 13>;
295#[doc = "Clock Source Select\n\nValue on reset: 0"]
296#[derive(Clone, Copy, Debug, PartialEq)]
297#[repr(u8)]
298pub enum CLKSEL_A {
299    #[doc = "0: Prescaled HFPERCLK"]
300    PRESCHFPERCLK = 0,
301    #[doc = "1: Compare/Capture Channel 1 Input"]
302    CC1 = 1,
303    #[doc = "2: Timer is clocked by underflow(down-count) or overflow(up-count) in the lower numbered neighbor Timer"]
304    TIMEROUF = 2,
305}
306impl From<CLKSEL_A> for u8 {
307    #[inline(always)]
308    fn from(variant: CLKSEL_A) -> Self {
309        variant as _
310    }
311}
312#[doc = "Field `CLKSEL` reader - Clock Source Select"]
313pub type CLKSEL_R = crate::FieldReader<u8, CLKSEL_A>;
314impl CLKSEL_R {
315    #[doc = "Get enumerated values variant"]
316    #[inline(always)]
317    pub fn variant(&self) -> Option<CLKSEL_A> {
318        match self.bits {
319            0 => Some(CLKSEL_A::PRESCHFPERCLK),
320            1 => Some(CLKSEL_A::CC1),
321            2 => Some(CLKSEL_A::TIMEROUF),
322            _ => None,
323        }
324    }
325    #[doc = "Checks if the value of the field is `PRESCHFPERCLK`"]
326    #[inline(always)]
327    pub fn is_preschfperclk(&self) -> bool {
328        *self == CLKSEL_A::PRESCHFPERCLK
329    }
330    #[doc = "Checks if the value of the field is `CC1`"]
331    #[inline(always)]
332    pub fn is_cc1(&self) -> bool {
333        *self == CLKSEL_A::CC1
334    }
335    #[doc = "Checks if the value of the field is `TIMEROUF`"]
336    #[inline(always)]
337    pub fn is_timerouf(&self) -> bool {
338        *self == CLKSEL_A::TIMEROUF
339    }
340}
341#[doc = "Field `CLKSEL` writer - Clock Source Select"]
342pub type CLKSEL_W<'a> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, CLKSEL_A, 2, 16>;
343impl<'a> CLKSEL_W<'a> {
344    #[doc = "Prescaled HFPERCLK"]
345    #[inline(always)]
346    pub fn preschfperclk(self) -> &'a mut W {
347        self.variant(CLKSEL_A::PRESCHFPERCLK)
348    }
349    #[doc = "Compare/Capture Channel 1 Input"]
350    #[inline(always)]
351    pub fn cc1(self) -> &'a mut W {
352        self.variant(CLKSEL_A::CC1)
353    }
354    #[doc = "Timer is clocked by underflow(down-count) or overflow(up-count) in the lower numbered neighbor Timer"]
355    #[inline(always)]
356    pub fn timerouf(self) -> &'a mut W {
357        self.variant(CLKSEL_A::TIMEROUF)
358    }
359}
360#[doc = "Prescaler Setting\n\nValue on reset: 0"]
361#[derive(Clone, Copy, Debug, PartialEq)]
362#[repr(u8)]
363pub enum PRESC_A {
364    #[doc = "0: The HFPERCLK is undivided"]
365    DIV1 = 0,
366    #[doc = "1: The HFPERCLK is divided by 2"]
367    DIV2 = 1,
368    #[doc = "2: The HFPERCLK is divided by 4"]
369    DIV4 = 2,
370    #[doc = "3: The HFPERCLK is divided by 8"]
371    DIV8 = 3,
372    #[doc = "4: The HFPERCLK is divided by 16"]
373    DIV16 = 4,
374    #[doc = "5: The HFPERCLK is divided by 32"]
375    DIV32 = 5,
376    #[doc = "6: The HFPERCLK is divided by 64"]
377    DIV64 = 6,
378    #[doc = "7: The HFPERCLK is divided by 128"]
379    DIV128 = 7,
380    #[doc = "8: The HFPERCLK is divided by 256"]
381    DIV256 = 8,
382    #[doc = "9: The HFPERCLK is divided by 512"]
383    DIV512 = 9,
384    #[doc = "10: The HFPERCLK is divided by 1024"]
385    DIV1024 = 10,
386}
387impl From<PRESC_A> for u8 {
388    #[inline(always)]
389    fn from(variant: PRESC_A) -> Self {
390        variant as _
391    }
392}
393#[doc = "Field `PRESC` reader - Prescaler Setting"]
394pub type PRESC_R = crate::FieldReader<u8, PRESC_A>;
395impl PRESC_R {
396    #[doc = "Get enumerated values variant"]
397    #[inline(always)]
398    pub fn variant(&self) -> Option<PRESC_A> {
399        match self.bits {
400            0 => Some(PRESC_A::DIV1),
401            1 => Some(PRESC_A::DIV2),
402            2 => Some(PRESC_A::DIV4),
403            3 => Some(PRESC_A::DIV8),
404            4 => Some(PRESC_A::DIV16),
405            5 => Some(PRESC_A::DIV32),
406            6 => Some(PRESC_A::DIV64),
407            7 => Some(PRESC_A::DIV128),
408            8 => Some(PRESC_A::DIV256),
409            9 => Some(PRESC_A::DIV512),
410            10 => Some(PRESC_A::DIV1024),
411            _ => None,
412        }
413    }
414    #[doc = "Checks if the value of the field is `DIV1`"]
415    #[inline(always)]
416    pub fn is_div1(&self) -> bool {
417        *self == PRESC_A::DIV1
418    }
419    #[doc = "Checks if the value of the field is `DIV2`"]
420    #[inline(always)]
421    pub fn is_div2(&self) -> bool {
422        *self == PRESC_A::DIV2
423    }
424    #[doc = "Checks if the value of the field is `DIV4`"]
425    #[inline(always)]
426    pub fn is_div4(&self) -> bool {
427        *self == PRESC_A::DIV4
428    }
429    #[doc = "Checks if the value of the field is `DIV8`"]
430    #[inline(always)]
431    pub fn is_div8(&self) -> bool {
432        *self == PRESC_A::DIV8
433    }
434    #[doc = "Checks if the value of the field is `DIV16`"]
435    #[inline(always)]
436    pub fn is_div16(&self) -> bool {
437        *self == PRESC_A::DIV16
438    }
439    #[doc = "Checks if the value of the field is `DIV32`"]
440    #[inline(always)]
441    pub fn is_div32(&self) -> bool {
442        *self == PRESC_A::DIV32
443    }
444    #[doc = "Checks if the value of the field is `DIV64`"]
445    #[inline(always)]
446    pub fn is_div64(&self) -> bool {
447        *self == PRESC_A::DIV64
448    }
449    #[doc = "Checks if the value of the field is `DIV128`"]
450    #[inline(always)]
451    pub fn is_div128(&self) -> bool {
452        *self == PRESC_A::DIV128
453    }
454    #[doc = "Checks if the value of the field is `DIV256`"]
455    #[inline(always)]
456    pub fn is_div256(&self) -> bool {
457        *self == PRESC_A::DIV256
458    }
459    #[doc = "Checks if the value of the field is `DIV512`"]
460    #[inline(always)]
461    pub fn is_div512(&self) -> bool {
462        *self == PRESC_A::DIV512
463    }
464    #[doc = "Checks if the value of the field is `DIV1024`"]
465    #[inline(always)]
466    pub fn is_div1024(&self) -> bool {
467        *self == PRESC_A::DIV1024
468    }
469}
470#[doc = "Field `PRESC` writer - Prescaler Setting"]
471pub type PRESC_W<'a> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, PRESC_A, 4, 24>;
472impl<'a> PRESC_W<'a> {
473    #[doc = "The HFPERCLK is undivided"]
474    #[inline(always)]
475    pub fn div1(self) -> &'a mut W {
476        self.variant(PRESC_A::DIV1)
477    }
478    #[doc = "The HFPERCLK is divided by 2"]
479    #[inline(always)]
480    pub fn div2(self) -> &'a mut W {
481        self.variant(PRESC_A::DIV2)
482    }
483    #[doc = "The HFPERCLK is divided by 4"]
484    #[inline(always)]
485    pub fn div4(self) -> &'a mut W {
486        self.variant(PRESC_A::DIV4)
487    }
488    #[doc = "The HFPERCLK is divided by 8"]
489    #[inline(always)]
490    pub fn div8(self) -> &'a mut W {
491        self.variant(PRESC_A::DIV8)
492    }
493    #[doc = "The HFPERCLK is divided by 16"]
494    #[inline(always)]
495    pub fn div16(self) -> &'a mut W {
496        self.variant(PRESC_A::DIV16)
497    }
498    #[doc = "The HFPERCLK is divided by 32"]
499    #[inline(always)]
500    pub fn div32(self) -> &'a mut W {
501        self.variant(PRESC_A::DIV32)
502    }
503    #[doc = "The HFPERCLK is divided by 64"]
504    #[inline(always)]
505    pub fn div64(self) -> &'a mut W {
506        self.variant(PRESC_A::DIV64)
507    }
508    #[doc = "The HFPERCLK is divided by 128"]
509    #[inline(always)]
510    pub fn div128(self) -> &'a mut W {
511        self.variant(PRESC_A::DIV128)
512    }
513    #[doc = "The HFPERCLK is divided by 256"]
514    #[inline(always)]
515    pub fn div256(self) -> &'a mut W {
516        self.variant(PRESC_A::DIV256)
517    }
518    #[doc = "The HFPERCLK is divided by 512"]
519    #[inline(always)]
520    pub fn div512(self) -> &'a mut W {
521        self.variant(PRESC_A::DIV512)
522    }
523    #[doc = "The HFPERCLK is divided by 1024"]
524    #[inline(always)]
525    pub fn div1024(self) -> &'a mut W {
526        self.variant(PRESC_A::DIV1024)
527    }
528}
529#[doc = "Field `ATI` reader - Always Track Inputs"]
530pub type ATI_R = crate::BitReader<bool>;
531#[doc = "Field `ATI` writer - Always Track Inputs"]
532pub type ATI_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 28>;
533#[doc = "Field `RSSCOIST` reader - Reload-Start Sets Compare Output initial State"]
534pub type RSSCOIST_R = crate::BitReader<bool>;
535#[doc = "Field `RSSCOIST` writer - Reload-Start Sets Compare Output initial State"]
536pub type RSSCOIST_W<'a> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, 29>;
537impl R {
538    #[doc = "Bits 0:1 - Timer Mode"]
539    #[inline(always)]
540    pub fn mode(&self) -> MODE_R {
541        MODE_R::new((self.bits & 3) as u8)
542    }
543    #[doc = "Bit 3 - Timer Start/Stop/Reload Synchronization"]
544    #[inline(always)]
545    pub fn sync(&self) -> SYNC_R {
546        SYNC_R::new(((self.bits >> 3) & 1) != 0)
547    }
548    #[doc = "Bit 4 - One-shot Mode Enable"]
549    #[inline(always)]
550    pub fn osmen(&self) -> OSMEN_R {
551        OSMEN_R::new(((self.bits >> 4) & 1) != 0)
552    }
553    #[doc = "Bit 5 - Quadrature Decoder Mode Selection"]
554    #[inline(always)]
555    pub fn qdm(&self) -> QDM_R {
556        QDM_R::new(((self.bits >> 5) & 1) != 0)
557    }
558    #[doc = "Bit 6 - Debug Mode Run Enable"]
559    #[inline(always)]
560    pub fn debugrun(&self) -> DEBUGRUN_R {
561        DEBUGRUN_R::new(((self.bits >> 6) & 1) != 0)
562    }
563    #[doc = "Bit 7 - DMA Request Clear on Active"]
564    #[inline(always)]
565    pub fn dmaclract(&self) -> DMACLRACT_R {
566        DMACLRACT_R::new(((self.bits >> 7) & 1) != 0)
567    }
568    #[doc = "Bits 8:9 - Timer Rising Input Edge Action"]
569    #[inline(always)]
570    pub fn risea(&self) -> RISEA_R {
571        RISEA_R::new(((self.bits >> 8) & 3) as u8)
572    }
573    #[doc = "Bits 10:11 - Timer Falling Input Edge Action"]
574    #[inline(always)]
575    pub fn falla(&self) -> FALLA_R {
576        FALLA_R::new(((self.bits >> 10) & 3) as u8)
577    }
578    #[doc = "Bit 13 - 2x Count Mode"]
579    #[inline(always)]
580    pub fn x2cnt(&self) -> X2CNT_R {
581        X2CNT_R::new(((self.bits >> 13) & 1) != 0)
582    }
583    #[doc = "Bits 16:17 - Clock Source Select"]
584    #[inline(always)]
585    pub fn clksel(&self) -> CLKSEL_R {
586        CLKSEL_R::new(((self.bits >> 16) & 3) as u8)
587    }
588    #[doc = "Bits 24:27 - Prescaler Setting"]
589    #[inline(always)]
590    pub fn presc(&self) -> PRESC_R {
591        PRESC_R::new(((self.bits >> 24) & 0x0f) as u8)
592    }
593    #[doc = "Bit 28 - Always Track Inputs"]
594    #[inline(always)]
595    pub fn ati(&self) -> ATI_R {
596        ATI_R::new(((self.bits >> 28) & 1) != 0)
597    }
598    #[doc = "Bit 29 - Reload-Start Sets Compare Output initial State"]
599    #[inline(always)]
600    pub fn rsscoist(&self) -> RSSCOIST_R {
601        RSSCOIST_R::new(((self.bits >> 29) & 1) != 0)
602    }
603}
604impl W {
605    #[doc = "Bits 0:1 - Timer Mode"]
606    #[inline(always)]
607    pub fn mode(&mut self) -> MODE_W {
608        MODE_W::new(self)
609    }
610    #[doc = "Bit 3 - Timer Start/Stop/Reload Synchronization"]
611    #[inline(always)]
612    pub fn sync(&mut self) -> SYNC_W {
613        SYNC_W::new(self)
614    }
615    #[doc = "Bit 4 - One-shot Mode Enable"]
616    #[inline(always)]
617    pub fn osmen(&mut self) -> OSMEN_W {
618        OSMEN_W::new(self)
619    }
620    #[doc = "Bit 5 - Quadrature Decoder Mode Selection"]
621    #[inline(always)]
622    pub fn qdm(&mut self) -> QDM_W {
623        QDM_W::new(self)
624    }
625    #[doc = "Bit 6 - Debug Mode Run Enable"]
626    #[inline(always)]
627    pub fn debugrun(&mut self) -> DEBUGRUN_W {
628        DEBUGRUN_W::new(self)
629    }
630    #[doc = "Bit 7 - DMA Request Clear on Active"]
631    #[inline(always)]
632    pub fn dmaclract(&mut self) -> DMACLRACT_W {
633        DMACLRACT_W::new(self)
634    }
635    #[doc = "Bits 8:9 - Timer Rising Input Edge Action"]
636    #[inline(always)]
637    pub fn risea(&mut self) -> RISEA_W {
638        RISEA_W::new(self)
639    }
640    #[doc = "Bits 10:11 - Timer Falling Input Edge Action"]
641    #[inline(always)]
642    pub fn falla(&mut self) -> FALLA_W {
643        FALLA_W::new(self)
644    }
645    #[doc = "Bit 13 - 2x Count Mode"]
646    #[inline(always)]
647    pub fn x2cnt(&mut self) -> X2CNT_W {
648        X2CNT_W::new(self)
649    }
650    #[doc = "Bits 16:17 - Clock Source Select"]
651    #[inline(always)]
652    pub fn clksel(&mut self) -> CLKSEL_W {
653        CLKSEL_W::new(self)
654    }
655    #[doc = "Bits 24:27 - Prescaler Setting"]
656    #[inline(always)]
657    pub fn presc(&mut self) -> PRESC_W {
658        PRESC_W::new(self)
659    }
660    #[doc = "Bit 28 - Always Track Inputs"]
661    #[inline(always)]
662    pub fn ati(&mut self) -> ATI_W {
663        ATI_W::new(self)
664    }
665    #[doc = "Bit 29 - Reload-Start Sets Compare Output initial State"]
666    #[inline(always)]
667    pub fn rsscoist(&mut self) -> RSSCOIST_W {
668        RSSCOIST_W::new(self)
669    }
670    #[doc = "Writes raw bits to the register."]
671    #[inline(always)]
672    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
673        self.0.bits(bits);
674        self
675    }
676}
677#[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"]
678pub struct CTRL_SPEC;
679impl crate::RegisterSpec for CTRL_SPEC {
680    type Ux = u32;
681}
682#[doc = "`read()` method returns [ctrl::R](R) reader structure"]
683impl crate::Readable for CTRL_SPEC {
684    type Reader = R;
685}
686#[doc = "`write(|w| ..)` method takes [ctrl::W](W) writer structure"]
687impl crate::Writable for CTRL_SPEC {
688    type Writer = W;
689}
690#[doc = "`reset()` method sets CTRL to value 0"]
691impl crate::Resettable for CTRL_SPEC {
692    #[inline(always)]
693    fn reset_value() -> Self::Ux {
694        0
695    }
696}