efm32wg_pac/efm32wg230/timer3/
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 `MODE` reader - Timer Mode"]
38pub type MODE_R = crate::FieldReader<u8, MODE_A>;
39#[doc = "Timer Mode\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41#[repr(u8)]
42pub enum MODE_A {
43    #[doc = "0: Up-count mode"]
44    UP = 0,
45    #[doc = "1: Down-count mode"]
46    DOWN = 1,
47    #[doc = "2: Up/down-count mode"]
48    UPDOWN = 2,
49    #[doc = "3: Quadrature decoder mode"]
50    QDEC = 3,
51}
52impl From<MODE_A> for u8 {
53    #[inline(always)]
54    fn from(variant: MODE_A) -> Self {
55        variant as _
56    }
57}
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, const O: u8> = crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, MODE_A, 2, O>;
93impl<'a, const O: u8> MODE_W<'a, O> {
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, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
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, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
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, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
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, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
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, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
135#[doc = "Field `RISEA` reader - Timer Rising Input Edge Action"]
136pub type RISEA_R = crate::FieldReader<u8, RISEA_A>;
137#[doc = "Timer Rising Input Edge Action\n\nValue on reset: 0"]
138#[derive(Clone, Copy, Debug, PartialEq, Eq)]
139#[repr(u8)]
140pub enum RISEA_A {
141    #[doc = "0: No action"]
142    NONE = 0,
143    #[doc = "1: Start counter without reload"]
144    START = 1,
145    #[doc = "2: Stop counter without reload"]
146    STOP = 2,
147    #[doc = "3: Reload and start counter"]
148    RELOADSTART = 3,
149}
150impl From<RISEA_A> for u8 {
151    #[inline(always)]
152    fn from(variant: RISEA_A) -> Self {
153        variant as _
154    }
155}
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, const O: u8> = crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, RISEA_A, 2, O>;
191impl<'a, const O: u8> RISEA_W<'a, O> {
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 = "Field `FALLA` reader - Timer Falling Input Edge Action"]
214pub type FALLA_R = crate::FieldReader<u8, FALLA_A>;
215#[doc = "Timer Falling Input Edge Action\n\nValue on reset: 0"]
216#[derive(Clone, Copy, Debug, PartialEq, Eq)]
217#[repr(u8)]
218pub enum FALLA_A {
219    #[doc = "0: No action"]
220    NONE = 0,
221    #[doc = "1: Start counter without reload"]
222    START = 1,
223    #[doc = "2: Stop counter without reload"]
224    STOP = 2,
225    #[doc = "3: Reload and start counter"]
226    RELOADSTART = 3,
227}
228impl From<FALLA_A> for u8 {
229    #[inline(always)]
230    fn from(variant: FALLA_A) -> Self {
231        variant as _
232    }
233}
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, const O: u8> = crate::FieldWriterSafe<'a, u32, CTRL_SPEC, u8, FALLA_A, 2, O>;
269impl<'a, const O: u8> FALLA_W<'a, O> {
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, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
295#[doc = "Field `CLKSEL` reader - Clock Source Select"]
296pub type CLKSEL_R = crate::FieldReader<u8, CLKSEL_A>;
297#[doc = "Clock Source Select\n\nValue on reset: 0"]
298#[derive(Clone, Copy, Debug, PartialEq, Eq)]
299#[repr(u8)]
300pub enum CLKSEL_A {
301    #[doc = "0: Prescaled HFPERCLK"]
302    PRESCHFPERCLK = 0,
303    #[doc = "1: Compare/Capture Channel 1 Input"]
304    CC1 = 1,
305    #[doc = "2: Timer is clocked by underflow(down-count) or overflow(up-count) in the lower numbered neighbor Timer"]
306    TIMEROUF = 2,
307}
308impl From<CLKSEL_A> for u8 {
309    #[inline(always)]
310    fn from(variant: CLKSEL_A) -> Self {
311        variant as _
312    }
313}
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, const O: u8> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, CLKSEL_A, 2, O>;
343impl<'a, const O: u8> CLKSEL_W<'a, O> {
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 = "Field `PRESC` reader - Prescaler Setting"]
361pub type PRESC_R = crate::FieldReader<u8, PRESC_A>;
362#[doc = "Prescaler Setting\n\nValue on reset: 0"]
363#[derive(Clone, Copy, Debug, PartialEq, Eq)]
364#[repr(u8)]
365pub enum PRESC_A {
366    #[doc = "0: The HFPERCLK is undivided"]
367    DIV1 = 0,
368    #[doc = "1: The HFPERCLK is divided by 2"]
369    DIV2 = 1,
370    #[doc = "2: The HFPERCLK is divided by 4"]
371    DIV4 = 2,
372    #[doc = "3: The HFPERCLK is divided by 8"]
373    DIV8 = 3,
374    #[doc = "4: The HFPERCLK is divided by 16"]
375    DIV16 = 4,
376    #[doc = "5: The HFPERCLK is divided by 32"]
377    DIV32 = 5,
378    #[doc = "6: The HFPERCLK is divided by 64"]
379    DIV64 = 6,
380    #[doc = "7: The HFPERCLK is divided by 128"]
381    DIV128 = 7,
382    #[doc = "8: The HFPERCLK is divided by 256"]
383    DIV256 = 8,
384    #[doc = "9: The HFPERCLK is divided by 512"]
385    DIV512 = 9,
386    #[doc = "10: The HFPERCLK is divided by 1024"]
387    DIV1024 = 10,
388}
389impl From<PRESC_A> for u8 {
390    #[inline(always)]
391    fn from(variant: PRESC_A) -> Self {
392        variant as _
393    }
394}
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, const O: u8> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, PRESC_A, 4, O>;
472impl<'a, const O: u8> PRESC_W<'a, O> {
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, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
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, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
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    #[must_use]
608    pub fn mode(&mut self) -> MODE_W<0> {
609        MODE_W::new(self)
610    }
611    #[doc = "Bit 3 - Timer Start/Stop/Reload Synchronization"]
612    #[inline(always)]
613    #[must_use]
614    pub fn sync(&mut self) -> SYNC_W<3> {
615        SYNC_W::new(self)
616    }
617    #[doc = "Bit 4 - One-shot Mode Enable"]
618    #[inline(always)]
619    #[must_use]
620    pub fn osmen(&mut self) -> OSMEN_W<4> {
621        OSMEN_W::new(self)
622    }
623    #[doc = "Bit 5 - Quadrature Decoder Mode Selection"]
624    #[inline(always)]
625    #[must_use]
626    pub fn qdm(&mut self) -> QDM_W<5> {
627        QDM_W::new(self)
628    }
629    #[doc = "Bit 6 - Debug Mode Run Enable"]
630    #[inline(always)]
631    #[must_use]
632    pub fn debugrun(&mut self) -> DEBUGRUN_W<6> {
633        DEBUGRUN_W::new(self)
634    }
635    #[doc = "Bit 7 - DMA Request Clear on Active"]
636    #[inline(always)]
637    #[must_use]
638    pub fn dmaclract(&mut self) -> DMACLRACT_W<7> {
639        DMACLRACT_W::new(self)
640    }
641    #[doc = "Bits 8:9 - Timer Rising Input Edge Action"]
642    #[inline(always)]
643    #[must_use]
644    pub fn risea(&mut self) -> RISEA_W<8> {
645        RISEA_W::new(self)
646    }
647    #[doc = "Bits 10:11 - Timer Falling Input Edge Action"]
648    #[inline(always)]
649    #[must_use]
650    pub fn falla(&mut self) -> FALLA_W<10> {
651        FALLA_W::new(self)
652    }
653    #[doc = "Bit 13 - 2x Count Mode"]
654    #[inline(always)]
655    #[must_use]
656    pub fn x2cnt(&mut self) -> X2CNT_W<13> {
657        X2CNT_W::new(self)
658    }
659    #[doc = "Bits 16:17 - Clock Source Select"]
660    #[inline(always)]
661    #[must_use]
662    pub fn clksel(&mut self) -> CLKSEL_W<16> {
663        CLKSEL_W::new(self)
664    }
665    #[doc = "Bits 24:27 - Prescaler Setting"]
666    #[inline(always)]
667    #[must_use]
668    pub fn presc(&mut self) -> PRESC_W<24> {
669        PRESC_W::new(self)
670    }
671    #[doc = "Bit 28 - Always Track Inputs"]
672    #[inline(always)]
673    #[must_use]
674    pub fn ati(&mut self) -> ATI_W<28> {
675        ATI_W::new(self)
676    }
677    #[doc = "Bit 29 - Reload-Start Sets Compare Output initial State"]
678    #[inline(always)]
679    #[must_use]
680    pub fn rsscoist(&mut self) -> RSSCOIST_W<29> {
681        RSSCOIST_W::new(self)
682    }
683    #[doc = "Writes raw bits to the register."]
684    #[inline(always)]
685    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
686        self.0.bits(bits);
687        self
688    }
689}
690#[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"]
691pub struct CTRL_SPEC;
692impl crate::RegisterSpec for CTRL_SPEC {
693    type Ux = u32;
694}
695#[doc = "`read()` method returns [ctrl::R](R) reader structure"]
696impl crate::Readable for CTRL_SPEC {
697    type Reader = R;
698}
699#[doc = "`write(|w| ..)` method takes [ctrl::W](W) writer structure"]
700impl crate::Writable for CTRL_SPEC {
701    type Writer = W;
702    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
703    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
704}
705#[doc = "`reset()` method sets CTRL to value 0"]
706impl crate::Resettable for CTRL_SPEC {
707    const RESET_VALUE: Self::Ux = 0;
708}