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
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
#[doc = "Reader of register GC"]
pub type R = crate::R<u32, super::GC>;
#[doc = "Writer for register GC"]
pub type W = crate::W<u32, super::GC>;
#[doc = "Register GC `reset()`'s with value 0"]
impl crate::ResetValue for super::GC {
    type Type = u32;
    #[inline(always)]
    fn reset_value() -> Self::Type {
        0
    }
}
#[doc = "HRCy high resolution mode configuration for source selector 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum HRM0_A {
    #[doc = "0: Rising edge high resolution signal positioning enabled"]
    VALUE1 = 0,
    #[doc = "1: Falling edge high resolution signal positioning enabled"]
    VALUE2 = 1,
    #[doc = "2: Both edges high resolution signal positioning is enabled"]
    VALUE3 = 2,
    #[doc = "3: No high resolution positioning"]
    VALUE4 = 3,
}
impl From<HRM0_A> for u8 {
    #[inline(always)]
    fn from(variant: HRM0_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `HRM0`"]
pub type HRM0_R = crate::R<u8, HRM0_A>;
impl HRM0_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> HRM0_A {
        match self.bits {
            0 => HRM0_A::VALUE1,
            1 => HRM0_A::VALUE2,
            2 => HRM0_A::VALUE3,
            3 => HRM0_A::VALUE4,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `VALUE1`"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == HRM0_A::VALUE1
    }
    #[doc = "Checks if the value of the field is `VALUE2`"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == HRM0_A::VALUE2
    }
    #[doc = "Checks if the value of the field is `VALUE3`"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == HRM0_A::VALUE3
    }
    #[doc = "Checks if the value of the field is `VALUE4`"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == HRM0_A::VALUE4
    }
}
#[doc = "Write proxy for field `HRM0`"]
pub struct HRM0_W<'a> {
    w: &'a mut W,
}
impl<'a> HRM0_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: HRM0_A) -> &'a mut W {
        {
            self.bits(variant.into())
        }
    }
    #[doc = "Rising edge high resolution signal positioning enabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut W {
        self.variant(HRM0_A::VALUE1)
    }
    #[doc = "Falling edge high resolution signal positioning enabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut W {
        self.variant(HRM0_A::VALUE2)
    }
    #[doc = "Both edges high resolution signal positioning is enabled"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut W {
        self.variant(HRM0_A::VALUE3)
    }
    #[doc = "No high resolution positioning"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut W {
        self.variant(HRM0_A::VALUE4)
    }
    #[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) | ((value as u32) & 0x03);
        self.w
    }
}
#[doc = "HRCy high resolution mode configuration for source selector 1\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum HRM1_A {
    #[doc = "0: Rising edge high resolution signal positioning enabled"]
    VALUE1 = 0,
    #[doc = "1: Falling edge high resolution signal positioning enabled"]
    VALUE2 = 1,
    #[doc = "2: Both edges high resolution signal positioning is enabled"]
    VALUE3 = 2,
    #[doc = "3: No high resolution positioning"]
    VALUE4 = 3,
}
impl From<HRM1_A> for u8 {
    #[inline(always)]
    fn from(variant: HRM1_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `HRM1`"]
pub type HRM1_R = crate::R<u8, HRM1_A>;
impl HRM1_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> HRM1_A {
        match self.bits {
            0 => HRM1_A::VALUE1,
            1 => HRM1_A::VALUE2,
            2 => HRM1_A::VALUE3,
            3 => HRM1_A::VALUE4,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `VALUE1`"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == HRM1_A::VALUE1
    }
    #[doc = "Checks if the value of the field is `VALUE2`"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == HRM1_A::VALUE2
    }
    #[doc = "Checks if the value of the field is `VALUE3`"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == HRM1_A::VALUE3
    }
    #[doc = "Checks if the value of the field is `VALUE4`"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == HRM1_A::VALUE4
    }
}
#[doc = "Write proxy for field `HRM1`"]
pub struct HRM1_W<'a> {
    w: &'a mut W,
}
impl<'a> HRM1_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: HRM1_A) -> &'a mut W {
        {
            self.bits(variant.into())
        }
    }
    #[doc = "Rising edge high resolution signal positioning enabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut W {
        self.variant(HRM1_A::VALUE1)
    }
    #[doc = "Falling edge high resolution signal positioning enabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut W {
        self.variant(HRM1_A::VALUE2)
    }
    #[doc = "Both edges high resolution signal positioning is enabled"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut W {
        self.variant(HRM1_A::VALUE3)
    }
    #[doc = "No high resolution positioning"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut W {
        self.variant(HRM1_A::VALUE4)
    }
    #[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 << 2)) | (((value as u32) & 0x03) << 2);
        self.w
    }
}
#[doc = "HRCy dead time enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DTE_A {
    #[doc = "0: Dead time insertion is disabled"]
    VALUE1 = 0,
    #[doc = "1: Dead time insertion is enabled"]
    VALUE2 = 1,
}
impl From<DTE_A> for bool {
    #[inline(always)]
    fn from(variant: DTE_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `DTE`"]
pub type DTE_R = crate::R<bool, DTE_A>;
impl DTE_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DTE_A {
        match self.bits {
            false => DTE_A::VALUE1,
            true => DTE_A::VALUE2,
        }
    }
    #[doc = "Checks if the value of the field is `VALUE1`"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == DTE_A::VALUE1
    }
    #[doc = "Checks if the value of the field is `VALUE2`"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == DTE_A::VALUE2
    }
}
#[doc = "Write proxy for field `DTE`"]
pub struct DTE_W<'a> {
    w: &'a mut W,
}
impl<'a> DTE_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: DTE_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "Dead time insertion is disabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut W {
        self.variant(DTE_A::VALUE1)
    }
    #[doc = "Dead time insertion is enabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut W {
        self.variant(DTE_A::VALUE2)
    }
    #[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 << 8)) | (((value as u32) & 0x01) << 8);
        self.w
    }
}
#[doc = "HRCy trap enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TR0E_A {
    #[doc = "0: Trap function for HRPWMx.HROUTy0 is disabled"]
    VALUE1 = 0,
    #[doc = "1: Trap function for HRPWMx.HROUTy0 is enabled"]
    VALUE2 = 1,
}
impl From<TR0E_A> for bool {
    #[inline(always)]
    fn from(variant: TR0E_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `TR0E`"]
pub type TR0E_R = crate::R<bool, TR0E_A>;
impl TR0E_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TR0E_A {
        match self.bits {
            false => TR0E_A::VALUE1,
            true => TR0E_A::VALUE2,
        }
    }
    #[doc = "Checks if the value of the field is `VALUE1`"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == TR0E_A::VALUE1
    }
    #[doc = "Checks if the value of the field is `VALUE2`"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == TR0E_A::VALUE2
    }
}
#[doc = "Write proxy for field `TR0E`"]
pub struct TR0E_W<'a> {
    w: &'a mut W,
}
impl<'a> TR0E_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: TR0E_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "Trap function for HRPWMx.HROUTy0 is disabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut W {
        self.variant(TR0E_A::VALUE1)
    }
    #[doc = "Trap function for HRPWMx.HROUTy0 is enabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut W {
        self.variant(TR0E_A::VALUE2)
    }
    #[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 << 9)) | (((value as u32) & 0x01) << 9);
        self.w
    }
}
#[doc = "HRCy complementary trap enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TR1E_A {
    #[doc = "0: Trap function for HRPWMx.HROUTy1 is disabled"]
    VALUE1 = 0,
    #[doc = "1: Trap function for HRPWMx.HROUTy1 is enabled"]
    VALUE2 = 1,
}
impl From<TR1E_A> for bool {
    #[inline(always)]
    fn from(variant: TR1E_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `TR1E`"]
pub type TR1E_R = crate::R<bool, TR1E_A>;
impl TR1E_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TR1E_A {
        match self.bits {
            false => TR1E_A::VALUE1,
            true => TR1E_A::VALUE2,
        }
    }
    #[doc = "Checks if the value of the field is `VALUE1`"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == TR1E_A::VALUE1
    }
    #[doc = "Checks if the value of the field is `VALUE2`"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == TR1E_A::VALUE2
    }
}
#[doc = "Write proxy for field `TR1E`"]
pub struct TR1E_W<'a> {
    w: &'a mut W,
}
impl<'a> TR1E_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: TR1E_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "Trap function for HRPWMx.HROUTy1 is disabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut W {
        self.variant(TR1E_A::VALUE1)
    }
    #[doc = "Trap function for HRPWMx.HROUTy1 is enabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut W {
        self.variant(TR1E_A::VALUE2)
    }
    #[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 << 10)) | (((value as u32) & 0x01) << 10);
        self.w
    }
}
#[doc = "HRCy shadow transfer configuration\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum STC_A {
    #[doc = "0: HRCy shadow transfer enable for HRCyCR1This register holds the value for the rising edge high resolution signal placement. the update of this value should be done via the associated shadow register, . and HRCyCR2This register holds the value for the falling edge high resolution signal placement. the update of this value should be done via the associated shadow register, . values is not linked with the specific Capture/Compare Unit timer."]
    VALUE1 = 0,
    #[doc = "1: HRCy shadow transfer enable for HRCyCR1This register holds the value for the rising edge high resolution signal placement. the update of this value should be done via the associated shadow register, . and HRCyCR2This register holds the value for the falling edge high resolution signal placement. the update of this value should be done via the associated shadow register, . values is linked with the specific Capture/Compare Unit timer."]
    VALUE2 = 1,
}
impl From<STC_A> for bool {
    #[inline(always)]
    fn from(variant: STC_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `STC`"]
pub type STC_R = crate::R<bool, STC_A>;
impl STC_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> STC_A {
        match self.bits {
            false => STC_A::VALUE1,
            true => STC_A::VALUE2,
        }
    }
    #[doc = "Checks if the value of the field is `VALUE1`"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == STC_A::VALUE1
    }
    #[doc = "Checks if the value of the field is `VALUE2`"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == STC_A::VALUE2
    }
}
#[doc = "Write proxy for field `STC`"]
pub struct STC_W<'a> {
    w: &'a mut W,
}
impl<'a> STC_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: STC_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "HRCy shadow transfer enable for HRCyCR1This register holds the value for the rising edge high resolution signal placement. the update of this value should be done via the associated shadow register, . and HRCyCR2This register holds the value for the falling edge high resolution signal placement. the update of this value should be done via the associated shadow register, . values is not linked with the specific Capture/Compare Unit timer."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut W {
        self.variant(STC_A::VALUE1)
    }
    #[doc = "HRCy shadow transfer enable for HRCyCR1This register holds the value for the rising edge high resolution signal placement. the update of this value should be done via the associated shadow register, . and HRCyCR2This register holds the value for the falling edge high resolution signal placement. the update of this value should be done via the associated shadow register, . values is linked with the specific Capture/Compare Unit timer."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut W {
        self.variant(STC_A::VALUE2)
    }
    #[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 << 11)) | (((value as u32) & 0x01) << 11);
        self.w
    }
}
#[doc = "HRCy dead time shadow transfer configuration\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DSTC_A {
    #[doc = "0: HRCy shadow transfer enable for HRCyDCRThis register holds the dead time value that is going to be inserted whenever a rising transition on the output latch is sensed. and HRCyDCFThis register holds the dead time value that is going to be inserted whenever a falling transition on the output latch is sensed. values is not linked with the specific Capture/Compare Unit timer."]
    VALUE1 = 0,
    #[doc = "1: HRCy shadow transfer enable for HRCyDCRThis register holds the dead time value that is going to be inserted whenever a rising transition on the output latch is sensed. and HRCyDCFThis register holds the dead time value that is going to be inserted whenever a falling transition on the output latch is sensed. values is linked with the specific Capture/Compare Unit timer."]
    VALUE2 = 1,
}
impl From<DSTC_A> for bool {
    #[inline(always)]
    fn from(variant: DSTC_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `DSTC`"]
pub type DSTC_R = crate::R<bool, DSTC_A>;
impl DSTC_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DSTC_A {
        match self.bits {
            false => DSTC_A::VALUE1,
            true => DSTC_A::VALUE2,
        }
    }
    #[doc = "Checks if the value of the field is `VALUE1`"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == DSTC_A::VALUE1
    }
    #[doc = "Checks if the value of the field is `VALUE2`"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == DSTC_A::VALUE2
    }
}
#[doc = "Write proxy for field `DSTC`"]
pub struct DSTC_W<'a> {
    w: &'a mut W,
}
impl<'a> DSTC_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: DSTC_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "HRCy shadow transfer enable for HRCyDCRThis register holds the dead time value that is going to be inserted whenever a rising transition on the output latch is sensed. and HRCyDCFThis register holds the dead time value that is going to be inserted whenever a falling transition on the output latch is sensed. values is not linked with the specific Capture/Compare Unit timer."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut W {
        self.variant(DSTC_A::VALUE1)
    }
    #[doc = "HRCy shadow transfer enable for HRCyDCRThis register holds the dead time value that is going to be inserted whenever a rising transition on the output latch is sensed. and HRCyDCFThis register holds the dead time value that is going to be inserted whenever a falling transition on the output latch is sensed. values is linked with the specific Capture/Compare Unit timer."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut W {
        self.variant(DSTC_A::VALUE2)
    }
    #[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 << 12)) | (((value as u32) & 0x01) << 12);
        self.w
    }
}
#[doc = "HRPWMx.OUTy0 channel selector\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum OCS0_A {
    #[doc = "0: HRPWMx.OUTy0 is connected to the latch Q channel"]
    VALUE1 = 0,
    #[doc = "1: HRPWMx.OUTy0 is connected to the latch Qn channel"]
    VALUE2 = 1,
}
impl From<OCS0_A> for bool {
    #[inline(always)]
    fn from(variant: OCS0_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `OCS0`"]
pub type OCS0_R = crate::R<bool, OCS0_A>;
impl OCS0_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> OCS0_A {
        match self.bits {
            false => OCS0_A::VALUE1,
            true => OCS0_A::VALUE2,
        }
    }
    #[doc = "Checks if the value of the field is `VALUE1`"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == OCS0_A::VALUE1
    }
    #[doc = "Checks if the value of the field is `VALUE2`"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == OCS0_A::VALUE2
    }
}
#[doc = "Write proxy for field `OCS0`"]
pub struct OCS0_W<'a> {
    w: &'a mut W,
}
impl<'a> OCS0_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: OCS0_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "HRPWMx.OUTy0 is connected to the latch Q channel"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut W {
        self.variant(OCS0_A::VALUE1)
    }
    #[doc = "HRPWMx.OUTy0 is connected to the latch Qn channel"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut W {
        self.variant(OCS0_A::VALUE2)
    }
    #[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 << 13)) | (((value as u32) & 0x01) << 13);
        self.w
    }
}
#[doc = "HRPWMx.OUTy1 channel selector\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum OCS1_A {
    #[doc = "0: HRPWMx.OUTy1 is connected to the latch Qn channel"]
    VALUE1 = 0,
    #[doc = "1: HRPWMx.OUTy1 is connected to the latch Q channel"]
    VALUE2 = 1,
}
impl From<OCS1_A> for bool {
    #[inline(always)]
    fn from(variant: OCS1_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `OCS1`"]
pub type OCS1_R = crate::R<bool, OCS1_A>;
impl OCS1_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> OCS1_A {
        match self.bits {
            false => OCS1_A::VALUE1,
            true => OCS1_A::VALUE2,
        }
    }
    #[doc = "Checks if the value of the field is `VALUE1`"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == OCS1_A::VALUE1
    }
    #[doc = "Checks if the value of the field is `VALUE2`"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == OCS1_A::VALUE2
    }
}
#[doc = "Write proxy for field `OCS1`"]
pub struct OCS1_W<'a> {
    w: &'a mut W,
}
impl<'a> OCS1_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: OCS1_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "HRPWMx.OUTy1 is connected to the latch Qn channel"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut W {
        self.variant(OCS1_A::VALUE1)
    }
    #[doc = "HRPWMx.OUTy1 is connected to the latch Q channel"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut W {
        self.variant(OCS1_A::VALUE2)
    }
    #[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 << 14)) | (((value as u32) & 0x01) << 14);
        self.w
    }
}
#[doc = "Dead Time update trigger selector\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DTUS_A {
    #[doc = "0: The update of the values is done with the trigger generated by the timers. This is the same trigger that is used to update the HRCyCR1This register holds the value for the rising edge high resolution signal placement. the update of this value should be done via the associated shadow register, . and HRCyCR2This register holds the value for the falling edge high resolution signal placement. the update of this value should be done via the associated shadow register, .."]
    VALUE1 = 0,
    #[doc = "1: The update of the dead time values is done when the dead time counter is not running, independently of the HRCyCR1This register holds the value for the rising edge high resolution signal placement. the update of this value should be done via the associated shadow register, . and HRCyCR2This register holds the value for the falling edge high resolution signal placement. the update of this value should be done via the associated shadow register, . registers."]
    VALUE2 = 1,
}
impl From<DTUS_A> for bool {
    #[inline(always)]
    fn from(variant: DTUS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `DTUS`"]
pub type DTUS_R = crate::R<bool, DTUS_A>;
impl DTUS_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> DTUS_A {
        match self.bits {
            false => DTUS_A::VALUE1,
            true => DTUS_A::VALUE2,
        }
    }
    #[doc = "Checks if the value of the field is `VALUE1`"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == DTUS_A::VALUE1
    }
    #[doc = "Checks if the value of the field is `VALUE2`"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == DTUS_A::VALUE2
    }
}
#[doc = "Write proxy for field `DTUS`"]
pub struct DTUS_W<'a> {
    w: &'a mut W,
}
impl<'a> DTUS_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: DTUS_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "The update of the values is done with the trigger generated by the timers. This is the same trigger that is used to update the HRCyCR1This register holds the value for the rising edge high resolution signal placement. the update of this value should be done via the associated shadow register, . and HRCyCR2This register holds the value for the falling edge high resolution signal placement. the update of this value should be done via the associated shadow register, .."]
    #[inline(always)]
    pub fn value1(self) -> &'a mut W {
        self.variant(DTUS_A::VALUE1)
    }
    #[doc = "The update of the dead time values is done when the dead time counter is not running, independently of the HRCyCR1This register holds the value for the rising edge high resolution signal placement. the update of this value should be done via the associated shadow register, . and HRCyCR2This register holds the value for the falling edge high resolution signal placement. the update of this value should be done via the associated shadow register, . registers."]
    #[inline(always)]
    pub fn value2(self) -> &'a mut W {
        self.variant(DTUS_A::VALUE2)
    }
    #[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 << 16)) | (((value as u32) & 0x01) << 16);
        self.w
    }
}
impl R {
    #[doc = "Bits 0:1 - HRCy high resolution mode configuration for source selector 0"]
    #[inline(always)]
    pub fn hrm0(&self) -> HRM0_R {
        HRM0_R::new((self.bits & 0x03) as u8)
    }
    #[doc = "Bits 2:3 - HRCy high resolution mode configuration for source selector 1"]
    #[inline(always)]
    pub fn hrm1(&self) -> HRM1_R {
        HRM1_R::new(((self.bits >> 2) & 0x03) as u8)
    }
    #[doc = "Bit 8 - HRCy dead time enable"]
    #[inline(always)]
    pub fn dte(&self) -> DTE_R {
        DTE_R::new(((self.bits >> 8) & 0x01) != 0)
    }
    #[doc = "Bit 9 - HRCy trap enable"]
    #[inline(always)]
    pub fn tr0e(&self) -> TR0E_R {
        TR0E_R::new(((self.bits >> 9) & 0x01) != 0)
    }
    #[doc = "Bit 10 - HRCy complementary trap enable"]
    #[inline(always)]
    pub fn tr1e(&self) -> TR1E_R {
        TR1E_R::new(((self.bits >> 10) & 0x01) != 0)
    }
    #[doc = "Bit 11 - HRCy shadow transfer configuration"]
    #[inline(always)]
    pub fn stc(&self) -> STC_R {
        STC_R::new(((self.bits >> 11) & 0x01) != 0)
    }
    #[doc = "Bit 12 - HRCy dead time shadow transfer configuration"]
    #[inline(always)]
    pub fn dstc(&self) -> DSTC_R {
        DSTC_R::new(((self.bits >> 12) & 0x01) != 0)
    }
    #[doc = "Bit 13 - HRPWMx.OUTy0 channel selector"]
    #[inline(always)]
    pub fn ocs0(&self) -> OCS0_R {
        OCS0_R::new(((self.bits >> 13) & 0x01) != 0)
    }
    #[doc = "Bit 14 - HRPWMx.OUTy1 channel selector"]
    #[inline(always)]
    pub fn ocs1(&self) -> OCS1_R {
        OCS1_R::new(((self.bits >> 14) & 0x01) != 0)
    }
    #[doc = "Bit 16 - Dead Time update trigger selector"]
    #[inline(always)]
    pub fn dtus(&self) -> DTUS_R {
        DTUS_R::new(((self.bits >> 16) & 0x01) != 0)
    }
}
impl W {
    #[doc = "Bits 0:1 - HRCy high resolution mode configuration for source selector 0"]
    #[inline(always)]
    pub fn hrm0(&mut self) -> HRM0_W {
        HRM0_W { w: self }
    }
    #[doc = "Bits 2:3 - HRCy high resolution mode configuration for source selector 1"]
    #[inline(always)]
    pub fn hrm1(&mut self) -> HRM1_W {
        HRM1_W { w: self }
    }
    #[doc = "Bit 8 - HRCy dead time enable"]
    #[inline(always)]
    pub fn dte(&mut self) -> DTE_W {
        DTE_W { w: self }
    }
    #[doc = "Bit 9 - HRCy trap enable"]
    #[inline(always)]
    pub fn tr0e(&mut self) -> TR0E_W {
        TR0E_W { w: self }
    }
    #[doc = "Bit 10 - HRCy complementary trap enable"]
    #[inline(always)]
    pub fn tr1e(&mut self) -> TR1E_W {
        TR1E_W { w: self }
    }
    #[doc = "Bit 11 - HRCy shadow transfer configuration"]
    #[inline(always)]
    pub fn stc(&mut self) -> STC_W {
        STC_W { w: self }
    }
    #[doc = "Bit 12 - HRCy dead time shadow transfer configuration"]
    #[inline(always)]
    pub fn dstc(&mut self) -> DSTC_W {
        DSTC_W { w: self }
    }
    #[doc = "Bit 13 - HRPWMx.OUTy0 channel selector"]
    #[inline(always)]
    pub fn ocs0(&mut self) -> OCS0_W {
        OCS0_W { w: self }
    }
    #[doc = "Bit 14 - HRPWMx.OUTy1 channel selector"]
    #[inline(always)]
    pub fn ocs1(&mut self) -> OCS1_W {
        OCS1_W { w: self }
    }
    #[doc = "Bit 16 - Dead Time update trigger selector"]
    #[inline(always)]
    pub fn dtus(&mut self) -> DTUS_W {
        DTUS_W { w: self }
    }
}