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