mimxrt595s/flexio0/
timctl.rs

1#[doc = "Register `TIMCTL[%s]` reader"]
2pub struct R(crate::R<TIMCTL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<TIMCTL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<TIMCTL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<TIMCTL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `TIMCTL[%s]` writer"]
17pub struct W(crate::W<TIMCTL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<TIMCTL_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<TIMCTL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<TIMCTL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `TIMOD` reader - Timer Mode"]
38pub type TIMOD_R = crate::FieldReader<u8, TIMOD_A>;
39#[doc = "Timer Mode\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41#[repr(u8)]
42pub enum TIMOD_A {
43    #[doc = "0: Timer Disabled."]
44    DISABLE = 0,
45    #[doc = "1: Dual 8-bit counters baud mode."]
46    DUAL8BIT_BAUD = 1,
47    #[doc = "2: Dual 8-bit counters PWM high mode."]
48    DUAL8BIT_PWM_H = 2,
49    #[doc = "3: Single 16-bit counter mode."]
50    SINGLE16BIT = 3,
51    #[doc = "4: Single 16-bit counter disable mode."]
52    SINGLE16BIT_DISABLE = 4,
53    #[doc = "5: Dual 8-bit counters word mode."]
54    DUAL8BIT_WORD = 5,
55    #[doc = "6: Dual 8-bit counters PWM low mode."]
56    DUAL8BIT_PWM_L = 6,
57    #[doc = "7: Single 16-bit input capture mode."]
58    SINGLE16BIT_IN_CAPTURE = 7,
59}
60impl From<TIMOD_A> for u8 {
61    #[inline(always)]
62    fn from(variant: TIMOD_A) -> Self {
63        variant as _
64    }
65}
66impl TIMOD_R {
67    #[doc = "Get enumerated values variant"]
68    #[inline(always)]
69    pub fn variant(&self) -> TIMOD_A {
70        match self.bits {
71            0 => TIMOD_A::DISABLE,
72            1 => TIMOD_A::DUAL8BIT_BAUD,
73            2 => TIMOD_A::DUAL8BIT_PWM_H,
74            3 => TIMOD_A::SINGLE16BIT,
75            4 => TIMOD_A::SINGLE16BIT_DISABLE,
76            5 => TIMOD_A::DUAL8BIT_WORD,
77            6 => TIMOD_A::DUAL8BIT_PWM_L,
78            7 => TIMOD_A::SINGLE16BIT_IN_CAPTURE,
79            _ => unreachable!(),
80        }
81    }
82    #[doc = "Checks if the value of the field is `DISABLE`"]
83    #[inline(always)]
84    pub fn is_disable(&self) -> bool {
85        *self == TIMOD_A::DISABLE
86    }
87    #[doc = "Checks if the value of the field is `DUAL8BIT_BAUD`"]
88    #[inline(always)]
89    pub fn is_dual8bit_baud(&self) -> bool {
90        *self == TIMOD_A::DUAL8BIT_BAUD
91    }
92    #[doc = "Checks if the value of the field is `DUAL8BIT_PWM_H`"]
93    #[inline(always)]
94    pub fn is_dual8bit_pwm_h(&self) -> bool {
95        *self == TIMOD_A::DUAL8BIT_PWM_H
96    }
97    #[doc = "Checks if the value of the field is `SINGLE16BIT`"]
98    #[inline(always)]
99    pub fn is_single16bit(&self) -> bool {
100        *self == TIMOD_A::SINGLE16BIT
101    }
102    #[doc = "Checks if the value of the field is `SINGLE16BIT_DISABLE`"]
103    #[inline(always)]
104    pub fn is_single16bit_disable(&self) -> bool {
105        *self == TIMOD_A::SINGLE16BIT_DISABLE
106    }
107    #[doc = "Checks if the value of the field is `DUAL8BIT_WORD`"]
108    #[inline(always)]
109    pub fn is_dual8bit_word(&self) -> bool {
110        *self == TIMOD_A::DUAL8BIT_WORD
111    }
112    #[doc = "Checks if the value of the field is `DUAL8BIT_PWM_L`"]
113    #[inline(always)]
114    pub fn is_dual8bit_pwm_l(&self) -> bool {
115        *self == TIMOD_A::DUAL8BIT_PWM_L
116    }
117    #[doc = "Checks if the value of the field is `SINGLE16BIT_IN_CAPTURE`"]
118    #[inline(always)]
119    pub fn is_single16bit_in_capture(&self) -> bool {
120        *self == TIMOD_A::SINGLE16BIT_IN_CAPTURE
121    }
122}
123#[doc = "Field `TIMOD` writer - Timer Mode"]
124pub type TIMOD_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, TIMCTL_SPEC, u8, TIMOD_A, 3, O>;
125impl<'a, const O: u8> TIMOD_W<'a, O> {
126    #[doc = "Timer Disabled."]
127    #[inline(always)]
128    pub fn disable(self) -> &'a mut W {
129        self.variant(TIMOD_A::DISABLE)
130    }
131    #[doc = "Dual 8-bit counters baud mode."]
132    #[inline(always)]
133    pub fn dual8bit_baud(self) -> &'a mut W {
134        self.variant(TIMOD_A::DUAL8BIT_BAUD)
135    }
136    #[doc = "Dual 8-bit counters PWM high mode."]
137    #[inline(always)]
138    pub fn dual8bit_pwm_h(self) -> &'a mut W {
139        self.variant(TIMOD_A::DUAL8BIT_PWM_H)
140    }
141    #[doc = "Single 16-bit counter mode."]
142    #[inline(always)]
143    pub fn single16bit(self) -> &'a mut W {
144        self.variant(TIMOD_A::SINGLE16BIT)
145    }
146    #[doc = "Single 16-bit counter disable mode."]
147    #[inline(always)]
148    pub fn single16bit_disable(self) -> &'a mut W {
149        self.variant(TIMOD_A::SINGLE16BIT_DISABLE)
150    }
151    #[doc = "Dual 8-bit counters word mode."]
152    #[inline(always)]
153    pub fn dual8bit_word(self) -> &'a mut W {
154        self.variant(TIMOD_A::DUAL8BIT_WORD)
155    }
156    #[doc = "Dual 8-bit counters PWM low mode."]
157    #[inline(always)]
158    pub fn dual8bit_pwm_l(self) -> &'a mut W {
159        self.variant(TIMOD_A::DUAL8BIT_PWM_L)
160    }
161    #[doc = "Single 16-bit input capture mode."]
162    #[inline(always)]
163    pub fn single16bit_in_capture(self) -> &'a mut W {
164        self.variant(TIMOD_A::SINGLE16BIT_IN_CAPTURE)
165    }
166}
167#[doc = "Field `ONETIM` reader - Timer One Time Operation"]
168pub type ONETIM_R = crate::BitReader<ONETIM_A>;
169#[doc = "Timer One Time Operation\n\nValue on reset: 0"]
170#[derive(Clone, Copy, Debug, PartialEq, Eq)]
171pub enum ONETIM_A {
172    #[doc = "0: The timer enable event is generated as normal."]
173    NOT_BLOCKED = 0,
174    #[doc = "1: The timer enable event is blocked unless timer status flag is clear."]
175    BLOCKED = 1,
176}
177impl From<ONETIM_A> for bool {
178    #[inline(always)]
179    fn from(variant: ONETIM_A) -> Self {
180        variant as u8 != 0
181    }
182}
183impl ONETIM_R {
184    #[doc = "Get enumerated values variant"]
185    #[inline(always)]
186    pub fn variant(&self) -> ONETIM_A {
187        match self.bits {
188            false => ONETIM_A::NOT_BLOCKED,
189            true => ONETIM_A::BLOCKED,
190        }
191    }
192    #[doc = "Checks if the value of the field is `NOT_BLOCKED`"]
193    #[inline(always)]
194    pub fn is_not_blocked(&self) -> bool {
195        *self == ONETIM_A::NOT_BLOCKED
196    }
197    #[doc = "Checks if the value of the field is `BLOCKED`"]
198    #[inline(always)]
199    pub fn is_blocked(&self) -> bool {
200        *self == ONETIM_A::BLOCKED
201    }
202}
203#[doc = "Field `ONETIM` writer - Timer One Time Operation"]
204pub type ONETIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, TIMCTL_SPEC, ONETIM_A, O>;
205impl<'a, const O: u8> ONETIM_W<'a, O> {
206    #[doc = "The timer enable event is generated as normal."]
207    #[inline(always)]
208    pub fn not_blocked(self) -> &'a mut W {
209        self.variant(ONETIM_A::NOT_BLOCKED)
210    }
211    #[doc = "The timer enable event is blocked unless timer status flag is clear."]
212    #[inline(always)]
213    pub fn blocked(self) -> &'a mut W {
214        self.variant(ONETIM_A::BLOCKED)
215    }
216}
217#[doc = "Field `PININS` reader - Timer Pin Input Select"]
218pub type PININS_R = crate::BitReader<PININS_A>;
219#[doc = "Timer Pin Input Select\n\nValue on reset: 0"]
220#[derive(Clone, Copy, Debug, PartialEq, Eq)]
221pub enum PININS_A {
222    #[doc = "0: Timer pin input and output are selected by PINSEL."]
223    PINSEL = 0,
224    #[doc = "1: Timer pin input is selected by PINSEL+1, timer pin output remains selected by PINSEL."]
225    PINSELPLUS1 = 1,
226}
227impl From<PININS_A> for bool {
228    #[inline(always)]
229    fn from(variant: PININS_A) -> Self {
230        variant as u8 != 0
231    }
232}
233impl PININS_R {
234    #[doc = "Get enumerated values variant"]
235    #[inline(always)]
236    pub fn variant(&self) -> PININS_A {
237        match self.bits {
238            false => PININS_A::PINSEL,
239            true => PININS_A::PINSELPLUS1,
240        }
241    }
242    #[doc = "Checks if the value of the field is `PINSEL`"]
243    #[inline(always)]
244    pub fn is_pinsel(&self) -> bool {
245        *self == PININS_A::PINSEL
246    }
247    #[doc = "Checks if the value of the field is `PINSELPLUS1`"]
248    #[inline(always)]
249    pub fn is_pinselplus1(&self) -> bool {
250        *self == PININS_A::PINSELPLUS1
251    }
252}
253#[doc = "Field `PININS` writer - Timer Pin Input Select"]
254pub type PININS_W<'a, const O: u8> = crate::BitWriter<'a, u32, TIMCTL_SPEC, PININS_A, O>;
255impl<'a, const O: u8> PININS_W<'a, O> {
256    #[doc = "Timer pin input and output are selected by PINSEL."]
257    #[inline(always)]
258    pub fn pinsel(self) -> &'a mut W {
259        self.variant(PININS_A::PINSEL)
260    }
261    #[doc = "Timer pin input is selected by PINSEL+1, timer pin output remains selected by PINSEL."]
262    #[inline(always)]
263    pub fn pinselplus1(self) -> &'a mut W {
264        self.variant(PININS_A::PINSELPLUS1)
265    }
266}
267#[doc = "Field `PINPOL` reader - Timer Pin Polarity"]
268pub type PINPOL_R = crate::BitReader<PINPOL_A>;
269#[doc = "Timer Pin Polarity\n\nValue on reset: 0"]
270#[derive(Clone, Copy, Debug, PartialEq, Eq)]
271pub enum PINPOL_A {
272    #[doc = "0: Pin is active high"]
273    ACTIVE_HIGH = 0,
274    #[doc = "1: Pin is active low"]
275    ACTIVE_LOW = 1,
276}
277impl From<PINPOL_A> for bool {
278    #[inline(always)]
279    fn from(variant: PINPOL_A) -> Self {
280        variant as u8 != 0
281    }
282}
283impl PINPOL_R {
284    #[doc = "Get enumerated values variant"]
285    #[inline(always)]
286    pub fn variant(&self) -> PINPOL_A {
287        match self.bits {
288            false => PINPOL_A::ACTIVE_HIGH,
289            true => PINPOL_A::ACTIVE_LOW,
290        }
291    }
292    #[doc = "Checks if the value of the field is `ACTIVE_HIGH`"]
293    #[inline(always)]
294    pub fn is_active_high(&self) -> bool {
295        *self == PINPOL_A::ACTIVE_HIGH
296    }
297    #[doc = "Checks if the value of the field is `ACTIVE_LOW`"]
298    #[inline(always)]
299    pub fn is_active_low(&self) -> bool {
300        *self == PINPOL_A::ACTIVE_LOW
301    }
302}
303#[doc = "Field `PINPOL` writer - Timer Pin Polarity"]
304pub type PINPOL_W<'a, const O: u8> = crate::BitWriter<'a, u32, TIMCTL_SPEC, PINPOL_A, O>;
305impl<'a, const O: u8> PINPOL_W<'a, O> {
306    #[doc = "Pin is active high"]
307    #[inline(always)]
308    pub fn active_high(self) -> &'a mut W {
309        self.variant(PINPOL_A::ACTIVE_HIGH)
310    }
311    #[doc = "Pin is active low"]
312    #[inline(always)]
313    pub fn active_low(self) -> &'a mut W {
314        self.variant(PINPOL_A::ACTIVE_LOW)
315    }
316}
317#[doc = "Field `PINSEL` reader - Timer Pin Select"]
318pub type PINSEL_R = crate::FieldReader<u8, u8>;
319#[doc = "Field `PINSEL` writer - Timer Pin Select"]
320pub type PINSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TIMCTL_SPEC, u8, u8, 4, O>;
321#[doc = "Field `PINCFG` reader - Timer Pin Configuration"]
322pub type PINCFG_R = crate::FieldReader<u8, PINCFG_A>;
323#[doc = "Timer Pin Configuration\n\nValue on reset: 0"]
324#[derive(Clone, Copy, Debug, PartialEq, Eq)]
325#[repr(u8)]
326pub enum PINCFG_A {
327    #[doc = "0: Timer pin output disabled"]
328    OUTDISABLE = 0,
329    #[doc = "1: Timer pin open drain or bidirectional output enable"]
330    OPEND_BIDIROUTEN = 1,
331    #[doc = "2: Timer pin bidirectional output data"]
332    BIDIR_OUTDATA = 2,
333    #[doc = "3: Timer pin output"]
334    OUTPUT = 3,
335}
336impl From<PINCFG_A> for u8 {
337    #[inline(always)]
338    fn from(variant: PINCFG_A) -> Self {
339        variant as _
340    }
341}
342impl PINCFG_R {
343    #[doc = "Get enumerated values variant"]
344    #[inline(always)]
345    pub fn variant(&self) -> PINCFG_A {
346        match self.bits {
347            0 => PINCFG_A::OUTDISABLE,
348            1 => PINCFG_A::OPEND_BIDIROUTEN,
349            2 => PINCFG_A::BIDIR_OUTDATA,
350            3 => PINCFG_A::OUTPUT,
351            _ => unreachable!(),
352        }
353    }
354    #[doc = "Checks if the value of the field is `OUTDISABLE`"]
355    #[inline(always)]
356    pub fn is_outdisable(&self) -> bool {
357        *self == PINCFG_A::OUTDISABLE
358    }
359    #[doc = "Checks if the value of the field is `OPEND_BIDIROUTEN`"]
360    #[inline(always)]
361    pub fn is_opend_bidirouten(&self) -> bool {
362        *self == PINCFG_A::OPEND_BIDIROUTEN
363    }
364    #[doc = "Checks if the value of the field is `BIDIR_OUTDATA`"]
365    #[inline(always)]
366    pub fn is_bidir_outdata(&self) -> bool {
367        *self == PINCFG_A::BIDIR_OUTDATA
368    }
369    #[doc = "Checks if the value of the field is `OUTPUT`"]
370    #[inline(always)]
371    pub fn is_output(&self) -> bool {
372        *self == PINCFG_A::OUTPUT
373    }
374}
375#[doc = "Field `PINCFG` writer - Timer Pin Configuration"]
376pub type PINCFG_W<'a, const O: u8> =
377    crate::FieldWriterSafe<'a, u32, TIMCTL_SPEC, u8, PINCFG_A, 2, O>;
378impl<'a, const O: u8> PINCFG_W<'a, O> {
379    #[doc = "Timer pin output disabled"]
380    #[inline(always)]
381    pub fn outdisable(self) -> &'a mut W {
382        self.variant(PINCFG_A::OUTDISABLE)
383    }
384    #[doc = "Timer pin open drain or bidirectional output enable"]
385    #[inline(always)]
386    pub fn opend_bidirouten(self) -> &'a mut W {
387        self.variant(PINCFG_A::OPEND_BIDIROUTEN)
388    }
389    #[doc = "Timer pin bidirectional output data"]
390    #[inline(always)]
391    pub fn bidir_outdata(self) -> &'a mut W {
392        self.variant(PINCFG_A::BIDIR_OUTDATA)
393    }
394    #[doc = "Timer pin output"]
395    #[inline(always)]
396    pub fn output(self) -> &'a mut W {
397        self.variant(PINCFG_A::OUTPUT)
398    }
399}
400#[doc = "Field `TRGSRC` reader - Trigger Source"]
401pub type TRGSRC_R = crate::BitReader<TRGSRC_A>;
402#[doc = "Trigger Source\n\nValue on reset: 0"]
403#[derive(Clone, Copy, Debug, PartialEq, Eq)]
404pub enum TRGSRC_A {
405    #[doc = "0: External trigger selected"]
406    EXT_TRIG = 0,
407    #[doc = "1: Internal trigger selected"]
408    INTERNAL_TRIG = 1,
409}
410impl From<TRGSRC_A> for bool {
411    #[inline(always)]
412    fn from(variant: TRGSRC_A) -> Self {
413        variant as u8 != 0
414    }
415}
416impl TRGSRC_R {
417    #[doc = "Get enumerated values variant"]
418    #[inline(always)]
419    pub fn variant(&self) -> TRGSRC_A {
420        match self.bits {
421            false => TRGSRC_A::EXT_TRIG,
422            true => TRGSRC_A::INTERNAL_TRIG,
423        }
424    }
425    #[doc = "Checks if the value of the field is `EXT_TRIG`"]
426    #[inline(always)]
427    pub fn is_ext_trig(&self) -> bool {
428        *self == TRGSRC_A::EXT_TRIG
429    }
430    #[doc = "Checks if the value of the field is `INTERNAL_TRIG`"]
431    #[inline(always)]
432    pub fn is_internal_trig(&self) -> bool {
433        *self == TRGSRC_A::INTERNAL_TRIG
434    }
435}
436#[doc = "Field `TRGSRC` writer - Trigger Source"]
437pub type TRGSRC_W<'a, const O: u8> = crate::BitWriter<'a, u32, TIMCTL_SPEC, TRGSRC_A, O>;
438impl<'a, const O: u8> TRGSRC_W<'a, O> {
439    #[doc = "External trigger selected"]
440    #[inline(always)]
441    pub fn ext_trig(self) -> &'a mut W {
442        self.variant(TRGSRC_A::EXT_TRIG)
443    }
444    #[doc = "Internal trigger selected"]
445    #[inline(always)]
446    pub fn internal_trig(self) -> &'a mut W {
447        self.variant(TRGSRC_A::INTERNAL_TRIG)
448    }
449}
450#[doc = "Field `TRGPOL` reader - Trigger Polarity"]
451pub type TRGPOL_R = crate::BitReader<TRGPOL_A>;
452#[doc = "Trigger Polarity\n\nValue on reset: 0"]
453#[derive(Clone, Copy, Debug, PartialEq, Eq)]
454pub enum TRGPOL_A {
455    #[doc = "0: Trigger active high"]
456    ACTIVE_HIGH = 0,
457    #[doc = "1: Trigger active low"]
458    ACTIVE_LOW = 1,
459}
460impl From<TRGPOL_A> for bool {
461    #[inline(always)]
462    fn from(variant: TRGPOL_A) -> Self {
463        variant as u8 != 0
464    }
465}
466impl TRGPOL_R {
467    #[doc = "Get enumerated values variant"]
468    #[inline(always)]
469    pub fn variant(&self) -> TRGPOL_A {
470        match self.bits {
471            false => TRGPOL_A::ACTIVE_HIGH,
472            true => TRGPOL_A::ACTIVE_LOW,
473        }
474    }
475    #[doc = "Checks if the value of the field is `ACTIVE_HIGH`"]
476    #[inline(always)]
477    pub fn is_active_high(&self) -> bool {
478        *self == TRGPOL_A::ACTIVE_HIGH
479    }
480    #[doc = "Checks if the value of the field is `ACTIVE_LOW`"]
481    #[inline(always)]
482    pub fn is_active_low(&self) -> bool {
483        *self == TRGPOL_A::ACTIVE_LOW
484    }
485}
486#[doc = "Field `TRGPOL` writer - Trigger Polarity"]
487pub type TRGPOL_W<'a, const O: u8> = crate::BitWriter<'a, u32, TIMCTL_SPEC, TRGPOL_A, O>;
488impl<'a, const O: u8> TRGPOL_W<'a, O> {
489    #[doc = "Trigger active high"]
490    #[inline(always)]
491    pub fn active_high(self) -> &'a mut W {
492        self.variant(TRGPOL_A::ACTIVE_HIGH)
493    }
494    #[doc = "Trigger active low"]
495    #[inline(always)]
496    pub fn active_low(self) -> &'a mut W {
497        self.variant(TRGPOL_A::ACTIVE_LOW)
498    }
499}
500#[doc = "Field `TRGSEL` reader - Trigger Select"]
501pub type TRGSEL_R = crate::FieldReader<u8, u8>;
502#[doc = "Field `TRGSEL` writer - Trigger Select"]
503pub type TRGSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TIMCTL_SPEC, u8, u8, 5, O>;
504impl R {
505    #[doc = "Bits 0:2 - Timer Mode"]
506    #[inline(always)]
507    pub fn timod(&self) -> TIMOD_R {
508        TIMOD_R::new((self.bits & 7) as u8)
509    }
510    #[doc = "Bit 5 - Timer One Time Operation"]
511    #[inline(always)]
512    pub fn onetim(&self) -> ONETIM_R {
513        ONETIM_R::new(((self.bits >> 5) & 1) != 0)
514    }
515    #[doc = "Bit 6 - Timer Pin Input Select"]
516    #[inline(always)]
517    pub fn pinins(&self) -> PININS_R {
518        PININS_R::new(((self.bits >> 6) & 1) != 0)
519    }
520    #[doc = "Bit 7 - Timer Pin Polarity"]
521    #[inline(always)]
522    pub fn pinpol(&self) -> PINPOL_R {
523        PINPOL_R::new(((self.bits >> 7) & 1) != 0)
524    }
525    #[doc = "Bits 8:11 - Timer Pin Select"]
526    #[inline(always)]
527    pub fn pinsel(&self) -> PINSEL_R {
528        PINSEL_R::new(((self.bits >> 8) & 0x0f) as u8)
529    }
530    #[doc = "Bits 16:17 - Timer Pin Configuration"]
531    #[inline(always)]
532    pub fn pincfg(&self) -> PINCFG_R {
533        PINCFG_R::new(((self.bits >> 16) & 3) as u8)
534    }
535    #[doc = "Bit 22 - Trigger Source"]
536    #[inline(always)]
537    pub fn trgsrc(&self) -> TRGSRC_R {
538        TRGSRC_R::new(((self.bits >> 22) & 1) != 0)
539    }
540    #[doc = "Bit 23 - Trigger Polarity"]
541    #[inline(always)]
542    pub fn trgpol(&self) -> TRGPOL_R {
543        TRGPOL_R::new(((self.bits >> 23) & 1) != 0)
544    }
545    #[doc = "Bits 24:28 - Trigger Select"]
546    #[inline(always)]
547    pub fn trgsel(&self) -> TRGSEL_R {
548        TRGSEL_R::new(((self.bits >> 24) & 0x1f) as u8)
549    }
550}
551impl W {
552    #[doc = "Bits 0:2 - Timer Mode"]
553    #[inline(always)]
554    #[must_use]
555    pub fn timod(&mut self) -> TIMOD_W<0> {
556        TIMOD_W::new(self)
557    }
558    #[doc = "Bit 5 - Timer One Time Operation"]
559    #[inline(always)]
560    #[must_use]
561    pub fn onetim(&mut self) -> ONETIM_W<5> {
562        ONETIM_W::new(self)
563    }
564    #[doc = "Bit 6 - Timer Pin Input Select"]
565    #[inline(always)]
566    #[must_use]
567    pub fn pinins(&mut self) -> PININS_W<6> {
568        PININS_W::new(self)
569    }
570    #[doc = "Bit 7 - Timer Pin Polarity"]
571    #[inline(always)]
572    #[must_use]
573    pub fn pinpol(&mut self) -> PINPOL_W<7> {
574        PINPOL_W::new(self)
575    }
576    #[doc = "Bits 8:11 - Timer Pin Select"]
577    #[inline(always)]
578    #[must_use]
579    pub fn pinsel(&mut self) -> PINSEL_W<8> {
580        PINSEL_W::new(self)
581    }
582    #[doc = "Bits 16:17 - Timer Pin Configuration"]
583    #[inline(always)]
584    #[must_use]
585    pub fn pincfg(&mut self) -> PINCFG_W<16> {
586        PINCFG_W::new(self)
587    }
588    #[doc = "Bit 22 - Trigger Source"]
589    #[inline(always)]
590    #[must_use]
591    pub fn trgsrc(&mut self) -> TRGSRC_W<22> {
592        TRGSRC_W::new(self)
593    }
594    #[doc = "Bit 23 - Trigger Polarity"]
595    #[inline(always)]
596    #[must_use]
597    pub fn trgpol(&mut self) -> TRGPOL_W<23> {
598        TRGPOL_W::new(self)
599    }
600    #[doc = "Bits 24:28 - Trigger Select"]
601    #[inline(always)]
602    #[must_use]
603    pub fn trgsel(&mut self) -> TRGSEL_W<24> {
604        TRGSEL_W::new(self)
605    }
606    #[doc = "Writes raw bits to the register."]
607    #[inline(always)]
608    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
609        self.0.bits(bits);
610        self
611    }
612}
613#[doc = "Timer Control N 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 [timctl](index.html) module"]
614pub struct TIMCTL_SPEC;
615impl crate::RegisterSpec for TIMCTL_SPEC {
616    type Ux = u32;
617}
618#[doc = "`read()` method returns [timctl::R](R) reader structure"]
619impl crate::Readable for TIMCTL_SPEC {
620    type Reader = R;
621}
622#[doc = "`write(|w| ..)` method takes [timctl::W](W) writer structure"]
623impl crate::Writable for TIMCTL_SPEC {
624    type Writer = W;
625    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
626    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
627}
628#[doc = "`reset()` method sets TIMCTL[%s]
629to value 0"]
630impl crate::Resettable for TIMCTL_SPEC {
631    const RESET_VALUE: Self::Ux = 0;
632}