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
#[doc = "Register `CHC` reader"]
pub type R = crate::R<ChcSpec>;
#[doc = "Register `CHC` writer"]
pub type W = crate::W<ChcSpec>;
#[doc = "Asymmetric PWM mode Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ase {
    #[doc = "0: Asymmetric PWM is disabled"]
    Value1 = 0,
    #[doc = "1: Asymmetric PWM is enabled"]
    Value2 = 1,
}
impl From<Ase> for bool {
    #[inline(always)]
    fn from(variant: Ase) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ASE` reader - Asymmetric PWM mode Enable"]
pub type AseR = crate::BitReader<Ase>;
impl AseR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Ase {
        match self.bits {
            false => Ase::Value1,
            true => Ase::Value2,
        }
    }
    #[doc = "Asymmetric PWM is disabled"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Ase::Value1
    }
    #[doc = "Asymmetric PWM is enabled"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Ase::Value2
    }
}
#[doc = "Field `ASE` writer - Asymmetric PWM mode Enable"]
pub type AseW<'a, REG> = crate::BitWriter<'a, REG, Ase>;
impl<'a, REG> AseW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Asymmetric PWM is disabled"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Ase::Value1)
    }
    #[doc = "Asymmetric PWM is enabled"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Ase::Value2)
    }
}
#[doc = "Output selector for CCU8x.OUTy0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ocs1 {
    #[doc = "0: CC8yST1 signal path is connected to the CCU8x.OUTy0"]
    Value1 = 0,
    #[doc = "1: Inverted CC8yST1 signal path is connected to the CCU8x.OUTy0"]
    Value2 = 1,
}
impl From<Ocs1> for bool {
    #[inline(always)]
    fn from(variant: Ocs1) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `OCS1` reader - Output selector for CCU8x.OUTy0"]
pub type Ocs1R = crate::BitReader<Ocs1>;
impl Ocs1R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Ocs1 {
        match self.bits {
            false => Ocs1::Value1,
            true => Ocs1::Value2,
        }
    }
    #[doc = "CC8yST1 signal path is connected to the CCU8x.OUTy0"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Ocs1::Value1
    }
    #[doc = "Inverted CC8yST1 signal path is connected to the CCU8x.OUTy0"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Ocs1::Value2
    }
}
#[doc = "Field `OCS1` writer - Output selector for CCU8x.OUTy0"]
pub type Ocs1W<'a, REG> = crate::BitWriter<'a, REG, Ocs1>;
impl<'a, REG> Ocs1W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "CC8yST1 signal path is connected to the CCU8x.OUTy0"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Ocs1::Value1)
    }
    #[doc = "Inverted CC8yST1 signal path is connected to the CCU8x.OUTy0"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Ocs1::Value2)
    }
}
#[doc = "Output selector for CCU8x.OUTy1\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ocs2 {
    #[doc = "0: Inverted CC8yST1 signal path is connected to the CCU8x.OUTy1"]
    Value1 = 0,
    #[doc = "1: CC8yST1 signal path is connected to the CCU8x.OUTy1"]
    Value2 = 1,
}
impl From<Ocs2> for bool {
    #[inline(always)]
    fn from(variant: Ocs2) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `OCS2` reader - Output selector for CCU8x.OUTy1"]
pub type Ocs2R = crate::BitReader<Ocs2>;
impl Ocs2R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Ocs2 {
        match self.bits {
            false => Ocs2::Value1,
            true => Ocs2::Value2,
        }
    }
    #[doc = "Inverted CC8yST1 signal path is connected to the CCU8x.OUTy1"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Ocs2::Value1
    }
    #[doc = "CC8yST1 signal path is connected to the CCU8x.OUTy1"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Ocs2::Value2
    }
}
#[doc = "Field `OCS2` writer - Output selector for CCU8x.OUTy1"]
pub type Ocs2W<'a, REG> = crate::BitWriter<'a, REG, Ocs2>;
impl<'a, REG> Ocs2W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Inverted CC8yST1 signal path is connected to the CCU8x.OUTy1"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Ocs2::Value1)
    }
    #[doc = "CC8yST1 signal path is connected to the CCU8x.OUTy1"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Ocs2::Value2)
    }
}
#[doc = "Output selector for CCU8x.OUTy2\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ocs3 {
    #[doc = "0: CC8yST2 signal path is connected to the CCU8x.OUTy2"]
    Value1 = 0,
    #[doc = "1: Inverted CCST2 signal path is connected to the CCU8x.OUTy2"]
    Value2 = 1,
}
impl From<Ocs3> for bool {
    #[inline(always)]
    fn from(variant: Ocs3) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `OCS3` reader - Output selector for CCU8x.OUTy2"]
pub type Ocs3R = crate::BitReader<Ocs3>;
impl Ocs3R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Ocs3 {
        match self.bits {
            false => Ocs3::Value1,
            true => Ocs3::Value2,
        }
    }
    #[doc = "CC8yST2 signal path is connected to the CCU8x.OUTy2"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Ocs3::Value1
    }
    #[doc = "Inverted CCST2 signal path is connected to the CCU8x.OUTy2"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Ocs3::Value2
    }
}
#[doc = "Field `OCS3` writer - Output selector for CCU8x.OUTy2"]
pub type Ocs3W<'a, REG> = crate::BitWriter<'a, REG, Ocs3>;
impl<'a, REG> Ocs3W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "CC8yST2 signal path is connected to the CCU8x.OUTy2"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Ocs3::Value1)
    }
    #[doc = "Inverted CCST2 signal path is connected to the CCU8x.OUTy2"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Ocs3::Value2)
    }
}
#[doc = "Output selector for CCU8x.OUTy3\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ocs4 {
    #[doc = "0: Inverted CC8yST2 signal path is connected to the CCU8x.OUTy3"]
    Value1 = 0,
    #[doc = "1: CC8yST2 signal path is connected to the CCU8x.OUTy3"]
    Value2 = 1,
}
impl From<Ocs4> for bool {
    #[inline(always)]
    fn from(variant: Ocs4) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `OCS4` reader - Output selector for CCU8x.OUTy3"]
pub type Ocs4R = crate::BitReader<Ocs4>;
impl Ocs4R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Ocs4 {
        match self.bits {
            false => Ocs4::Value1,
            true => Ocs4::Value2,
        }
    }
    #[doc = "Inverted CC8yST2 signal path is connected to the CCU8x.OUTy3"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Ocs4::Value1
    }
    #[doc = "CC8yST2 signal path is connected to the CCU8x.OUTy3"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Ocs4::Value2
    }
}
#[doc = "Field `OCS4` writer - Output selector for CCU8x.OUTy3"]
pub type Ocs4W<'a, REG> = crate::BitWriter<'a, REG, Ocs4>;
impl<'a, REG> Ocs4W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "Inverted CC8yST2 signal path is connected to the CCU8x.OUTy3"]
    #[inline(always)]
    pub fn value1(self) -> &'a mut crate::W<REG> {
        self.variant(Ocs4::Value1)
    }
    #[doc = "CC8yST2 signal path is connected to the CCU8x.OUTy3"]
    #[inline(always)]
    pub fn value2(self) -> &'a mut crate::W<REG> {
        self.variant(Ocs4::Value2)
    }
}
impl R {
    #[doc = "Bit 0 - Asymmetric PWM mode Enable"]
    #[inline(always)]
    pub fn ase(&self) -> AseR {
        AseR::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Output selector for CCU8x.OUTy0"]
    #[inline(always)]
    pub fn ocs1(&self) -> Ocs1R {
        Ocs1R::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - Output selector for CCU8x.OUTy1"]
    #[inline(always)]
    pub fn ocs2(&self) -> Ocs2R {
        Ocs2R::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - Output selector for CCU8x.OUTy2"]
    #[inline(always)]
    pub fn ocs3(&self) -> Ocs3R {
        Ocs3R::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 4 - Output selector for CCU8x.OUTy3"]
    #[inline(always)]
    pub fn ocs4(&self) -> Ocs4R {
        Ocs4R::new(((self.bits >> 4) & 1) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - Asymmetric PWM mode Enable"]
    #[inline(always)]
    #[must_use]
    pub fn ase(&mut self) -> AseW<ChcSpec> {
        AseW::new(self, 0)
    }
    #[doc = "Bit 1 - Output selector for CCU8x.OUTy0"]
    #[inline(always)]
    #[must_use]
    pub fn ocs1(&mut self) -> Ocs1W<ChcSpec> {
        Ocs1W::new(self, 1)
    }
    #[doc = "Bit 2 - Output selector for CCU8x.OUTy1"]
    #[inline(always)]
    #[must_use]
    pub fn ocs2(&mut self) -> Ocs2W<ChcSpec> {
        Ocs2W::new(self, 2)
    }
    #[doc = "Bit 3 - Output selector for CCU8x.OUTy2"]
    #[inline(always)]
    #[must_use]
    pub fn ocs3(&mut self) -> Ocs3W<ChcSpec> {
        Ocs3W::new(self, 3)
    }
    #[doc = "Bit 4 - Output selector for CCU8x.OUTy3"]
    #[inline(always)]
    #[must_use]
    pub fn ocs4(&mut self) -> Ocs4W<ChcSpec> {
        Ocs4W::new(self, 4)
    }
}
#[doc = "Channel Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`chc::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 [`chc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct ChcSpec;
impl crate::RegisterSpec for ChcSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`chc::R`](R) reader structure"]
impl crate::Readable for ChcSpec {}
#[doc = "`write(|w| ..)` method takes [`chc::W`](W) writer structure"]
impl crate::Writable for ChcSpec {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets CHC to value 0"]
impl crate::Resettable for ChcSpec {
    const RESET_VALUE: u32 = 0;
}