1pub type R = crate::R<CRrs>;
3pub type W = crate::W<CRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum EN {
11 Disabled = 0,
13 Enabled = 1,
15}
16impl From<EN> for bool {
17 #[inline(always)]
18 fn from(variant: EN) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type EN_R = crate::BitReader<EN>;
24impl EN_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> EN {
28 match self.bits {
29 false => EN::Disabled,
30 true => EN::Enabled,
31 }
32 }
33 #[inline(always)]
35 pub fn is_disabled(&self) -> bool {
36 *self == EN::Disabled
37 }
38 #[inline(always)]
40 pub fn is_enabled(&self) -> bool {
41 *self == EN::Enabled
42 }
43}
44pub type EN_W<'a, REG> = crate::BitWriter<'a, REG, EN>;
46impl<'a, REG> EN_W<'a, REG>
47where
48 REG: crate::Writable + crate::RegisterSpec,
49{
50 #[inline(always)]
52 pub fn disabled(self) -> &'a mut crate::W<REG> {
53 self.variant(EN::Disabled)
54 }
55 #[inline(always)]
57 pub fn enabled(self) -> &'a mut crate::W<REG> {
58 self.variant(EN::Enabled)
59 }
60}
61#[cfg_attr(feature = "defmt", derive(defmt::Format))]
65#[derive(Clone, Copy, Debug, PartialEq, Eq)]
66pub enum ABORT {
67 NoAbortRequested = 0,
69 AbortRequested = 1,
71}
72impl From<ABORT> for bool {
73 #[inline(always)]
74 fn from(variant: ABORT) -> Self {
75 variant as u8 != 0
76 }
77}
78pub type ABORT_R = crate::BitReader<ABORT>;
80impl ABORT_R {
81 #[inline(always)]
83 pub const fn variant(&self) -> ABORT {
84 match self.bits {
85 false => ABORT::NoAbortRequested,
86 true => ABORT::AbortRequested,
87 }
88 }
89 #[inline(always)]
91 pub fn is_no_abort_requested(&self) -> bool {
92 *self == ABORT::NoAbortRequested
93 }
94 #[inline(always)]
96 pub fn is_abort_requested(&self) -> bool {
97 *self == ABORT::AbortRequested
98 }
99}
100pub type ABORT_W<'a, REG> = crate::BitWriter<'a, REG, ABORT>;
102impl<'a, REG> ABORT_W<'a, REG>
103where
104 REG: crate::Writable + crate::RegisterSpec,
105{
106 #[inline(always)]
108 pub fn no_abort_requested(self) -> &'a mut crate::W<REG> {
109 self.variant(ABORT::NoAbortRequested)
110 }
111 #[inline(always)]
113 pub fn abort_requested(self) -> &'a mut crate::W<REG> {
114 self.variant(ABORT::AbortRequested)
115 }
116}
117#[cfg_attr(feature = "defmt", derive(defmt::Format))]
121#[derive(Clone, Copy, Debug, PartialEq, Eq)]
122pub enum DMAEN {
123 Disabled = 0,
125 Enabled = 1,
127}
128impl From<DMAEN> for bool {
129 #[inline(always)]
130 fn from(variant: DMAEN) -> Self {
131 variant as u8 != 0
132 }
133}
134pub type DMAEN_R = crate::BitReader<DMAEN>;
136impl DMAEN_R {
137 #[inline(always)]
139 pub const fn variant(&self) -> DMAEN {
140 match self.bits {
141 false => DMAEN::Disabled,
142 true => DMAEN::Enabled,
143 }
144 }
145 #[inline(always)]
147 pub fn is_disabled(&self) -> bool {
148 *self == DMAEN::Disabled
149 }
150 #[inline(always)]
152 pub fn is_enabled(&self) -> bool {
153 *self == DMAEN::Enabled
154 }
155}
156pub type DMAEN_W<'a, REG> = crate::BitWriter<'a, REG, DMAEN>;
158impl<'a, REG> DMAEN_W<'a, REG>
159where
160 REG: crate::Writable + crate::RegisterSpec,
161{
162 #[inline(always)]
164 pub fn disabled(self) -> &'a mut crate::W<REG> {
165 self.variant(DMAEN::Disabled)
166 }
167 #[inline(always)]
169 pub fn enabled(self) -> &'a mut crate::W<REG> {
170 self.variant(DMAEN::Enabled)
171 }
172}
173#[cfg_attr(feature = "defmt", derive(defmt::Format))]
177#[derive(Clone, Copy, Debug, PartialEq, Eq)]
178pub enum TCEN {
179 Disabled = 0,
181 Enabled = 1,
183}
184impl From<TCEN> for bool {
185 #[inline(always)]
186 fn from(variant: TCEN) -> Self {
187 variant as u8 != 0
188 }
189}
190pub type TCEN_R = crate::BitReader<TCEN>;
192impl TCEN_R {
193 #[inline(always)]
195 pub const fn variant(&self) -> TCEN {
196 match self.bits {
197 false => TCEN::Disabled,
198 true => TCEN::Enabled,
199 }
200 }
201 #[inline(always)]
203 pub fn is_disabled(&self) -> bool {
204 *self == TCEN::Disabled
205 }
206 #[inline(always)]
208 pub fn is_enabled(&self) -> bool {
209 *self == TCEN::Enabled
210 }
211}
212pub type TCEN_W<'a, REG> = crate::BitWriter<'a, REG, TCEN>;
214impl<'a, REG> TCEN_W<'a, REG>
215where
216 REG: crate::Writable + crate::RegisterSpec,
217{
218 #[inline(always)]
220 pub fn disabled(self) -> &'a mut crate::W<REG> {
221 self.variant(TCEN::Disabled)
222 }
223 #[inline(always)]
225 pub fn enabled(self) -> &'a mut crate::W<REG> {
226 self.variant(TCEN::Enabled)
227 }
228}
229#[cfg_attr(feature = "defmt", derive(defmt::Format))]
233#[derive(Clone, Copy, Debug, PartialEq, Eq)]
234pub enum SSHIFT {
235 NoShift = 0,
237 OneHalfCycleShift = 1,
239}
240impl From<SSHIFT> for bool {
241 #[inline(always)]
242 fn from(variant: SSHIFT) -> Self {
243 variant as u8 != 0
244 }
245}
246pub type SSHIFT_R = crate::BitReader<SSHIFT>;
248impl SSHIFT_R {
249 #[inline(always)]
251 pub const fn variant(&self) -> SSHIFT {
252 match self.bits {
253 false => SSHIFT::NoShift,
254 true => SSHIFT::OneHalfCycleShift,
255 }
256 }
257 #[inline(always)]
259 pub fn is_no_shift(&self) -> bool {
260 *self == SSHIFT::NoShift
261 }
262 #[inline(always)]
264 pub fn is_one_half_cycle_shift(&self) -> bool {
265 *self == SSHIFT::OneHalfCycleShift
266 }
267}
268pub type SSHIFT_W<'a, REG> = crate::BitWriter<'a, REG, SSHIFT>;
270impl<'a, REG> SSHIFT_W<'a, REG>
271where
272 REG: crate::Writable + crate::RegisterSpec,
273{
274 #[inline(always)]
276 pub fn no_shift(self) -> &'a mut crate::W<REG> {
277 self.variant(SSHIFT::NoShift)
278 }
279 #[inline(always)]
281 pub fn one_half_cycle_shift(self) -> &'a mut crate::W<REG> {
282 self.variant(SSHIFT::OneHalfCycleShift)
283 }
284}
285#[cfg_attr(feature = "defmt", derive(defmt::Format))]
289#[derive(Clone, Copy, Debug, PartialEq, Eq)]
290pub enum DFM {
291 Disabled = 0,
293 Enabled = 1,
295}
296impl From<DFM> for bool {
297 #[inline(always)]
298 fn from(variant: DFM) -> Self {
299 variant as u8 != 0
300 }
301}
302pub type DFM_R = crate::BitReader<DFM>;
304impl DFM_R {
305 #[inline(always)]
307 pub const fn variant(&self) -> DFM {
308 match self.bits {
309 false => DFM::Disabled,
310 true => DFM::Enabled,
311 }
312 }
313 #[inline(always)]
315 pub fn is_disabled(&self) -> bool {
316 *self == DFM::Disabled
317 }
318 #[inline(always)]
320 pub fn is_enabled(&self) -> bool {
321 *self == DFM::Enabled
322 }
323}
324pub type DFM_W<'a, REG> = crate::BitWriter<'a, REG, DFM>;
326impl<'a, REG> DFM_W<'a, REG>
327where
328 REG: crate::Writable + crate::RegisterSpec,
329{
330 #[inline(always)]
332 pub fn disabled(self) -> &'a mut crate::W<REG> {
333 self.variant(DFM::Disabled)
334 }
335 #[inline(always)]
337 pub fn enabled(self) -> &'a mut crate::W<REG> {
338 self.variant(DFM::Enabled)
339 }
340}
341#[cfg_attr(feature = "defmt", derive(defmt::Format))]
345#[derive(Clone, Copy, Debug, PartialEq, Eq)]
346pub enum FSEL {
347 SelectFlash1 = 0,
349 SelectFlash2 = 1,
351}
352impl From<FSEL> for bool {
353 #[inline(always)]
354 fn from(variant: FSEL) -> Self {
355 variant as u8 != 0
356 }
357}
358pub type FSEL_R = crate::BitReader<FSEL>;
360impl FSEL_R {
361 #[inline(always)]
363 pub const fn variant(&self) -> FSEL {
364 match self.bits {
365 false => FSEL::SelectFlash1,
366 true => FSEL::SelectFlash2,
367 }
368 }
369 #[inline(always)]
371 pub fn is_select_flash1(&self) -> bool {
372 *self == FSEL::SelectFlash1
373 }
374 #[inline(always)]
376 pub fn is_select_flash2(&self) -> bool {
377 *self == FSEL::SelectFlash2
378 }
379}
380pub type FSEL_W<'a, REG> = crate::BitWriter<'a, REG, FSEL>;
382impl<'a, REG> FSEL_W<'a, REG>
383where
384 REG: crate::Writable + crate::RegisterSpec,
385{
386 #[inline(always)]
388 pub fn select_flash1(self) -> &'a mut crate::W<REG> {
389 self.variant(FSEL::SelectFlash1)
390 }
391 #[inline(always)]
393 pub fn select_flash2(self) -> &'a mut crate::W<REG> {
394 self.variant(FSEL::SelectFlash2)
395 }
396}
397pub type FTHRES_R = crate::FieldReader;
399pub type FTHRES_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
401#[cfg_attr(feature = "defmt", derive(defmt::Format))]
405#[derive(Clone, Copy, Debug, PartialEq, Eq)]
406pub enum TEIE {
407 Disabled = 0,
409 Enabled = 1,
411}
412impl From<TEIE> for bool {
413 #[inline(always)]
414 fn from(variant: TEIE) -> Self {
415 variant as u8 != 0
416 }
417}
418pub type TEIE_R = crate::BitReader<TEIE>;
420impl TEIE_R {
421 #[inline(always)]
423 pub const fn variant(&self) -> TEIE {
424 match self.bits {
425 false => TEIE::Disabled,
426 true => TEIE::Enabled,
427 }
428 }
429 #[inline(always)]
431 pub fn is_disabled(&self) -> bool {
432 *self == TEIE::Disabled
433 }
434 #[inline(always)]
436 pub fn is_enabled(&self) -> bool {
437 *self == TEIE::Enabled
438 }
439}
440pub type TEIE_W<'a, REG> = crate::BitWriter<'a, REG, TEIE>;
442impl<'a, REG> TEIE_W<'a, REG>
443where
444 REG: crate::Writable + crate::RegisterSpec,
445{
446 #[inline(always)]
448 pub fn disabled(self) -> &'a mut crate::W<REG> {
449 self.variant(TEIE::Disabled)
450 }
451 #[inline(always)]
453 pub fn enabled(self) -> &'a mut crate::W<REG> {
454 self.variant(TEIE::Enabled)
455 }
456}
457pub use TEIE_R as TCIE_R;
459pub use TEIE_R as FTIE_R;
461pub use TEIE_R as SMIE_R;
463pub use TEIE_R as TOIE_R;
465pub use TEIE_W as TCIE_W;
467pub use TEIE_W as FTIE_W;
469pub use TEIE_W as SMIE_W;
471pub use TEIE_W as TOIE_W;
473#[cfg_attr(feature = "defmt", derive(defmt::Format))]
477#[derive(Clone, Copy, Debug, PartialEq, Eq)]
478pub enum APMS {
479 NotStopOnMatch = 0,
481 StopOnMatch = 1,
483}
484impl From<APMS> for bool {
485 #[inline(always)]
486 fn from(variant: APMS) -> Self {
487 variant as u8 != 0
488 }
489}
490pub type APMS_R = crate::BitReader<APMS>;
492impl APMS_R {
493 #[inline(always)]
495 pub const fn variant(&self) -> APMS {
496 match self.bits {
497 false => APMS::NotStopOnMatch,
498 true => APMS::StopOnMatch,
499 }
500 }
501 #[inline(always)]
503 pub fn is_not_stop_on_match(&self) -> bool {
504 *self == APMS::NotStopOnMatch
505 }
506 #[inline(always)]
508 pub fn is_stop_on_match(&self) -> bool {
509 *self == APMS::StopOnMatch
510 }
511}
512pub type APMS_W<'a, REG> = crate::BitWriter<'a, REG, APMS>;
514impl<'a, REG> APMS_W<'a, REG>
515where
516 REG: crate::Writable + crate::RegisterSpec,
517{
518 #[inline(always)]
520 pub fn not_stop_on_match(self) -> &'a mut crate::W<REG> {
521 self.variant(APMS::NotStopOnMatch)
522 }
523 #[inline(always)]
525 pub fn stop_on_match(self) -> &'a mut crate::W<REG> {
526 self.variant(APMS::StopOnMatch)
527 }
528}
529#[cfg_attr(feature = "defmt", derive(defmt::Format))]
533#[derive(Clone, Copy, Debug, PartialEq, Eq)]
534pub enum PMM {
535 AndMatch = 0,
537 OrMatch = 1,
539}
540impl From<PMM> for bool {
541 #[inline(always)]
542 fn from(variant: PMM) -> Self {
543 variant as u8 != 0
544 }
545}
546pub type PMM_R = crate::BitReader<PMM>;
548impl PMM_R {
549 #[inline(always)]
551 pub const fn variant(&self) -> PMM {
552 match self.bits {
553 false => PMM::AndMatch,
554 true => PMM::OrMatch,
555 }
556 }
557 #[inline(always)]
559 pub fn is_and_match(&self) -> bool {
560 *self == PMM::AndMatch
561 }
562 #[inline(always)]
564 pub fn is_or_match(&self) -> bool {
565 *self == PMM::OrMatch
566 }
567}
568pub type PMM_W<'a, REG> = crate::BitWriter<'a, REG, PMM>;
570impl<'a, REG> PMM_W<'a, REG>
571where
572 REG: crate::Writable + crate::RegisterSpec,
573{
574 #[inline(always)]
576 pub fn and_match(self) -> &'a mut crate::W<REG> {
577 self.variant(PMM::AndMatch)
578 }
579 #[inline(always)]
581 pub fn or_match(self) -> &'a mut crate::W<REG> {
582 self.variant(PMM::OrMatch)
583 }
584}
585pub type PRESCALER_R = crate::FieldReader;
587pub type PRESCALER_W<'a, REG> = crate::FieldWriter<'a, REG, 8, u8, crate::Safe>;
589impl R {
590 #[inline(always)]
592 pub fn en(&self) -> EN_R {
593 EN_R::new((self.bits & 1) != 0)
594 }
595 #[inline(always)]
597 pub fn abort(&self) -> ABORT_R {
598 ABORT_R::new(((self.bits >> 1) & 1) != 0)
599 }
600 #[inline(always)]
602 pub fn dmaen(&self) -> DMAEN_R {
603 DMAEN_R::new(((self.bits >> 2) & 1) != 0)
604 }
605 #[inline(always)]
607 pub fn tcen(&self) -> TCEN_R {
608 TCEN_R::new(((self.bits >> 3) & 1) != 0)
609 }
610 #[inline(always)]
612 pub fn sshift(&self) -> SSHIFT_R {
613 SSHIFT_R::new(((self.bits >> 4) & 1) != 0)
614 }
615 #[inline(always)]
617 pub fn dfm(&self) -> DFM_R {
618 DFM_R::new(((self.bits >> 6) & 1) != 0)
619 }
620 #[inline(always)]
622 pub fn fsel(&self) -> FSEL_R {
623 FSEL_R::new(((self.bits >> 7) & 1) != 0)
624 }
625 #[inline(always)]
627 pub fn fthres(&self) -> FTHRES_R {
628 FTHRES_R::new(((self.bits >> 8) & 0x1f) as u8)
629 }
630 #[inline(always)]
632 pub fn teie(&self) -> TEIE_R {
633 TEIE_R::new(((self.bits >> 16) & 1) != 0)
634 }
635 #[inline(always)]
637 pub fn tcie(&self) -> TCIE_R {
638 TCIE_R::new(((self.bits >> 17) & 1) != 0)
639 }
640 #[inline(always)]
642 pub fn ftie(&self) -> FTIE_R {
643 FTIE_R::new(((self.bits >> 18) & 1) != 0)
644 }
645 #[inline(always)]
647 pub fn smie(&self) -> SMIE_R {
648 SMIE_R::new(((self.bits >> 19) & 1) != 0)
649 }
650 #[inline(always)]
652 pub fn toie(&self) -> TOIE_R {
653 TOIE_R::new(((self.bits >> 20) & 1) != 0)
654 }
655 #[inline(always)]
657 pub fn apms(&self) -> APMS_R {
658 APMS_R::new(((self.bits >> 22) & 1) != 0)
659 }
660 #[inline(always)]
662 pub fn pmm(&self) -> PMM_R {
663 PMM_R::new(((self.bits >> 23) & 1) != 0)
664 }
665 #[inline(always)]
667 pub fn prescaler(&self) -> PRESCALER_R {
668 PRESCALER_R::new(((self.bits >> 24) & 0xff) as u8)
669 }
670}
671impl core::fmt::Debug for R {
672 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
673 f.debug_struct("CR")
674 .field("prescaler", &self.prescaler())
675 .field("pmm", &self.pmm())
676 .field("apms", &self.apms())
677 .field("teie", &self.teie())
678 .field("toie", &self.toie())
679 .field("smie", &self.smie())
680 .field("ftie", &self.ftie())
681 .field("tcie", &self.tcie())
682 .field("fthres", &self.fthres())
683 .field("fsel", &self.fsel())
684 .field("dfm", &self.dfm())
685 .field("sshift", &self.sshift())
686 .field("tcen", &self.tcen())
687 .field("dmaen", &self.dmaen())
688 .field("abort", &self.abort())
689 .field("en", &self.en())
690 .finish()
691 }
692}
693impl W {
694 #[inline(always)]
696 pub fn en(&mut self) -> EN_W<CRrs> {
697 EN_W::new(self, 0)
698 }
699 #[inline(always)]
701 pub fn abort(&mut self) -> ABORT_W<CRrs> {
702 ABORT_W::new(self, 1)
703 }
704 #[inline(always)]
706 pub fn dmaen(&mut self) -> DMAEN_W<CRrs> {
707 DMAEN_W::new(self, 2)
708 }
709 #[inline(always)]
711 pub fn tcen(&mut self) -> TCEN_W<CRrs> {
712 TCEN_W::new(self, 3)
713 }
714 #[inline(always)]
716 pub fn sshift(&mut self) -> SSHIFT_W<CRrs> {
717 SSHIFT_W::new(self, 4)
718 }
719 #[inline(always)]
721 pub fn dfm(&mut self) -> DFM_W<CRrs> {
722 DFM_W::new(self, 6)
723 }
724 #[inline(always)]
726 pub fn fsel(&mut self) -> FSEL_W<CRrs> {
727 FSEL_W::new(self, 7)
728 }
729 #[inline(always)]
731 pub fn fthres(&mut self) -> FTHRES_W<CRrs> {
732 FTHRES_W::new(self, 8)
733 }
734 #[inline(always)]
736 pub fn teie(&mut self) -> TEIE_W<CRrs> {
737 TEIE_W::new(self, 16)
738 }
739 #[inline(always)]
741 pub fn tcie(&mut self) -> TCIE_W<CRrs> {
742 TCIE_W::new(self, 17)
743 }
744 #[inline(always)]
746 pub fn ftie(&mut self) -> FTIE_W<CRrs> {
747 FTIE_W::new(self, 18)
748 }
749 #[inline(always)]
751 pub fn smie(&mut self) -> SMIE_W<CRrs> {
752 SMIE_W::new(self, 19)
753 }
754 #[inline(always)]
756 pub fn toie(&mut self) -> TOIE_W<CRrs> {
757 TOIE_W::new(self, 20)
758 }
759 #[inline(always)]
761 pub fn apms(&mut self) -> APMS_W<CRrs> {
762 APMS_W::new(self, 22)
763 }
764 #[inline(always)]
766 pub fn pmm(&mut self) -> PMM_W<CRrs> {
767 PMM_W::new(self, 23)
768 }
769 #[inline(always)]
771 pub fn prescaler(&mut self) -> PRESCALER_W<CRrs> {
772 PRESCALER_W::new(self, 24)
773 }
774}
775pub struct CRrs;
781impl crate::RegisterSpec for CRrs {
782 type Ux = u32;
783}
784impl crate::Readable for CRrs {}
786impl crate::Writable for CRrs {
788 type Safety = crate::Unsafe;
789}
790impl crate::Resettable for CRrs {}