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
#[doc = "Register `DTC` reader"]
pub type R = crate::R<DtcSpec>;
#[doc = "Register `DTC` writer"]
pub type W = crate::W<DtcSpec>;
#[doc = "Dead Time Enable for Channel 1\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Dte1 {
    #[doc = "0: Dead Time for channel 1 is disabled"]
    Value1 = 0,
    #[doc = "1: Dead Time for channel 1 is enabled"]
    Value2 = 1,
}
impl From<Dte1> for bool {
    #[inline(always)]
    fn from(variant: Dte1) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DTE1` reader - Dead Time Enable for Channel 1"]
pub type Dte1R = crate::BitReader<Dte1>;
impl Dte1R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Dte1 {
        match self.bits {
            false => Dte1::Value1,
            true => Dte1::Value2,
        }
    }
    #[doc = "Dead Time for channel 1 is disabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Dte1::Value1
    }
    #[doc = "Dead Time for channel 1 is enabled"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Dte1::Value2
    }
}
#[doc = "Field `DTE1` writer - Dead Time Enable for Channel 1"]
pub type Dte1W<'a, REG> = crate::BitWriter<'a, REG, Dte1>;
impl<'a, REG> Dte1W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Dead Time for channel 1 is disabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Dte1::Value1)
    }
    #[doc = "Dead Time for channel 1 is enabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Dte1::Value2)
    }
}
#[doc = "Dead Time Enable for Channel 2\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Dte2 {
    #[doc = "0: Dead Time for channel 2 is disabled"]
    Value1 = 0,
    #[doc = "1: Dead Time for channel 2 is enabled"]
    Value2 = 1,
}
impl From<Dte2> for bool {
    #[inline(always)]
    fn from(variant: Dte2) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DTE2` reader - Dead Time Enable for Channel 2"]
pub type Dte2R = crate::BitReader<Dte2>;
impl Dte2R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Dte2 {
        match self.bits {
            false => Dte2::Value1,
            true => Dte2::Value2,
        }
    }
    #[doc = "Dead Time for channel 2 is disabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Dte2::Value1
    }
    #[doc = "Dead Time for channel 2 is enabled"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Dte2::Value2
    }
}
#[doc = "Field `DTE2` writer - Dead Time Enable for Channel 2"]
pub type Dte2W<'a, REG> = crate::BitWriter<'a, REG, Dte2>;
impl<'a, REG> Dte2W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Dead Time for channel 2 is disabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Dte2::Value1)
    }
    #[doc = "Dead Time for channel 2 is enabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Dte2::Value2)
    }
}
#[doc = "Dead Time Enable for CC8yST1\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Dcen1 {
    #[doc = "0: Dead Time for CC8yST1 path is disabled"]
    Value1 = 0,
    #[doc = "1: Dead Time for CC8yST1 path is enabled"]
    Value2 = 1,
}
impl From<Dcen1> for bool {
    #[inline(always)]
    fn from(variant: Dcen1) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DCEN1` reader - Dead Time Enable for CC8yST1"]
pub type Dcen1R = crate::BitReader<Dcen1>;
impl Dcen1R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Dcen1 {
        match self.bits {
            false => Dcen1::Value1,
            true => Dcen1::Value2,
        }
    }
    #[doc = "Dead Time for CC8yST1 path is disabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Dcen1::Value1
    }
    #[doc = "Dead Time for CC8yST1 path is enabled"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Dcen1::Value2
    }
}
#[doc = "Field `DCEN1` writer - Dead Time Enable for CC8yST1"]
pub type Dcen1W<'a, REG> = crate::BitWriter<'a, REG, Dcen1>;
impl<'a, REG> Dcen1W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Dead Time for CC8yST1 path is disabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Dcen1::Value1)
    }
    #[doc = "Dead Time for CC8yST1 path is enabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Dcen1::Value2)
    }
}
#[doc = "Dead Time Enable for inverted CC8yST1\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Dcen2 {
    #[doc = "0: Dead Time for inverted CC8yST1 path is disabled"]
    Value1 = 0,
    #[doc = "1: Dead Time for inverted CC8yST1 path is enabled"]
    Value2 = 1,
}
impl From<Dcen2> for bool {
    #[inline(always)]
    fn from(variant: Dcen2) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DCEN2` reader - Dead Time Enable for inverted CC8yST1"]
pub type Dcen2R = crate::BitReader<Dcen2>;
impl Dcen2R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Dcen2 {
        match self.bits {
            false => Dcen2::Value1,
            true => Dcen2::Value2,
        }
    }
    #[doc = "Dead Time for inverted CC8yST1 path is disabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Dcen2::Value1
    }
    #[doc = "Dead Time for inverted CC8yST1 path is enabled"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Dcen2::Value2
    }
}
#[doc = "Field `DCEN2` writer - Dead Time Enable for inverted CC8yST1"]
pub type Dcen2W<'a, REG> = crate::BitWriter<'a, REG, Dcen2>;
impl<'a, REG> Dcen2W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Dead Time for inverted CC8yST1 path is disabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Dcen2::Value1)
    }
    #[doc = "Dead Time for inverted CC8yST1 path is enabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Dcen2::Value2)
    }
}
#[doc = "Dead Time Enable for CC8yST2\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Dcen3 {
    #[doc = "0: Dead Time for CC8yST2 path is disabled"]
    Value1 = 0,
    #[doc = "1: Dead Time for CC8yST2 path is enabled"]
    Value2 = 1,
}
impl From<Dcen3> for bool {
    #[inline(always)]
    fn from(variant: Dcen3) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DCEN3` reader - Dead Time Enable for CC8yST2"]
pub type Dcen3R = crate::BitReader<Dcen3>;
impl Dcen3R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Dcen3 {
        match self.bits {
            false => Dcen3::Value1,
            true => Dcen3::Value2,
        }
    }
    #[doc = "Dead Time for CC8yST2 path is disabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Dcen3::Value1
    }
    #[doc = "Dead Time for CC8yST2 path is enabled"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Dcen3::Value2
    }
}
#[doc = "Field `DCEN3` writer - Dead Time Enable for CC8yST2"]
pub type Dcen3W<'a, REG> = crate::BitWriter<'a, REG, Dcen3>;
impl<'a, REG> Dcen3W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Dead Time for CC8yST2 path is disabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Dcen3::Value1)
    }
    #[doc = "Dead Time for CC8yST2 path is enabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Dcen3::Value2)
    }
}
#[doc = "Dead Time Enable for inverted CC8yST2\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Dcen4 {
    #[doc = "0: Dead Time for inverted CC8yST2 path is disabled"]
    Value1 = 0,
    #[doc = "1: Dead Time for inverted CC8yST2 path is enabled"]
    Value2 = 1,
}
impl From<Dcen4> for bool {
    #[inline(always)]
    fn from(variant: Dcen4) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DCEN4` reader - Dead Time Enable for inverted CC8yST2"]
pub type Dcen4R = crate::BitReader<Dcen4>;
impl Dcen4R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Dcen4 {
        match self.bits {
            false => Dcen4::Value1,
            true => Dcen4::Value2,
        }
    }
    #[doc = "Dead Time for inverted CC8yST2 path is disabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Dcen4::Value1
    }
    #[doc = "Dead Time for inverted CC8yST2 path is enabled"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Dcen4::Value2
    }
}
#[doc = "Field `DCEN4` writer - Dead Time Enable for inverted CC8yST2"]
pub type Dcen4W<'a, REG> = crate::BitWriter<'a, REG, Dcen4>;
impl<'a, REG> Dcen4W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Dead Time for inverted CC8yST2 path is disabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Dcen4::Value1)
    }
    #[doc = "Dead Time for inverted CC8yST2 path is enabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Dcen4::Value2)
    }
}
#[doc = "Dead Time clock control\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum Dtcc {
    #[doc = "0: ftclk"]
    Value1 = 0,
    #[doc = "1: ftclk/2"]
    Value2 = 1,
    #[doc = "2: ftclk/4"]
    Value3 = 2,
    #[doc = "3: ftclk/8"]
    Value4 = 3,
}
impl From<Dtcc> for u8 {
    #[inline(always)]
    fn from(variant: Dtcc) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for Dtcc {
    type Ux = u8;
}
#[doc = "Field `DTCC` reader - Dead Time clock control"]
pub type DtccR = crate::FieldReader<Dtcc>;
impl DtccR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Dtcc {
        match self.bits {
            0 => Dtcc::Value1,
            1 => Dtcc::Value2,
            2 => Dtcc::Value3,
            3 => Dtcc::Value4,
            _ => unreachable!(),
        }
    }
    #[doc = "ftclk"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Dtcc::Value1
    }
    #[doc = "ftclk/2"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Dtcc::Value2
    }
    #[doc = "ftclk/4"]
    #[inline(always)]
    pub fn is_value3(&self) -> bool {
        *self == Dtcc::Value3
    }
    #[doc = "ftclk/8"]
    #[inline(always)]
    pub fn is_value4(&self) -> bool {
        *self == Dtcc::Value4
    }
}
#[doc = "Field `DTCC` writer - Dead Time clock control"]
pub type DtccW<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, Dtcc>;
impl<'a, REG> DtccW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    #[doc = "ftclk"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Dtcc::Value1)
    }
    #[doc = "ftclk/2"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Dtcc::Value2)
    }
    #[doc = "ftclk/4"]
    #[inline(always)]
    pub fn value3(self) -> &'a mut crate::W<REG> {
        self.variant(Dtcc::Value3)
    }
    #[doc = "ftclk/8"]
    #[inline(always)]
    pub fn value4(self) -> &'a mut crate::W<REG> {
        self.variant(Dtcc::Value4)
    }
}
impl R {
    #[doc = "Bit 0 - Dead Time Enable for Channel 1"]
    #[inline(always)]
    pub fn dte1(&self) -> Dte1R {
        Dte1R::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Dead Time Enable for Channel 2"]
    #[inline(always)]
    pub fn dte2(&self) -> Dte2R {
        Dte2R::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - Dead Time Enable for CC8yST1"]
    #[inline(always)]
    pub fn dcen1(&self) -> Dcen1R {
        Dcen1R::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - Dead Time Enable for inverted CC8yST1"]
    #[inline(always)]
    pub fn dcen2(&self) -> Dcen2R {
        Dcen2R::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 4 - Dead Time Enable for CC8yST2"]
    #[inline(always)]
    pub fn dcen3(&self) -> Dcen3R {
        Dcen3R::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - Dead Time Enable for inverted CC8yST2"]
    #[inline(always)]
    pub fn dcen4(&self) -> Dcen4R {
        Dcen4R::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bits 6:7 - Dead Time clock control"]
    #[inline(always)]
    pub fn dtcc(&self) -> DtccR {
        DtccR::new(((self.bits >> 6) & 3) as u8)
    }
}
impl W {
    #[doc = "Bit 0 - Dead Time Enable for Channel 1"]
    #[inline(always)]
    #[must_use]
    pub fn dte1(&mut self) -> Dte1W<DtcSpec> {
        Dte1W::new(self, 0)
    }
    #[doc = "Bit 1 - Dead Time Enable for Channel 2"]
    #[inline(always)]
    #[must_use]
    pub fn dte2(&mut self) -> Dte2W<DtcSpec> {
        Dte2W::new(self, 1)
    }
    #[doc = "Bit 2 - Dead Time Enable for CC8yST1"]
    #[inline(always)]
    #[must_use]
    pub fn dcen1(&mut self) -> Dcen1W<DtcSpec> {
        Dcen1W::new(self, 2)
    }
    #[doc = "Bit 3 - Dead Time Enable for inverted CC8yST1"]
    #[inline(always)]
    #[must_use]
    pub fn dcen2(&mut self) -> Dcen2W<DtcSpec> {
        Dcen2W::new(self, 3)
    }
    #[doc = "Bit 4 - Dead Time Enable for CC8yST2"]
    #[inline(always)]
    #[must_use]
    pub fn dcen3(&mut self) -> Dcen3W<DtcSpec> {
        Dcen3W::new(self, 4)
    }
    #[doc = "Bit 5 - Dead Time Enable for inverted CC8yST2"]
    #[inline(always)]
    #[must_use]
    pub fn dcen4(&mut self) -> Dcen4W<DtcSpec> {
        Dcen4W::new(self, 5)
    }
    #[doc = "Bits 6:7 - Dead Time clock control"]
    #[inline(always)]
    #[must_use]
    pub fn dtcc(&mut self) -> DtccW<DtcSpec> {
        DtccW::new(self, 6)
    }
}
#[doc = "Dead Time Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dtc::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dtc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct DtcSpec;
impl crate::RegisterSpec for DtcSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`dtc::R`](R) reader structure"]
impl crate::Readable for DtcSpec {}
#[doc = "`write(|w| ..)` method takes [`dtc::W`](W) writer structure"]
impl crate::Writable for DtcSpec {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets DTC to value 0"]
impl crate::Resettable for DtcSpec {
    const RESET_VALUE: u32 = 0;
}