s32k142_pac/flexio/
timcfg3.rs

1#[doc = "Register `TIMCFG3` reader"]
2pub struct R(crate::R<TIMCFG3_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<TIMCFG3_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<TIMCFG3_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<TIMCFG3_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `TIMCFG3` writer"]
17pub struct W(crate::W<TIMCFG3_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<TIMCFG3_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<TIMCFG3_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<TIMCFG3_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Timer Start Bit\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39pub enum TSTART_A {
40    #[doc = "0: Start bit disabled"]
41    _0 = 0,
42    #[doc = "1: Start bit enabled"]
43    _1 = 1,
44}
45impl From<TSTART_A> for bool {
46    #[inline(always)]
47    fn from(variant: TSTART_A) -> Self {
48        variant as u8 != 0
49    }
50}
51#[doc = "Field `TSTART` reader - Timer Start Bit"]
52pub struct TSTART_R(crate::FieldReader<bool, TSTART_A>);
53impl TSTART_R {
54    #[inline(always)]
55    pub(crate) fn new(bits: bool) -> Self {
56        TSTART_R(crate::FieldReader::new(bits))
57    }
58    #[doc = r"Get enumerated values variant"]
59    #[inline(always)]
60    pub fn variant(&self) -> TSTART_A {
61        match self.bits {
62            false => TSTART_A::_0,
63            true => TSTART_A::_1,
64        }
65    }
66    #[doc = "Checks if the value of the field is `_0`"]
67    #[inline(always)]
68    pub fn is_0(&self) -> bool {
69        **self == TSTART_A::_0
70    }
71    #[doc = "Checks if the value of the field is `_1`"]
72    #[inline(always)]
73    pub fn is_1(&self) -> bool {
74        **self == TSTART_A::_1
75    }
76}
77impl core::ops::Deref for TSTART_R {
78    type Target = crate::FieldReader<bool, TSTART_A>;
79    #[inline(always)]
80    fn deref(&self) -> &Self::Target {
81        &self.0
82    }
83}
84#[doc = "Field `TSTART` writer - Timer Start Bit"]
85pub struct TSTART_W<'a> {
86    w: &'a mut W,
87}
88impl<'a> TSTART_W<'a> {
89    #[doc = r"Writes `variant` to the field"]
90    #[inline(always)]
91    pub fn variant(self, variant: TSTART_A) -> &'a mut W {
92        self.bit(variant.into())
93    }
94    #[doc = "Start bit disabled"]
95    #[inline(always)]
96    pub fn _0(self) -> &'a mut W {
97        self.variant(TSTART_A::_0)
98    }
99    #[doc = "Start bit enabled"]
100    #[inline(always)]
101    pub fn _1(self) -> &'a mut W {
102        self.variant(TSTART_A::_1)
103    }
104    #[doc = r"Sets the field bit"]
105    #[inline(always)]
106    pub fn set_bit(self) -> &'a mut W {
107        self.bit(true)
108    }
109    #[doc = r"Clears the field bit"]
110    #[inline(always)]
111    pub fn clear_bit(self) -> &'a mut W {
112        self.bit(false)
113    }
114    #[doc = r"Writes raw bits to the field"]
115    #[inline(always)]
116    pub fn bit(self, value: bool) -> &'a mut W {
117        self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
118        self.w
119    }
120}
121#[doc = "Timer Stop Bit\n\nValue on reset: 0"]
122#[derive(Clone, Copy, Debug, PartialEq)]
123#[repr(u8)]
124pub enum TSTOP_A {
125    #[doc = "0: Stop bit disabled"]
126    _0 = 0,
127    #[doc = "1: Stop bit is enabled on timer compare"]
128    _1 = 1,
129    #[doc = "2: Stop bit is enabled on timer disable"]
130    _10 = 2,
131    #[doc = "3: Stop bit is enabled on timer compare and timer disable"]
132    _11 = 3,
133}
134impl From<TSTOP_A> for u8 {
135    #[inline(always)]
136    fn from(variant: TSTOP_A) -> Self {
137        variant as _
138    }
139}
140#[doc = "Field `TSTOP` reader - Timer Stop Bit"]
141pub struct TSTOP_R(crate::FieldReader<u8, TSTOP_A>);
142impl TSTOP_R {
143    #[inline(always)]
144    pub(crate) fn new(bits: u8) -> Self {
145        TSTOP_R(crate::FieldReader::new(bits))
146    }
147    #[doc = r"Get enumerated values variant"]
148    #[inline(always)]
149    pub fn variant(&self) -> TSTOP_A {
150        match self.bits {
151            0 => TSTOP_A::_0,
152            1 => TSTOP_A::_1,
153            2 => TSTOP_A::_10,
154            3 => TSTOP_A::_11,
155            _ => unreachable!(),
156        }
157    }
158    #[doc = "Checks if the value of the field is `_0`"]
159    #[inline(always)]
160    pub fn is_0(&self) -> bool {
161        **self == TSTOP_A::_0
162    }
163    #[doc = "Checks if the value of the field is `_1`"]
164    #[inline(always)]
165    pub fn is_1(&self) -> bool {
166        **self == TSTOP_A::_1
167    }
168    #[doc = "Checks if the value of the field is `_10`"]
169    #[inline(always)]
170    pub fn is_10(&self) -> bool {
171        **self == TSTOP_A::_10
172    }
173    #[doc = "Checks if the value of the field is `_11`"]
174    #[inline(always)]
175    pub fn is_11(&self) -> bool {
176        **self == TSTOP_A::_11
177    }
178}
179impl core::ops::Deref for TSTOP_R {
180    type Target = crate::FieldReader<u8, TSTOP_A>;
181    #[inline(always)]
182    fn deref(&self) -> &Self::Target {
183        &self.0
184    }
185}
186#[doc = "Field `TSTOP` writer - Timer Stop Bit"]
187pub struct TSTOP_W<'a> {
188    w: &'a mut W,
189}
190impl<'a> TSTOP_W<'a> {
191    #[doc = r"Writes `variant` to the field"]
192    #[inline(always)]
193    pub fn variant(self, variant: TSTOP_A) -> &'a mut W {
194        self.bits(variant.into())
195    }
196    #[doc = "Stop bit disabled"]
197    #[inline(always)]
198    pub fn _0(self) -> &'a mut W {
199        self.variant(TSTOP_A::_0)
200    }
201    #[doc = "Stop bit is enabled on timer compare"]
202    #[inline(always)]
203    pub fn _1(self) -> &'a mut W {
204        self.variant(TSTOP_A::_1)
205    }
206    #[doc = "Stop bit is enabled on timer disable"]
207    #[inline(always)]
208    pub fn _10(self) -> &'a mut W {
209        self.variant(TSTOP_A::_10)
210    }
211    #[doc = "Stop bit is enabled on timer compare and timer disable"]
212    #[inline(always)]
213    pub fn _11(self) -> &'a mut W {
214        self.variant(TSTOP_A::_11)
215    }
216    #[doc = r"Writes raw bits to the field"]
217    #[inline(always)]
218    pub fn bits(self, value: u8) -> &'a mut W {
219        self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4);
220        self.w
221    }
222}
223#[doc = "Timer Enable\n\nValue on reset: 0"]
224#[derive(Clone, Copy, Debug, PartialEq)]
225#[repr(u8)]
226pub enum TIMENA_A {
227    #[doc = "0: Timer always enabled"]
228    _0 = 0,
229    #[doc = "1: Timer enabled on Timer N-1 enable"]
230    _1 = 1,
231    #[doc = "2: Timer enabled on Trigger high"]
232    _10 = 2,
233    #[doc = "3: Timer enabled on Trigger high and Pin high"]
234    _11 = 3,
235    #[doc = "4: Timer enabled on Pin rising edge"]
236    _100 = 4,
237    #[doc = "5: Timer enabled on Pin rising edge and Trigger high"]
238    _101 = 5,
239    #[doc = "6: Timer enabled on Trigger rising edge"]
240    _110 = 6,
241    #[doc = "7: Timer enabled on Trigger rising or falling edge"]
242    _111 = 7,
243}
244impl From<TIMENA_A> for u8 {
245    #[inline(always)]
246    fn from(variant: TIMENA_A) -> Self {
247        variant as _
248    }
249}
250#[doc = "Field `TIMENA` reader - Timer Enable"]
251pub struct TIMENA_R(crate::FieldReader<u8, TIMENA_A>);
252impl TIMENA_R {
253    #[inline(always)]
254    pub(crate) fn new(bits: u8) -> Self {
255        TIMENA_R(crate::FieldReader::new(bits))
256    }
257    #[doc = r"Get enumerated values variant"]
258    #[inline(always)]
259    pub fn variant(&self) -> TIMENA_A {
260        match self.bits {
261            0 => TIMENA_A::_0,
262            1 => TIMENA_A::_1,
263            2 => TIMENA_A::_10,
264            3 => TIMENA_A::_11,
265            4 => TIMENA_A::_100,
266            5 => TIMENA_A::_101,
267            6 => TIMENA_A::_110,
268            7 => TIMENA_A::_111,
269            _ => unreachable!(),
270        }
271    }
272    #[doc = "Checks if the value of the field is `_0`"]
273    #[inline(always)]
274    pub fn is_0(&self) -> bool {
275        **self == TIMENA_A::_0
276    }
277    #[doc = "Checks if the value of the field is `_1`"]
278    #[inline(always)]
279    pub fn is_1(&self) -> bool {
280        **self == TIMENA_A::_1
281    }
282    #[doc = "Checks if the value of the field is `_10`"]
283    #[inline(always)]
284    pub fn is_10(&self) -> bool {
285        **self == TIMENA_A::_10
286    }
287    #[doc = "Checks if the value of the field is `_11`"]
288    #[inline(always)]
289    pub fn is_11(&self) -> bool {
290        **self == TIMENA_A::_11
291    }
292    #[doc = "Checks if the value of the field is `_100`"]
293    #[inline(always)]
294    pub fn is_100(&self) -> bool {
295        **self == TIMENA_A::_100
296    }
297    #[doc = "Checks if the value of the field is `_101`"]
298    #[inline(always)]
299    pub fn is_101(&self) -> bool {
300        **self == TIMENA_A::_101
301    }
302    #[doc = "Checks if the value of the field is `_110`"]
303    #[inline(always)]
304    pub fn is_110(&self) -> bool {
305        **self == TIMENA_A::_110
306    }
307    #[doc = "Checks if the value of the field is `_111`"]
308    #[inline(always)]
309    pub fn is_111(&self) -> bool {
310        **self == TIMENA_A::_111
311    }
312}
313impl core::ops::Deref for TIMENA_R {
314    type Target = crate::FieldReader<u8, TIMENA_A>;
315    #[inline(always)]
316    fn deref(&self) -> &Self::Target {
317        &self.0
318    }
319}
320#[doc = "Field `TIMENA` writer - Timer Enable"]
321pub struct TIMENA_W<'a> {
322    w: &'a mut W,
323}
324impl<'a> TIMENA_W<'a> {
325    #[doc = r"Writes `variant` to the field"]
326    #[inline(always)]
327    pub fn variant(self, variant: TIMENA_A) -> &'a mut W {
328        self.bits(variant.into())
329    }
330    #[doc = "Timer always enabled"]
331    #[inline(always)]
332    pub fn _0(self) -> &'a mut W {
333        self.variant(TIMENA_A::_0)
334    }
335    #[doc = "Timer enabled on Timer N-1 enable"]
336    #[inline(always)]
337    pub fn _1(self) -> &'a mut W {
338        self.variant(TIMENA_A::_1)
339    }
340    #[doc = "Timer enabled on Trigger high"]
341    #[inline(always)]
342    pub fn _10(self) -> &'a mut W {
343        self.variant(TIMENA_A::_10)
344    }
345    #[doc = "Timer enabled on Trigger high and Pin high"]
346    #[inline(always)]
347    pub fn _11(self) -> &'a mut W {
348        self.variant(TIMENA_A::_11)
349    }
350    #[doc = "Timer enabled on Pin rising edge"]
351    #[inline(always)]
352    pub fn _100(self) -> &'a mut W {
353        self.variant(TIMENA_A::_100)
354    }
355    #[doc = "Timer enabled on Pin rising edge and Trigger high"]
356    #[inline(always)]
357    pub fn _101(self) -> &'a mut W {
358        self.variant(TIMENA_A::_101)
359    }
360    #[doc = "Timer enabled on Trigger rising edge"]
361    #[inline(always)]
362    pub fn _110(self) -> &'a mut W {
363        self.variant(TIMENA_A::_110)
364    }
365    #[doc = "Timer enabled on Trigger rising or falling edge"]
366    #[inline(always)]
367    pub fn _111(self) -> &'a mut W {
368        self.variant(TIMENA_A::_111)
369    }
370    #[doc = r"Writes raw bits to the field"]
371    #[inline(always)]
372    pub fn bits(self, value: u8) -> &'a mut W {
373        self.w.bits = (self.w.bits & !(0x07 << 8)) | ((value as u32 & 0x07) << 8);
374        self.w
375    }
376}
377#[doc = "Timer Disable\n\nValue on reset: 0"]
378#[derive(Clone, Copy, Debug, PartialEq)]
379#[repr(u8)]
380pub enum TIMDIS_A {
381    #[doc = "0: Timer never disabled"]
382    _0 = 0,
383    #[doc = "1: Timer disabled on Timer N-1 disable"]
384    _1 = 1,
385    #[doc = "2: Timer disabled on Timer compare"]
386    _10 = 2,
387    #[doc = "3: Timer disabled on Timer compare and Trigger Low"]
388    _11 = 3,
389    #[doc = "4: Timer disabled on Pin rising or falling edge"]
390    _100 = 4,
391    #[doc = "5: Timer disabled on Pin rising or falling edge provided Trigger is high"]
392    _101 = 5,
393    #[doc = "6: Timer disabled on Trigger falling edge"]
394    _110 = 6,
395}
396impl From<TIMDIS_A> for u8 {
397    #[inline(always)]
398    fn from(variant: TIMDIS_A) -> Self {
399        variant as _
400    }
401}
402#[doc = "Field `TIMDIS` reader - Timer Disable"]
403pub struct TIMDIS_R(crate::FieldReader<u8, TIMDIS_A>);
404impl TIMDIS_R {
405    #[inline(always)]
406    pub(crate) fn new(bits: u8) -> Self {
407        TIMDIS_R(crate::FieldReader::new(bits))
408    }
409    #[doc = r"Get enumerated values variant"]
410    #[inline(always)]
411    pub fn variant(&self) -> Option<TIMDIS_A> {
412        match self.bits {
413            0 => Some(TIMDIS_A::_0),
414            1 => Some(TIMDIS_A::_1),
415            2 => Some(TIMDIS_A::_10),
416            3 => Some(TIMDIS_A::_11),
417            4 => Some(TIMDIS_A::_100),
418            5 => Some(TIMDIS_A::_101),
419            6 => Some(TIMDIS_A::_110),
420            _ => None,
421        }
422    }
423    #[doc = "Checks if the value of the field is `_0`"]
424    #[inline(always)]
425    pub fn is_0(&self) -> bool {
426        **self == TIMDIS_A::_0
427    }
428    #[doc = "Checks if the value of the field is `_1`"]
429    #[inline(always)]
430    pub fn is_1(&self) -> bool {
431        **self == TIMDIS_A::_1
432    }
433    #[doc = "Checks if the value of the field is `_10`"]
434    #[inline(always)]
435    pub fn is_10(&self) -> bool {
436        **self == TIMDIS_A::_10
437    }
438    #[doc = "Checks if the value of the field is `_11`"]
439    #[inline(always)]
440    pub fn is_11(&self) -> bool {
441        **self == TIMDIS_A::_11
442    }
443    #[doc = "Checks if the value of the field is `_100`"]
444    #[inline(always)]
445    pub fn is_100(&self) -> bool {
446        **self == TIMDIS_A::_100
447    }
448    #[doc = "Checks if the value of the field is `_101`"]
449    #[inline(always)]
450    pub fn is_101(&self) -> bool {
451        **self == TIMDIS_A::_101
452    }
453    #[doc = "Checks if the value of the field is `_110`"]
454    #[inline(always)]
455    pub fn is_110(&self) -> bool {
456        **self == TIMDIS_A::_110
457    }
458}
459impl core::ops::Deref for TIMDIS_R {
460    type Target = crate::FieldReader<u8, TIMDIS_A>;
461    #[inline(always)]
462    fn deref(&self) -> &Self::Target {
463        &self.0
464    }
465}
466#[doc = "Field `TIMDIS` writer - Timer Disable"]
467pub struct TIMDIS_W<'a> {
468    w: &'a mut W,
469}
470impl<'a> TIMDIS_W<'a> {
471    #[doc = r"Writes `variant` to the field"]
472    #[inline(always)]
473    pub fn variant(self, variant: TIMDIS_A) -> &'a mut W {
474        unsafe { self.bits(variant.into()) }
475    }
476    #[doc = "Timer never disabled"]
477    #[inline(always)]
478    pub fn _0(self) -> &'a mut W {
479        self.variant(TIMDIS_A::_0)
480    }
481    #[doc = "Timer disabled on Timer N-1 disable"]
482    #[inline(always)]
483    pub fn _1(self) -> &'a mut W {
484        self.variant(TIMDIS_A::_1)
485    }
486    #[doc = "Timer disabled on Timer compare"]
487    #[inline(always)]
488    pub fn _10(self) -> &'a mut W {
489        self.variant(TIMDIS_A::_10)
490    }
491    #[doc = "Timer disabled on Timer compare and Trigger Low"]
492    #[inline(always)]
493    pub fn _11(self) -> &'a mut W {
494        self.variant(TIMDIS_A::_11)
495    }
496    #[doc = "Timer disabled on Pin rising or falling edge"]
497    #[inline(always)]
498    pub fn _100(self) -> &'a mut W {
499        self.variant(TIMDIS_A::_100)
500    }
501    #[doc = "Timer disabled on Pin rising or falling edge provided Trigger is high"]
502    #[inline(always)]
503    pub fn _101(self) -> &'a mut W {
504        self.variant(TIMDIS_A::_101)
505    }
506    #[doc = "Timer disabled on Trigger falling edge"]
507    #[inline(always)]
508    pub fn _110(self) -> &'a mut W {
509        self.variant(TIMDIS_A::_110)
510    }
511    #[doc = r"Writes raw bits to the field"]
512    #[inline(always)]
513    pub unsafe fn bits(self, value: u8) -> &'a mut W {
514        self.w.bits = (self.w.bits & !(0x07 << 12)) | ((value as u32 & 0x07) << 12);
515        self.w
516    }
517}
518#[doc = "Timer Reset\n\nValue on reset: 0"]
519#[derive(Clone, Copy, Debug, PartialEq)]
520#[repr(u8)]
521pub enum TIMRST_A {
522    #[doc = "0: Timer never reset"]
523    _0 = 0,
524    #[doc = "2: Timer reset on Timer Pin equal to Timer Output"]
525    _10 = 2,
526    #[doc = "3: Timer reset on Timer Trigger equal to Timer Output"]
527    _11 = 3,
528    #[doc = "4: Timer reset on Timer Pin rising edge"]
529    _100 = 4,
530    #[doc = "6: Timer reset on Trigger rising edge"]
531    _110 = 6,
532    #[doc = "7: Timer reset on Trigger rising or falling edge"]
533    _111 = 7,
534}
535impl From<TIMRST_A> for u8 {
536    #[inline(always)]
537    fn from(variant: TIMRST_A) -> Self {
538        variant as _
539    }
540}
541#[doc = "Field `TIMRST` reader - Timer Reset"]
542pub struct TIMRST_R(crate::FieldReader<u8, TIMRST_A>);
543impl TIMRST_R {
544    #[inline(always)]
545    pub(crate) fn new(bits: u8) -> Self {
546        TIMRST_R(crate::FieldReader::new(bits))
547    }
548    #[doc = r"Get enumerated values variant"]
549    #[inline(always)]
550    pub fn variant(&self) -> Option<TIMRST_A> {
551        match self.bits {
552            0 => Some(TIMRST_A::_0),
553            2 => Some(TIMRST_A::_10),
554            3 => Some(TIMRST_A::_11),
555            4 => Some(TIMRST_A::_100),
556            6 => Some(TIMRST_A::_110),
557            7 => Some(TIMRST_A::_111),
558            _ => None,
559        }
560    }
561    #[doc = "Checks if the value of the field is `_0`"]
562    #[inline(always)]
563    pub fn is_0(&self) -> bool {
564        **self == TIMRST_A::_0
565    }
566    #[doc = "Checks if the value of the field is `_10`"]
567    #[inline(always)]
568    pub fn is_10(&self) -> bool {
569        **self == TIMRST_A::_10
570    }
571    #[doc = "Checks if the value of the field is `_11`"]
572    #[inline(always)]
573    pub fn is_11(&self) -> bool {
574        **self == TIMRST_A::_11
575    }
576    #[doc = "Checks if the value of the field is `_100`"]
577    #[inline(always)]
578    pub fn is_100(&self) -> bool {
579        **self == TIMRST_A::_100
580    }
581    #[doc = "Checks if the value of the field is `_110`"]
582    #[inline(always)]
583    pub fn is_110(&self) -> bool {
584        **self == TIMRST_A::_110
585    }
586    #[doc = "Checks if the value of the field is `_111`"]
587    #[inline(always)]
588    pub fn is_111(&self) -> bool {
589        **self == TIMRST_A::_111
590    }
591}
592impl core::ops::Deref for TIMRST_R {
593    type Target = crate::FieldReader<u8, TIMRST_A>;
594    #[inline(always)]
595    fn deref(&self) -> &Self::Target {
596        &self.0
597    }
598}
599#[doc = "Field `TIMRST` writer - Timer Reset"]
600pub struct TIMRST_W<'a> {
601    w: &'a mut W,
602}
603impl<'a> TIMRST_W<'a> {
604    #[doc = r"Writes `variant` to the field"]
605    #[inline(always)]
606    pub fn variant(self, variant: TIMRST_A) -> &'a mut W {
607        unsafe { self.bits(variant.into()) }
608    }
609    #[doc = "Timer never reset"]
610    #[inline(always)]
611    pub fn _0(self) -> &'a mut W {
612        self.variant(TIMRST_A::_0)
613    }
614    #[doc = "Timer reset on Timer Pin equal to Timer Output"]
615    #[inline(always)]
616    pub fn _10(self) -> &'a mut W {
617        self.variant(TIMRST_A::_10)
618    }
619    #[doc = "Timer reset on Timer Trigger equal to Timer Output"]
620    #[inline(always)]
621    pub fn _11(self) -> &'a mut W {
622        self.variant(TIMRST_A::_11)
623    }
624    #[doc = "Timer reset on Timer Pin rising edge"]
625    #[inline(always)]
626    pub fn _100(self) -> &'a mut W {
627        self.variant(TIMRST_A::_100)
628    }
629    #[doc = "Timer reset on Trigger rising edge"]
630    #[inline(always)]
631    pub fn _110(self) -> &'a mut W {
632        self.variant(TIMRST_A::_110)
633    }
634    #[doc = "Timer reset on Trigger rising or falling edge"]
635    #[inline(always)]
636    pub fn _111(self) -> &'a mut W {
637        self.variant(TIMRST_A::_111)
638    }
639    #[doc = r"Writes raw bits to the field"]
640    #[inline(always)]
641    pub unsafe fn bits(self, value: u8) -> &'a mut W {
642        self.w.bits = (self.w.bits & !(0x07 << 16)) | ((value as u32 & 0x07) << 16);
643        self.w
644    }
645}
646#[doc = "Timer Decrement\n\nValue on reset: 0"]
647#[derive(Clone, Copy, Debug, PartialEq)]
648#[repr(u8)]
649pub enum TIMDEC_A {
650    #[doc = "0: Decrement counter on FlexIO clock, Shift clock equals Timer output."]
651    _0 = 0,
652    #[doc = "1: Decrement counter on Trigger input (both edges), Shift clock equals Timer output."]
653    _1 = 1,
654    #[doc = "2: Decrement counter on Pin input (both edges), Shift clock equals Pin input."]
655    _10 = 2,
656    #[doc = "3: Decrement counter on Trigger input (both edges), Shift clock equals Trigger input."]
657    _11 = 3,
658}
659impl From<TIMDEC_A> for u8 {
660    #[inline(always)]
661    fn from(variant: TIMDEC_A) -> Self {
662        variant as _
663    }
664}
665#[doc = "Field `TIMDEC` reader - Timer Decrement"]
666pub struct TIMDEC_R(crate::FieldReader<u8, TIMDEC_A>);
667impl TIMDEC_R {
668    #[inline(always)]
669    pub(crate) fn new(bits: u8) -> Self {
670        TIMDEC_R(crate::FieldReader::new(bits))
671    }
672    #[doc = r"Get enumerated values variant"]
673    #[inline(always)]
674    pub fn variant(&self) -> TIMDEC_A {
675        match self.bits {
676            0 => TIMDEC_A::_0,
677            1 => TIMDEC_A::_1,
678            2 => TIMDEC_A::_10,
679            3 => TIMDEC_A::_11,
680            _ => unreachable!(),
681        }
682    }
683    #[doc = "Checks if the value of the field is `_0`"]
684    #[inline(always)]
685    pub fn is_0(&self) -> bool {
686        **self == TIMDEC_A::_0
687    }
688    #[doc = "Checks if the value of the field is `_1`"]
689    #[inline(always)]
690    pub fn is_1(&self) -> bool {
691        **self == TIMDEC_A::_1
692    }
693    #[doc = "Checks if the value of the field is `_10`"]
694    #[inline(always)]
695    pub fn is_10(&self) -> bool {
696        **self == TIMDEC_A::_10
697    }
698    #[doc = "Checks if the value of the field is `_11`"]
699    #[inline(always)]
700    pub fn is_11(&self) -> bool {
701        **self == TIMDEC_A::_11
702    }
703}
704impl core::ops::Deref for TIMDEC_R {
705    type Target = crate::FieldReader<u8, TIMDEC_A>;
706    #[inline(always)]
707    fn deref(&self) -> &Self::Target {
708        &self.0
709    }
710}
711#[doc = "Field `TIMDEC` writer - Timer Decrement"]
712pub struct TIMDEC_W<'a> {
713    w: &'a mut W,
714}
715impl<'a> TIMDEC_W<'a> {
716    #[doc = r"Writes `variant` to the field"]
717    #[inline(always)]
718    pub fn variant(self, variant: TIMDEC_A) -> &'a mut W {
719        self.bits(variant.into())
720    }
721    #[doc = "Decrement counter on FlexIO clock, Shift clock equals Timer output."]
722    #[inline(always)]
723    pub fn _0(self) -> &'a mut W {
724        self.variant(TIMDEC_A::_0)
725    }
726    #[doc = "Decrement counter on Trigger input (both edges), Shift clock equals Timer output."]
727    #[inline(always)]
728    pub fn _1(self) -> &'a mut W {
729        self.variant(TIMDEC_A::_1)
730    }
731    #[doc = "Decrement counter on Pin input (both edges), Shift clock equals Pin input."]
732    #[inline(always)]
733    pub fn _10(self) -> &'a mut W {
734        self.variant(TIMDEC_A::_10)
735    }
736    #[doc = "Decrement counter on Trigger input (both edges), Shift clock equals Trigger input."]
737    #[inline(always)]
738    pub fn _11(self) -> &'a mut W {
739        self.variant(TIMDEC_A::_11)
740    }
741    #[doc = r"Writes raw bits to the field"]
742    #[inline(always)]
743    pub fn bits(self, value: u8) -> &'a mut W {
744        self.w.bits = (self.w.bits & !(0x03 << 20)) | ((value as u32 & 0x03) << 20);
745        self.w
746    }
747}
748#[doc = "Timer Output\n\nValue on reset: 0"]
749#[derive(Clone, Copy, Debug, PartialEq)]
750#[repr(u8)]
751pub enum TIMOUT_A {
752    #[doc = "0: Timer output is logic one when enabled and is not affected by timer reset"]
753    _0 = 0,
754    #[doc = "1: Timer output is logic zero when enabled and is not affected by timer reset"]
755    _1 = 1,
756    #[doc = "2: Timer output is logic one when enabled and on timer reset"]
757    _10 = 2,
758    #[doc = "3: Timer output is logic zero when enabled and on timer reset"]
759    _11 = 3,
760}
761impl From<TIMOUT_A> for u8 {
762    #[inline(always)]
763    fn from(variant: TIMOUT_A) -> Self {
764        variant as _
765    }
766}
767#[doc = "Field `TIMOUT` reader - Timer Output"]
768pub struct TIMOUT_R(crate::FieldReader<u8, TIMOUT_A>);
769impl TIMOUT_R {
770    #[inline(always)]
771    pub(crate) fn new(bits: u8) -> Self {
772        TIMOUT_R(crate::FieldReader::new(bits))
773    }
774    #[doc = r"Get enumerated values variant"]
775    #[inline(always)]
776    pub fn variant(&self) -> TIMOUT_A {
777        match self.bits {
778            0 => TIMOUT_A::_0,
779            1 => TIMOUT_A::_1,
780            2 => TIMOUT_A::_10,
781            3 => TIMOUT_A::_11,
782            _ => unreachable!(),
783        }
784    }
785    #[doc = "Checks if the value of the field is `_0`"]
786    #[inline(always)]
787    pub fn is_0(&self) -> bool {
788        **self == TIMOUT_A::_0
789    }
790    #[doc = "Checks if the value of the field is `_1`"]
791    #[inline(always)]
792    pub fn is_1(&self) -> bool {
793        **self == TIMOUT_A::_1
794    }
795    #[doc = "Checks if the value of the field is `_10`"]
796    #[inline(always)]
797    pub fn is_10(&self) -> bool {
798        **self == TIMOUT_A::_10
799    }
800    #[doc = "Checks if the value of the field is `_11`"]
801    #[inline(always)]
802    pub fn is_11(&self) -> bool {
803        **self == TIMOUT_A::_11
804    }
805}
806impl core::ops::Deref for TIMOUT_R {
807    type Target = crate::FieldReader<u8, TIMOUT_A>;
808    #[inline(always)]
809    fn deref(&self) -> &Self::Target {
810        &self.0
811    }
812}
813#[doc = "Field `TIMOUT` writer - Timer Output"]
814pub struct TIMOUT_W<'a> {
815    w: &'a mut W,
816}
817impl<'a> TIMOUT_W<'a> {
818    #[doc = r"Writes `variant` to the field"]
819    #[inline(always)]
820    pub fn variant(self, variant: TIMOUT_A) -> &'a mut W {
821        self.bits(variant.into())
822    }
823    #[doc = "Timer output is logic one when enabled and is not affected by timer reset"]
824    #[inline(always)]
825    pub fn _0(self) -> &'a mut W {
826        self.variant(TIMOUT_A::_0)
827    }
828    #[doc = "Timer output is logic zero when enabled and is not affected by timer reset"]
829    #[inline(always)]
830    pub fn _1(self) -> &'a mut W {
831        self.variant(TIMOUT_A::_1)
832    }
833    #[doc = "Timer output is logic one when enabled and on timer reset"]
834    #[inline(always)]
835    pub fn _10(self) -> &'a mut W {
836        self.variant(TIMOUT_A::_10)
837    }
838    #[doc = "Timer output is logic zero when enabled and on timer reset"]
839    #[inline(always)]
840    pub fn _11(self) -> &'a mut W {
841        self.variant(TIMOUT_A::_11)
842    }
843    #[doc = r"Writes raw bits to the field"]
844    #[inline(always)]
845    pub fn bits(self, value: u8) -> &'a mut W {
846        self.w.bits = (self.w.bits & !(0x03 << 24)) | ((value as u32 & 0x03) << 24);
847        self.w
848    }
849}
850impl R {
851    #[doc = "Bit 1 - Timer Start Bit"]
852    #[inline(always)]
853    pub fn tstart(&self) -> TSTART_R {
854        TSTART_R::new(((self.bits >> 1) & 0x01) != 0)
855    }
856    #[doc = "Bits 4:5 - Timer Stop Bit"]
857    #[inline(always)]
858    pub fn tstop(&self) -> TSTOP_R {
859        TSTOP_R::new(((self.bits >> 4) & 0x03) as u8)
860    }
861    #[doc = "Bits 8:10 - Timer Enable"]
862    #[inline(always)]
863    pub fn timena(&self) -> TIMENA_R {
864        TIMENA_R::new(((self.bits >> 8) & 0x07) as u8)
865    }
866    #[doc = "Bits 12:14 - Timer Disable"]
867    #[inline(always)]
868    pub fn timdis(&self) -> TIMDIS_R {
869        TIMDIS_R::new(((self.bits >> 12) & 0x07) as u8)
870    }
871    #[doc = "Bits 16:18 - Timer Reset"]
872    #[inline(always)]
873    pub fn timrst(&self) -> TIMRST_R {
874        TIMRST_R::new(((self.bits >> 16) & 0x07) as u8)
875    }
876    #[doc = "Bits 20:21 - Timer Decrement"]
877    #[inline(always)]
878    pub fn timdec(&self) -> TIMDEC_R {
879        TIMDEC_R::new(((self.bits >> 20) & 0x03) as u8)
880    }
881    #[doc = "Bits 24:25 - Timer Output"]
882    #[inline(always)]
883    pub fn timout(&self) -> TIMOUT_R {
884        TIMOUT_R::new(((self.bits >> 24) & 0x03) as u8)
885    }
886}
887impl W {
888    #[doc = "Bit 1 - Timer Start Bit"]
889    #[inline(always)]
890    pub fn tstart(&mut self) -> TSTART_W {
891        TSTART_W { w: self }
892    }
893    #[doc = "Bits 4:5 - Timer Stop Bit"]
894    #[inline(always)]
895    pub fn tstop(&mut self) -> TSTOP_W {
896        TSTOP_W { w: self }
897    }
898    #[doc = "Bits 8:10 - Timer Enable"]
899    #[inline(always)]
900    pub fn timena(&mut self) -> TIMENA_W {
901        TIMENA_W { w: self }
902    }
903    #[doc = "Bits 12:14 - Timer Disable"]
904    #[inline(always)]
905    pub fn timdis(&mut self) -> TIMDIS_W {
906        TIMDIS_W { w: self }
907    }
908    #[doc = "Bits 16:18 - Timer Reset"]
909    #[inline(always)]
910    pub fn timrst(&mut self) -> TIMRST_W {
911        TIMRST_W { w: self }
912    }
913    #[doc = "Bits 20:21 - Timer Decrement"]
914    #[inline(always)]
915    pub fn timdec(&mut self) -> TIMDEC_W {
916        TIMDEC_W { w: self }
917    }
918    #[doc = "Bits 24:25 - Timer Output"]
919    #[inline(always)]
920    pub fn timout(&mut self) -> TIMOUT_W {
921        TIMOUT_W { w: self }
922    }
923    #[doc = "Writes raw bits to the register."]
924    #[inline(always)]
925    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
926        self.0.bits(bits);
927        self
928    }
929}
930#[doc = "Timer Configuration 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 [timcfg3](index.html) module"]
931pub struct TIMCFG3_SPEC;
932impl crate::RegisterSpec for TIMCFG3_SPEC {
933    type Ux = u32;
934}
935#[doc = "`read()` method returns [timcfg3::R](R) reader structure"]
936impl crate::Readable for TIMCFG3_SPEC {
937    type Reader = R;
938}
939#[doc = "`write(|w| ..)` method takes [timcfg3::W](W) writer structure"]
940impl crate::Writable for TIMCFG3_SPEC {
941    type Writer = W;
942}
943#[doc = "`reset()` method sets TIMCFG3 to value 0"]
944impl crate::Resettable for TIMCFG3_SPEC {
945    #[inline(always)]
946    fn reset_value() -> Self::Ux {
947        0
948    }
949}