xmc4400/hrpwm0_csg0/
cc.rs

1#[doc = "Register `CC` reader"]
2pub type R = crate::R<CC_SPEC>;
3#[doc = "Register `CC` writer"]
4pub type W = crate::W<CC_SPEC>;
5#[doc = "External blanking trigger selector\n\nValue on reset: 0"]
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7#[repr(u8)]
8pub enum IBS_A {
9    #[doc = "0: HRPWMx.BLyA"]
10    VALUE1 = 0,
11    #[doc = "1: HRPWMx.BLyB"]
12    VALUE2 = 1,
13    #[doc = "2: HRPWMx.BLyC"]
14    VALUE3 = 2,
15    #[doc = "3: HRPWMx.BLyD"]
16    VALUE4 = 3,
17    #[doc = "4: HRPWMx.BLyE"]
18    VALUE5 = 4,
19    #[doc = "5: HRPWMx.BLyF"]
20    VALUE6 = 5,
21    #[doc = "6: HRPWMx.BLyG"]
22    VALUE7 = 6,
23    #[doc = "7: HRPWMx.BLyH"]
24    VALUE8 = 7,
25    #[doc = "8: HRPWMx.BLyI"]
26    VALUE9 = 8,
27    #[doc = "9: HRPWMx.BLyJ"]
28    VALUE10 = 9,
29    #[doc = "10: HRPWMx.BLyK"]
30    VALUE11 = 10,
31    #[doc = "11: HRPWMx.BLyL"]
32    VALUE12 = 11,
33    #[doc = "12: HRPWMx.BLyM"]
34    VALUE13 = 12,
35    #[doc = "13: HRPWMx.BLyN"]
36    VALUE14 = 13,
37    #[doc = "14: HRPWMx.BLyO"]
38    VALUE15 = 14,
39    #[doc = "15: HRPWMx.BLyP"]
40    VALUE16 = 15,
41}
42impl From<IBS_A> for u8 {
43    #[inline(always)]
44    fn from(variant: IBS_A) -> Self {
45        variant as _
46    }
47}
48impl crate::FieldSpec for IBS_A {
49    type Ux = u8;
50}
51impl crate::IsEnum for IBS_A {}
52#[doc = "Field `IBS` reader - External blanking trigger selector"]
53pub type IBS_R = crate::FieldReader<IBS_A>;
54impl IBS_R {
55    #[doc = "Get enumerated values variant"]
56    #[inline(always)]
57    pub const fn variant(&self) -> IBS_A {
58        match self.bits {
59            0 => IBS_A::VALUE1,
60            1 => IBS_A::VALUE2,
61            2 => IBS_A::VALUE3,
62            3 => IBS_A::VALUE4,
63            4 => IBS_A::VALUE5,
64            5 => IBS_A::VALUE6,
65            6 => IBS_A::VALUE7,
66            7 => IBS_A::VALUE8,
67            8 => IBS_A::VALUE9,
68            9 => IBS_A::VALUE10,
69            10 => IBS_A::VALUE11,
70            11 => IBS_A::VALUE12,
71            12 => IBS_A::VALUE13,
72            13 => IBS_A::VALUE14,
73            14 => IBS_A::VALUE15,
74            15 => IBS_A::VALUE16,
75            _ => unreachable!(),
76        }
77    }
78    #[doc = "HRPWMx.BLyA"]
79    #[inline(always)]
80    pub fn is_value1(&self) -> bool {
81        *self == IBS_A::VALUE1
82    }
83    #[doc = "HRPWMx.BLyB"]
84    #[inline(always)]
85    pub fn is_value2(&self) -> bool {
86        *self == IBS_A::VALUE2
87    }
88    #[doc = "HRPWMx.BLyC"]
89    #[inline(always)]
90    pub fn is_value3(&self) -> bool {
91        *self == IBS_A::VALUE3
92    }
93    #[doc = "HRPWMx.BLyD"]
94    #[inline(always)]
95    pub fn is_value4(&self) -> bool {
96        *self == IBS_A::VALUE4
97    }
98    #[doc = "HRPWMx.BLyE"]
99    #[inline(always)]
100    pub fn is_value5(&self) -> bool {
101        *self == IBS_A::VALUE5
102    }
103    #[doc = "HRPWMx.BLyF"]
104    #[inline(always)]
105    pub fn is_value6(&self) -> bool {
106        *self == IBS_A::VALUE6
107    }
108    #[doc = "HRPWMx.BLyG"]
109    #[inline(always)]
110    pub fn is_value7(&self) -> bool {
111        *self == IBS_A::VALUE7
112    }
113    #[doc = "HRPWMx.BLyH"]
114    #[inline(always)]
115    pub fn is_value8(&self) -> bool {
116        *self == IBS_A::VALUE8
117    }
118    #[doc = "HRPWMx.BLyI"]
119    #[inline(always)]
120    pub fn is_value9(&self) -> bool {
121        *self == IBS_A::VALUE9
122    }
123    #[doc = "HRPWMx.BLyJ"]
124    #[inline(always)]
125    pub fn is_value10(&self) -> bool {
126        *self == IBS_A::VALUE10
127    }
128    #[doc = "HRPWMx.BLyK"]
129    #[inline(always)]
130    pub fn is_value11(&self) -> bool {
131        *self == IBS_A::VALUE11
132    }
133    #[doc = "HRPWMx.BLyL"]
134    #[inline(always)]
135    pub fn is_value12(&self) -> bool {
136        *self == IBS_A::VALUE12
137    }
138    #[doc = "HRPWMx.BLyM"]
139    #[inline(always)]
140    pub fn is_value13(&self) -> bool {
141        *self == IBS_A::VALUE13
142    }
143    #[doc = "HRPWMx.BLyN"]
144    #[inline(always)]
145    pub fn is_value14(&self) -> bool {
146        *self == IBS_A::VALUE14
147    }
148    #[doc = "HRPWMx.BLyO"]
149    #[inline(always)]
150    pub fn is_value15(&self) -> bool {
151        *self == IBS_A::VALUE15
152    }
153    #[doc = "HRPWMx.BLyP"]
154    #[inline(always)]
155    pub fn is_value16(&self) -> bool {
156        *self == IBS_A::VALUE16
157    }
158}
159#[doc = "Field `IBS` writer - External blanking trigger selector"]
160pub type IBS_W<'a, REG> = crate::FieldWriter<'a, REG, 4, IBS_A, crate::Safe>;
161impl<'a, REG> IBS_W<'a, REG>
162where
163    REG: crate::Writable + crate::RegisterSpec,
164    REG::Ux: From<u8>,
165{
166    #[doc = "HRPWMx.BLyA"]
167    #[inline(always)]
168    pub fn value1(self) -> &'a mut crate::W<REG> {
169        self.variant(IBS_A::VALUE1)
170    }
171    #[doc = "HRPWMx.BLyB"]
172    #[inline(always)]
173    pub fn value2(self) -> &'a mut crate::W<REG> {
174        self.variant(IBS_A::VALUE2)
175    }
176    #[doc = "HRPWMx.BLyC"]
177    #[inline(always)]
178    pub fn value3(self) -> &'a mut crate::W<REG> {
179        self.variant(IBS_A::VALUE3)
180    }
181    #[doc = "HRPWMx.BLyD"]
182    #[inline(always)]
183    pub fn value4(self) -> &'a mut crate::W<REG> {
184        self.variant(IBS_A::VALUE4)
185    }
186    #[doc = "HRPWMx.BLyE"]
187    #[inline(always)]
188    pub fn value5(self) -> &'a mut crate::W<REG> {
189        self.variant(IBS_A::VALUE5)
190    }
191    #[doc = "HRPWMx.BLyF"]
192    #[inline(always)]
193    pub fn value6(self) -> &'a mut crate::W<REG> {
194        self.variant(IBS_A::VALUE6)
195    }
196    #[doc = "HRPWMx.BLyG"]
197    #[inline(always)]
198    pub fn value7(self) -> &'a mut crate::W<REG> {
199        self.variant(IBS_A::VALUE7)
200    }
201    #[doc = "HRPWMx.BLyH"]
202    #[inline(always)]
203    pub fn value8(self) -> &'a mut crate::W<REG> {
204        self.variant(IBS_A::VALUE8)
205    }
206    #[doc = "HRPWMx.BLyI"]
207    #[inline(always)]
208    pub fn value9(self) -> &'a mut crate::W<REG> {
209        self.variant(IBS_A::VALUE9)
210    }
211    #[doc = "HRPWMx.BLyJ"]
212    #[inline(always)]
213    pub fn value10(self) -> &'a mut crate::W<REG> {
214        self.variant(IBS_A::VALUE10)
215    }
216    #[doc = "HRPWMx.BLyK"]
217    #[inline(always)]
218    pub fn value11(self) -> &'a mut crate::W<REG> {
219        self.variant(IBS_A::VALUE11)
220    }
221    #[doc = "HRPWMx.BLyL"]
222    #[inline(always)]
223    pub fn value12(self) -> &'a mut crate::W<REG> {
224        self.variant(IBS_A::VALUE12)
225    }
226    #[doc = "HRPWMx.BLyM"]
227    #[inline(always)]
228    pub fn value13(self) -> &'a mut crate::W<REG> {
229        self.variant(IBS_A::VALUE13)
230    }
231    #[doc = "HRPWMx.BLyN"]
232    #[inline(always)]
233    pub fn value14(self) -> &'a mut crate::W<REG> {
234        self.variant(IBS_A::VALUE14)
235    }
236    #[doc = "HRPWMx.BLyO"]
237    #[inline(always)]
238    pub fn value15(self) -> &'a mut crate::W<REG> {
239        self.variant(IBS_A::VALUE15)
240    }
241    #[doc = "HRPWMx.BLyP"]
242    #[inline(always)]
243    pub fn value16(self) -> &'a mut crate::W<REG> {
244        self.variant(IBS_A::VALUE16)
245    }
246}
247#[doc = "Inverting comparator input selector\n\nValue on reset: 0"]
248#[derive(Clone, Copy, Debug, PartialEq, Eq)]
249pub enum IMCS_A {
250    #[doc = "0: HRPWMx.CyINA"]
251    VALUE1 = 0,
252    #[doc = "1: HRPWMx.CyINB"]
253    VALUE2 = 1,
254}
255impl From<IMCS_A> for bool {
256    #[inline(always)]
257    fn from(variant: IMCS_A) -> Self {
258        variant as u8 != 0
259    }
260}
261#[doc = "Field `IMCS` reader - Inverting comparator input selector"]
262pub type IMCS_R = crate::BitReader<IMCS_A>;
263impl IMCS_R {
264    #[doc = "Get enumerated values variant"]
265    #[inline(always)]
266    pub const fn variant(&self) -> IMCS_A {
267        match self.bits {
268            false => IMCS_A::VALUE1,
269            true => IMCS_A::VALUE2,
270        }
271    }
272    #[doc = "HRPWMx.CyINA"]
273    #[inline(always)]
274    pub fn is_value1(&self) -> bool {
275        *self == IMCS_A::VALUE1
276    }
277    #[doc = "HRPWMx.CyINB"]
278    #[inline(always)]
279    pub fn is_value2(&self) -> bool {
280        *self == IMCS_A::VALUE2
281    }
282}
283#[doc = "Field `IMCS` writer - Inverting comparator input selector"]
284pub type IMCS_W<'a, REG> = crate::BitWriter<'a, REG, IMCS_A>;
285impl<'a, REG> IMCS_W<'a, REG>
286where
287    REG: crate::Writable + crate::RegisterSpec,
288{
289    #[doc = "HRPWMx.CyINA"]
290    #[inline(always)]
291    pub fn value1(self) -> &'a mut crate::W<REG> {
292        self.variant(IMCS_A::VALUE1)
293    }
294    #[doc = "HRPWMx.CyINB"]
295    #[inline(always)]
296    pub fn value2(self) -> &'a mut crate::W<REG> {
297        self.variant(IMCS_A::VALUE2)
298    }
299}
300#[doc = "Comparator input switching configuration\n\nValue on reset: 0"]
301#[derive(Clone, Copy, Debug, PartialEq, Eq)]
302#[repr(u8)]
303pub enum IMCC_A {
304    #[doc = "0: Dynamic switch disabled"]
305    VALUE1 = 0,
306    #[doc = "1: Comparator input is connected to HRPWMx.CyINB when the control signal is HIGH"]
307    VALUE2 = 1,
308    #[doc = "2: Comparator input is connected to HRPWMx.CyINA when the control signal is HIGH"]
309    VALUE3 = 2,
310}
311impl From<IMCC_A> for u8 {
312    #[inline(always)]
313    fn from(variant: IMCC_A) -> Self {
314        variant as _
315    }
316}
317impl crate::FieldSpec for IMCC_A {
318    type Ux = u8;
319}
320impl crate::IsEnum for IMCC_A {}
321#[doc = "Field `IMCC` reader - Comparator input switching configuration"]
322pub type IMCC_R = crate::FieldReader<IMCC_A>;
323impl IMCC_R {
324    #[doc = "Get enumerated values variant"]
325    #[inline(always)]
326    pub const fn variant(&self) -> Option<IMCC_A> {
327        match self.bits {
328            0 => Some(IMCC_A::VALUE1),
329            1 => Some(IMCC_A::VALUE2),
330            2 => Some(IMCC_A::VALUE3),
331            _ => None,
332        }
333    }
334    #[doc = "Dynamic switch disabled"]
335    #[inline(always)]
336    pub fn is_value1(&self) -> bool {
337        *self == IMCC_A::VALUE1
338    }
339    #[doc = "Comparator input is connected to HRPWMx.CyINB when the control signal is HIGH"]
340    #[inline(always)]
341    pub fn is_value2(&self) -> bool {
342        *self == IMCC_A::VALUE2
343    }
344    #[doc = "Comparator input is connected to HRPWMx.CyINA when the control signal is HIGH"]
345    #[inline(always)]
346    pub fn is_value3(&self) -> bool {
347        *self == IMCC_A::VALUE3
348    }
349}
350#[doc = "Field `IMCC` writer - Comparator input switching configuration"]
351pub type IMCC_W<'a, REG> = crate::FieldWriter<'a, REG, 2, IMCC_A>;
352impl<'a, REG> IMCC_W<'a, REG>
353where
354    REG: crate::Writable + crate::RegisterSpec,
355    REG::Ux: From<u8>,
356{
357    #[doc = "Dynamic switch disabled"]
358    #[inline(always)]
359    pub fn value1(self) -> &'a mut crate::W<REG> {
360        self.variant(IMCC_A::VALUE1)
361    }
362    #[doc = "Comparator input is connected to HRPWMx.CyINB when the control signal is HIGH"]
363    #[inline(always)]
364    pub fn value2(self) -> &'a mut crate::W<REG> {
365        self.variant(IMCC_A::VALUE2)
366    }
367    #[doc = "Comparator input is connected to HRPWMx.CyINA when the control signal is HIGH"]
368    #[inline(always)]
369    pub fn value3(self) -> &'a mut crate::W<REG> {
370        self.variant(IMCC_A::VALUE3)
371    }
372}
373#[doc = "Field `ESE` reader - External triggered switch enable"]
374pub type ESE_R = crate::BitReader;
375#[doc = "Field `ESE` writer - External triggered switch enable"]
376pub type ESE_W<'a, REG> = crate::BitWriter<'a, REG>;
377#[doc = "Field `OIE` reader - Comparator output inversion enable"]
378pub type OIE_R = crate::BitReader;
379#[doc = "Field `OIE` writer - Comparator output inversion enable"]
380pub type OIE_W<'a, REG> = crate::BitWriter<'a, REG>;
381#[doc = "Field `OSE` reader - Comparator output synchronization enable"]
382pub type OSE_R = crate::BitReader;
383#[doc = "Field `OSE` writer - Comparator output synchronization enable"]
384pub type OSE_W<'a, REG> = crate::BitWriter<'a, REG>;
385#[doc = "Blanking mode\n\nValue on reset: 0"]
386#[derive(Clone, Copy, Debug, PartialEq, Eq)]
387#[repr(u8)]
388pub enum BLMC_A {
389    #[doc = "0: Blanking disabled"]
390    VALUE1 = 0,
391    #[doc = "1: Blanking on a LOW to HIGH transition"]
392    VALUE2 = 1,
393    #[doc = "2: Blanking on a HIGH to LOW transition"]
394    VALUE3 = 2,
395    #[doc = "3: Blanking on both transitions"]
396    VALUE4 = 3,
397}
398impl From<BLMC_A> for u8 {
399    #[inline(always)]
400    fn from(variant: BLMC_A) -> Self {
401        variant as _
402    }
403}
404impl crate::FieldSpec for BLMC_A {
405    type Ux = u8;
406}
407impl crate::IsEnum for BLMC_A {}
408#[doc = "Field `BLMC` reader - Blanking mode"]
409pub type BLMC_R = crate::FieldReader<BLMC_A>;
410impl BLMC_R {
411    #[doc = "Get enumerated values variant"]
412    #[inline(always)]
413    pub const fn variant(&self) -> BLMC_A {
414        match self.bits {
415            0 => BLMC_A::VALUE1,
416            1 => BLMC_A::VALUE2,
417            2 => BLMC_A::VALUE3,
418            3 => BLMC_A::VALUE4,
419            _ => unreachable!(),
420        }
421    }
422    #[doc = "Blanking disabled"]
423    #[inline(always)]
424    pub fn is_value1(&self) -> bool {
425        *self == BLMC_A::VALUE1
426    }
427    #[doc = "Blanking on a LOW to HIGH transition"]
428    #[inline(always)]
429    pub fn is_value2(&self) -> bool {
430        *self == BLMC_A::VALUE2
431    }
432    #[doc = "Blanking on a HIGH to LOW transition"]
433    #[inline(always)]
434    pub fn is_value3(&self) -> bool {
435        *self == BLMC_A::VALUE3
436    }
437    #[doc = "Blanking on both transitions"]
438    #[inline(always)]
439    pub fn is_value4(&self) -> bool {
440        *self == BLMC_A::VALUE4
441    }
442}
443#[doc = "Field `BLMC` writer - Blanking mode"]
444pub type BLMC_W<'a, REG> = crate::FieldWriter<'a, REG, 2, BLMC_A, crate::Safe>;
445impl<'a, REG> BLMC_W<'a, REG>
446where
447    REG: crate::Writable + crate::RegisterSpec,
448    REG::Ux: From<u8>,
449{
450    #[doc = "Blanking disabled"]
451    #[inline(always)]
452    pub fn value1(self) -> &'a mut crate::W<REG> {
453        self.variant(BLMC_A::VALUE1)
454    }
455    #[doc = "Blanking on a LOW to HIGH transition"]
456    #[inline(always)]
457    pub fn value2(self) -> &'a mut crate::W<REG> {
458        self.variant(BLMC_A::VALUE2)
459    }
460    #[doc = "Blanking on a HIGH to LOW transition"]
461    #[inline(always)]
462    pub fn value3(self) -> &'a mut crate::W<REG> {
463        self.variant(BLMC_A::VALUE3)
464    }
465    #[doc = "Blanking on both transitions"]
466    #[inline(always)]
467    pub fn value4(self) -> &'a mut crate::W<REG> {
468        self.variant(BLMC_A::VALUE4)
469    }
470}
471#[doc = "Field `EBE` reader - External blanking trigger enabled"]
472pub type EBE_R = crate::BitReader;
473#[doc = "Field `EBE` writer - External blanking trigger enabled"]
474pub type EBE_W<'a, REG> = crate::BitWriter<'a, REG>;
475#[doc = "Comparator output filter enable\n\nValue on reset: 0"]
476#[derive(Clone, Copy, Debug, PartialEq, Eq)]
477pub enum COFE_A {
478    #[doc = "0: Filtering stage disabled"]
479    VALUE1 = 0,
480    #[doc = "1: Filtering stage enabled"]
481    VALUE2 = 1,
482}
483impl From<COFE_A> for bool {
484    #[inline(always)]
485    fn from(variant: COFE_A) -> Self {
486        variant as u8 != 0
487    }
488}
489#[doc = "Field `COFE` reader - Comparator output filter enable"]
490pub type COFE_R = crate::BitReader<COFE_A>;
491impl COFE_R {
492    #[doc = "Get enumerated values variant"]
493    #[inline(always)]
494    pub const fn variant(&self) -> COFE_A {
495        match self.bits {
496            false => COFE_A::VALUE1,
497            true => COFE_A::VALUE2,
498        }
499    }
500    #[doc = "Filtering stage disabled"]
501    #[inline(always)]
502    pub fn is_value1(&self) -> bool {
503        *self == COFE_A::VALUE1
504    }
505    #[doc = "Filtering stage enabled"]
506    #[inline(always)]
507    pub fn is_value2(&self) -> bool {
508        *self == COFE_A::VALUE2
509    }
510}
511#[doc = "Field `COFE` writer - Comparator output filter enable"]
512pub type COFE_W<'a, REG> = crate::BitWriter<'a, REG, COFE_A>;
513impl<'a, REG> COFE_W<'a, REG>
514where
515    REG: crate::Writable + crate::RegisterSpec,
516{
517    #[doc = "Filtering stage disabled"]
518    #[inline(always)]
519    pub fn value1(self) -> &'a mut crate::W<REG> {
520        self.variant(COFE_A::VALUE1)
521    }
522    #[doc = "Filtering stage enabled"]
523    #[inline(always)]
524    pub fn value2(self) -> &'a mut crate::W<REG> {
525        self.variant(COFE_A::VALUE2)
526    }
527}
528#[doc = "Comparator output filter window\n\nValue on reset: 0"]
529#[derive(Clone, Copy, Debug, PartialEq, Eq)]
530#[repr(u8)]
531pub enum COFM_A {
532    #[doc = "0: Comparator Output needs to be stable for 2 clock cycles"]
533    VALUE1 = 0,
534    #[doc = "1: Comparator Output needs to be stable for 3 clock cycles"]
535    VALUE2 = 1,
536    #[doc = "2: Comparator Output needs to be stable for 4 clock cycles"]
537    VALUE3 = 2,
538    #[doc = "3: Comparator Output needs to be stable for 5 clock cycles"]
539    VALUE4 = 3,
540    #[doc = "12: Comparator Output needs to be stable for 14 clock cycles"]
541    VALUE5 = 12,
542    #[doc = "13: Comparator Output needs to be stable for 15 clock cycles"]
543    VALUE6 = 13,
544    #[doc = "14: Comparator Output needs to be stable for 16 clock cycles"]
545    VALUE7 = 14,
546    #[doc = "15: Comparator Output needs to be stable for 32 clock cycles"]
547    VALUE8 = 15,
548}
549impl From<COFM_A> for u8 {
550    #[inline(always)]
551    fn from(variant: COFM_A) -> Self {
552        variant as _
553    }
554}
555impl crate::FieldSpec for COFM_A {
556    type Ux = u8;
557}
558impl crate::IsEnum for COFM_A {}
559#[doc = "Field `COFM` reader - Comparator output filter window"]
560pub type COFM_R = crate::FieldReader<COFM_A>;
561impl COFM_R {
562    #[doc = "Get enumerated values variant"]
563    #[inline(always)]
564    pub const fn variant(&self) -> Option<COFM_A> {
565        match self.bits {
566            0 => Some(COFM_A::VALUE1),
567            1 => Some(COFM_A::VALUE2),
568            2 => Some(COFM_A::VALUE3),
569            3 => Some(COFM_A::VALUE4),
570            12 => Some(COFM_A::VALUE5),
571            13 => Some(COFM_A::VALUE6),
572            14 => Some(COFM_A::VALUE7),
573            15 => Some(COFM_A::VALUE8),
574            _ => None,
575        }
576    }
577    #[doc = "Comparator Output needs to be stable for 2 clock cycles"]
578    #[inline(always)]
579    pub fn is_value1(&self) -> bool {
580        *self == COFM_A::VALUE1
581    }
582    #[doc = "Comparator Output needs to be stable for 3 clock cycles"]
583    #[inline(always)]
584    pub fn is_value2(&self) -> bool {
585        *self == COFM_A::VALUE2
586    }
587    #[doc = "Comparator Output needs to be stable for 4 clock cycles"]
588    #[inline(always)]
589    pub fn is_value3(&self) -> bool {
590        *self == COFM_A::VALUE3
591    }
592    #[doc = "Comparator Output needs to be stable for 5 clock cycles"]
593    #[inline(always)]
594    pub fn is_value4(&self) -> bool {
595        *self == COFM_A::VALUE4
596    }
597    #[doc = "Comparator Output needs to be stable for 14 clock cycles"]
598    #[inline(always)]
599    pub fn is_value5(&self) -> bool {
600        *self == COFM_A::VALUE5
601    }
602    #[doc = "Comparator Output needs to be stable for 15 clock cycles"]
603    #[inline(always)]
604    pub fn is_value6(&self) -> bool {
605        *self == COFM_A::VALUE6
606    }
607    #[doc = "Comparator Output needs to be stable for 16 clock cycles"]
608    #[inline(always)]
609    pub fn is_value7(&self) -> bool {
610        *self == COFM_A::VALUE7
611    }
612    #[doc = "Comparator Output needs to be stable for 32 clock cycles"]
613    #[inline(always)]
614    pub fn is_value8(&self) -> bool {
615        *self == COFM_A::VALUE8
616    }
617}
618#[doc = "Field `COFM` writer - Comparator output filter window"]
619pub type COFM_W<'a, REG> = crate::FieldWriter<'a, REG, 4, COFM_A>;
620impl<'a, REG> COFM_W<'a, REG>
621where
622    REG: crate::Writable + crate::RegisterSpec,
623    REG::Ux: From<u8>,
624{
625    #[doc = "Comparator Output needs to be stable for 2 clock cycles"]
626    #[inline(always)]
627    pub fn value1(self) -> &'a mut crate::W<REG> {
628        self.variant(COFM_A::VALUE1)
629    }
630    #[doc = "Comparator Output needs to be stable for 3 clock cycles"]
631    #[inline(always)]
632    pub fn value2(self) -> &'a mut crate::W<REG> {
633        self.variant(COFM_A::VALUE2)
634    }
635    #[doc = "Comparator Output needs to be stable for 4 clock cycles"]
636    #[inline(always)]
637    pub fn value3(self) -> &'a mut crate::W<REG> {
638        self.variant(COFM_A::VALUE3)
639    }
640    #[doc = "Comparator Output needs to be stable for 5 clock cycles"]
641    #[inline(always)]
642    pub fn value4(self) -> &'a mut crate::W<REG> {
643        self.variant(COFM_A::VALUE4)
644    }
645    #[doc = "Comparator Output needs to be stable for 14 clock cycles"]
646    #[inline(always)]
647    pub fn value5(self) -> &'a mut crate::W<REG> {
648        self.variant(COFM_A::VALUE5)
649    }
650    #[doc = "Comparator Output needs to be stable for 15 clock cycles"]
651    #[inline(always)]
652    pub fn value6(self) -> &'a mut crate::W<REG> {
653        self.variant(COFM_A::VALUE6)
654    }
655    #[doc = "Comparator Output needs to be stable for 16 clock cycles"]
656    #[inline(always)]
657    pub fn value7(self) -> &'a mut crate::W<REG> {
658        self.variant(COFM_A::VALUE7)
659    }
660    #[doc = "Comparator Output needs to be stable for 32 clock cycles"]
661    #[inline(always)]
662    pub fn value8(self) -> &'a mut crate::W<REG> {
663        self.variant(COFM_A::VALUE8)
664    }
665}
666#[doc = "Comparator output filter control\n\nValue on reset: 0"]
667#[derive(Clone, Copy, Debug, PartialEq, Eq)]
668#[repr(u8)]
669pub enum COFC_A {
670    #[doc = "0: Filtering is always done if enabled"]
671    VALUE1 = 0,
672    #[doc = "1: Filtering is only done when CSGyDSV1 value is currently fed to the DAC"]
673    VALUE2 = 1,
674    #[doc = "2: Filtering is only done when the CSGyDSV2 value is currently fed to the DAC"]
675    VALUE3 = 2,
676}
677impl From<COFC_A> for u8 {
678    #[inline(always)]
679    fn from(variant: COFC_A) -> Self {
680        variant as _
681    }
682}
683impl crate::FieldSpec for COFC_A {
684    type Ux = u8;
685}
686impl crate::IsEnum for COFC_A {}
687#[doc = "Field `COFC` reader - Comparator output filter control"]
688pub type COFC_R = crate::FieldReader<COFC_A>;
689impl COFC_R {
690    #[doc = "Get enumerated values variant"]
691    #[inline(always)]
692    pub const fn variant(&self) -> Option<COFC_A> {
693        match self.bits {
694            0 => Some(COFC_A::VALUE1),
695            1 => Some(COFC_A::VALUE2),
696            2 => Some(COFC_A::VALUE3),
697            _ => None,
698        }
699    }
700    #[doc = "Filtering is always done if enabled"]
701    #[inline(always)]
702    pub fn is_value1(&self) -> bool {
703        *self == COFC_A::VALUE1
704    }
705    #[doc = "Filtering is only done when CSGyDSV1 value is currently fed to the DAC"]
706    #[inline(always)]
707    pub fn is_value2(&self) -> bool {
708        *self == COFC_A::VALUE2
709    }
710    #[doc = "Filtering is only done when the CSGyDSV2 value is currently fed to the DAC"]
711    #[inline(always)]
712    pub fn is_value3(&self) -> bool {
713        *self == COFC_A::VALUE3
714    }
715}
716#[doc = "Field `COFC` writer - Comparator output filter control"]
717pub type COFC_W<'a, REG> = crate::FieldWriter<'a, REG, 2, COFC_A>;
718impl<'a, REG> COFC_W<'a, REG>
719where
720    REG: crate::Writable + crate::RegisterSpec,
721    REG::Ux: From<u8>,
722{
723    #[doc = "Filtering is always done if enabled"]
724    #[inline(always)]
725    pub fn value1(self) -> &'a mut crate::W<REG> {
726        self.variant(COFC_A::VALUE1)
727    }
728    #[doc = "Filtering is only done when CSGyDSV1 value is currently fed to the DAC"]
729    #[inline(always)]
730    pub fn value2(self) -> &'a mut crate::W<REG> {
731        self.variant(COFC_A::VALUE2)
732    }
733    #[doc = "Filtering is only done when the CSGyDSV2 value is currently fed to the DAC"]
734    #[inline(always)]
735    pub fn value3(self) -> &'a mut crate::W<REG> {
736        self.variant(COFC_A::VALUE3)
737    }
738}
739impl R {
740    #[doc = "Bits 0:3 - External blanking trigger selector"]
741    #[inline(always)]
742    pub fn ibs(&self) -> IBS_R {
743        IBS_R::new((self.bits & 0x0f) as u8)
744    }
745    #[doc = "Bit 8 - Inverting comparator input selector"]
746    #[inline(always)]
747    pub fn imcs(&self) -> IMCS_R {
748        IMCS_R::new(((self.bits >> 8) & 1) != 0)
749    }
750    #[doc = "Bits 9:10 - Comparator input switching configuration"]
751    #[inline(always)]
752    pub fn imcc(&self) -> IMCC_R {
753        IMCC_R::new(((self.bits >> 9) & 3) as u8)
754    }
755    #[doc = "Bit 11 - External triggered switch enable"]
756    #[inline(always)]
757    pub fn ese(&self) -> ESE_R {
758        ESE_R::new(((self.bits >> 11) & 1) != 0)
759    }
760    #[doc = "Bit 12 - Comparator output inversion enable"]
761    #[inline(always)]
762    pub fn oie(&self) -> OIE_R {
763        OIE_R::new(((self.bits >> 12) & 1) != 0)
764    }
765    #[doc = "Bit 13 - Comparator output synchronization enable"]
766    #[inline(always)]
767    pub fn ose(&self) -> OSE_R {
768        OSE_R::new(((self.bits >> 13) & 1) != 0)
769    }
770    #[doc = "Bits 14:15 - Blanking mode"]
771    #[inline(always)]
772    pub fn blmc(&self) -> BLMC_R {
773        BLMC_R::new(((self.bits >> 14) & 3) as u8)
774    }
775    #[doc = "Bit 16 - External blanking trigger enabled"]
776    #[inline(always)]
777    pub fn ebe(&self) -> EBE_R {
778        EBE_R::new(((self.bits >> 16) & 1) != 0)
779    }
780    #[doc = "Bit 17 - Comparator output filter enable"]
781    #[inline(always)]
782    pub fn cofe(&self) -> COFE_R {
783        COFE_R::new(((self.bits >> 17) & 1) != 0)
784    }
785    #[doc = "Bits 18:21 - Comparator output filter window"]
786    #[inline(always)]
787    pub fn cofm(&self) -> COFM_R {
788        COFM_R::new(((self.bits >> 18) & 0x0f) as u8)
789    }
790    #[doc = "Bits 24:25 - Comparator output filter control"]
791    #[inline(always)]
792    pub fn cofc(&self) -> COFC_R {
793        COFC_R::new(((self.bits >> 24) & 3) as u8)
794    }
795}
796impl W {
797    #[doc = "Bits 0:3 - External blanking trigger selector"]
798    #[inline(always)]
799    pub fn ibs(&mut self) -> IBS_W<CC_SPEC> {
800        IBS_W::new(self, 0)
801    }
802    #[doc = "Bit 8 - Inverting comparator input selector"]
803    #[inline(always)]
804    pub fn imcs(&mut self) -> IMCS_W<CC_SPEC> {
805        IMCS_W::new(self, 8)
806    }
807    #[doc = "Bits 9:10 - Comparator input switching configuration"]
808    #[inline(always)]
809    pub fn imcc(&mut self) -> IMCC_W<CC_SPEC> {
810        IMCC_W::new(self, 9)
811    }
812    #[doc = "Bit 11 - External triggered switch enable"]
813    #[inline(always)]
814    pub fn ese(&mut self) -> ESE_W<CC_SPEC> {
815        ESE_W::new(self, 11)
816    }
817    #[doc = "Bit 12 - Comparator output inversion enable"]
818    #[inline(always)]
819    pub fn oie(&mut self) -> OIE_W<CC_SPEC> {
820        OIE_W::new(self, 12)
821    }
822    #[doc = "Bit 13 - Comparator output synchronization enable"]
823    #[inline(always)]
824    pub fn ose(&mut self) -> OSE_W<CC_SPEC> {
825        OSE_W::new(self, 13)
826    }
827    #[doc = "Bits 14:15 - Blanking mode"]
828    #[inline(always)]
829    pub fn blmc(&mut self) -> BLMC_W<CC_SPEC> {
830        BLMC_W::new(self, 14)
831    }
832    #[doc = "Bit 16 - External blanking trigger enabled"]
833    #[inline(always)]
834    pub fn ebe(&mut self) -> EBE_W<CC_SPEC> {
835        EBE_W::new(self, 16)
836    }
837    #[doc = "Bit 17 - Comparator output filter enable"]
838    #[inline(always)]
839    pub fn cofe(&mut self) -> COFE_W<CC_SPEC> {
840        COFE_W::new(self, 17)
841    }
842    #[doc = "Bits 18:21 - Comparator output filter window"]
843    #[inline(always)]
844    pub fn cofm(&mut self) -> COFM_W<CC_SPEC> {
845        COFM_W::new(self, 18)
846    }
847    #[doc = "Bits 24:25 - Comparator output filter control"]
848    #[inline(always)]
849    pub fn cofc(&mut self) -> COFC_W<CC_SPEC> {
850        COFC_W::new(self, 24)
851    }
852}
853#[doc = "Comparator configuration\n\nYou can [`read`](crate::Reg::read) this register and get [`cc::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cc::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
854pub struct CC_SPEC;
855impl crate::RegisterSpec for CC_SPEC {
856    type Ux = u32;
857}
858#[doc = "`read()` method returns [`cc::R`](R) reader structure"]
859impl crate::Readable for CC_SPEC {}
860#[doc = "`write(|w| ..)` method takes [`cc::W`](W) writer structure"]
861impl crate::Writable for CC_SPEC {
862    type Safety = crate::Unsafe;
863    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
864    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
865}
866#[doc = "`reset()` method sets CC to value 0"]
867impl crate::Resettable for CC_SPEC {
868    const RESET_VALUE: u32 = 0;
869}