xmc4100 0.14.0

XMC4100 Cortex-M peripheral access library
Documentation
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
#[doc = "Register `GC` reader"]
pub type R = crate::R<GC_SPEC>;
#[doc = "Register `GC` writer"]
pub type W = crate::W<GC_SPEC>;
#[doc = "HRCy high resolution mode configuration for source selector 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[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 _
    }
}
impl crate::FieldSpec for HRM0_A {
    type Ux = u8;
}
impl crate::IsEnum for HRM0_A {}
#[doc = "Field `HRM0` reader - HRCy high resolution mode configuration for source selector 0"]
pub type HRM0_R = crate::FieldReader<HRM0_A>;
impl HRM0_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const 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 = "Rising edge high resolution signal positioning enabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == HRM0_A::VALUE1
    }
    #[doc = "Falling edge high resolution signal positioning enabled"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == HRM0_A::VALUE2
    }
    #[doc = "Both edges high resolution signal positioning is enabled"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == HRM0_A::VALUE3
    }
    #[doc = "No high resolution positioning"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == HRM0_A::VALUE4
    }
}
#[doc = "Field `HRM0` writer - HRCy high resolution mode configuration for source selector 0"]
pub type HRM0_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HRM0_A, crate::Safe>;
impl<'a, REG> HRM0_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Rising edge high resolution signal positioning enabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(HRM0_A::VALUE1)
    }
    #[doc = "Falling edge high resolution signal positioning enabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(HRM0_A::VALUE2)
    }
    #[doc = "Both edges high resolution signal positioning is enabled"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(HRM0_A::VALUE3)
    }
    #[doc = "No high resolution positioning"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(HRM0_A::VALUE4)
    }
}
#[doc = "HRCy high resolution mode configuration for source selector 1\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[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 _
    }
}
impl crate::FieldSpec for HRM1_A {
    type Ux = u8;
}
impl crate::IsEnum for HRM1_A {}
#[doc = "Field `HRM1` reader - HRCy high resolution mode configuration for source selector 1"]
pub type HRM1_R = crate::FieldReader<HRM1_A>;
impl HRM1_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const 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 = "Rising edge high resolution signal positioning enabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == HRM1_A::VALUE1
    }
    #[doc = "Falling edge high resolution signal positioning enabled"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == HRM1_A::VALUE2
    }
    #[doc = "Both edges high resolution signal positioning is enabled"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == HRM1_A::VALUE3
    }
    #[doc = "No high resolution positioning"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == HRM1_A::VALUE4
    }
}
#[doc = "Field `HRM1` writer - HRCy high resolution mode configuration for source selector 1"]
pub type HRM1_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HRM1_A, crate::Safe>;
impl<'a, REG> HRM1_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "Rising edge high resolution signal positioning enabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(HRM1_A::VALUE1)
    }
    #[doc = "Falling edge high resolution signal positioning enabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(HRM1_A::VALUE2)
    }
    #[doc = "Both edges high resolution signal positioning is enabled"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(HRM1_A::VALUE3)
    }
    #[doc = "No high resolution positioning"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(HRM1_A::VALUE4)
    }
}
#[doc = "HRCy dead time enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
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 = "Field `DTE` reader - HRCy dead time enable"]
pub type DTE_R = crate::BitReader<DTE_A>;
impl DTE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> DTE_A {
        match self.bits {
            false => DTE_A::VALUE1,
            true => DTE_A::VALUE2,
        }
    }
    #[doc = "Dead time insertion is disabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == DTE_A::VALUE1
    }
    #[doc = "Dead time insertion is enabled"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == DTE_A::VALUE2
    }
}
#[doc = "Field `DTE` writer - HRCy dead time enable"]
pub type DTE_W<'a, REG> = crate::BitWriter<'a, REG, DTE_A>;
impl<'a, REG> DTE_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Dead time insertion is disabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(DTE_A::VALUE1)
    }
    #[doc = "Dead time insertion is enabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(DTE_A::VALUE2)
    }
}
#[doc = "HRCy trap enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
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 = "Field `TR0E` reader - HRCy trap enable"]
pub type TR0E_R = crate::BitReader<TR0E_A>;
impl TR0E_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> TR0E_A {
        match self.bits {
            false => TR0E_A::VALUE1,
            true => TR0E_A::VALUE2,
        }
    }
    #[doc = "Trap function for HRPWMx.HROUTy0 is disabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == TR0E_A::VALUE1
    }
    #[doc = "Trap function for HRPWMx.HROUTy0 is enabled"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == TR0E_A::VALUE2
    }
}
#[doc = "Field `TR0E` writer - HRCy trap enable"]
pub type TR0E_W<'a, REG> = crate::BitWriter<'a, REG, TR0E_A>;
impl<'a, REG> TR0E_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Trap function for HRPWMx.HROUTy0 is disabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(TR0E_A::VALUE1)
    }
    #[doc = "Trap function for HRPWMx.HROUTy0 is enabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(TR0E_A::VALUE2)
    }
}
#[doc = "HRCy complementary trap enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
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 = "Field `TR1E` reader - HRCy complementary trap enable"]
pub type TR1E_R = crate::BitReader<TR1E_A>;
impl TR1E_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> TR1E_A {
        match self.bits {
            false => TR1E_A::VALUE1,
            true => TR1E_A::VALUE2,
        }
    }
    #[doc = "Trap function for HRPWMx.HROUTy1 is disabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == TR1E_A::VALUE1
    }
    #[doc = "Trap function for HRPWMx.HROUTy1 is enabled"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == TR1E_A::VALUE2
    }
}
#[doc = "Field `TR1E` writer - HRCy complementary trap enable"]
pub type TR1E_W<'a, REG> = crate::BitWriter<'a, REG, TR1E_A>;
impl<'a, REG> TR1E_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Trap function for HRPWMx.HROUTy1 is disabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(TR1E_A::VALUE1)
    }
    #[doc = "Trap function for HRPWMx.HROUTy1 is enabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(TR1E_A::VALUE2)
    }
}
#[doc = "HRCy shadow transfer configuration\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
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 = "Field `STC` reader - HRCy shadow transfer configuration"]
pub type STC_R = crate::BitReader<STC_A>;
impl STC_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> STC_A {
        match self.bits {
            false => STC_A::VALUE1,
            true => STC_A::VALUE2,
        }
    }
    #[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 is_value1(&self) -> bool {
        *self == 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 is_value2(&self) -> bool {
        *self == STC_A::VALUE2
    }
}
#[doc = "Field `STC` writer - HRCy shadow transfer configuration"]
pub type STC_W<'a, REG> = crate::BitWriter<'a, REG, STC_A>;
impl<'a, REG> STC_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[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 crate::W<REG> {
        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 crate::W<REG> {
        self.variant(STC_A::VALUE2)
    }
}
#[doc = "HRCy dead time shadow transfer configuration\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
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 = "Field `DSTC` reader - HRCy dead time shadow transfer configuration"]
pub type DSTC_R = crate::BitReader<DSTC_A>;
impl DSTC_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> DSTC_A {
        match self.bits {
            false => DSTC_A::VALUE1,
            true => DSTC_A::VALUE2,
        }
    }
    #[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 is_value1(&self) -> bool {
        *self == 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 is_value2(&self) -> bool {
        *self == DSTC_A::VALUE2
    }
}
#[doc = "Field `DSTC` writer - HRCy dead time shadow transfer configuration"]
pub type DSTC_W<'a, REG> = crate::BitWriter<'a, REG, DSTC_A>;
impl<'a, REG> DSTC_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[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 crate::W<REG> {
        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 crate::W<REG> {
        self.variant(DSTC_A::VALUE2)
    }
}
#[doc = "HRPWMx.OUTy0 channel selector\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
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 = "Field `OCS0` reader - HRPWMx.OUTy0 channel selector"]
pub type OCS0_R = crate::BitReader<OCS0_A>;
impl OCS0_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> OCS0_A {
        match self.bits {
            false => OCS0_A::VALUE1,
            true => OCS0_A::VALUE2,
        }
    }
    #[doc = "HRPWMx.OUTy0 is connected to the latch Q channel"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == OCS0_A::VALUE1
    }
    #[doc = "HRPWMx.OUTy0 is connected to the latch Qn channel"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == OCS0_A::VALUE2
    }
}
#[doc = "Field `OCS0` writer - HRPWMx.OUTy0 channel selector"]
pub type OCS0_W<'a, REG> = crate::BitWriter<'a, REG, OCS0_A>;
impl<'a, REG> OCS0_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "HRPWMx.OUTy0 is connected to the latch Q channel"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(OCS0_A::VALUE1)
    }
    #[doc = "HRPWMx.OUTy0 is connected to the latch Qn channel"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(OCS0_A::VALUE2)
    }
}
#[doc = "HRPWMx.OUTy1 channel selector\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
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 = "Field `OCS1` reader - HRPWMx.OUTy1 channel selector"]
pub type OCS1_R = crate::BitReader<OCS1_A>;
impl OCS1_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> OCS1_A {
        match self.bits {
            false => OCS1_A::VALUE1,
            true => OCS1_A::VALUE2,
        }
    }
    #[doc = "HRPWMx.OUTy1 is connected to the latch Qn channel"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == OCS1_A::VALUE1
    }
    #[doc = "HRPWMx.OUTy1 is connected to the latch Q channel"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == OCS1_A::VALUE2
    }
}
#[doc = "Field `OCS1` writer - HRPWMx.OUTy1 channel selector"]
pub type OCS1_W<'a, REG> = crate::BitWriter<'a, REG, OCS1_A>;
impl<'a, REG> OCS1_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "HRPWMx.OUTy1 is connected to the latch Qn channel"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(OCS1_A::VALUE1)
    }
    #[doc = "HRPWMx.OUTy1 is connected to the latch Q channel"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(OCS1_A::VALUE2)
    }
}
#[doc = "Dead Time update trigger selector\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
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 = "Field `DTUS` reader - Dead Time update trigger selector"]
pub type DTUS_R = crate::BitReader<DTUS_A>;
impl DTUS_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> DTUS_A {
        match self.bits {
            false => DTUS_A::VALUE1,
            true => DTUS_A::VALUE2,
        }
    }
    #[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 is_value1(&self) -> bool {
        *self == 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 is_value2(&self) -> bool {
        *self == DTUS_A::VALUE2
    }
}
#[doc = "Field `DTUS` writer - Dead Time update trigger selector"]
pub type DTUS_W<'a, REG> = crate::BitWriter<'a, REG, DTUS_A>;
impl<'a, REG> DTUS_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[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 crate::W<REG> {
        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 crate::W<REG> {
        self.variant(DTUS_A::VALUE2)
    }
}
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 & 3) 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) & 3) as u8)
    }
    #[doc = "Bit 8 - HRCy dead time enable"]
    #[inline(always)]
    pub fn dte(&self) -> DTE_R {
        DTE_R::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bit 9 - HRCy trap enable"]
    #[inline(always)]
    pub fn tr0e(&self) -> TR0E_R {
        TR0E_R::new(((self.bits >> 9) & 1) != 0)
    }
    #[doc = "Bit 10 - HRCy complementary trap enable"]
    #[inline(always)]
    pub fn tr1e(&self) -> TR1E_R {
        TR1E_R::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bit 11 - HRCy shadow transfer configuration"]
    #[inline(always)]
    pub fn stc(&self) -> STC_R {
        STC_R::new(((self.bits >> 11) & 1) != 0)
    }
    #[doc = "Bit 12 - HRCy dead time shadow transfer configuration"]
    #[inline(always)]
    pub fn dstc(&self) -> DSTC_R {
        DSTC_R::new(((self.bits >> 12) & 1) != 0)
    }
    #[doc = "Bit 13 - HRPWMx.OUTy0 channel selector"]
    #[inline(always)]
    pub fn ocs0(&self) -> OCS0_R {
        OCS0_R::new(((self.bits >> 13) & 1) != 0)
    }
    #[doc = "Bit 14 - HRPWMx.OUTy1 channel selector"]
    #[inline(always)]
    pub fn ocs1(&self) -> OCS1_R {
        OCS1_R::new(((self.bits >> 14) & 1) != 0)
    }
    #[doc = "Bit 16 - Dead Time update trigger selector"]
    #[inline(always)]
    pub fn dtus(&self) -> DTUS_R {
        DTUS_R::new(((self.bits >> 16) & 1) != 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<GC_SPEC> {
        HRM0_W::new(self, 0)
    }
    #[doc = "Bits 2:3 - HRCy high resolution mode configuration for source selector 1"]
    #[inline(always)]
    pub fn hrm1(&mut self) -> HRM1_W<GC_SPEC> {
        HRM1_W::new(self, 2)
    }
    #[doc = "Bit 8 - HRCy dead time enable"]
    #[inline(always)]
    pub fn dte(&mut self) -> DTE_W<GC_SPEC> {
        DTE_W::new(self, 8)
    }
    #[doc = "Bit 9 - HRCy trap enable"]
    #[inline(always)]
    pub fn tr0e(&mut self) -> TR0E_W<GC_SPEC> {
        TR0E_W::new(self, 9)
    }
    #[doc = "Bit 10 - HRCy complementary trap enable"]
    #[inline(always)]
    pub fn tr1e(&mut self) -> TR1E_W<GC_SPEC> {
        TR1E_W::new(self, 10)
    }
    #[doc = "Bit 11 - HRCy shadow transfer configuration"]
    #[inline(always)]
    pub fn stc(&mut self) -> STC_W<GC_SPEC> {
        STC_W::new(self, 11)
    }
    #[doc = "Bit 12 - HRCy dead time shadow transfer configuration"]
    #[inline(always)]
    pub fn dstc(&mut self) -> DSTC_W<GC_SPEC> {
        DSTC_W::new(self, 12)
    }
    #[doc = "Bit 13 - HRPWMx.OUTy0 channel selector"]
    #[inline(always)]
    pub fn ocs0(&mut self) -> OCS0_W<GC_SPEC> {
        OCS0_W::new(self, 13)
    }
    #[doc = "Bit 14 - HRPWMx.OUTy1 channel selector"]
    #[inline(always)]
    pub fn ocs1(&mut self) -> OCS1_W<GC_SPEC> {
        OCS1_W::new(self, 14)
    }
    #[doc = "Bit 16 - Dead Time update trigger selector"]
    #[inline(always)]
    pub fn dtus(&mut self) -> DTUS_W<GC_SPEC> {
        DTUS_W::new(self, 16)
    }
}
#[doc = "HRC mode configuration\n\nYou can [`read`](crate::Reg::read) this register and get [`gc::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`gc::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct GC_SPEC;
impl crate::RegisterSpec for GC_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [`gc::R`](R) reader structure"]
impl crate::Readable for GC_SPEC {}
#[doc = "`write(|w| ..)` method takes [`gc::W`](W) writer structure"]
impl crate::Writable for GC_SPEC {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets GC to value 0"]
impl crate::Resettable for GC_SPEC {
    const RESET_VALUE: u32 = 0;
}