efm32tg11b_pac/efm32tg11b540/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 = "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 `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, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
299#[doc = "Field `CLKSEL` reader - Clock Source Select"]
300pub type CLKSEL_R = crate::FieldReader<u8, CLKSEL_A>;
301#[doc = "Clock Source Select\n\nValue on reset: 0"]
302#[derive(Clone, Copy, Debug, PartialEq, Eq)]
303#[repr(u8)]
304pub enum CLKSEL_A {
305    #[doc = "0: Prescaled HFPERCLK"]
306    PRESCHFPERCLK = 0,
307    #[doc = "1: Compare/Capture Channel 1 Input"]
308    CC1 = 1,
309    #[doc = "2: Timer is clocked by underflow(down-count) or overflow(up-count) in the lower numbered neighbor Timer"]
310    TIMEROUF = 2,
311}
312impl From<CLKSEL_A> for u8 {
313    #[inline(always)]
314    fn from(variant: CLKSEL_A) -> Self {
315        variant as _
316    }
317}
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, const O: u8> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, CLKSEL_A, 2, O>;
347impl<'a, const O: u8> CLKSEL_W<'a, O> {
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 = "Field `PRESC` reader - Prescaler Setting"]
365pub type PRESC_R = crate::FieldReader<u8, PRESC_A>;
366#[doc = "Prescaler Setting\n\nValue on reset: 0"]
367#[derive(Clone, Copy, Debug, PartialEq, Eq)]
368#[repr(u8)]
369pub enum PRESC_A {
370    #[doc = "0: The HFPERCLK is undivided"]
371    DIV1 = 0,
372    #[doc = "1: The HFPERCLK is divided by 2"]
373    DIV2 = 1,
374    #[doc = "2: The HFPERCLK is divided by 4"]
375    DIV4 = 2,
376    #[doc = "3: The HFPERCLK is divided by 8"]
377    DIV8 = 3,
378    #[doc = "4: The HFPERCLK is divided by 16"]
379    DIV16 = 4,
380    #[doc = "5: The HFPERCLK is divided by 32"]
381    DIV32 = 5,
382    #[doc = "6: The HFPERCLK is divided by 64"]
383    DIV64 = 6,
384    #[doc = "7: The HFPERCLK is divided by 128"]
385    DIV128 = 7,
386    #[doc = "8: The HFPERCLK is divided by 256"]
387    DIV256 = 8,
388    #[doc = "9: The HFPERCLK is divided by 512"]
389    DIV512 = 9,
390    #[doc = "10: The HFPERCLK is divided by 1024"]
391    DIV1024 = 10,
392}
393impl From<PRESC_A> for u8 {
394    #[inline(always)]
395    fn from(variant: PRESC_A) -> Self {
396        variant as _
397    }
398}
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, const O: u8> = crate::FieldWriter<'a, u32, CTRL_SPEC, u8, PRESC_A, 4, O>;
476impl<'a, const O: u8> PRESC_W<'a, O> {
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, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
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, const O: u8> = crate::BitWriter<'a, u32, CTRL_SPEC, bool, O>;
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    #[must_use]
617    pub fn mode(&mut self) -> MODE_W<0> {
618        MODE_W::new(self)
619    }
620    #[doc = "Bit 3 - Timer Start/Stop/Reload Synchronization"]
621    #[inline(always)]
622    #[must_use]
623    pub fn sync(&mut self) -> SYNC_W<3> {
624        SYNC_W::new(self)
625    }
626    #[doc = "Bit 4 - One-shot Mode Enable"]
627    #[inline(always)]
628    #[must_use]
629    pub fn osmen(&mut self) -> OSMEN_W<4> {
630        OSMEN_W::new(self)
631    }
632    #[doc = "Bit 5 - Quadrature Decoder Mode Selection"]
633    #[inline(always)]
634    #[must_use]
635    pub fn qdm(&mut self) -> QDM_W<5> {
636        QDM_W::new(self)
637    }
638    #[doc = "Bit 6 - Debug Mode Run Enable"]
639    #[inline(always)]
640    #[must_use]
641    pub fn debugrun(&mut self) -> DEBUGRUN_W<6> {
642        DEBUGRUN_W::new(self)
643    }
644    #[doc = "Bit 7 - DMA Request Clear on Active"]
645    #[inline(always)]
646    #[must_use]
647    pub fn dmaclract(&mut self) -> DMACLRACT_W<7> {
648        DMACLRACT_W::new(self)
649    }
650    #[doc = "Bits 8:9 - Timer Rising Input Edge Action"]
651    #[inline(always)]
652    #[must_use]
653    pub fn risea(&mut self) -> RISEA_W<8> {
654        RISEA_W::new(self)
655    }
656    #[doc = "Bits 10:11 - Timer Falling Input Edge Action"]
657    #[inline(always)]
658    #[must_use]
659    pub fn falla(&mut self) -> FALLA_W<10> {
660        FALLA_W::new(self)
661    }
662    #[doc = "Bit 13 - 2x Count Mode"]
663    #[inline(always)]
664    #[must_use]
665    pub fn x2cnt(&mut self) -> X2CNT_W<13> {
666        X2CNT_W::new(self)
667    }
668    #[doc = "Bit 14 - Disable Timer From Start/Stop/Reload Other Synchronized Timers"]
669    #[inline(always)]
670    #[must_use]
671    pub fn dissyncout(&mut self) -> DISSYNCOUT_W<14> {
672        DISSYNCOUT_W::new(self)
673    }
674    #[doc = "Bits 16:17 - Clock Source Select"]
675    #[inline(always)]
676    #[must_use]
677    pub fn clksel(&mut self) -> CLKSEL_W<16> {
678        CLKSEL_W::new(self)
679    }
680    #[doc = "Bits 24:27 - Prescaler Setting"]
681    #[inline(always)]
682    #[must_use]
683    pub fn presc(&mut self) -> PRESC_W<24> {
684        PRESC_W::new(self)
685    }
686    #[doc = "Bit 28 - Always Track Inputs"]
687    #[inline(always)]
688    #[must_use]
689    pub fn ati(&mut self) -> ATI_W<28> {
690        ATI_W::new(self)
691    }
692    #[doc = "Bit 29 - Reload-Start Sets Compare Output Initial State"]
693    #[inline(always)]
694    #[must_use]
695    pub fn rsscoist(&mut self) -> RSSCOIST_W<29> {
696        RSSCOIST_W::new(self)
697    }
698    #[doc = "Writes raw bits to the register."]
699    #[inline(always)]
700    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
701        self.0.bits(bits);
702        self
703    }
704}
705#[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"]
706pub struct CTRL_SPEC;
707impl crate::RegisterSpec for CTRL_SPEC {
708    type Ux = u32;
709}
710#[doc = "`read()` method returns [ctrl::R](R) reader structure"]
711impl crate::Readable for CTRL_SPEC {
712    type Reader = R;
713}
714#[doc = "`write(|w| ..)` method takes [ctrl::W](W) writer structure"]
715impl crate::Writable for CTRL_SPEC {
716    type Writer = W;
717    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
718    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
719}
720#[doc = "`reset()` method sets CTRL to value 0"]
721impl crate::Resettable for CTRL_SPEC {
722    const RESET_VALUE: Self::Ux = 0;
723}