1#[doc = "Register `TC` reader"]
2pub type R = crate::R<TC_SPEC>;
3#[doc = "Register `TC` writer"]
4pub type W = crate::W<TC_SPEC>;
5#[doc = "Timer Counting Mode\n\nValue on reset: 0"]
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7pub enum TCM_A {
8 #[doc = "0: Edge aligned mode"]
9 VALUE1 = 0,
10 #[doc = "1: Center aligned mode"]
11 VALUE2 = 1,
12}
13impl From<TCM_A> for bool {
14 #[inline(always)]
15 fn from(variant: TCM_A) -> Self {
16 variant as u8 != 0
17 }
18}
19#[doc = "Field `TCM` reader - Timer Counting Mode"]
20pub type TCM_R = crate::BitReader<TCM_A>;
21impl TCM_R {
22 #[doc = "Get enumerated values variant"]
23 #[inline(always)]
24 pub const fn variant(&self) -> TCM_A {
25 match self.bits {
26 false => TCM_A::VALUE1,
27 true => TCM_A::VALUE2,
28 }
29 }
30 #[doc = "Edge aligned mode"]
31 #[inline(always)]
32 pub fn is_value1(&self) -> bool {
33 *self == TCM_A::VALUE1
34 }
35 #[doc = "Center aligned mode"]
36 #[inline(always)]
37 pub fn is_value2(&self) -> bool {
38 *self == TCM_A::VALUE2
39 }
40}
41#[doc = "Field `TCM` writer - Timer Counting Mode"]
42pub type TCM_W<'a, REG> = crate::BitWriter<'a, REG, TCM_A>;
43impl<'a, REG> TCM_W<'a, REG>
44where
45 REG: crate::Writable + crate::RegisterSpec,
46{
47 #[doc = "Edge aligned mode"]
48 #[inline(always)]
49 pub fn value1(self) -> &'a mut crate::W<REG> {
50 self.variant(TCM_A::VALUE1)
51 }
52 #[doc = "Center aligned mode"]
53 #[inline(always)]
54 pub fn value2(self) -> &'a mut crate::W<REG> {
55 self.variant(TCM_A::VALUE2)
56 }
57}
58#[doc = "Timer Single Shot Mode\n\nValue on reset: 0"]
59#[derive(Clone, Copy, Debug, PartialEq, Eq)]
60pub enum TSSM_A {
61 #[doc = "0: Single shot mode is disabled"]
62 VALUE1 = 0,
63 #[doc = "1: Single shot mode is enabled"]
64 VALUE2 = 1,
65}
66impl From<TSSM_A> for bool {
67 #[inline(always)]
68 fn from(variant: TSSM_A) -> Self {
69 variant as u8 != 0
70 }
71}
72#[doc = "Field `TSSM` reader - Timer Single Shot Mode"]
73pub type TSSM_R = crate::BitReader<TSSM_A>;
74impl TSSM_R {
75 #[doc = "Get enumerated values variant"]
76 #[inline(always)]
77 pub const fn variant(&self) -> TSSM_A {
78 match self.bits {
79 false => TSSM_A::VALUE1,
80 true => TSSM_A::VALUE2,
81 }
82 }
83 #[doc = "Single shot mode is disabled"]
84 #[inline(always)]
85 pub fn is_value1(&self) -> bool {
86 *self == TSSM_A::VALUE1
87 }
88 #[doc = "Single shot mode is enabled"]
89 #[inline(always)]
90 pub fn is_value2(&self) -> bool {
91 *self == TSSM_A::VALUE2
92 }
93}
94#[doc = "Field `TSSM` writer - Timer Single Shot Mode"]
95pub type TSSM_W<'a, REG> = crate::BitWriter<'a, REG, TSSM_A>;
96impl<'a, REG> TSSM_W<'a, REG>
97where
98 REG: crate::Writable + crate::RegisterSpec,
99{
100 #[doc = "Single shot mode is disabled"]
101 #[inline(always)]
102 pub fn value1(self) -> &'a mut crate::W<REG> {
103 self.variant(TSSM_A::VALUE1)
104 }
105 #[doc = "Single shot mode is enabled"]
106 #[inline(always)]
107 pub fn value2(self) -> &'a mut crate::W<REG> {
108 self.variant(TSSM_A::VALUE2)
109 }
110}
111#[doc = "Field `CLST` reader - Shadow Transfer on Clear"]
112pub type CLST_R = crate::BitReader;
113#[doc = "Field `CLST` writer - Shadow Transfer on Clear"]
114pub type CLST_W<'a, REG> = crate::BitWriter<'a, REG>;
115#[doc = "Capture Compare Mode\n\nValue on reset: 0"]
116#[derive(Clone, Copy, Debug, PartialEq, Eq)]
117pub enum CMOD_A {
118 #[doc = "0: Compare Mode"]
119 VALUE1 = 0,
120 #[doc = "1: Capture Mode"]
121 VALUE2 = 1,
122}
123impl From<CMOD_A> for bool {
124 #[inline(always)]
125 fn from(variant: CMOD_A) -> Self {
126 variant as u8 != 0
127 }
128}
129#[doc = "Field `CMOD` reader - Capture Compare Mode"]
130pub type CMOD_R = crate::BitReader<CMOD_A>;
131impl CMOD_R {
132 #[doc = "Get enumerated values variant"]
133 #[inline(always)]
134 pub const fn variant(&self) -> CMOD_A {
135 match self.bits {
136 false => CMOD_A::VALUE1,
137 true => CMOD_A::VALUE2,
138 }
139 }
140 #[doc = "Compare Mode"]
141 #[inline(always)]
142 pub fn is_value1(&self) -> bool {
143 *self == CMOD_A::VALUE1
144 }
145 #[doc = "Capture Mode"]
146 #[inline(always)]
147 pub fn is_value2(&self) -> bool {
148 *self == CMOD_A::VALUE2
149 }
150}
151#[doc = "Extended Capture Mode\n\nValue on reset: 0"]
152#[derive(Clone, Copy, Debug, PartialEq, Eq)]
153pub enum ECM_A {
154 #[doc = "0: Normal Capture Mode. Clear of the Full Flag of each capture register is done by accessing the registers individually only."]
155 VALUE1 = 0,
156 #[doc = "1: Extended Capture Mode. Clear of the Full Flag of each capture register is done not only by accessing the individual registers but also by accessing the ECRDThis register holds the information related to the extended capture mode. register. When reading the ECRDThis register holds the information related to the extended capture mode. register, only the capture register register full flag pointed by the ECRDThis register holds the information related to the extended capture mode..VPTR is cleared"]
157 VALUE2 = 1,
158}
159impl From<ECM_A> for bool {
160 #[inline(always)]
161 fn from(variant: ECM_A) -> Self {
162 variant as u8 != 0
163 }
164}
165#[doc = "Field `ECM` reader - Extended Capture Mode"]
166pub type ECM_R = crate::BitReader<ECM_A>;
167impl ECM_R {
168 #[doc = "Get enumerated values variant"]
169 #[inline(always)]
170 pub const fn variant(&self) -> ECM_A {
171 match self.bits {
172 false => ECM_A::VALUE1,
173 true => ECM_A::VALUE2,
174 }
175 }
176 #[doc = "Normal Capture Mode. Clear of the Full Flag of each capture register is done by accessing the registers individually only."]
177 #[inline(always)]
178 pub fn is_value1(&self) -> bool {
179 *self == ECM_A::VALUE1
180 }
181 #[doc = "Extended Capture Mode. Clear of the Full Flag of each capture register is done not only by accessing the individual registers but also by accessing the ECRDThis register holds the information related to the extended capture mode. register. When reading the ECRDThis register holds the information related to the extended capture mode. register, only the capture register register full flag pointed by the ECRDThis register holds the information related to the extended capture mode..VPTR is cleared"]
182 #[inline(always)]
183 pub fn is_value2(&self) -> bool {
184 *self == ECM_A::VALUE2
185 }
186}
187#[doc = "Field `ECM` writer - Extended Capture Mode"]
188pub type ECM_W<'a, REG> = crate::BitWriter<'a, REG, ECM_A>;
189impl<'a, REG> ECM_W<'a, REG>
190where
191 REG: crate::Writable + crate::RegisterSpec,
192{
193 #[doc = "Normal Capture Mode. Clear of the Full Flag of each capture register is done by accessing the registers individually only."]
194 #[inline(always)]
195 pub fn value1(self) -> &'a mut crate::W<REG> {
196 self.variant(ECM_A::VALUE1)
197 }
198 #[doc = "Extended Capture Mode. Clear of the Full Flag of each capture register is done not only by accessing the individual registers but also by accessing the ECRDThis register holds the information related to the extended capture mode. register. When reading the ECRDThis register holds the information related to the extended capture mode. register, only the capture register register full flag pointed by the ECRDThis register holds the information related to the extended capture mode..VPTR is cleared"]
199 #[inline(always)]
200 pub fn value2(self) -> &'a mut crate::W<REG> {
201 self.variant(ECM_A::VALUE2)
202 }
203}
204#[doc = "Clear on Capture Control\n\nValue on reset: 0"]
205#[derive(Clone, Copy, Debug, PartialEq, Eq)]
206#[repr(u8)]
207pub enum CAPC_A {
208 #[doc = "0: Timer is never cleared on a capture event"]
209 VALUE1 = 0,
210 #[doc = "1: Timer is cleared on a capture event into capture registers 2 and 3. (When SCE = 1#, Timer is always cleared in a capture event)"]
211 VALUE2 = 1,
212 #[doc = "2: Timer is cleared on a capture event into capture registers 0 and 1. (When SCE = 1#, Timer is always cleared in a capture event)"]
213 VALUE3 = 2,
214 #[doc = "3: Timer is always cleared in a capture event."]
215 VALUE4 = 3,
216}
217impl From<CAPC_A> for u8 {
218 #[inline(always)]
219 fn from(variant: CAPC_A) -> Self {
220 variant as _
221 }
222}
223impl crate::FieldSpec for CAPC_A {
224 type Ux = u8;
225}
226impl crate::IsEnum for CAPC_A {}
227#[doc = "Field `CAPC` reader - Clear on Capture Control"]
228pub type CAPC_R = crate::FieldReader<CAPC_A>;
229impl CAPC_R {
230 #[doc = "Get enumerated values variant"]
231 #[inline(always)]
232 pub const fn variant(&self) -> CAPC_A {
233 match self.bits {
234 0 => CAPC_A::VALUE1,
235 1 => CAPC_A::VALUE2,
236 2 => CAPC_A::VALUE3,
237 3 => CAPC_A::VALUE4,
238 _ => unreachable!(),
239 }
240 }
241 #[doc = "Timer is never cleared on a capture event"]
242 #[inline(always)]
243 pub fn is_value1(&self) -> bool {
244 *self == CAPC_A::VALUE1
245 }
246 #[doc = "Timer is cleared on a capture event into capture registers 2 and 3. (When SCE = 1#, Timer is always cleared in a capture event)"]
247 #[inline(always)]
248 pub fn is_value2(&self) -> bool {
249 *self == CAPC_A::VALUE2
250 }
251 #[doc = "Timer is cleared on a capture event into capture registers 0 and 1. (When SCE = 1#, Timer is always cleared in a capture event)"]
252 #[inline(always)]
253 pub fn is_value3(&self) -> bool {
254 *self == CAPC_A::VALUE3
255 }
256 #[doc = "Timer is always cleared in a capture event."]
257 #[inline(always)]
258 pub fn is_value4(&self) -> bool {
259 *self == CAPC_A::VALUE4
260 }
261}
262#[doc = "Field `CAPC` writer - Clear on Capture Control"]
263pub type CAPC_W<'a, REG> = crate::FieldWriter<'a, REG, 2, CAPC_A, crate::Safe>;
264impl<'a, REG> CAPC_W<'a, REG>
265where
266 REG: crate::Writable + crate::RegisterSpec,
267 REG::Ux: From<u8>,
268{
269 #[doc = "Timer is never cleared on a capture event"]
270 #[inline(always)]
271 pub fn value1(self) -> &'a mut crate::W<REG> {
272 self.variant(CAPC_A::VALUE1)
273 }
274 #[doc = "Timer is cleared on a capture event into capture registers 2 and 3. (When SCE = 1#, Timer is always cleared in a capture event)"]
275 #[inline(always)]
276 pub fn value2(self) -> &'a mut crate::W<REG> {
277 self.variant(CAPC_A::VALUE2)
278 }
279 #[doc = "Timer is cleared on a capture event into capture registers 0 and 1. (When SCE = 1#, Timer is always cleared in a capture event)"]
280 #[inline(always)]
281 pub fn value3(self) -> &'a mut crate::W<REG> {
282 self.variant(CAPC_A::VALUE3)
283 }
284 #[doc = "Timer is always cleared in a capture event."]
285 #[inline(always)]
286 pub fn value4(self) -> &'a mut crate::W<REG> {
287 self.variant(CAPC_A::VALUE4)
288 }
289}
290#[doc = "Timer Load selector\n\nValue on reset: 0"]
291#[derive(Clone, Copy, Debug, PartialEq, Eq)]
292pub enum TLS_A {
293 #[doc = "0: Timer is loaded with the value of CR1"]
294 VALUE1 = 0,
295 #[doc = "1: Timer is loaded with the value of CR2"]
296 VALUE2 = 1,
297}
298impl From<TLS_A> for bool {
299 #[inline(always)]
300 fn from(variant: TLS_A) -> Self {
301 variant as u8 != 0
302 }
303}
304#[doc = "Field `TLS` reader - Timer Load selector"]
305pub type TLS_R = crate::BitReader<TLS_A>;
306impl TLS_R {
307 #[doc = "Get enumerated values variant"]
308 #[inline(always)]
309 pub const fn variant(&self) -> TLS_A {
310 match self.bits {
311 false => TLS_A::VALUE1,
312 true => TLS_A::VALUE2,
313 }
314 }
315 #[doc = "Timer is loaded with the value of CR1"]
316 #[inline(always)]
317 pub fn is_value1(&self) -> bool {
318 *self == TLS_A::VALUE1
319 }
320 #[doc = "Timer is loaded with the value of CR2"]
321 #[inline(always)]
322 pub fn is_value2(&self) -> bool {
323 *self == TLS_A::VALUE2
324 }
325}
326#[doc = "Field `TLS` writer - Timer Load selector"]
327pub type TLS_W<'a, REG> = crate::BitWriter<'a, REG, TLS_A>;
328impl<'a, REG> TLS_W<'a, REG>
329where
330 REG: crate::Writable + crate::RegisterSpec,
331{
332 #[doc = "Timer is loaded with the value of CR1"]
333 #[inline(always)]
334 pub fn value1(self) -> &'a mut crate::W<REG> {
335 self.variant(TLS_A::VALUE1)
336 }
337 #[doc = "Timer is loaded with the value of CR2"]
338 #[inline(always)]
339 pub fn value2(self) -> &'a mut crate::W<REG> {
340 self.variant(TLS_A::VALUE2)
341 }
342}
343#[doc = "Extended Stop Function Control\n\nValue on reset: 0"]
344#[derive(Clone, Copy, Debug, PartialEq, Eq)]
345#[repr(u8)]
346pub enum ENDM_A {
347 #[doc = "0: Clears the timer run bit only (default stop)"]
348 VALUE1 = 0,
349 #[doc = "1: Clears the timer only (flush)"]
350 VALUE2 = 1,
351 #[doc = "2: Clears the timer and run bit (flush/stop)"]
352 VALUE3 = 2,
353}
354impl From<ENDM_A> for u8 {
355 #[inline(always)]
356 fn from(variant: ENDM_A) -> Self {
357 variant as _
358 }
359}
360impl crate::FieldSpec for ENDM_A {
361 type Ux = u8;
362}
363impl crate::IsEnum for ENDM_A {}
364#[doc = "Field `ENDM` reader - Extended Stop Function Control"]
365pub type ENDM_R = crate::FieldReader<ENDM_A>;
366impl ENDM_R {
367 #[doc = "Get enumerated values variant"]
368 #[inline(always)]
369 pub const fn variant(&self) -> Option<ENDM_A> {
370 match self.bits {
371 0 => Some(ENDM_A::VALUE1),
372 1 => Some(ENDM_A::VALUE2),
373 2 => Some(ENDM_A::VALUE3),
374 _ => None,
375 }
376 }
377 #[doc = "Clears the timer run bit only (default stop)"]
378 #[inline(always)]
379 pub fn is_value1(&self) -> bool {
380 *self == ENDM_A::VALUE1
381 }
382 #[doc = "Clears the timer only (flush)"]
383 #[inline(always)]
384 pub fn is_value2(&self) -> bool {
385 *self == ENDM_A::VALUE2
386 }
387 #[doc = "Clears the timer and run bit (flush/stop)"]
388 #[inline(always)]
389 pub fn is_value3(&self) -> bool {
390 *self == ENDM_A::VALUE3
391 }
392}
393#[doc = "Field `ENDM` writer - Extended Stop Function Control"]
394pub type ENDM_W<'a, REG> = crate::FieldWriter<'a, REG, 2, ENDM_A>;
395impl<'a, REG> ENDM_W<'a, REG>
396where
397 REG: crate::Writable + crate::RegisterSpec,
398 REG::Ux: From<u8>,
399{
400 #[doc = "Clears the timer run bit only (default stop)"]
401 #[inline(always)]
402 pub fn value1(self) -> &'a mut crate::W<REG> {
403 self.variant(ENDM_A::VALUE1)
404 }
405 #[doc = "Clears the timer only (flush)"]
406 #[inline(always)]
407 pub fn value2(self) -> &'a mut crate::W<REG> {
408 self.variant(ENDM_A::VALUE2)
409 }
410 #[doc = "Clears the timer and run bit (flush/stop)"]
411 #[inline(always)]
412 pub fn value3(self) -> &'a mut crate::W<REG> {
413 self.variant(ENDM_A::VALUE3)
414 }
415}
416#[doc = "Extended Start Function Control\n\nValue on reset: 0"]
417#[derive(Clone, Copy, Debug, PartialEq, Eq)]
418pub enum STRM_A {
419 #[doc = "0: Sets run bit only (default start)"]
420 VALUE1 = 0,
421 #[doc = "1: Clears the timer and sets run bit, if not set (flush/start)"]
422 VALUE2 = 1,
423}
424impl From<STRM_A> for bool {
425 #[inline(always)]
426 fn from(variant: STRM_A) -> Self {
427 variant as u8 != 0
428 }
429}
430#[doc = "Field `STRM` reader - Extended Start Function Control"]
431pub type STRM_R = crate::BitReader<STRM_A>;
432impl STRM_R {
433 #[doc = "Get enumerated values variant"]
434 #[inline(always)]
435 pub const fn variant(&self) -> STRM_A {
436 match self.bits {
437 false => STRM_A::VALUE1,
438 true => STRM_A::VALUE2,
439 }
440 }
441 #[doc = "Sets run bit only (default start)"]
442 #[inline(always)]
443 pub fn is_value1(&self) -> bool {
444 *self == STRM_A::VALUE1
445 }
446 #[doc = "Clears the timer and sets run bit, if not set (flush/start)"]
447 #[inline(always)]
448 pub fn is_value2(&self) -> bool {
449 *self == STRM_A::VALUE2
450 }
451}
452#[doc = "Field `STRM` writer - Extended Start Function Control"]
453pub type STRM_W<'a, REG> = crate::BitWriter<'a, REG, STRM_A>;
454impl<'a, REG> STRM_W<'a, REG>
455where
456 REG: crate::Writable + crate::RegisterSpec,
457{
458 #[doc = "Sets run bit only (default start)"]
459 #[inline(always)]
460 pub fn value1(self) -> &'a mut crate::W<REG> {
461 self.variant(STRM_A::VALUE1)
462 }
463 #[doc = "Clears the timer and sets run bit, if not set (flush/start)"]
464 #[inline(always)]
465 pub fn value2(self) -> &'a mut crate::W<REG> {
466 self.variant(STRM_A::VALUE2)
467 }
468}
469#[doc = "Equal Capture Event enable\n\nValue on reset: 0"]
470#[derive(Clone, Copy, Debug, PartialEq, Eq)]
471pub enum SCE_A {
472 #[doc = "0: Capture into CC8yC0VThis register contains the values associated with the Capture 0 field./CC8yC1VThis register contains the values associated with the Capture 1 field. registers control by CCycapt0 and capture into CC8yC3VThis register contains the values associated with the Capture 3 field./CC8yC2VThis register contains the values associated with the Capture 2 field. control by CCycapt1"]
473 VALUE1 = 0,
474 #[doc = "1: Capture into CC8yC0VThis register contains the values associated with the Capture 0 field./CC8yC1VThis register contains the values associated with the Capture 1 field. and CC8yC3VThis register contains the values associated with the Capture 3 field./CC8yC2VThis register contains the values associated with the Capture 2 field. control by CCycapt1"]
475 VALUE2 = 1,
476}
477impl From<SCE_A> for bool {
478 #[inline(always)]
479 fn from(variant: SCE_A) -> Self {
480 variant as u8 != 0
481 }
482}
483#[doc = "Field `SCE` reader - Equal Capture Event enable"]
484pub type SCE_R = crate::BitReader<SCE_A>;
485impl SCE_R {
486 #[doc = "Get enumerated values variant"]
487 #[inline(always)]
488 pub const fn variant(&self) -> SCE_A {
489 match self.bits {
490 false => SCE_A::VALUE1,
491 true => SCE_A::VALUE2,
492 }
493 }
494 #[doc = "Capture into CC8yC0VThis register contains the values associated with the Capture 0 field./CC8yC1VThis register contains the values associated with the Capture 1 field. registers control by CCycapt0 and capture into CC8yC3VThis register contains the values associated with the Capture 3 field./CC8yC2VThis register contains the values associated with the Capture 2 field. control by CCycapt1"]
495 #[inline(always)]
496 pub fn is_value1(&self) -> bool {
497 *self == SCE_A::VALUE1
498 }
499 #[doc = "Capture into CC8yC0VThis register contains the values associated with the Capture 0 field./CC8yC1VThis register contains the values associated with the Capture 1 field. and CC8yC3VThis register contains the values associated with the Capture 3 field./CC8yC2VThis register contains the values associated with the Capture 2 field. control by CCycapt1"]
500 #[inline(always)]
501 pub fn is_value2(&self) -> bool {
502 *self == SCE_A::VALUE2
503 }
504}
505#[doc = "Field `SCE` writer - Equal Capture Event enable"]
506pub type SCE_W<'a, REG> = crate::BitWriter<'a, REG, SCE_A>;
507impl<'a, REG> SCE_W<'a, REG>
508where
509 REG: crate::Writable + crate::RegisterSpec,
510{
511 #[doc = "Capture into CC8yC0VThis register contains the values associated with the Capture 0 field./CC8yC1VThis register contains the values associated with the Capture 1 field. registers control by CCycapt0 and capture into CC8yC3VThis register contains the values associated with the Capture 3 field./CC8yC2VThis register contains the values associated with the Capture 2 field. control by CCycapt1"]
512 #[inline(always)]
513 pub fn value1(self) -> &'a mut crate::W<REG> {
514 self.variant(SCE_A::VALUE1)
515 }
516 #[doc = "Capture into CC8yC0VThis register contains the values associated with the Capture 0 field./CC8yC1VThis register contains the values associated with the Capture 1 field. and CC8yC3VThis register contains the values associated with the Capture 3 field./CC8yC2VThis register contains the values associated with the Capture 2 field. control by CCycapt1"]
517 #[inline(always)]
518 pub fn value2(self) -> &'a mut crate::W<REG> {
519 self.variant(SCE_A::VALUE2)
520 }
521}
522#[doc = "Continuous Capture Enable\n\nValue on reset: 0"]
523#[derive(Clone, Copy, Debug, PartialEq, Eq)]
524pub enum CCS_A {
525 #[doc = "0: The capture into a specific capture register is done with the rules linked with the full flags, described at ."]
526 VALUE1 = 0,
527 #[doc = "1: The capture into the capture registers is always done regardless of the full flag status (even if the register has not been read back)."]
528 VALUE2 = 1,
529}
530impl From<CCS_A> for bool {
531 #[inline(always)]
532 fn from(variant: CCS_A) -> Self {
533 variant as u8 != 0
534 }
535}
536#[doc = "Field `CCS` reader - Continuous Capture Enable"]
537pub type CCS_R = crate::BitReader<CCS_A>;
538impl CCS_R {
539 #[doc = "Get enumerated values variant"]
540 #[inline(always)]
541 pub const fn variant(&self) -> CCS_A {
542 match self.bits {
543 false => CCS_A::VALUE1,
544 true => CCS_A::VALUE2,
545 }
546 }
547 #[doc = "The capture into a specific capture register is done with the rules linked with the full flags, described at ."]
548 #[inline(always)]
549 pub fn is_value1(&self) -> bool {
550 *self == CCS_A::VALUE1
551 }
552 #[doc = "The capture into the capture registers is always done regardless of the full flag status (even if the register has not been read back)."]
553 #[inline(always)]
554 pub fn is_value2(&self) -> bool {
555 *self == CCS_A::VALUE2
556 }
557}
558#[doc = "Field `CCS` writer - Continuous Capture Enable"]
559pub type CCS_W<'a, REG> = crate::BitWriter<'a, REG, CCS_A>;
560impl<'a, REG> CCS_W<'a, REG>
561where
562 REG: crate::Writable + crate::RegisterSpec,
563{
564 #[doc = "The capture into a specific capture register is done with the rules linked with the full flags, described at ."]
565 #[inline(always)]
566 pub fn value1(self) -> &'a mut crate::W<REG> {
567 self.variant(CCS_A::VALUE1)
568 }
569 #[doc = "The capture into the capture registers is always done regardless of the full flag status (even if the register has not been read back)."]
570 #[inline(always)]
571 pub fn value2(self) -> &'a mut crate::W<REG> {
572 self.variant(CCS_A::VALUE2)
573 }
574}
575#[doc = "Dither Enable\n\nValue on reset: 0"]
576#[derive(Clone, Copy, Debug, PartialEq, Eq)]
577#[repr(u8)]
578pub enum DITHE_A {
579 #[doc = "0: Dither is disabled"]
580 VALUE1 = 0,
581 #[doc = "1: Dither is applied to the Period"]
582 VALUE2 = 1,
583 #[doc = "2: Dither is applied to the Compare"]
584 VALUE3 = 2,
585 #[doc = "3: Dither is applied to the Period and Compare"]
586 VALUE4 = 3,
587}
588impl From<DITHE_A> for u8 {
589 #[inline(always)]
590 fn from(variant: DITHE_A) -> Self {
591 variant as _
592 }
593}
594impl crate::FieldSpec for DITHE_A {
595 type Ux = u8;
596}
597impl crate::IsEnum for DITHE_A {}
598#[doc = "Field `DITHE` reader - Dither Enable"]
599pub type DITHE_R = crate::FieldReader<DITHE_A>;
600impl DITHE_R {
601 #[doc = "Get enumerated values variant"]
602 #[inline(always)]
603 pub const fn variant(&self) -> DITHE_A {
604 match self.bits {
605 0 => DITHE_A::VALUE1,
606 1 => DITHE_A::VALUE2,
607 2 => DITHE_A::VALUE3,
608 3 => DITHE_A::VALUE4,
609 _ => unreachable!(),
610 }
611 }
612 #[doc = "Dither is disabled"]
613 #[inline(always)]
614 pub fn is_value1(&self) -> bool {
615 *self == DITHE_A::VALUE1
616 }
617 #[doc = "Dither is applied to the Period"]
618 #[inline(always)]
619 pub fn is_value2(&self) -> bool {
620 *self == DITHE_A::VALUE2
621 }
622 #[doc = "Dither is applied to the Compare"]
623 #[inline(always)]
624 pub fn is_value3(&self) -> bool {
625 *self == DITHE_A::VALUE3
626 }
627 #[doc = "Dither is applied to the Period and Compare"]
628 #[inline(always)]
629 pub fn is_value4(&self) -> bool {
630 *self == DITHE_A::VALUE4
631 }
632}
633#[doc = "Field `DITHE` writer - Dither Enable"]
634pub type DITHE_W<'a, REG> = crate::FieldWriter<'a, REG, 2, DITHE_A, crate::Safe>;
635impl<'a, REG> DITHE_W<'a, REG>
636where
637 REG: crate::Writable + crate::RegisterSpec,
638 REG::Ux: From<u8>,
639{
640 #[doc = "Dither is disabled"]
641 #[inline(always)]
642 pub fn value1(self) -> &'a mut crate::W<REG> {
643 self.variant(DITHE_A::VALUE1)
644 }
645 #[doc = "Dither is applied to the Period"]
646 #[inline(always)]
647 pub fn value2(self) -> &'a mut crate::W<REG> {
648 self.variant(DITHE_A::VALUE2)
649 }
650 #[doc = "Dither is applied to the Compare"]
651 #[inline(always)]
652 pub fn value3(self) -> &'a mut crate::W<REG> {
653 self.variant(DITHE_A::VALUE3)
654 }
655 #[doc = "Dither is applied to the Period and Compare"]
656 #[inline(always)]
657 pub fn value4(self) -> &'a mut crate::W<REG> {
658 self.variant(DITHE_A::VALUE4)
659 }
660}
661#[doc = "Dither input selector\n\nValue on reset: 0"]
662#[derive(Clone, Copy, Debug, PartialEq, Eq)]
663pub enum DIM_A {
664 #[doc = "0: Slice is using it own dither unit"]
665 VALUE1 = 0,
666 #[doc = "1: Slice is connected to the dither unit of slice 0."]
667 VALUE2 = 1,
668}
669impl From<DIM_A> for bool {
670 #[inline(always)]
671 fn from(variant: DIM_A) -> Self {
672 variant as u8 != 0
673 }
674}
675#[doc = "Field `DIM` reader - Dither input selector"]
676pub type DIM_R = crate::BitReader<DIM_A>;
677impl DIM_R {
678 #[doc = "Get enumerated values variant"]
679 #[inline(always)]
680 pub const fn variant(&self) -> DIM_A {
681 match self.bits {
682 false => DIM_A::VALUE1,
683 true => DIM_A::VALUE2,
684 }
685 }
686 #[doc = "Slice is using it own dither unit"]
687 #[inline(always)]
688 pub fn is_value1(&self) -> bool {
689 *self == DIM_A::VALUE1
690 }
691 #[doc = "Slice is connected to the dither unit of slice 0."]
692 #[inline(always)]
693 pub fn is_value2(&self) -> bool {
694 *self == DIM_A::VALUE2
695 }
696}
697#[doc = "Field `DIM` writer - Dither input selector"]
698pub type DIM_W<'a, REG> = crate::BitWriter<'a, REG, DIM_A>;
699impl<'a, REG> DIM_W<'a, REG>
700where
701 REG: crate::Writable + crate::RegisterSpec,
702{
703 #[doc = "Slice is using it own dither unit"]
704 #[inline(always)]
705 pub fn value1(self) -> &'a mut crate::W<REG> {
706 self.variant(DIM_A::VALUE1)
707 }
708 #[doc = "Slice is connected to the dither unit of slice 0."]
709 #[inline(always)]
710 pub fn value2(self) -> &'a mut crate::W<REG> {
711 self.variant(DIM_A::VALUE2)
712 }
713}
714#[doc = "Floating Prescaler enable\n\nValue on reset: 0"]
715#[derive(Clone, Copy, Debug, PartialEq, Eq)]
716pub enum FPE_A {
717 #[doc = "0: Floating prescaler mode is disabled"]
718 VALUE1 = 0,
719 #[doc = "1: Floating prescaler mode is enabled"]
720 VALUE2 = 1,
721}
722impl From<FPE_A> for bool {
723 #[inline(always)]
724 fn from(variant: FPE_A) -> Self {
725 variant as u8 != 0
726 }
727}
728#[doc = "Field `FPE` reader - Floating Prescaler enable"]
729pub type FPE_R = crate::BitReader<FPE_A>;
730impl FPE_R {
731 #[doc = "Get enumerated values variant"]
732 #[inline(always)]
733 pub const fn variant(&self) -> FPE_A {
734 match self.bits {
735 false => FPE_A::VALUE1,
736 true => FPE_A::VALUE2,
737 }
738 }
739 #[doc = "Floating prescaler mode is disabled"]
740 #[inline(always)]
741 pub fn is_value1(&self) -> bool {
742 *self == FPE_A::VALUE1
743 }
744 #[doc = "Floating prescaler mode is enabled"]
745 #[inline(always)]
746 pub fn is_value2(&self) -> bool {
747 *self == FPE_A::VALUE2
748 }
749}
750#[doc = "Field `FPE` writer - Floating Prescaler enable"]
751pub type FPE_W<'a, REG> = crate::BitWriter<'a, REG, FPE_A>;
752impl<'a, REG> FPE_W<'a, REG>
753where
754 REG: crate::Writable + crate::RegisterSpec,
755{
756 #[doc = "Floating prescaler mode is disabled"]
757 #[inline(always)]
758 pub fn value1(self) -> &'a mut crate::W<REG> {
759 self.variant(FPE_A::VALUE1)
760 }
761 #[doc = "Floating prescaler mode is enabled"]
762 #[inline(always)]
763 pub fn value2(self) -> &'a mut crate::W<REG> {
764 self.variant(FPE_A::VALUE2)
765 }
766}
767#[doc = "TRAP enable for CCU8x.OUTy0\n\nValue on reset: 0"]
768#[derive(Clone, Copy, Debug, PartialEq, Eq)]
769pub enum TRAPE0_A {
770 #[doc = "0: TRAP functionality has no effect on the CCU8x.OUTy0 output"]
771 VALUE1 = 0,
772 #[doc = "1: TRAP functionality affects the CCU8x.OUTy0 output"]
773 VALUE2 = 1,
774}
775impl From<TRAPE0_A> for bool {
776 #[inline(always)]
777 fn from(variant: TRAPE0_A) -> Self {
778 variant as u8 != 0
779 }
780}
781#[doc = "Field `TRAPE0` reader - TRAP enable for CCU8x.OUTy0"]
782pub type TRAPE0_R = crate::BitReader<TRAPE0_A>;
783impl TRAPE0_R {
784 #[doc = "Get enumerated values variant"]
785 #[inline(always)]
786 pub const fn variant(&self) -> TRAPE0_A {
787 match self.bits {
788 false => TRAPE0_A::VALUE1,
789 true => TRAPE0_A::VALUE2,
790 }
791 }
792 #[doc = "TRAP functionality has no effect on the CCU8x.OUTy0 output"]
793 #[inline(always)]
794 pub fn is_value1(&self) -> bool {
795 *self == TRAPE0_A::VALUE1
796 }
797 #[doc = "TRAP functionality affects the CCU8x.OUTy0 output"]
798 #[inline(always)]
799 pub fn is_value2(&self) -> bool {
800 *self == TRAPE0_A::VALUE2
801 }
802}
803#[doc = "Field `TRAPE0` writer - TRAP enable for CCU8x.OUTy0"]
804pub type TRAPE0_W<'a, REG> = crate::BitWriter<'a, REG, TRAPE0_A>;
805impl<'a, REG> TRAPE0_W<'a, REG>
806where
807 REG: crate::Writable + crate::RegisterSpec,
808{
809 #[doc = "TRAP functionality has no effect on the CCU8x.OUTy0 output"]
810 #[inline(always)]
811 pub fn value1(self) -> &'a mut crate::W<REG> {
812 self.variant(TRAPE0_A::VALUE1)
813 }
814 #[doc = "TRAP functionality affects the CCU8x.OUTy0 output"]
815 #[inline(always)]
816 pub fn value2(self) -> &'a mut crate::W<REG> {
817 self.variant(TRAPE0_A::VALUE2)
818 }
819}
820#[doc = "Field `TRAPE1` reader - TRAP enable for CCU8x.OUTy1"]
821pub type TRAPE1_R = crate::BitReader;
822#[doc = "Field `TRAPE1` writer - TRAP enable for CCU8x.OUTy1"]
823pub type TRAPE1_W<'a, REG> = crate::BitWriter<'a, REG>;
824#[doc = "Field `TRAPE2` reader - TRAP enable for CCU8x.OUTy2"]
825pub type TRAPE2_R = crate::BitReader;
826#[doc = "Field `TRAPE2` writer - TRAP enable for CCU8x.OUTy2"]
827pub type TRAPE2_W<'a, REG> = crate::BitWriter<'a, REG>;
828#[doc = "Field `TRAPE3` reader - TRAP enable for CCU8x.OUTy3"]
829pub type TRAPE3_R = crate::BitReader;
830#[doc = "Field `TRAPE3` writer - TRAP enable for CCU8x.OUTy3"]
831pub type TRAPE3_W<'a, REG> = crate::BitWriter<'a, REG>;
832#[doc = "TRAP Synchronization Enable\n\nValue on reset: 0"]
833#[derive(Clone, Copy, Debug, PartialEq, Eq)]
834pub enum TRPSE_A {
835 #[doc = "0: Exiting from TRAP state isn't synchronized with the PWM signal"]
836 VALUE1 = 0,
837 #[doc = "1: Exiting from TRAP state is synchronized with the PWM signal"]
838 VALUE2 = 1,
839}
840impl From<TRPSE_A> for bool {
841 #[inline(always)]
842 fn from(variant: TRPSE_A) -> Self {
843 variant as u8 != 0
844 }
845}
846#[doc = "Field `TRPSE` reader - TRAP Synchronization Enable"]
847pub type TRPSE_R = crate::BitReader<TRPSE_A>;
848impl TRPSE_R {
849 #[doc = "Get enumerated values variant"]
850 #[inline(always)]
851 pub const fn variant(&self) -> TRPSE_A {
852 match self.bits {
853 false => TRPSE_A::VALUE1,
854 true => TRPSE_A::VALUE2,
855 }
856 }
857 #[doc = "Exiting from TRAP state isn't synchronized with the PWM signal"]
858 #[inline(always)]
859 pub fn is_value1(&self) -> bool {
860 *self == TRPSE_A::VALUE1
861 }
862 #[doc = "Exiting from TRAP state is synchronized with the PWM signal"]
863 #[inline(always)]
864 pub fn is_value2(&self) -> bool {
865 *self == TRPSE_A::VALUE2
866 }
867}
868#[doc = "Field `TRPSE` writer - TRAP Synchronization Enable"]
869pub type TRPSE_W<'a, REG> = crate::BitWriter<'a, REG, TRPSE_A>;
870impl<'a, REG> TRPSE_W<'a, REG>
871where
872 REG: crate::Writable + crate::RegisterSpec,
873{
874 #[doc = "Exiting from TRAP state isn't synchronized with the PWM signal"]
875 #[inline(always)]
876 pub fn value1(self) -> &'a mut crate::W<REG> {
877 self.variant(TRPSE_A::VALUE1)
878 }
879 #[doc = "Exiting from TRAP state is synchronized with the PWM signal"]
880 #[inline(always)]
881 pub fn value2(self) -> &'a mut crate::W<REG> {
882 self.variant(TRPSE_A::VALUE2)
883 }
884}
885#[doc = "TRAP State Clear Control\n\nValue on reset: 0"]
886#[derive(Clone, Copy, Debug, PartialEq, Eq)]
887pub enum TRPSW_A {
888 #[doc = "0: The slice exits the TRAP state automatically when the TRAP condition is not present (Trap state cleared by HW and SW)"]
889 VALUE1 = 0,
890 #[doc = "1: The TRAP state can only be exited by a SW request."]
891 VALUE2 = 1,
892}
893impl From<TRPSW_A> for bool {
894 #[inline(always)]
895 fn from(variant: TRPSW_A) -> Self {
896 variant as u8 != 0
897 }
898}
899#[doc = "Field `TRPSW` reader - TRAP State Clear Control"]
900pub type TRPSW_R = crate::BitReader<TRPSW_A>;
901impl TRPSW_R {
902 #[doc = "Get enumerated values variant"]
903 #[inline(always)]
904 pub const fn variant(&self) -> TRPSW_A {
905 match self.bits {
906 false => TRPSW_A::VALUE1,
907 true => TRPSW_A::VALUE2,
908 }
909 }
910 #[doc = "The slice exits the TRAP state automatically when the TRAP condition is not present (Trap state cleared by HW and SW)"]
911 #[inline(always)]
912 pub fn is_value1(&self) -> bool {
913 *self == TRPSW_A::VALUE1
914 }
915 #[doc = "The TRAP state can only be exited by a SW request."]
916 #[inline(always)]
917 pub fn is_value2(&self) -> bool {
918 *self == TRPSW_A::VALUE2
919 }
920}
921#[doc = "Field `TRPSW` writer - TRAP State Clear Control"]
922pub type TRPSW_W<'a, REG> = crate::BitWriter<'a, REG, TRPSW_A>;
923impl<'a, REG> TRPSW_W<'a, REG>
924where
925 REG: crate::Writable + crate::RegisterSpec,
926{
927 #[doc = "The slice exits the TRAP state automatically when the TRAP condition is not present (Trap state cleared by HW and SW)"]
928 #[inline(always)]
929 pub fn value1(self) -> &'a mut crate::W<REG> {
930 self.variant(TRPSW_A::VALUE1)
931 }
932 #[doc = "The TRAP state can only be exited by a SW request."]
933 #[inline(always)]
934 pub fn value2(self) -> &'a mut crate::W<REG> {
935 self.variant(TRPSW_A::VALUE2)
936 }
937}
938#[doc = "External Modulation Synchronization\n\nValue on reset: 0"]
939#[derive(Clone, Copy, Debug, PartialEq, Eq)]
940pub enum EMS_A {
941 #[doc = "0: External Modulation functionality is not synchronized with the PWM signal"]
942 VALUE1 = 0,
943 #[doc = "1: External Modulation functionality is synchronized with the PWM signal"]
944 VALUE2 = 1,
945}
946impl From<EMS_A> for bool {
947 #[inline(always)]
948 fn from(variant: EMS_A) -> Self {
949 variant as u8 != 0
950 }
951}
952#[doc = "Field `EMS` reader - External Modulation Synchronization"]
953pub type EMS_R = crate::BitReader<EMS_A>;
954impl EMS_R {
955 #[doc = "Get enumerated values variant"]
956 #[inline(always)]
957 pub const fn variant(&self) -> EMS_A {
958 match self.bits {
959 false => EMS_A::VALUE1,
960 true => EMS_A::VALUE2,
961 }
962 }
963 #[doc = "External Modulation functionality is not synchronized with the PWM signal"]
964 #[inline(always)]
965 pub fn is_value1(&self) -> bool {
966 *self == EMS_A::VALUE1
967 }
968 #[doc = "External Modulation functionality is synchronized with the PWM signal"]
969 #[inline(always)]
970 pub fn is_value2(&self) -> bool {
971 *self == EMS_A::VALUE2
972 }
973}
974#[doc = "Field `EMS` writer - External Modulation Synchronization"]
975pub type EMS_W<'a, REG> = crate::BitWriter<'a, REG, EMS_A>;
976impl<'a, REG> EMS_W<'a, REG>
977where
978 REG: crate::Writable + crate::RegisterSpec,
979{
980 #[doc = "External Modulation functionality is not synchronized with the PWM signal"]
981 #[inline(always)]
982 pub fn value1(self) -> &'a mut crate::W<REG> {
983 self.variant(EMS_A::VALUE1)
984 }
985 #[doc = "External Modulation functionality is synchronized with the PWM signal"]
986 #[inline(always)]
987 pub fn value2(self) -> &'a mut crate::W<REG> {
988 self.variant(EMS_A::VALUE2)
989 }
990}
991#[doc = "External Modulation Type\n\nValue on reset: 0"]
992#[derive(Clone, Copy, Debug, PartialEq, Eq)]
993pub enum EMT_A {
994 #[doc = "0: External Modulation functionality is clearing the CC8ySTx bits."]
995 VALUE1 = 0,
996 #[doc = "1: External Modulation functionality is gating the outputs."]
997 VALUE2 = 1,
998}
999impl From<EMT_A> for bool {
1000 #[inline(always)]
1001 fn from(variant: EMT_A) -> Self {
1002 variant as u8 != 0
1003 }
1004}
1005#[doc = "Field `EMT` reader - External Modulation Type"]
1006pub type EMT_R = crate::BitReader<EMT_A>;
1007impl EMT_R {
1008 #[doc = "Get enumerated values variant"]
1009 #[inline(always)]
1010 pub const fn variant(&self) -> EMT_A {
1011 match self.bits {
1012 false => EMT_A::VALUE1,
1013 true => EMT_A::VALUE2,
1014 }
1015 }
1016 #[doc = "External Modulation functionality is clearing the CC8ySTx bits."]
1017 #[inline(always)]
1018 pub fn is_value1(&self) -> bool {
1019 *self == EMT_A::VALUE1
1020 }
1021 #[doc = "External Modulation functionality is gating the outputs."]
1022 #[inline(always)]
1023 pub fn is_value2(&self) -> bool {
1024 *self == EMT_A::VALUE2
1025 }
1026}
1027#[doc = "Field `EMT` writer - External Modulation Type"]
1028pub type EMT_W<'a, REG> = crate::BitWriter<'a, REG, EMT_A>;
1029impl<'a, REG> EMT_W<'a, REG>
1030where
1031 REG: crate::Writable + crate::RegisterSpec,
1032{
1033 #[doc = "External Modulation functionality is clearing the CC8ySTx bits."]
1034 #[inline(always)]
1035 pub fn value1(self) -> &'a mut crate::W<REG> {
1036 self.variant(EMT_A::VALUE1)
1037 }
1038 #[doc = "External Modulation functionality is gating the outputs."]
1039 #[inline(always)]
1040 pub fn value2(self) -> &'a mut crate::W<REG> {
1041 self.variant(EMT_A::VALUE2)
1042 }
1043}
1044#[doc = "Multi Channel Mode Enable for Channel 1\n\nValue on reset: 0"]
1045#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1046pub enum MCME1_A {
1047 #[doc = "0: Multi Channel Mode in Channel 1 is disabled"]
1048 VALUE1 = 0,
1049 #[doc = "1: Multi Channel Mode in Channel 1 is enabled"]
1050 VALUE2 = 1,
1051}
1052impl From<MCME1_A> for bool {
1053 #[inline(always)]
1054 fn from(variant: MCME1_A) -> Self {
1055 variant as u8 != 0
1056 }
1057}
1058#[doc = "Field `MCME1` reader - Multi Channel Mode Enable for Channel 1"]
1059pub type MCME1_R = crate::BitReader<MCME1_A>;
1060impl MCME1_R {
1061 #[doc = "Get enumerated values variant"]
1062 #[inline(always)]
1063 pub const fn variant(&self) -> MCME1_A {
1064 match self.bits {
1065 false => MCME1_A::VALUE1,
1066 true => MCME1_A::VALUE2,
1067 }
1068 }
1069 #[doc = "Multi Channel Mode in Channel 1 is disabled"]
1070 #[inline(always)]
1071 pub fn is_value1(&self) -> bool {
1072 *self == MCME1_A::VALUE1
1073 }
1074 #[doc = "Multi Channel Mode in Channel 1 is enabled"]
1075 #[inline(always)]
1076 pub fn is_value2(&self) -> bool {
1077 *self == MCME1_A::VALUE2
1078 }
1079}
1080#[doc = "Field `MCME1` writer - Multi Channel Mode Enable for Channel 1"]
1081pub type MCME1_W<'a, REG> = crate::BitWriter<'a, REG, MCME1_A>;
1082impl<'a, REG> MCME1_W<'a, REG>
1083where
1084 REG: crate::Writable + crate::RegisterSpec,
1085{
1086 #[doc = "Multi Channel Mode in Channel 1 is disabled"]
1087 #[inline(always)]
1088 pub fn value1(self) -> &'a mut crate::W<REG> {
1089 self.variant(MCME1_A::VALUE1)
1090 }
1091 #[doc = "Multi Channel Mode in Channel 1 is enabled"]
1092 #[inline(always)]
1093 pub fn value2(self) -> &'a mut crate::W<REG> {
1094 self.variant(MCME1_A::VALUE2)
1095 }
1096}
1097#[doc = "Multi Channel Mode Enable for Channel 2\n\nValue on reset: 0"]
1098#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1099pub enum MCME2_A {
1100 #[doc = "0: Multi Channel Mode in Channel 2 is disabled"]
1101 VALUE1 = 0,
1102 #[doc = "1: Multi Channel Mode in Channel 2 is enabled"]
1103 VALUE2 = 1,
1104}
1105impl From<MCME2_A> for bool {
1106 #[inline(always)]
1107 fn from(variant: MCME2_A) -> Self {
1108 variant as u8 != 0
1109 }
1110}
1111#[doc = "Field `MCME2` reader - Multi Channel Mode Enable for Channel 2"]
1112pub type MCME2_R = crate::BitReader<MCME2_A>;
1113impl MCME2_R {
1114 #[doc = "Get enumerated values variant"]
1115 #[inline(always)]
1116 pub const fn variant(&self) -> MCME2_A {
1117 match self.bits {
1118 false => MCME2_A::VALUE1,
1119 true => MCME2_A::VALUE2,
1120 }
1121 }
1122 #[doc = "Multi Channel Mode in Channel 2 is disabled"]
1123 #[inline(always)]
1124 pub fn is_value1(&self) -> bool {
1125 *self == MCME2_A::VALUE1
1126 }
1127 #[doc = "Multi Channel Mode in Channel 2 is enabled"]
1128 #[inline(always)]
1129 pub fn is_value2(&self) -> bool {
1130 *self == MCME2_A::VALUE2
1131 }
1132}
1133#[doc = "Field `MCME2` writer - Multi Channel Mode Enable for Channel 2"]
1134pub type MCME2_W<'a, REG> = crate::BitWriter<'a, REG, MCME2_A>;
1135impl<'a, REG> MCME2_W<'a, REG>
1136where
1137 REG: crate::Writable + crate::RegisterSpec,
1138{
1139 #[doc = "Multi Channel Mode in Channel 2 is disabled"]
1140 #[inline(always)]
1141 pub fn value1(self) -> &'a mut crate::W<REG> {
1142 self.variant(MCME2_A::VALUE1)
1143 }
1144 #[doc = "Multi Channel Mode in Channel 2 is enabled"]
1145 #[inline(always)]
1146 pub fn value2(self) -> &'a mut crate::W<REG> {
1147 self.variant(MCME2_A::VALUE2)
1148 }
1149}
1150#[doc = "External Modulation Channel enable\n\nValue on reset: 3"]
1151#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1152#[repr(u8)]
1153pub enum EME_A {
1154 #[doc = "0: External Modulation functionality doesn't affect any channel"]
1155 VALUE1 = 0,
1156 #[doc = "1: External Modulation only applied on channel 1"]
1157 VALUE2 = 1,
1158 #[doc = "2: External Modulation only applied on channel 2"]
1159 VALUE3 = 2,
1160 #[doc = "3: External Modulation applied on both channels"]
1161 VALUE4 = 3,
1162}
1163impl From<EME_A> for u8 {
1164 #[inline(always)]
1165 fn from(variant: EME_A) -> Self {
1166 variant as _
1167 }
1168}
1169impl crate::FieldSpec for EME_A {
1170 type Ux = u8;
1171}
1172impl crate::IsEnum for EME_A {}
1173#[doc = "Field `EME` reader - External Modulation Channel enable"]
1174pub type EME_R = crate::FieldReader<EME_A>;
1175impl EME_R {
1176 #[doc = "Get enumerated values variant"]
1177 #[inline(always)]
1178 pub const fn variant(&self) -> EME_A {
1179 match self.bits {
1180 0 => EME_A::VALUE1,
1181 1 => EME_A::VALUE2,
1182 2 => EME_A::VALUE3,
1183 3 => EME_A::VALUE4,
1184 _ => unreachable!(),
1185 }
1186 }
1187 #[doc = "External Modulation functionality doesn't affect any channel"]
1188 #[inline(always)]
1189 pub fn is_value1(&self) -> bool {
1190 *self == EME_A::VALUE1
1191 }
1192 #[doc = "External Modulation only applied on channel 1"]
1193 #[inline(always)]
1194 pub fn is_value2(&self) -> bool {
1195 *self == EME_A::VALUE2
1196 }
1197 #[doc = "External Modulation only applied on channel 2"]
1198 #[inline(always)]
1199 pub fn is_value3(&self) -> bool {
1200 *self == EME_A::VALUE3
1201 }
1202 #[doc = "External Modulation applied on both channels"]
1203 #[inline(always)]
1204 pub fn is_value4(&self) -> bool {
1205 *self == EME_A::VALUE4
1206 }
1207}
1208#[doc = "Field `EME` writer - External Modulation Channel enable"]
1209pub type EME_W<'a, REG> = crate::FieldWriter<'a, REG, 2, EME_A, crate::Safe>;
1210impl<'a, REG> EME_W<'a, REG>
1211where
1212 REG: crate::Writable + crate::RegisterSpec,
1213 REG::Ux: From<u8>,
1214{
1215 #[doc = "External Modulation functionality doesn't affect any channel"]
1216 #[inline(always)]
1217 pub fn value1(self) -> &'a mut crate::W<REG> {
1218 self.variant(EME_A::VALUE1)
1219 }
1220 #[doc = "External Modulation only applied on channel 1"]
1221 #[inline(always)]
1222 pub fn value2(self) -> &'a mut crate::W<REG> {
1223 self.variant(EME_A::VALUE2)
1224 }
1225 #[doc = "External Modulation only applied on channel 2"]
1226 #[inline(always)]
1227 pub fn value3(self) -> &'a mut crate::W<REG> {
1228 self.variant(EME_A::VALUE3)
1229 }
1230 #[doc = "External Modulation applied on both channels"]
1231 #[inline(always)]
1232 pub fn value4(self) -> &'a mut crate::W<REG> {
1233 self.variant(EME_A::VALUE4)
1234 }
1235}
1236#[doc = "Status bit output selector\n\nValue on reset: 0"]
1237#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1238#[repr(u8)]
1239pub enum STOS_A {
1240 #[doc = "0: CC8yST1 forward to CCU8x.STy"]
1241 VALUE1 = 0,
1242 #[doc = "1: CC8yST2 forward to CCU8x.STy"]
1243 VALUE2 = 1,
1244 #[doc = "2: CC8yST1 AND CC8yST2 forward to CCU8x.STy"]
1245 VALUE3 = 2,
1246}
1247impl From<STOS_A> for u8 {
1248 #[inline(always)]
1249 fn from(variant: STOS_A) -> Self {
1250 variant as _
1251 }
1252}
1253impl crate::FieldSpec for STOS_A {
1254 type Ux = u8;
1255}
1256impl crate::IsEnum for STOS_A {}
1257#[doc = "Field `STOS` reader - Status bit output selector"]
1258pub type STOS_R = crate::FieldReader<STOS_A>;
1259impl STOS_R {
1260 #[doc = "Get enumerated values variant"]
1261 #[inline(always)]
1262 pub const fn variant(&self) -> Option<STOS_A> {
1263 match self.bits {
1264 0 => Some(STOS_A::VALUE1),
1265 1 => Some(STOS_A::VALUE2),
1266 2 => Some(STOS_A::VALUE3),
1267 _ => None,
1268 }
1269 }
1270 #[doc = "CC8yST1 forward to CCU8x.STy"]
1271 #[inline(always)]
1272 pub fn is_value1(&self) -> bool {
1273 *self == STOS_A::VALUE1
1274 }
1275 #[doc = "CC8yST2 forward to CCU8x.STy"]
1276 #[inline(always)]
1277 pub fn is_value2(&self) -> bool {
1278 *self == STOS_A::VALUE2
1279 }
1280 #[doc = "CC8yST1 AND CC8yST2 forward to CCU8x.STy"]
1281 #[inline(always)]
1282 pub fn is_value3(&self) -> bool {
1283 *self == STOS_A::VALUE3
1284 }
1285}
1286#[doc = "Field `STOS` writer - Status bit output selector"]
1287pub type STOS_W<'a, REG> = crate::FieldWriter<'a, REG, 2, STOS_A>;
1288impl<'a, REG> STOS_W<'a, REG>
1289where
1290 REG: crate::Writable + crate::RegisterSpec,
1291 REG::Ux: From<u8>,
1292{
1293 #[doc = "CC8yST1 forward to CCU8x.STy"]
1294 #[inline(always)]
1295 pub fn value1(self) -> &'a mut crate::W<REG> {
1296 self.variant(STOS_A::VALUE1)
1297 }
1298 #[doc = "CC8yST2 forward to CCU8x.STy"]
1299 #[inline(always)]
1300 pub fn value2(self) -> &'a mut crate::W<REG> {
1301 self.variant(STOS_A::VALUE2)
1302 }
1303 #[doc = "CC8yST1 AND CC8yST2 forward to CCU8x.STy"]
1304 #[inline(always)]
1305 pub fn value3(self) -> &'a mut crate::W<REG> {
1306 self.variant(STOS_A::VALUE3)
1307 }
1308}
1309impl R {
1310 #[doc = "Bit 0 - Timer Counting Mode"]
1311 #[inline(always)]
1312 pub fn tcm(&self) -> TCM_R {
1313 TCM_R::new((self.bits & 1) != 0)
1314 }
1315 #[doc = "Bit 1 - Timer Single Shot Mode"]
1316 #[inline(always)]
1317 pub fn tssm(&self) -> TSSM_R {
1318 TSSM_R::new(((self.bits >> 1) & 1) != 0)
1319 }
1320 #[doc = "Bit 2 - Shadow Transfer on Clear"]
1321 #[inline(always)]
1322 pub fn clst(&self) -> CLST_R {
1323 CLST_R::new(((self.bits >> 2) & 1) != 0)
1324 }
1325 #[doc = "Bit 3 - Capture Compare Mode"]
1326 #[inline(always)]
1327 pub fn cmod(&self) -> CMOD_R {
1328 CMOD_R::new(((self.bits >> 3) & 1) != 0)
1329 }
1330 #[doc = "Bit 4 - Extended Capture Mode"]
1331 #[inline(always)]
1332 pub fn ecm(&self) -> ECM_R {
1333 ECM_R::new(((self.bits >> 4) & 1) != 0)
1334 }
1335 #[doc = "Bits 5:6 - Clear on Capture Control"]
1336 #[inline(always)]
1337 pub fn capc(&self) -> CAPC_R {
1338 CAPC_R::new(((self.bits >> 5) & 3) as u8)
1339 }
1340 #[doc = "Bit 7 - Timer Load selector"]
1341 #[inline(always)]
1342 pub fn tls(&self) -> TLS_R {
1343 TLS_R::new(((self.bits >> 7) & 1) != 0)
1344 }
1345 #[doc = "Bits 8:9 - Extended Stop Function Control"]
1346 #[inline(always)]
1347 pub fn endm(&self) -> ENDM_R {
1348 ENDM_R::new(((self.bits >> 8) & 3) as u8)
1349 }
1350 #[doc = "Bit 10 - Extended Start Function Control"]
1351 #[inline(always)]
1352 pub fn strm(&self) -> STRM_R {
1353 STRM_R::new(((self.bits >> 10) & 1) != 0)
1354 }
1355 #[doc = "Bit 11 - Equal Capture Event enable"]
1356 #[inline(always)]
1357 pub fn sce(&self) -> SCE_R {
1358 SCE_R::new(((self.bits >> 11) & 1) != 0)
1359 }
1360 #[doc = "Bit 12 - Continuous Capture Enable"]
1361 #[inline(always)]
1362 pub fn ccs(&self) -> CCS_R {
1363 CCS_R::new(((self.bits >> 12) & 1) != 0)
1364 }
1365 #[doc = "Bits 13:14 - Dither Enable"]
1366 #[inline(always)]
1367 pub fn dithe(&self) -> DITHE_R {
1368 DITHE_R::new(((self.bits >> 13) & 3) as u8)
1369 }
1370 #[doc = "Bit 15 - Dither input selector"]
1371 #[inline(always)]
1372 pub fn dim(&self) -> DIM_R {
1373 DIM_R::new(((self.bits >> 15) & 1) != 0)
1374 }
1375 #[doc = "Bit 16 - Floating Prescaler enable"]
1376 #[inline(always)]
1377 pub fn fpe(&self) -> FPE_R {
1378 FPE_R::new(((self.bits >> 16) & 1) != 0)
1379 }
1380 #[doc = "Bit 17 - TRAP enable for CCU8x.OUTy0"]
1381 #[inline(always)]
1382 pub fn trape0(&self) -> TRAPE0_R {
1383 TRAPE0_R::new(((self.bits >> 17) & 1) != 0)
1384 }
1385 #[doc = "Bit 18 - TRAP enable for CCU8x.OUTy1"]
1386 #[inline(always)]
1387 pub fn trape1(&self) -> TRAPE1_R {
1388 TRAPE1_R::new(((self.bits >> 18) & 1) != 0)
1389 }
1390 #[doc = "Bit 19 - TRAP enable for CCU8x.OUTy2"]
1391 #[inline(always)]
1392 pub fn trape2(&self) -> TRAPE2_R {
1393 TRAPE2_R::new(((self.bits >> 19) & 1) != 0)
1394 }
1395 #[doc = "Bit 20 - TRAP enable for CCU8x.OUTy3"]
1396 #[inline(always)]
1397 pub fn trape3(&self) -> TRAPE3_R {
1398 TRAPE3_R::new(((self.bits >> 20) & 1) != 0)
1399 }
1400 #[doc = "Bit 21 - TRAP Synchronization Enable"]
1401 #[inline(always)]
1402 pub fn trpse(&self) -> TRPSE_R {
1403 TRPSE_R::new(((self.bits >> 21) & 1) != 0)
1404 }
1405 #[doc = "Bit 22 - TRAP State Clear Control"]
1406 #[inline(always)]
1407 pub fn trpsw(&self) -> TRPSW_R {
1408 TRPSW_R::new(((self.bits >> 22) & 1) != 0)
1409 }
1410 #[doc = "Bit 23 - External Modulation Synchronization"]
1411 #[inline(always)]
1412 pub fn ems(&self) -> EMS_R {
1413 EMS_R::new(((self.bits >> 23) & 1) != 0)
1414 }
1415 #[doc = "Bit 24 - External Modulation Type"]
1416 #[inline(always)]
1417 pub fn emt(&self) -> EMT_R {
1418 EMT_R::new(((self.bits >> 24) & 1) != 0)
1419 }
1420 #[doc = "Bit 25 - Multi Channel Mode Enable for Channel 1"]
1421 #[inline(always)]
1422 pub fn mcme1(&self) -> MCME1_R {
1423 MCME1_R::new(((self.bits >> 25) & 1) != 0)
1424 }
1425 #[doc = "Bit 26 - Multi Channel Mode Enable for Channel 2"]
1426 #[inline(always)]
1427 pub fn mcme2(&self) -> MCME2_R {
1428 MCME2_R::new(((self.bits >> 26) & 1) != 0)
1429 }
1430 #[doc = "Bits 27:28 - External Modulation Channel enable"]
1431 #[inline(always)]
1432 pub fn eme(&self) -> EME_R {
1433 EME_R::new(((self.bits >> 27) & 3) as u8)
1434 }
1435 #[doc = "Bits 29:30 - Status bit output selector"]
1436 #[inline(always)]
1437 pub fn stos(&self) -> STOS_R {
1438 STOS_R::new(((self.bits >> 29) & 3) as u8)
1439 }
1440}
1441impl W {
1442 #[doc = "Bit 0 - Timer Counting Mode"]
1443 #[inline(always)]
1444 pub fn tcm(&mut self) -> TCM_W<TC_SPEC> {
1445 TCM_W::new(self, 0)
1446 }
1447 #[doc = "Bit 1 - Timer Single Shot Mode"]
1448 #[inline(always)]
1449 pub fn tssm(&mut self) -> TSSM_W<TC_SPEC> {
1450 TSSM_W::new(self, 1)
1451 }
1452 #[doc = "Bit 2 - Shadow Transfer on Clear"]
1453 #[inline(always)]
1454 pub fn clst(&mut self) -> CLST_W<TC_SPEC> {
1455 CLST_W::new(self, 2)
1456 }
1457 #[doc = "Bit 4 - Extended Capture Mode"]
1458 #[inline(always)]
1459 pub fn ecm(&mut self) -> ECM_W<TC_SPEC> {
1460 ECM_W::new(self, 4)
1461 }
1462 #[doc = "Bits 5:6 - Clear on Capture Control"]
1463 #[inline(always)]
1464 pub fn capc(&mut self) -> CAPC_W<TC_SPEC> {
1465 CAPC_W::new(self, 5)
1466 }
1467 #[doc = "Bit 7 - Timer Load selector"]
1468 #[inline(always)]
1469 pub fn tls(&mut self) -> TLS_W<TC_SPEC> {
1470 TLS_W::new(self, 7)
1471 }
1472 #[doc = "Bits 8:9 - Extended Stop Function Control"]
1473 #[inline(always)]
1474 pub fn endm(&mut self) -> ENDM_W<TC_SPEC> {
1475 ENDM_W::new(self, 8)
1476 }
1477 #[doc = "Bit 10 - Extended Start Function Control"]
1478 #[inline(always)]
1479 pub fn strm(&mut self) -> STRM_W<TC_SPEC> {
1480 STRM_W::new(self, 10)
1481 }
1482 #[doc = "Bit 11 - Equal Capture Event enable"]
1483 #[inline(always)]
1484 pub fn sce(&mut self) -> SCE_W<TC_SPEC> {
1485 SCE_W::new(self, 11)
1486 }
1487 #[doc = "Bit 12 - Continuous Capture Enable"]
1488 #[inline(always)]
1489 pub fn ccs(&mut self) -> CCS_W<TC_SPEC> {
1490 CCS_W::new(self, 12)
1491 }
1492 #[doc = "Bits 13:14 - Dither Enable"]
1493 #[inline(always)]
1494 pub fn dithe(&mut self) -> DITHE_W<TC_SPEC> {
1495 DITHE_W::new(self, 13)
1496 }
1497 #[doc = "Bit 15 - Dither input selector"]
1498 #[inline(always)]
1499 pub fn dim(&mut self) -> DIM_W<TC_SPEC> {
1500 DIM_W::new(self, 15)
1501 }
1502 #[doc = "Bit 16 - Floating Prescaler enable"]
1503 #[inline(always)]
1504 pub fn fpe(&mut self) -> FPE_W<TC_SPEC> {
1505 FPE_W::new(self, 16)
1506 }
1507 #[doc = "Bit 17 - TRAP enable for CCU8x.OUTy0"]
1508 #[inline(always)]
1509 pub fn trape0(&mut self) -> TRAPE0_W<TC_SPEC> {
1510 TRAPE0_W::new(self, 17)
1511 }
1512 #[doc = "Bit 18 - TRAP enable for CCU8x.OUTy1"]
1513 #[inline(always)]
1514 pub fn trape1(&mut self) -> TRAPE1_W<TC_SPEC> {
1515 TRAPE1_W::new(self, 18)
1516 }
1517 #[doc = "Bit 19 - TRAP enable for CCU8x.OUTy2"]
1518 #[inline(always)]
1519 pub fn trape2(&mut self) -> TRAPE2_W<TC_SPEC> {
1520 TRAPE2_W::new(self, 19)
1521 }
1522 #[doc = "Bit 20 - TRAP enable for CCU8x.OUTy3"]
1523 #[inline(always)]
1524 pub fn trape3(&mut self) -> TRAPE3_W<TC_SPEC> {
1525 TRAPE3_W::new(self, 20)
1526 }
1527 #[doc = "Bit 21 - TRAP Synchronization Enable"]
1528 #[inline(always)]
1529 pub fn trpse(&mut self) -> TRPSE_W<TC_SPEC> {
1530 TRPSE_W::new(self, 21)
1531 }
1532 #[doc = "Bit 22 - TRAP State Clear Control"]
1533 #[inline(always)]
1534 pub fn trpsw(&mut self) -> TRPSW_W<TC_SPEC> {
1535 TRPSW_W::new(self, 22)
1536 }
1537 #[doc = "Bit 23 - External Modulation Synchronization"]
1538 #[inline(always)]
1539 pub fn ems(&mut self) -> EMS_W<TC_SPEC> {
1540 EMS_W::new(self, 23)
1541 }
1542 #[doc = "Bit 24 - External Modulation Type"]
1543 #[inline(always)]
1544 pub fn emt(&mut self) -> EMT_W<TC_SPEC> {
1545 EMT_W::new(self, 24)
1546 }
1547 #[doc = "Bit 25 - Multi Channel Mode Enable for Channel 1"]
1548 #[inline(always)]
1549 pub fn mcme1(&mut self) -> MCME1_W<TC_SPEC> {
1550 MCME1_W::new(self, 25)
1551 }
1552 #[doc = "Bit 26 - Multi Channel Mode Enable for Channel 2"]
1553 #[inline(always)]
1554 pub fn mcme2(&mut self) -> MCME2_W<TC_SPEC> {
1555 MCME2_W::new(self, 26)
1556 }
1557 #[doc = "Bits 27:28 - External Modulation Channel enable"]
1558 #[inline(always)]
1559 pub fn eme(&mut self) -> EME_W<TC_SPEC> {
1560 EME_W::new(self, 27)
1561 }
1562 #[doc = "Bits 29:30 - Status bit output selector"]
1563 #[inline(always)]
1564 pub fn stos(&mut self) -> STOS_W<TC_SPEC> {
1565 STOS_W::new(self, 29)
1566 }
1567}
1568#[doc = "Slice Timer Control\n\nYou can [`read`](crate::Reg::read) this register and get [`tc::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`tc::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
1569pub struct TC_SPEC;
1570impl crate::RegisterSpec for TC_SPEC {
1571 type Ux = u32;
1572}
1573#[doc = "`read()` method returns [`tc::R`](R) reader structure"]
1574impl crate::Readable for TC_SPEC {}
1575#[doc = "`write(|w| ..)` method takes [`tc::W`](W) writer structure"]
1576impl crate::Writable for TC_SPEC {
1577 type Safety = crate::Unsafe;
1578 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
1579 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
1580}
1581#[doc = "`reset()` method sets TC to value 0x1800_0000"]
1582impl crate::Resettable for TC_SPEC {
1583 const RESET_VALUE: u32 = 0x1800_0000;
1584}