1pub type R = crate::R<CCMR1_INPUTrs>;
3pub type W = crate::W<CCMR1_INPUTrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10#[repr(u8)]
11pub enum CC1S {
12 Ti1 = 1,
14 Ti2 = 2,
16 Trc = 3,
18}
19impl From<CC1S> for u8 {
20 #[inline(always)]
21 fn from(variant: CC1S) -> Self {
22 variant as _
23 }
24}
25impl crate::FieldSpec for CC1S {
26 type Ux = u8;
27}
28impl crate::IsEnum for CC1S {}
29pub type CC1S_R = crate::FieldReader<CC1S>;
31impl CC1S_R {
32 #[inline(always)]
34 pub const fn variant(&self) -> Option<CC1S> {
35 match self.bits {
36 1 => Some(CC1S::Ti1),
37 2 => Some(CC1S::Ti2),
38 3 => Some(CC1S::Trc),
39 _ => None,
40 }
41 }
42 #[inline(always)]
44 pub fn is_ti1(&self) -> bool {
45 *self == CC1S::Ti1
46 }
47 #[inline(always)]
49 pub fn is_ti2(&self) -> bool {
50 *self == CC1S::Ti2
51 }
52 #[inline(always)]
54 pub fn is_trc(&self) -> bool {
55 *self == CC1S::Trc
56 }
57}
58pub type CC1S_W<'a, REG> = crate::FieldWriter<'a, REG, 2, CC1S>;
60impl<'a, REG> CC1S_W<'a, REG>
61where
62 REG: crate::Writable + crate::RegisterSpec,
63 REG::Ux: From<u8>,
64{
65 #[inline(always)]
67 pub fn ti1(self) -> &'a mut crate::W<REG> {
68 self.variant(CC1S::Ti1)
69 }
70 #[inline(always)]
72 pub fn ti2(self) -> &'a mut crate::W<REG> {
73 self.variant(CC1S::Ti2)
74 }
75 #[inline(always)]
77 pub fn trc(self) -> &'a mut crate::W<REG> {
78 self.variant(CC1S::Trc)
79 }
80}
81#[cfg_attr(feature = "defmt", derive(defmt::Format))]
85#[derive(Clone, Copy, Debug, PartialEq, Eq)]
86#[repr(u8)]
87pub enum ICPRESCALER {
88 NoPrescaler = 0,
90 TwoEvents = 1,
92 FourEvents = 2,
94 EightEvents = 3,
96}
97impl From<ICPRESCALER> for u8 {
98 #[inline(always)]
99 fn from(variant: ICPRESCALER) -> Self {
100 variant as _
101 }
102}
103impl crate::FieldSpec for ICPRESCALER {
104 type Ux = u8;
105}
106impl crate::IsEnum for ICPRESCALER {}
107pub type ICPSC_R = crate::FieldReader<ICPRESCALER>;
109impl ICPSC_R {
110 #[inline(always)]
112 pub const fn variant(&self) -> ICPRESCALER {
113 match self.bits {
114 0 => ICPRESCALER::NoPrescaler,
115 1 => ICPRESCALER::TwoEvents,
116 2 => ICPRESCALER::FourEvents,
117 3 => ICPRESCALER::EightEvents,
118 _ => unreachable!(),
119 }
120 }
121 #[inline(always)]
123 pub fn is_no_prescaler(&self) -> bool {
124 *self == ICPRESCALER::NoPrescaler
125 }
126 #[inline(always)]
128 pub fn is_two_events(&self) -> bool {
129 *self == ICPRESCALER::TwoEvents
130 }
131 #[inline(always)]
133 pub fn is_four_events(&self) -> bool {
134 *self == ICPRESCALER::FourEvents
135 }
136 #[inline(always)]
138 pub fn is_eight_events(&self) -> bool {
139 *self == ICPRESCALER::EightEvents
140 }
141}
142pub type ICPSC_W<'a, REG> = crate::FieldWriter<'a, REG, 2, ICPRESCALER, crate::Safe>;
144impl<'a, REG> ICPSC_W<'a, REG>
145where
146 REG: crate::Writable + crate::RegisterSpec,
147 REG::Ux: From<u8>,
148{
149 #[inline(always)]
151 pub fn no_prescaler(self) -> &'a mut crate::W<REG> {
152 self.variant(ICPRESCALER::NoPrescaler)
153 }
154 #[inline(always)]
156 pub fn two_events(self) -> &'a mut crate::W<REG> {
157 self.variant(ICPRESCALER::TwoEvents)
158 }
159 #[inline(always)]
161 pub fn four_events(self) -> &'a mut crate::W<REG> {
162 self.variant(ICPRESCALER::FourEvents)
163 }
164 #[inline(always)]
166 pub fn eight_events(self) -> &'a mut crate::W<REG> {
167 self.variant(ICPRESCALER::EightEvents)
168 }
169}
170#[cfg_attr(feature = "defmt", derive(defmt::Format))]
174#[derive(Clone, Copy, Debug, PartialEq, Eq)]
175#[repr(u8)]
176pub enum ICFILTER {
177 NoFilter = 0,
179 FckIntN2 = 1,
181 FckIntN4 = 2,
183 FckIntN8 = 3,
185 FdtsDiv2N6 = 4,
187 FdtsDiv2N8 = 5,
189 FdtsDiv4N6 = 6,
191 FdtsDiv4N8 = 7,
193 FdtsDiv8N6 = 8,
195 FdtsDiv8N8 = 9,
197 FdtsDiv16N5 = 10,
199 FdtsDiv16N6 = 11,
201 FdtsDiv16N8 = 12,
203 FdtsDiv32N5 = 13,
205 FdtsDiv32N6 = 14,
207 FdtsDiv32N8 = 15,
209}
210impl From<ICFILTER> for u8 {
211 #[inline(always)]
212 fn from(variant: ICFILTER) -> Self {
213 variant as _
214 }
215}
216impl crate::FieldSpec for ICFILTER {
217 type Ux = u8;
218}
219impl crate::IsEnum for ICFILTER {}
220pub type ICF_R = crate::FieldReader<ICFILTER>;
222impl ICF_R {
223 #[inline(always)]
225 pub const fn variant(&self) -> ICFILTER {
226 match self.bits {
227 0 => ICFILTER::NoFilter,
228 1 => ICFILTER::FckIntN2,
229 2 => ICFILTER::FckIntN4,
230 3 => ICFILTER::FckIntN8,
231 4 => ICFILTER::FdtsDiv2N6,
232 5 => ICFILTER::FdtsDiv2N8,
233 6 => ICFILTER::FdtsDiv4N6,
234 7 => ICFILTER::FdtsDiv4N8,
235 8 => ICFILTER::FdtsDiv8N6,
236 9 => ICFILTER::FdtsDiv8N8,
237 10 => ICFILTER::FdtsDiv16N5,
238 11 => ICFILTER::FdtsDiv16N6,
239 12 => ICFILTER::FdtsDiv16N8,
240 13 => ICFILTER::FdtsDiv32N5,
241 14 => ICFILTER::FdtsDiv32N6,
242 15 => ICFILTER::FdtsDiv32N8,
243 _ => unreachable!(),
244 }
245 }
246 #[inline(always)]
248 pub fn is_no_filter(&self) -> bool {
249 *self == ICFILTER::NoFilter
250 }
251 #[inline(always)]
253 pub fn is_fck_int_n2(&self) -> bool {
254 *self == ICFILTER::FckIntN2
255 }
256 #[inline(always)]
258 pub fn is_fck_int_n4(&self) -> bool {
259 *self == ICFILTER::FckIntN4
260 }
261 #[inline(always)]
263 pub fn is_fck_int_n8(&self) -> bool {
264 *self == ICFILTER::FckIntN8
265 }
266 #[inline(always)]
268 pub fn is_fdts_div2_n6(&self) -> bool {
269 *self == ICFILTER::FdtsDiv2N6
270 }
271 #[inline(always)]
273 pub fn is_fdts_div2_n8(&self) -> bool {
274 *self == ICFILTER::FdtsDiv2N8
275 }
276 #[inline(always)]
278 pub fn is_fdts_div4_n6(&self) -> bool {
279 *self == ICFILTER::FdtsDiv4N6
280 }
281 #[inline(always)]
283 pub fn is_fdts_div4_n8(&self) -> bool {
284 *self == ICFILTER::FdtsDiv4N8
285 }
286 #[inline(always)]
288 pub fn is_fdts_div8_n6(&self) -> bool {
289 *self == ICFILTER::FdtsDiv8N6
290 }
291 #[inline(always)]
293 pub fn is_fdts_div8_n8(&self) -> bool {
294 *self == ICFILTER::FdtsDiv8N8
295 }
296 #[inline(always)]
298 pub fn is_fdts_div16_n5(&self) -> bool {
299 *self == ICFILTER::FdtsDiv16N5
300 }
301 #[inline(always)]
303 pub fn is_fdts_div16_n6(&self) -> bool {
304 *self == ICFILTER::FdtsDiv16N6
305 }
306 #[inline(always)]
308 pub fn is_fdts_div16_n8(&self) -> bool {
309 *self == ICFILTER::FdtsDiv16N8
310 }
311 #[inline(always)]
313 pub fn is_fdts_div32_n5(&self) -> bool {
314 *self == ICFILTER::FdtsDiv32N5
315 }
316 #[inline(always)]
318 pub fn is_fdts_div32_n6(&self) -> bool {
319 *self == ICFILTER::FdtsDiv32N6
320 }
321 #[inline(always)]
323 pub fn is_fdts_div32_n8(&self) -> bool {
324 *self == ICFILTER::FdtsDiv32N8
325 }
326}
327pub type ICF_W<'a, REG> = crate::FieldWriter<'a, REG, 4, ICFILTER, crate::Safe>;
329impl<'a, REG> ICF_W<'a, REG>
330where
331 REG: crate::Writable + crate::RegisterSpec,
332 REG::Ux: From<u8>,
333{
334 #[inline(always)]
336 pub fn no_filter(self) -> &'a mut crate::W<REG> {
337 self.variant(ICFILTER::NoFilter)
338 }
339 #[inline(always)]
341 pub fn fck_int_n2(self) -> &'a mut crate::W<REG> {
342 self.variant(ICFILTER::FckIntN2)
343 }
344 #[inline(always)]
346 pub fn fck_int_n4(self) -> &'a mut crate::W<REG> {
347 self.variant(ICFILTER::FckIntN4)
348 }
349 #[inline(always)]
351 pub fn fck_int_n8(self) -> &'a mut crate::W<REG> {
352 self.variant(ICFILTER::FckIntN8)
353 }
354 #[inline(always)]
356 pub fn fdts_div2_n6(self) -> &'a mut crate::W<REG> {
357 self.variant(ICFILTER::FdtsDiv2N6)
358 }
359 #[inline(always)]
361 pub fn fdts_div2_n8(self) -> &'a mut crate::W<REG> {
362 self.variant(ICFILTER::FdtsDiv2N8)
363 }
364 #[inline(always)]
366 pub fn fdts_div4_n6(self) -> &'a mut crate::W<REG> {
367 self.variant(ICFILTER::FdtsDiv4N6)
368 }
369 #[inline(always)]
371 pub fn fdts_div4_n8(self) -> &'a mut crate::W<REG> {
372 self.variant(ICFILTER::FdtsDiv4N8)
373 }
374 #[inline(always)]
376 pub fn fdts_div8_n6(self) -> &'a mut crate::W<REG> {
377 self.variant(ICFILTER::FdtsDiv8N6)
378 }
379 #[inline(always)]
381 pub fn fdts_div8_n8(self) -> &'a mut crate::W<REG> {
382 self.variant(ICFILTER::FdtsDiv8N8)
383 }
384 #[inline(always)]
386 pub fn fdts_div16_n5(self) -> &'a mut crate::W<REG> {
387 self.variant(ICFILTER::FdtsDiv16N5)
388 }
389 #[inline(always)]
391 pub fn fdts_div16_n6(self) -> &'a mut crate::W<REG> {
392 self.variant(ICFILTER::FdtsDiv16N6)
393 }
394 #[inline(always)]
396 pub fn fdts_div16_n8(self) -> &'a mut crate::W<REG> {
397 self.variant(ICFILTER::FdtsDiv16N8)
398 }
399 #[inline(always)]
401 pub fn fdts_div32_n5(self) -> &'a mut crate::W<REG> {
402 self.variant(ICFILTER::FdtsDiv32N5)
403 }
404 #[inline(always)]
406 pub fn fdts_div32_n6(self) -> &'a mut crate::W<REG> {
407 self.variant(ICFILTER::FdtsDiv32N6)
408 }
409 #[inline(always)]
411 pub fn fdts_div32_n8(self) -> &'a mut crate::W<REG> {
412 self.variant(ICFILTER::FdtsDiv32N8)
413 }
414}
415#[cfg_attr(feature = "defmt", derive(defmt::Format))]
419#[derive(Clone, Copy, Debug, PartialEq, Eq)]
420#[repr(u8)]
421pub enum CC2S {
422 Ti2 = 1,
424 Ti1 = 2,
426 Trc = 3,
428}
429impl From<CC2S> for u8 {
430 #[inline(always)]
431 fn from(variant: CC2S) -> Self {
432 variant as _
433 }
434}
435impl crate::FieldSpec for CC2S {
436 type Ux = u8;
437}
438impl crate::IsEnum for CC2S {}
439pub type CC2S_R = crate::FieldReader<CC2S>;
441impl CC2S_R {
442 #[inline(always)]
444 pub const fn variant(&self) -> Option<CC2S> {
445 match self.bits {
446 1 => Some(CC2S::Ti2),
447 2 => Some(CC2S::Ti1),
448 3 => Some(CC2S::Trc),
449 _ => None,
450 }
451 }
452 #[inline(always)]
454 pub fn is_ti2(&self) -> bool {
455 *self == CC2S::Ti2
456 }
457 #[inline(always)]
459 pub fn is_ti1(&self) -> bool {
460 *self == CC2S::Ti1
461 }
462 #[inline(always)]
464 pub fn is_trc(&self) -> bool {
465 *self == CC2S::Trc
466 }
467}
468pub type CC2S_W<'a, REG> = crate::FieldWriter<'a, REG, 2, CC2S>;
470impl<'a, REG> CC2S_W<'a, REG>
471where
472 REG: crate::Writable + crate::RegisterSpec,
473 REG::Ux: From<u8>,
474{
475 #[inline(always)]
477 pub fn ti2(self) -> &'a mut crate::W<REG> {
478 self.variant(CC2S::Ti2)
479 }
480 #[inline(always)]
482 pub fn ti1(self) -> &'a mut crate::W<REG> {
483 self.variant(CC2S::Ti1)
484 }
485 #[inline(always)]
487 pub fn trc(self) -> &'a mut crate::W<REG> {
488 self.variant(CC2S::Trc)
489 }
490}
491impl R {
492 #[inline(always)]
494 pub fn cc1s(&self) -> CC1S_R {
495 CC1S_R::new((self.bits & 3) as u8)
496 }
497 #[inline(always)]
501 pub fn icpsc(&self, n: u8) -> ICPSC_R {
502 #[allow(clippy::no_effect)]
503 [(); 2][n as usize];
504 ICPSC_R::new(((self.bits >> (n * 8 + 2)) & 3) as u8)
505 }
506 #[inline(always)]
509 pub fn icpsc_iter(&self) -> impl Iterator<Item = ICPSC_R> + '_ {
510 (0..2).map(move |n| ICPSC_R::new(((self.bits >> (n * 8 + 2)) & 3) as u8))
511 }
512 #[inline(always)]
514 pub fn ic1psc(&self) -> ICPSC_R {
515 ICPSC_R::new(((self.bits >> 2) & 3) as u8)
516 }
517 #[inline(always)]
519 pub fn ic2psc(&self) -> ICPSC_R {
520 ICPSC_R::new(((self.bits >> 10) & 3) as u8)
521 }
522 #[inline(always)]
526 pub fn icf(&self, n: u8) -> ICF_R {
527 #[allow(clippy::no_effect)]
528 [(); 2][n as usize];
529 ICF_R::new(((self.bits >> (n * 8 + 4)) & 0x0f) as u8)
530 }
531 #[inline(always)]
534 pub fn icf_iter(&self) -> impl Iterator<Item = ICF_R> + '_ {
535 (0..2).map(move |n| ICF_R::new(((self.bits >> (n * 8 + 4)) & 0x0f) as u8))
536 }
537 #[inline(always)]
539 pub fn ic1f(&self) -> ICF_R {
540 ICF_R::new(((self.bits >> 4) & 0x0f) as u8)
541 }
542 #[inline(always)]
544 pub fn ic2f(&self) -> ICF_R {
545 ICF_R::new(((self.bits >> 12) & 0x0f) as u8)
546 }
547 #[inline(always)]
549 pub fn cc2s(&self) -> CC2S_R {
550 CC2S_R::new(((self.bits >> 8) & 3) as u8)
551 }
552}
553impl core::fmt::Debug for R {
554 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
555 f.debug_struct("CCMR1_Input")
556 .field("ic1f", &self.ic1f())
557 .field("ic2f", &self.ic2f())
558 .field("ic1psc", &self.ic1psc())
559 .field("ic2psc", &self.ic2psc())
560 .field("cc2s", &self.cc2s())
561 .field("cc1s", &self.cc1s())
562 .finish()
563 }
564}
565impl W {
566 #[inline(always)]
568 pub fn cc1s(&mut self) -> CC1S_W<CCMR1_INPUTrs> {
569 CC1S_W::new(self, 0)
570 }
571 #[inline(always)]
575 pub fn icpsc(&mut self, n: u8) -> ICPSC_W<CCMR1_INPUTrs> {
576 #[allow(clippy::no_effect)]
577 [(); 2][n as usize];
578 ICPSC_W::new(self, n * 8 + 2)
579 }
580 #[inline(always)]
582 pub fn ic1psc(&mut self) -> ICPSC_W<CCMR1_INPUTrs> {
583 ICPSC_W::new(self, 2)
584 }
585 #[inline(always)]
587 pub fn ic2psc(&mut self) -> ICPSC_W<CCMR1_INPUTrs> {
588 ICPSC_W::new(self, 10)
589 }
590 #[inline(always)]
594 pub fn icf(&mut self, n: u8) -> ICF_W<CCMR1_INPUTrs> {
595 #[allow(clippy::no_effect)]
596 [(); 2][n as usize];
597 ICF_W::new(self, n * 8 + 4)
598 }
599 #[inline(always)]
601 pub fn ic1f(&mut self) -> ICF_W<CCMR1_INPUTrs> {
602 ICF_W::new(self, 4)
603 }
604 #[inline(always)]
606 pub fn ic2f(&mut self) -> ICF_W<CCMR1_INPUTrs> {
607 ICF_W::new(self, 12)
608 }
609 #[inline(always)]
611 pub fn cc2s(&mut self) -> CC2S_W<CCMR1_INPUTrs> {
612 CC2S_W::new(self, 8)
613 }
614}
615pub struct CCMR1_INPUTrs;
621impl crate::RegisterSpec for CCMR1_INPUTrs {
622 type Ux = u32;
623}
624impl crate::Readable for CCMR1_INPUTrs {}
626impl crate::Writable for CCMR1_INPUTrs {
628 type Safety = crate::Unsafe;
629}
630impl crate::Resettable for CCMR1_INPUTrs {}