1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
#[doc = "Reader of register TIMCFG[%s]"]
pub type R = crate::R<u32, super::TIMCFG>;
#[doc = "Writer for register TIMCFG[%s]"]
pub type W = crate::W<u32, super::TIMCFG>;
#[doc = "Register TIMCFG[%s] `reset()`'s with value 0"]
impl crate::ResetValue for super::TIMCFG {
  type Type = u32;
  #[inline(always)]
  fn reset_value() -> Self::Type {
    0
  }
}
#[doc = "Timer Start Bit\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TSTART_A {
  #[doc = "0: Start bit disabled"]
  TSTART_0,
  #[doc = "1: Start bit enabled"]
  TSTART_1,
}
impl From<TSTART_A> for bool {
  #[inline(always)]
  fn from(variant: TSTART_A) -> Self {
    match variant {
      TSTART_A::TSTART_0 => false,
      TSTART_A::TSTART_1 => true,
    }
  }
}
#[doc = "Reader of field `TSTART`"]
pub type TSTART_R = crate::R<bool, TSTART_A>;
impl TSTART_R {
  #[doc = r"Get enumerated values variant"]
  #[inline(always)]
  pub fn variant(&self) -> TSTART_A {
    match self.bits {
      false => TSTART_A::TSTART_0,
      true => TSTART_A::TSTART_1,
    }
  }
  #[doc = "Checks if the value of the field is `TSTART_0`"]
  #[inline(always)]
  pub fn is_tstart_0(&self) -> bool {
    *self == TSTART_A::TSTART_0
  }
  #[doc = "Checks if the value of the field is `TSTART_1`"]
  #[inline(always)]
  pub fn is_tstart_1(&self) -> bool {
    *self == TSTART_A::TSTART_1
  }
}
#[doc = "Write proxy for field `TSTART`"]
pub struct TSTART_W<'a> {
  w: &'a mut W,
}
impl<'a> TSTART_W<'a> {
  #[doc = r"Writes `variant` to the field"]
  #[inline(always)]
  pub fn variant(self, variant: TSTART_A) -> &'a mut W {
    {
      self.bit(variant.into())
    }
  }
  #[doc = "Start bit disabled"]
  #[inline(always)]
  pub fn tstart_0(self) -> &'a mut W {
    self.variant(TSTART_A::TSTART_0)
  }
  #[doc = "Start bit enabled"]
  #[inline(always)]
  pub fn tstart_1(self) -> &'a mut W {
    self.variant(TSTART_A::TSTART_1)
  }
  #[doc = r"Sets the field bit"]
  #[inline(always)]
  pub fn set_bit(self) -> &'a mut W {
    self.bit(true)
  }
  #[doc = r"Clears the field bit"]
  #[inline(always)]
  pub fn clear_bit(self) -> &'a mut W {
    self.bit(false)
  }
  #[doc = r"Writes raw bits to the field"]
  #[inline(always)]
  pub fn bit(self, value: bool) -> &'a mut W {
    self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
    self.w
  }
}
#[doc = "Timer Stop Bit\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TSTOP_A {
  #[doc = "0: Stop bit disabled"]
  TSTOP_0,
  #[doc = "1: Stop bit is enabled on timer compare"]
  TSTOP_1,
  #[doc = "2: Stop bit is enabled on timer disable"]
  TSTOP_2,
  #[doc = "3: Stop bit is enabled on timer compare and timer disable"]
  TSTOP_3,
}
impl From<TSTOP_A> for u8 {
  #[inline(always)]
  fn from(variant: TSTOP_A) -> Self {
    match variant {
      TSTOP_A::TSTOP_0 => 0,
      TSTOP_A::TSTOP_1 => 1,
      TSTOP_A::TSTOP_2 => 2,
      TSTOP_A::TSTOP_3 => 3,
    }
  }
}
#[doc = "Reader of field `TSTOP`"]
pub type TSTOP_R = crate::R<u8, TSTOP_A>;
impl TSTOP_R {
  #[doc = r"Get enumerated values variant"]
  #[inline(always)]
  pub fn variant(&self) -> TSTOP_A {
    match self.bits {
      0 => TSTOP_A::TSTOP_0,
      1 => TSTOP_A::TSTOP_1,
      2 => TSTOP_A::TSTOP_2,
      3 => TSTOP_A::TSTOP_3,
      _ => unreachable!(),
    }
  }
  #[doc = "Checks if the value of the field is `TSTOP_0`"]
  #[inline(always)]
  pub fn is_tstop_0(&self) -> bool {
    *self == TSTOP_A::TSTOP_0
  }
  #[doc = "Checks if the value of the field is `TSTOP_1`"]
  #[inline(always)]
  pub fn is_tstop_1(&self) -> bool {
    *self == TSTOP_A::TSTOP_1
  }
  #[doc = "Checks if the value of the field is `TSTOP_2`"]
  #[inline(always)]
  pub fn is_tstop_2(&self) -> bool {
    *self == TSTOP_A::TSTOP_2
  }
  #[doc = "Checks if the value of the field is `TSTOP_3`"]
  #[inline(always)]
  pub fn is_tstop_3(&self) -> bool {
    *self == TSTOP_A::TSTOP_3
  }
}
#[doc = "Write proxy for field `TSTOP`"]
pub struct TSTOP_W<'a> {
  w: &'a mut W,
}
impl<'a> TSTOP_W<'a> {
  #[doc = r"Writes `variant` to the field"]
  #[inline(always)]
  pub fn variant(self, variant: TSTOP_A) -> &'a mut W {
    {
      self.bits(variant.into())
    }
  }
  #[doc = "Stop bit disabled"]
  #[inline(always)]
  pub fn tstop_0(self) -> &'a mut W {
    self.variant(TSTOP_A::TSTOP_0)
  }
  #[doc = "Stop bit is enabled on timer compare"]
  #[inline(always)]
  pub fn tstop_1(self) -> &'a mut W {
    self.variant(TSTOP_A::TSTOP_1)
  }
  #[doc = "Stop bit is enabled on timer disable"]
  #[inline(always)]
  pub fn tstop_2(self) -> &'a mut W {
    self.variant(TSTOP_A::TSTOP_2)
  }
  #[doc = "Stop bit is enabled on timer compare and timer disable"]
  #[inline(always)]
  pub fn tstop_3(self) -> &'a mut W {
    self.variant(TSTOP_A::TSTOP_3)
  }
  #[doc = r"Writes raw bits to the field"]
  #[inline(always)]
  pub fn bits(self, value: u8) -> &'a mut W {
    self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4);
    self.w
  }
}
#[doc = "Timer Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TIMENA_A {
  #[doc = "0: Timer always enabled"]
  TIMENA_0,
  #[doc = "1: Timer enabled on Timer N-1 enable"]
  TIMENA_1,
  #[doc = "2: Timer enabled on Trigger high"]
  TIMENA_2,
  #[doc = "3: Timer enabled on Trigger high and Pin high"]
  TIMENA_3,
  #[doc = "4: Timer enabled on Pin rising edge"]
  TIMENA_4,
  #[doc = "5: Timer enabled on Pin rising edge and Trigger high"]
  TIMENA_5,
  #[doc = "6: Timer enabled on Trigger rising edge"]
  TIMENA_6,
  #[doc = "7: Timer enabled on Trigger rising or falling edge"]
  TIMENA_7,
}
impl From<TIMENA_A> for u8 {
  #[inline(always)]
  fn from(variant: TIMENA_A) -> Self {
    match variant {
      TIMENA_A::TIMENA_0 => 0,
      TIMENA_A::TIMENA_1 => 1,
      TIMENA_A::TIMENA_2 => 2,
      TIMENA_A::TIMENA_3 => 3,
      TIMENA_A::TIMENA_4 => 4,
      TIMENA_A::TIMENA_5 => 5,
      TIMENA_A::TIMENA_6 => 6,
      TIMENA_A::TIMENA_7 => 7,
    }
  }
}
#[doc = "Reader of field `TIMENA`"]
pub type TIMENA_R = crate::R<u8, TIMENA_A>;
impl TIMENA_R {
  #[doc = r"Get enumerated values variant"]
  #[inline(always)]
  pub fn variant(&self) -> TIMENA_A {
    match self.bits {
      0 => TIMENA_A::TIMENA_0,
      1 => TIMENA_A::TIMENA_1,
      2 => TIMENA_A::TIMENA_2,
      3 => TIMENA_A::TIMENA_3,
      4 => TIMENA_A::TIMENA_4,
      5 => TIMENA_A::TIMENA_5,
      6 => TIMENA_A::TIMENA_6,
      7 => TIMENA_A::TIMENA_7,
      _ => unreachable!(),
    }
  }
  #[doc = "Checks if the value of the field is `TIMENA_0`"]
  #[inline(always)]
  pub fn is_timena_0(&self) -> bool {
    *self == TIMENA_A::TIMENA_0
  }
  #[doc = "Checks if the value of the field is `TIMENA_1`"]
  #[inline(always)]
  pub fn is_timena_1(&self) -> bool {
    *self == TIMENA_A::TIMENA_1
  }
  #[doc = "Checks if the value of the field is `TIMENA_2`"]
  #[inline(always)]
  pub fn is_timena_2(&self) -> bool {
    *self == TIMENA_A::TIMENA_2
  }
  #[doc = "Checks if the value of the field is `TIMENA_3`"]
  #[inline(always)]
  pub fn is_timena_3(&self) -> bool {
    *self == TIMENA_A::TIMENA_3
  }
  #[doc = "Checks if the value of the field is `TIMENA_4`"]
  #[inline(always)]
  pub fn is_timena_4(&self) -> bool {
    *self == TIMENA_A::TIMENA_4
  }
  #[doc = "Checks if the value of the field is `TIMENA_5`"]
  #[inline(always)]
  pub fn is_timena_5(&self) -> bool {
    *self == TIMENA_A::TIMENA_5
  }
  #[doc = "Checks if the value of the field is `TIMENA_6`"]
  #[inline(always)]
  pub fn is_timena_6(&self) -> bool {
    *self == TIMENA_A::TIMENA_6
  }
  #[doc = "Checks if the value of the field is `TIMENA_7`"]
  #[inline(always)]
  pub fn is_timena_7(&self) -> bool {
    *self == TIMENA_A::TIMENA_7
  }
}
#[doc = "Write proxy for field `TIMENA`"]
pub struct TIMENA_W<'a> {
  w: &'a mut W,
}
impl<'a> TIMENA_W<'a> {
  #[doc = r"Writes `variant` to the field"]
  #[inline(always)]
  pub fn variant(self, variant: TIMENA_A) -> &'a mut W {
    {
      self.bits(variant.into())
    }
  }
  #[doc = "Timer always enabled"]
  #[inline(always)]
  pub fn timena_0(self) -> &'a mut W {
    self.variant(TIMENA_A::TIMENA_0)
  }
  #[doc = "Timer enabled on Timer N-1 enable"]
  #[inline(always)]
  pub fn timena_1(self) -> &'a mut W {
    self.variant(TIMENA_A::TIMENA_1)
  }
  #[doc = "Timer enabled on Trigger high"]
  #[inline(always)]
  pub fn timena_2(self) -> &'a mut W {
    self.variant(TIMENA_A::TIMENA_2)
  }
  #[doc = "Timer enabled on Trigger high and Pin high"]
  #[inline(always)]
  pub fn timena_3(self) -> &'a mut W {
    self.variant(TIMENA_A::TIMENA_3)
  }
  #[doc = "Timer enabled on Pin rising edge"]
  #[inline(always)]
  pub fn timena_4(self) -> &'a mut W {
    self.variant(TIMENA_A::TIMENA_4)
  }
  #[doc = "Timer enabled on Pin rising edge and Trigger high"]
  #[inline(always)]
  pub fn timena_5(self) -> &'a mut W {
    self.variant(TIMENA_A::TIMENA_5)
  }
  #[doc = "Timer enabled on Trigger rising edge"]
  #[inline(always)]
  pub fn timena_6(self) -> &'a mut W {
    self.variant(TIMENA_A::TIMENA_6)
  }
  #[doc = "Timer enabled on Trigger rising or falling edge"]
  #[inline(always)]
  pub fn timena_7(self) -> &'a mut W {
    self.variant(TIMENA_A::TIMENA_7)
  }
  #[doc = r"Writes raw bits to the field"]
  #[inline(always)]
  pub fn bits(self, value: u8) -> &'a mut W {
    self.w.bits = (self.w.bits & !(0x07 << 8)) | (((value as u32) & 0x07) << 8);
    self.w
  }
}
#[doc = "Timer Disable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TIMDIS_A {
  #[doc = "0: Timer never disabled"]
  TIMDIS_0,
  #[doc = "1: Timer disabled on Timer N-1 disable"]
  TIMDIS_1,
  #[doc = "2: Timer disabled on Timer compare (upper 8-bits match and decrement)"]
  TIMDIS_2,
  #[doc = "3: Timer disabled on Timer compare (upper 8-bits match and decrement) and Trigger Low"]
  TIMDIS_3,
  #[doc = "4: Timer disabled on Pin rising or falling edge"]
  TIMDIS_4,
  #[doc = "5: Timer disabled on Pin rising or falling edge provided Trigger is high"]
  TIMDIS_5,
  #[doc = "6: Timer disabled on Trigger falling edge"]
  TIMDIS_6,
}
impl From<TIMDIS_A> for u8 {
  #[inline(always)]
  fn from(variant: TIMDIS_A) -> Self {
    match variant {
      TIMDIS_A::TIMDIS_0 => 0,
      TIMDIS_A::TIMDIS_1 => 1,
      TIMDIS_A::TIMDIS_2 => 2,
      TIMDIS_A::TIMDIS_3 => 3,
      TIMDIS_A::TIMDIS_4 => 4,
      TIMDIS_A::TIMDIS_5 => 5,
      TIMDIS_A::TIMDIS_6 => 6,
    }
  }
}
#[doc = "Reader of field `TIMDIS`"]
pub type TIMDIS_R = crate::R<u8, TIMDIS_A>;
impl TIMDIS_R {
  #[doc = r"Get enumerated values variant"]
  #[inline(always)]
  pub fn variant(&self) -> crate::Variant<u8, TIMDIS_A> {
    use crate::Variant::*;
    match self.bits {
      0 => Val(TIMDIS_A::TIMDIS_0),
      1 => Val(TIMDIS_A::TIMDIS_1),
      2 => Val(TIMDIS_A::TIMDIS_2),
      3 => Val(TIMDIS_A::TIMDIS_3),
      4 => Val(TIMDIS_A::TIMDIS_4),
      5 => Val(TIMDIS_A::TIMDIS_5),
      6 => Val(TIMDIS_A::TIMDIS_6),
      i => Res(i),
    }
  }
  #[doc = "Checks if the value of the field is `TIMDIS_0`"]
  #[inline(always)]
  pub fn is_timdis_0(&self) -> bool {
    *self == TIMDIS_A::TIMDIS_0
  }
  #[doc = "Checks if the value of the field is `TIMDIS_1`"]
  #[inline(always)]
  pub fn is_timdis_1(&self) -> bool {
    *self == TIMDIS_A::TIMDIS_1
  }
  #[doc = "Checks if the value of the field is `TIMDIS_2`"]
  #[inline(always)]
  pub fn is_timdis_2(&self) -> bool {
    *self == TIMDIS_A::TIMDIS_2
  }
  #[doc = "Checks if the value of the field is `TIMDIS_3`"]
  #[inline(always)]
  pub fn is_timdis_3(&self) -> bool {
    *self == TIMDIS_A::TIMDIS_3
  }
  #[doc = "Checks if the value of the field is `TIMDIS_4`"]
  #[inline(always)]
  pub fn is_timdis_4(&self) -> bool {
    *self == TIMDIS_A::TIMDIS_4
  }
  #[doc = "Checks if the value of the field is `TIMDIS_5`"]
  #[inline(always)]
  pub fn is_timdis_5(&self) -> bool {
    *self == TIMDIS_A::TIMDIS_5
  }
  #[doc = "Checks if the value of the field is `TIMDIS_6`"]
  #[inline(always)]
  pub fn is_timdis_6(&self) -> bool {
    *self == TIMDIS_A::TIMDIS_6
  }
}
#[doc = "Write proxy for field `TIMDIS`"]
pub struct TIMDIS_W<'a> {
  w: &'a mut W,
}
impl<'a> TIMDIS_W<'a> {
  #[doc = r"Writes `variant` to the field"]
  #[inline(always)]
  pub fn variant(self, variant: TIMDIS_A) -> &'a mut W {
    unsafe { self.bits(variant.into()) }
  }
  #[doc = "Timer never disabled"]
  #[inline(always)]
  pub fn timdis_0(self) -> &'a mut W {
    self.variant(TIMDIS_A::TIMDIS_0)
  }
  #[doc = "Timer disabled on Timer N-1 disable"]
  #[inline(always)]
  pub fn timdis_1(self) -> &'a mut W {
    self.variant(TIMDIS_A::TIMDIS_1)
  }
  #[doc = "Timer disabled on Timer compare (upper 8-bits match and decrement)"]
  #[inline(always)]
  pub fn timdis_2(self) -> &'a mut W {
    self.variant(TIMDIS_A::TIMDIS_2)
  }
  #[doc = "Timer disabled on Timer compare (upper 8-bits match and decrement) and Trigger Low"]
  #[inline(always)]
  pub fn timdis_3(self) -> &'a mut W {
    self.variant(TIMDIS_A::TIMDIS_3)
  }
  #[doc = "Timer disabled on Pin rising or falling edge"]
  #[inline(always)]
  pub fn timdis_4(self) -> &'a mut W {
    self.variant(TIMDIS_A::TIMDIS_4)
  }
  #[doc = "Timer disabled on Pin rising or falling edge provided Trigger is high"]
  #[inline(always)]
  pub fn timdis_5(self) -> &'a mut W {
    self.variant(TIMDIS_A::TIMDIS_5)
  }
  #[doc = "Timer disabled on Trigger falling edge"]
  #[inline(always)]
  pub fn timdis_6(self) -> &'a mut W {
    self.variant(TIMDIS_A::TIMDIS_6)
  }
  #[doc = r"Writes raw bits to the field"]
  #[inline(always)]
  pub unsafe fn bits(self, value: u8) -> &'a mut W {
    self.w.bits = (self.w.bits & !(0x07 << 12)) | (((value as u32) & 0x07) << 12);
    self.w
  }
}
#[doc = "Timer Reset\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TIMRST_A {
  #[doc = "0: Timer never reset"]
  TIMRST_0,
  #[doc = "2: Timer reset on Timer Pin equal to Timer Output"]
  TIMRST_2,
  #[doc = "3: Timer reset on Timer Trigger equal to Timer Output"]
  TIMRST_3,
  #[doc = "4: Timer reset on Timer Pin rising edge"]
  TIMRST_4,
  #[doc = "6: Timer reset on Trigger rising edge"]
  TIMRST_6,
  #[doc = "7: Timer reset on Trigger rising or falling edge"]
  TIMRST_7,
}
impl From<TIMRST_A> for u8 {
  #[inline(always)]
  fn from(variant: TIMRST_A) -> Self {
    match variant {
      TIMRST_A::TIMRST_0 => 0,
      TIMRST_A::TIMRST_2 => 2,
      TIMRST_A::TIMRST_3 => 3,
      TIMRST_A::TIMRST_4 => 4,
      TIMRST_A::TIMRST_6 => 6,
      TIMRST_A::TIMRST_7 => 7,
    }
  }
}
#[doc = "Reader of field `TIMRST`"]
pub type TIMRST_R = crate::R<u8, TIMRST_A>;
impl TIMRST_R {
  #[doc = r"Get enumerated values variant"]
  #[inline(always)]
  pub fn variant(&self) -> crate::Variant<u8, TIMRST_A> {
    use crate::Variant::*;
    match self.bits {
      0 => Val(TIMRST_A::TIMRST_0),
      2 => Val(TIMRST_A::TIMRST_2),
      3 => Val(TIMRST_A::TIMRST_3),
      4 => Val(TIMRST_A::TIMRST_4),
      6 => Val(TIMRST_A::TIMRST_6),
      7 => Val(TIMRST_A::TIMRST_7),
      i => Res(i),
    }
  }
  #[doc = "Checks if the value of the field is `TIMRST_0`"]
  #[inline(always)]
  pub fn is_timrst_0(&self) -> bool {
    *self == TIMRST_A::TIMRST_0
  }
  #[doc = "Checks if the value of the field is `TIMRST_2`"]
  #[inline(always)]
  pub fn is_timrst_2(&self) -> bool {
    *self == TIMRST_A::TIMRST_2
  }
  #[doc = "Checks if the value of the field is `TIMRST_3`"]
  #[inline(always)]
  pub fn is_timrst_3(&self) -> bool {
    *self == TIMRST_A::TIMRST_3
  }
  #[doc = "Checks if the value of the field is `TIMRST_4`"]
  #[inline(always)]
  pub fn is_timrst_4(&self) -> bool {
    *self == TIMRST_A::TIMRST_4
  }
  #[doc = "Checks if the value of the field is `TIMRST_6`"]
  #[inline(always)]
  pub fn is_timrst_6(&self) -> bool {
    *self == TIMRST_A::TIMRST_6
  }
  #[doc = "Checks if the value of the field is `TIMRST_7`"]
  #[inline(always)]
  pub fn is_timrst_7(&self) -> bool {
    *self == TIMRST_A::TIMRST_7
  }
}
#[doc = "Write proxy for field `TIMRST`"]
pub struct TIMRST_W<'a> {
  w: &'a mut W,
}
impl<'a> TIMRST_W<'a> {
  #[doc = r"Writes `variant` to the field"]
  #[inline(always)]
  pub fn variant(self, variant: TIMRST_A) -> &'a mut W {
    unsafe { self.bits(variant.into()) }
  }
  #[doc = "Timer never reset"]
  #[inline(always)]
  pub fn timrst_0(self) -> &'a mut W {
    self.variant(TIMRST_A::TIMRST_0)
  }
  #[doc = "Timer reset on Timer Pin equal to Timer Output"]
  #[inline(always)]
  pub fn timrst_2(self) -> &'a mut W {
    self.variant(TIMRST_A::TIMRST_2)
  }
  #[doc = "Timer reset on Timer Trigger equal to Timer Output"]
  #[inline(always)]
  pub fn timrst_3(self) -> &'a mut W {
    self.variant(TIMRST_A::TIMRST_3)
  }
  #[doc = "Timer reset on Timer Pin rising edge"]
  #[inline(always)]
  pub fn timrst_4(self) -> &'a mut W {
    self.variant(TIMRST_A::TIMRST_4)
  }
  #[doc = "Timer reset on Trigger rising edge"]
  #[inline(always)]
  pub fn timrst_6(self) -> &'a mut W {
    self.variant(TIMRST_A::TIMRST_6)
  }
  #[doc = "Timer reset on Trigger rising or falling edge"]
  #[inline(always)]
  pub fn timrst_7(self) -> &'a mut W {
    self.variant(TIMRST_A::TIMRST_7)
  }
  #[doc = r"Writes raw bits to the field"]
  #[inline(always)]
  pub unsafe fn bits(self, value: u8) -> &'a mut W {
    self.w.bits = (self.w.bits & !(0x07 << 16)) | (((value as u32) & 0x07) << 16);
    self.w
  }
}
#[doc = "Timer Decrement\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TIMDEC_A {
  #[doc = "0: Decrement counter on FlexIO clock, Shift clock equals Timer output."]
  TIMDEC_0,
  #[doc = "1: Decrement counter on Trigger input (both edges), Shift clock equals Timer output."]
  TIMDEC_1,
  #[doc = "2: Decrement counter on Pin input (both edges), Shift clock equals Pin input."]
  TIMDEC_2,
  #[doc = "3: Decrement counter on Trigger input (both edges), Shift clock equals Trigger input."]
  TIMDEC_3,
}
impl From<TIMDEC_A> for u8 {
  #[inline(always)]
  fn from(variant: TIMDEC_A) -> Self {
    match variant {
      TIMDEC_A::TIMDEC_0 => 0,
      TIMDEC_A::TIMDEC_1 => 1,
      TIMDEC_A::TIMDEC_2 => 2,
      TIMDEC_A::TIMDEC_3 => 3,
    }
  }
}
#[doc = "Reader of field `TIMDEC`"]
pub type TIMDEC_R = crate::R<u8, TIMDEC_A>;
impl TIMDEC_R {
  #[doc = r"Get enumerated values variant"]
  #[inline(always)]
  pub fn variant(&self) -> TIMDEC_A {
    match self.bits {
      0 => TIMDEC_A::TIMDEC_0,
      1 => TIMDEC_A::TIMDEC_1,
      2 => TIMDEC_A::TIMDEC_2,
      3 => TIMDEC_A::TIMDEC_3,
      _ => unreachable!(),
    }
  }
  #[doc = "Checks if the value of the field is `TIMDEC_0`"]
  #[inline(always)]
  pub fn is_timdec_0(&self) -> bool {
    *self == TIMDEC_A::TIMDEC_0
  }
  #[doc = "Checks if the value of the field is `TIMDEC_1`"]
  #[inline(always)]
  pub fn is_timdec_1(&self) -> bool {
    *self == TIMDEC_A::TIMDEC_1
  }
  #[doc = "Checks if the value of the field is `TIMDEC_2`"]
  #[inline(always)]
  pub fn is_timdec_2(&self) -> bool {
    *self == TIMDEC_A::TIMDEC_2
  }
  #[doc = "Checks if the value of the field is `TIMDEC_3`"]
  #[inline(always)]
  pub fn is_timdec_3(&self) -> bool {
    *self == TIMDEC_A::TIMDEC_3
  }
}
#[doc = "Write proxy for field `TIMDEC`"]
pub struct TIMDEC_W<'a> {
  w: &'a mut W,
}
impl<'a> TIMDEC_W<'a> {
  #[doc = r"Writes `variant` to the field"]
  #[inline(always)]
  pub fn variant(self, variant: TIMDEC_A) -> &'a mut W {
    {
      self.bits(variant.into())
    }
  }
  #[doc = "Decrement counter on FlexIO clock, Shift clock equals Timer output."]
  #[inline(always)]
  pub fn timdec_0(self) -> &'a mut W {
    self.variant(TIMDEC_A::TIMDEC_0)
  }
  #[doc = "Decrement counter on Trigger input (both edges), Shift clock equals Timer output."]
  #[inline(always)]
  pub fn timdec_1(self) -> &'a mut W {
    self.variant(TIMDEC_A::TIMDEC_1)
  }
  #[doc = "Decrement counter on Pin input (both edges), Shift clock equals Pin input."]
  #[inline(always)]
  pub fn timdec_2(self) -> &'a mut W {
    self.variant(TIMDEC_A::TIMDEC_2)
  }
  #[doc = "Decrement counter on Trigger input (both edges), Shift clock equals Trigger input."]
  #[inline(always)]
  pub fn timdec_3(self) -> &'a mut W {
    self.variant(TIMDEC_A::TIMDEC_3)
  }
  #[doc = r"Writes raw bits to the field"]
  #[inline(always)]
  pub fn bits(self, value: u8) -> &'a mut W {
    self.w.bits = (self.w.bits & !(0x03 << 20)) | (((value as u32) & 0x03) << 20);
    self.w
  }
}
#[doc = "Timer Output\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TIMOUT_A {
  #[doc = "0: Timer output is logic one when enabled and is not affected by timer reset"]
  TIMOUT_0,
  #[doc = "1: Timer output is logic zero when enabled and is not affected by timer reset"]
  TIMOUT_1,
  #[doc = "2: Timer output is logic one when enabled and on timer reset"]
  TIMOUT_2,
  #[doc = "3: Timer output is logic zero when enabled and on timer reset"]
  TIMOUT_3,
}
impl From<TIMOUT_A> for u8 {
  #[inline(always)]
  fn from(variant: TIMOUT_A) -> Self {
    match variant {
      TIMOUT_A::TIMOUT_0 => 0,
      TIMOUT_A::TIMOUT_1 => 1,
      TIMOUT_A::TIMOUT_2 => 2,
      TIMOUT_A::TIMOUT_3 => 3,
    }
  }
}
#[doc = "Reader of field `TIMOUT`"]
pub type TIMOUT_R = crate::R<u8, TIMOUT_A>;
impl TIMOUT_R {
  #[doc = r"Get enumerated values variant"]
  #[inline(always)]
  pub fn variant(&self) -> TIMOUT_A {
    match self.bits {
      0 => TIMOUT_A::TIMOUT_0,
      1 => TIMOUT_A::TIMOUT_1,
      2 => TIMOUT_A::TIMOUT_2,
      3 => TIMOUT_A::TIMOUT_3,
      _ => unreachable!(),
    }
  }
  #[doc = "Checks if the value of the field is `TIMOUT_0`"]
  #[inline(always)]
  pub fn is_timout_0(&self) -> bool {
    *self == TIMOUT_A::TIMOUT_0
  }
  #[doc = "Checks if the value of the field is `TIMOUT_1`"]
  #[inline(always)]
  pub fn is_timout_1(&self) -> bool {
    *self == TIMOUT_A::TIMOUT_1
  }
  #[doc = "Checks if the value of the field is `TIMOUT_2`"]
  #[inline(always)]
  pub fn is_timout_2(&self) -> bool {
    *self == TIMOUT_A::TIMOUT_2
  }
  #[doc = "Checks if the value of the field is `TIMOUT_3`"]
  #[inline(always)]
  pub fn is_timout_3(&self) -> bool {
    *self == TIMOUT_A::TIMOUT_3
  }
}
#[doc = "Write proxy for field `TIMOUT`"]
pub struct TIMOUT_W<'a> {
  w: &'a mut W,
}
impl<'a> TIMOUT_W<'a> {
  #[doc = r"Writes `variant` to the field"]
  #[inline(always)]
  pub fn variant(self, variant: TIMOUT_A) -> &'a mut W {
    {
      self.bits(variant.into())
    }
  }
  #[doc = "Timer output is logic one when enabled and is not affected by timer reset"]
  #[inline(always)]
  pub fn timout_0(self) -> &'a mut W {
    self.variant(TIMOUT_A::TIMOUT_0)
  }
  #[doc = "Timer output is logic zero when enabled and is not affected by timer reset"]
  #[inline(always)]
  pub fn timout_1(self) -> &'a mut W {
    self.variant(TIMOUT_A::TIMOUT_1)
  }
  #[doc = "Timer output is logic one when enabled and on timer reset"]
  #[inline(always)]
  pub fn timout_2(self) -> &'a mut W {
    self.variant(TIMOUT_A::TIMOUT_2)
  }
  #[doc = "Timer output is logic zero when enabled and on timer reset"]
  #[inline(always)]
  pub fn timout_3(self) -> &'a mut W {
    self.variant(TIMOUT_A::TIMOUT_3)
  }
  #[doc = r"Writes raw bits to the field"]
  #[inline(always)]
  pub fn bits(self, value: u8) -> &'a mut W {
    self.w.bits = (self.w.bits & !(0x03 << 24)) | (((value as u32) & 0x03) << 24);
    self.w
  }
}
impl R {
  #[doc = "Bit 1 - Timer Start Bit"]
  #[inline(always)]
  pub fn tstart(&self) -> TSTART_R {
    TSTART_R::new(((self.bits >> 1) & 0x01) != 0)
  }
  #[doc = "Bits 4:5 - Timer Stop Bit"]
  #[inline(always)]
  pub fn tstop(&self) -> TSTOP_R {
    TSTOP_R::new(((self.bits >> 4) & 0x03) as u8)
  }
  #[doc = "Bits 8:10 - Timer Enable"]
  #[inline(always)]
  pub fn timena(&self) -> TIMENA_R {
    TIMENA_R::new(((self.bits >> 8) & 0x07) as u8)
  }
  #[doc = "Bits 12:14 - Timer Disable"]
  #[inline(always)]
  pub fn timdis(&self) -> TIMDIS_R {
    TIMDIS_R::new(((self.bits >> 12) & 0x07) as u8)
  }
  #[doc = "Bits 16:18 - Timer Reset"]
  #[inline(always)]
  pub fn timrst(&self) -> TIMRST_R {
    TIMRST_R::new(((self.bits >> 16) & 0x07) as u8)
  }
  #[doc = "Bits 20:21 - Timer Decrement"]
  #[inline(always)]
  pub fn timdec(&self) -> TIMDEC_R {
    TIMDEC_R::new(((self.bits >> 20) & 0x03) as u8)
  }
  #[doc = "Bits 24:25 - Timer Output"]
  #[inline(always)]
  pub fn timout(&self) -> TIMOUT_R {
    TIMOUT_R::new(((self.bits >> 24) & 0x03) as u8)
  }
}
impl W {
  #[doc = "Bit 1 - Timer Start Bit"]
  #[inline(always)]
  pub fn tstart(&mut self) -> TSTART_W {
    TSTART_W { w: self }
  }
  #[doc = "Bits 4:5 - Timer Stop Bit"]
  #[inline(always)]
  pub fn tstop(&mut self) -> TSTOP_W {
    TSTOP_W { w: self }
  }
  #[doc = "Bits 8:10 - Timer Enable"]
  #[inline(always)]
  pub fn timena(&mut self) -> TIMENA_W {
    TIMENA_W { w: self }
  }
  #[doc = "Bits 12:14 - Timer Disable"]
  #[inline(always)]
  pub fn timdis(&mut self) -> TIMDIS_W {
    TIMDIS_W { w: self }
  }
  #[doc = "Bits 16:18 - Timer Reset"]
  #[inline(always)]
  pub fn timrst(&mut self) -> TIMRST_W {
    TIMRST_W { w: self }
  }
  #[doc = "Bits 20:21 - Timer Decrement"]
  #[inline(always)]
  pub fn timdec(&mut self) -> TIMDEC_W {
    TIMDEC_W { w: self }
  }
  #[doc = "Bits 24:25 - Timer Output"]
  #[inline(always)]
  pub fn timout(&mut self) -> TIMOUT_W {
    TIMOUT_W { w: self }
  }
}