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)]
10#[repr(u8)]
11pub enum WUCKSEL {
12 Div16 = 0,
14 Div8 = 1,
16 Div4 = 2,
18 Div2 = 3,
20 ClockSpare = 4,
22 ClockSpareWithOffset = 6,
24}
25impl From<WUCKSEL> for u8 {
26 #[inline(always)]
27 fn from(variant: WUCKSEL) -> Self {
28 variant as _
29 }
30}
31impl crate::FieldSpec for WUCKSEL {
32 type Ux = u8;
33}
34impl crate::IsEnum for WUCKSEL {}
35pub type WUCKSEL_R = crate::FieldReader<WUCKSEL>;
37impl WUCKSEL_R {
38 #[inline(always)]
40 pub const fn variant(&self) -> Option<WUCKSEL> {
41 match self.bits {
42 0 => Some(WUCKSEL::Div16),
43 1 => Some(WUCKSEL::Div8),
44 2 => Some(WUCKSEL::Div4),
45 3 => Some(WUCKSEL::Div2),
46 4 => Some(WUCKSEL::ClockSpare),
47 6 => Some(WUCKSEL::ClockSpareWithOffset),
48 _ => None,
49 }
50 }
51 #[inline(always)]
53 pub fn is_div16(&self) -> bool {
54 *self == WUCKSEL::Div16
55 }
56 #[inline(always)]
58 pub fn is_div8(&self) -> bool {
59 *self == WUCKSEL::Div8
60 }
61 #[inline(always)]
63 pub fn is_div4(&self) -> bool {
64 *self == WUCKSEL::Div4
65 }
66 #[inline(always)]
68 pub fn is_div2(&self) -> bool {
69 *self == WUCKSEL::Div2
70 }
71 #[inline(always)]
73 pub fn is_clock_spare(&self) -> bool {
74 *self == WUCKSEL::ClockSpare
75 }
76 #[inline(always)]
78 pub fn is_clock_spare_with_offset(&self) -> bool {
79 *self == WUCKSEL::ClockSpareWithOffset
80 }
81}
82pub type WUCKSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, WUCKSEL>;
84impl<'a, REG> WUCKSEL_W<'a, REG>
85where
86 REG: crate::Writable + crate::RegisterSpec,
87 REG::Ux: From<u8>,
88{
89 #[inline(always)]
91 pub fn div16(self) -> &'a mut crate::W<REG> {
92 self.variant(WUCKSEL::Div16)
93 }
94 #[inline(always)]
96 pub fn div8(self) -> &'a mut crate::W<REG> {
97 self.variant(WUCKSEL::Div8)
98 }
99 #[inline(always)]
101 pub fn div4(self) -> &'a mut crate::W<REG> {
102 self.variant(WUCKSEL::Div4)
103 }
104 #[inline(always)]
106 pub fn div2(self) -> &'a mut crate::W<REG> {
107 self.variant(WUCKSEL::Div2)
108 }
109 #[inline(always)]
111 pub fn clock_spare(self) -> &'a mut crate::W<REG> {
112 self.variant(WUCKSEL::ClockSpare)
113 }
114 #[inline(always)]
116 pub fn clock_spare_with_offset(self) -> &'a mut crate::W<REG> {
117 self.variant(WUCKSEL::ClockSpareWithOffset)
118 }
119}
120#[cfg_attr(feature = "defmt", derive(defmt::Format))]
124#[derive(Clone, Copy, Debug, PartialEq, Eq)]
125pub enum TSEDGE {
126 RisingEdge = 0,
128 FallingEdge = 1,
130}
131impl From<TSEDGE> for bool {
132 #[inline(always)]
133 fn from(variant: TSEDGE) -> Self {
134 variant as u8 != 0
135 }
136}
137pub type TSEDGE_R = crate::BitReader<TSEDGE>;
139impl TSEDGE_R {
140 #[inline(always)]
142 pub const fn variant(&self) -> TSEDGE {
143 match self.bits {
144 false => TSEDGE::RisingEdge,
145 true => TSEDGE::FallingEdge,
146 }
147 }
148 #[inline(always)]
150 pub fn is_rising_edge(&self) -> bool {
151 *self == TSEDGE::RisingEdge
152 }
153 #[inline(always)]
155 pub fn is_falling_edge(&self) -> bool {
156 *self == TSEDGE::FallingEdge
157 }
158}
159pub type TSEDGE_W<'a, REG> = crate::BitWriter<'a, REG, TSEDGE>;
161impl<'a, REG> TSEDGE_W<'a, REG>
162where
163 REG: crate::Writable + crate::RegisterSpec,
164{
165 #[inline(always)]
167 pub fn rising_edge(self) -> &'a mut crate::W<REG> {
168 self.variant(TSEDGE::RisingEdge)
169 }
170 #[inline(always)]
172 pub fn falling_edge(self) -> &'a mut crate::W<REG> {
173 self.variant(TSEDGE::FallingEdge)
174 }
175}
176#[cfg_attr(feature = "defmt", derive(defmt::Format))]
180#[derive(Clone, Copy, Debug, PartialEq, Eq)]
181pub enum REFCKON {
182 Disabled = 0,
184 Enabled = 1,
186}
187impl From<REFCKON> for bool {
188 #[inline(always)]
189 fn from(variant: REFCKON) -> Self {
190 variant as u8 != 0
191 }
192}
193pub type REFCKON_R = crate::BitReader<REFCKON>;
195impl REFCKON_R {
196 #[inline(always)]
198 pub const fn variant(&self) -> REFCKON {
199 match self.bits {
200 false => REFCKON::Disabled,
201 true => REFCKON::Enabled,
202 }
203 }
204 #[inline(always)]
206 pub fn is_disabled(&self) -> bool {
207 *self == REFCKON::Disabled
208 }
209 #[inline(always)]
211 pub fn is_enabled(&self) -> bool {
212 *self == REFCKON::Enabled
213 }
214}
215pub type REFCKON_W<'a, REG> = crate::BitWriter<'a, REG, REFCKON>;
217impl<'a, REG> REFCKON_W<'a, REG>
218where
219 REG: crate::Writable + crate::RegisterSpec,
220{
221 #[inline(always)]
223 pub fn disabled(self) -> &'a mut crate::W<REG> {
224 self.variant(REFCKON::Disabled)
225 }
226 #[inline(always)]
228 pub fn enabled(self) -> &'a mut crate::W<REG> {
229 self.variant(REFCKON::Enabled)
230 }
231}
232#[cfg_attr(feature = "defmt", derive(defmt::Format))]
236#[derive(Clone, Copy, Debug, PartialEq, Eq)]
237pub enum BYPSHAD {
238 ShadowReg = 0,
240 BypassShadowReg = 1,
242}
243impl From<BYPSHAD> for bool {
244 #[inline(always)]
245 fn from(variant: BYPSHAD) -> Self {
246 variant as u8 != 0
247 }
248}
249pub type BYPSHAD_R = crate::BitReader<BYPSHAD>;
251impl BYPSHAD_R {
252 #[inline(always)]
254 pub const fn variant(&self) -> BYPSHAD {
255 match self.bits {
256 false => BYPSHAD::ShadowReg,
257 true => BYPSHAD::BypassShadowReg,
258 }
259 }
260 #[inline(always)]
262 pub fn is_shadow_reg(&self) -> bool {
263 *self == BYPSHAD::ShadowReg
264 }
265 #[inline(always)]
267 pub fn is_bypass_shadow_reg(&self) -> bool {
268 *self == BYPSHAD::BypassShadowReg
269 }
270}
271pub type BYPSHAD_W<'a, REG> = crate::BitWriter<'a, REG, BYPSHAD>;
273impl<'a, REG> BYPSHAD_W<'a, REG>
274where
275 REG: crate::Writable + crate::RegisterSpec,
276{
277 #[inline(always)]
279 pub fn shadow_reg(self) -> &'a mut crate::W<REG> {
280 self.variant(BYPSHAD::ShadowReg)
281 }
282 #[inline(always)]
284 pub fn bypass_shadow_reg(self) -> &'a mut crate::W<REG> {
285 self.variant(BYPSHAD::BypassShadowReg)
286 }
287}
288#[cfg_attr(feature = "defmt", derive(defmt::Format))]
292#[derive(Clone, Copy, Debug, PartialEq, Eq)]
293pub enum FMT {
294 TwentyFourHour = 0,
296 AmPm = 1,
298}
299impl From<FMT> for bool {
300 #[inline(always)]
301 fn from(variant: FMT) -> Self {
302 variant as u8 != 0
303 }
304}
305pub type FMT_R = crate::BitReader<FMT>;
307impl FMT_R {
308 #[inline(always)]
310 pub const fn variant(&self) -> FMT {
311 match self.bits {
312 false => FMT::TwentyFourHour,
313 true => FMT::AmPm,
314 }
315 }
316 #[inline(always)]
318 pub fn is_twenty_four_hour(&self) -> bool {
319 *self == FMT::TwentyFourHour
320 }
321 #[inline(always)]
323 pub fn is_am_pm(&self) -> bool {
324 *self == FMT::AmPm
325 }
326}
327pub type FMT_W<'a, REG> = crate::BitWriter<'a, REG, FMT>;
329impl<'a, REG> FMT_W<'a, REG>
330where
331 REG: crate::Writable + crate::RegisterSpec,
332{
333 #[inline(always)]
335 pub fn twenty_four_hour(self) -> &'a mut crate::W<REG> {
336 self.variant(FMT::TwentyFourHour)
337 }
338 #[inline(always)]
340 pub fn am_pm(self) -> &'a mut crate::W<REG> {
341 self.variant(FMT::AmPm)
342 }
343}
344#[cfg_attr(feature = "defmt", derive(defmt::Format))]
348#[derive(Clone, Copy, Debug, PartialEq, Eq)]
349pub enum ALRAE {
350 Disabled = 0,
352 Enabled = 1,
354}
355impl From<ALRAE> for bool {
356 #[inline(always)]
357 fn from(variant: ALRAE) -> Self {
358 variant as u8 != 0
359 }
360}
361pub type ALRE_R = crate::BitReader<ALRAE>;
363impl ALRE_R {
364 #[inline(always)]
366 pub const fn variant(&self) -> ALRAE {
367 match self.bits {
368 false => ALRAE::Disabled,
369 true => ALRAE::Enabled,
370 }
371 }
372 #[inline(always)]
374 pub fn is_disabled(&self) -> bool {
375 *self == ALRAE::Disabled
376 }
377 #[inline(always)]
379 pub fn is_enabled(&self) -> bool {
380 *self == ALRAE::Enabled
381 }
382}
383pub type ALRE_W<'a, REG> = crate::BitWriter<'a, REG, ALRAE>;
385impl<'a, REG> ALRE_W<'a, REG>
386where
387 REG: crate::Writable + crate::RegisterSpec,
388{
389 #[inline(always)]
391 pub fn disabled(self) -> &'a mut crate::W<REG> {
392 self.variant(ALRAE::Disabled)
393 }
394 #[inline(always)]
396 pub fn enabled(self) -> &'a mut crate::W<REG> {
397 self.variant(ALRAE::Enabled)
398 }
399}
400#[cfg_attr(feature = "defmt", derive(defmt::Format))]
404#[derive(Clone, Copy, Debug, PartialEq, Eq)]
405pub enum WUTE {
406 Disabled = 0,
408 Enabled = 1,
410}
411impl From<WUTE> for bool {
412 #[inline(always)]
413 fn from(variant: WUTE) -> Self {
414 variant as u8 != 0
415 }
416}
417pub type WUTE_R = crate::BitReader<WUTE>;
419impl WUTE_R {
420 #[inline(always)]
422 pub const fn variant(&self) -> WUTE {
423 match self.bits {
424 false => WUTE::Disabled,
425 true => WUTE::Enabled,
426 }
427 }
428 #[inline(always)]
430 pub fn is_disabled(&self) -> bool {
431 *self == WUTE::Disabled
432 }
433 #[inline(always)]
435 pub fn is_enabled(&self) -> bool {
436 *self == WUTE::Enabled
437 }
438}
439pub type WUTE_W<'a, REG> = crate::BitWriter<'a, REG, WUTE>;
441impl<'a, REG> WUTE_W<'a, REG>
442where
443 REG: crate::Writable + crate::RegisterSpec,
444{
445 #[inline(always)]
447 pub fn disabled(self) -> &'a mut crate::W<REG> {
448 self.variant(WUTE::Disabled)
449 }
450 #[inline(always)]
452 pub fn enabled(self) -> &'a mut crate::W<REG> {
453 self.variant(WUTE::Enabled)
454 }
455}
456#[cfg_attr(feature = "defmt", derive(defmt::Format))]
460#[derive(Clone, Copy, Debug, PartialEq, Eq)]
461pub enum TSE {
462 Disabled = 0,
464 Enabled = 1,
466}
467impl From<TSE> for bool {
468 #[inline(always)]
469 fn from(variant: TSE) -> Self {
470 variant as u8 != 0
471 }
472}
473pub type TSE_R = crate::BitReader<TSE>;
475impl TSE_R {
476 #[inline(always)]
478 pub const fn variant(&self) -> TSE {
479 match self.bits {
480 false => TSE::Disabled,
481 true => TSE::Enabled,
482 }
483 }
484 #[inline(always)]
486 pub fn is_disabled(&self) -> bool {
487 *self == TSE::Disabled
488 }
489 #[inline(always)]
491 pub fn is_enabled(&self) -> bool {
492 *self == TSE::Enabled
493 }
494}
495pub type TSE_W<'a, REG> = crate::BitWriter<'a, REG, TSE>;
497impl<'a, REG> TSE_W<'a, REG>
498where
499 REG: crate::Writable + crate::RegisterSpec,
500{
501 #[inline(always)]
503 pub fn disabled(self) -> &'a mut crate::W<REG> {
504 self.variant(TSE::Disabled)
505 }
506 #[inline(always)]
508 pub fn enabled(self) -> &'a mut crate::W<REG> {
509 self.variant(TSE::Enabled)
510 }
511}
512#[cfg_attr(feature = "defmt", derive(defmt::Format))]
516#[derive(Clone, Copy, Debug, PartialEq, Eq)]
517pub enum ALRAIE {
518 Disabled = 0,
520 Enabled = 1,
522}
523impl From<ALRAIE> for bool {
524 #[inline(always)]
525 fn from(variant: ALRAIE) -> Self {
526 variant as u8 != 0
527 }
528}
529pub type ALRIE_R = crate::BitReader<ALRAIE>;
531impl ALRIE_R {
532 #[inline(always)]
534 pub const fn variant(&self) -> ALRAIE {
535 match self.bits {
536 false => ALRAIE::Disabled,
537 true => ALRAIE::Enabled,
538 }
539 }
540 #[inline(always)]
542 pub fn is_disabled(&self) -> bool {
543 *self == ALRAIE::Disabled
544 }
545 #[inline(always)]
547 pub fn is_enabled(&self) -> bool {
548 *self == ALRAIE::Enabled
549 }
550}
551pub type ALRIE_W<'a, REG> = crate::BitWriter<'a, REG, ALRAIE>;
553impl<'a, REG> ALRIE_W<'a, REG>
554where
555 REG: crate::Writable + crate::RegisterSpec,
556{
557 #[inline(always)]
559 pub fn disabled(self) -> &'a mut crate::W<REG> {
560 self.variant(ALRAIE::Disabled)
561 }
562 #[inline(always)]
564 pub fn enabled(self) -> &'a mut crate::W<REG> {
565 self.variant(ALRAIE::Enabled)
566 }
567}
568#[cfg_attr(feature = "defmt", derive(defmt::Format))]
572#[derive(Clone, Copy, Debug, PartialEq, Eq)]
573pub enum WUTIE {
574 Disabled = 0,
576 Enabled = 1,
578}
579impl From<WUTIE> for bool {
580 #[inline(always)]
581 fn from(variant: WUTIE) -> Self {
582 variant as u8 != 0
583 }
584}
585pub type WUTIE_R = crate::BitReader<WUTIE>;
587impl WUTIE_R {
588 #[inline(always)]
590 pub const fn variant(&self) -> WUTIE {
591 match self.bits {
592 false => WUTIE::Disabled,
593 true => WUTIE::Enabled,
594 }
595 }
596 #[inline(always)]
598 pub fn is_disabled(&self) -> bool {
599 *self == WUTIE::Disabled
600 }
601 #[inline(always)]
603 pub fn is_enabled(&self) -> bool {
604 *self == WUTIE::Enabled
605 }
606}
607pub type WUTIE_W<'a, REG> = crate::BitWriter<'a, REG, WUTIE>;
609impl<'a, REG> WUTIE_W<'a, REG>
610where
611 REG: crate::Writable + crate::RegisterSpec,
612{
613 #[inline(always)]
615 pub fn disabled(self) -> &'a mut crate::W<REG> {
616 self.variant(WUTIE::Disabled)
617 }
618 #[inline(always)]
620 pub fn enabled(self) -> &'a mut crate::W<REG> {
621 self.variant(WUTIE::Enabled)
622 }
623}
624#[cfg_attr(feature = "defmt", derive(defmt::Format))]
628#[derive(Clone, Copy, Debug, PartialEq, Eq)]
629pub enum TSIE {
630 Disabled = 0,
632 Enabled = 1,
634}
635impl From<TSIE> for bool {
636 #[inline(always)]
637 fn from(variant: TSIE) -> Self {
638 variant as u8 != 0
639 }
640}
641pub type TSIE_R = crate::BitReader<TSIE>;
643impl TSIE_R {
644 #[inline(always)]
646 pub const fn variant(&self) -> TSIE {
647 match self.bits {
648 false => TSIE::Disabled,
649 true => TSIE::Enabled,
650 }
651 }
652 #[inline(always)]
654 pub fn is_disabled(&self) -> bool {
655 *self == TSIE::Disabled
656 }
657 #[inline(always)]
659 pub fn is_enabled(&self) -> bool {
660 *self == TSIE::Enabled
661 }
662}
663pub type TSIE_W<'a, REG> = crate::BitWriter<'a, REG, TSIE>;
665impl<'a, REG> TSIE_W<'a, REG>
666where
667 REG: crate::Writable + crate::RegisterSpec,
668{
669 #[inline(always)]
671 pub fn disabled(self) -> &'a mut crate::W<REG> {
672 self.variant(TSIE::Disabled)
673 }
674 #[inline(always)]
676 pub fn enabled(self) -> &'a mut crate::W<REG> {
677 self.variant(TSIE::Enabled)
678 }
679}
680#[cfg_attr(feature = "defmt", derive(defmt::Format))]
684#[derive(Clone, Copy, Debug, PartialEq, Eq)]
685pub enum ADD1HW {
686 Add1 = 1,
688}
689impl From<ADD1HW> for bool {
690 #[inline(always)]
691 fn from(variant: ADD1HW) -> Self {
692 variant as u8 != 0
693 }
694}
695pub type ADD1H_R = crate::BitReader<ADD1HW>;
697impl ADD1H_R {
698 #[inline(always)]
700 pub const fn variant(&self) -> Option<ADD1HW> {
701 match self.bits {
702 true => Some(ADD1HW::Add1),
703 _ => None,
704 }
705 }
706 #[inline(always)]
708 pub fn is_add1(&self) -> bool {
709 *self == ADD1HW::Add1
710 }
711}
712pub type ADD1H_W<'a, REG> = crate::BitWriter<'a, REG, ADD1HW>;
714impl<'a, REG> ADD1H_W<'a, REG>
715where
716 REG: crate::Writable + crate::RegisterSpec,
717{
718 #[inline(always)]
720 pub fn add1(self) -> &'a mut crate::W<REG> {
721 self.variant(ADD1HW::Add1)
722 }
723}
724#[cfg_attr(feature = "defmt", derive(defmt::Format))]
728#[derive(Clone, Copy, Debug, PartialEq, Eq)]
729pub enum SUB1HW {
730 Sub1 = 1,
732}
733impl From<SUB1HW> for bool {
734 #[inline(always)]
735 fn from(variant: SUB1HW) -> Self {
736 variant as u8 != 0
737 }
738}
739pub type SUB1H_R = crate::BitReader<SUB1HW>;
741impl SUB1H_R {
742 #[inline(always)]
744 pub const fn variant(&self) -> Option<SUB1HW> {
745 match self.bits {
746 true => Some(SUB1HW::Sub1),
747 _ => None,
748 }
749 }
750 #[inline(always)]
752 pub fn is_sub1(&self) -> bool {
753 *self == SUB1HW::Sub1
754 }
755}
756pub type SUB1H_W<'a, REG> = crate::BitWriter<'a, REG, SUB1HW>;
758impl<'a, REG> SUB1H_W<'a, REG>
759where
760 REG: crate::Writable + crate::RegisterSpec,
761{
762 #[inline(always)]
764 pub fn sub1(self) -> &'a mut crate::W<REG> {
765 self.variant(SUB1HW::Sub1)
766 }
767}
768#[cfg_attr(feature = "defmt", derive(defmt::Format))]
772#[derive(Clone, Copy, Debug, PartialEq, Eq)]
773pub enum BKP {
774 DstNotChanged = 0,
776 DstChanged = 1,
778}
779impl From<BKP> for bool {
780 #[inline(always)]
781 fn from(variant: BKP) -> Self {
782 variant as u8 != 0
783 }
784}
785pub type BKP_R = crate::BitReader<BKP>;
787impl BKP_R {
788 #[inline(always)]
790 pub const fn variant(&self) -> BKP {
791 match self.bits {
792 false => BKP::DstNotChanged,
793 true => BKP::DstChanged,
794 }
795 }
796 #[inline(always)]
798 pub fn is_dst_not_changed(&self) -> bool {
799 *self == BKP::DstNotChanged
800 }
801 #[inline(always)]
803 pub fn is_dst_changed(&self) -> bool {
804 *self == BKP::DstChanged
805 }
806}
807pub type BKP_W<'a, REG> = crate::BitWriter<'a, REG, BKP>;
809impl<'a, REG> BKP_W<'a, REG>
810where
811 REG: crate::Writable + crate::RegisterSpec,
812{
813 #[inline(always)]
815 pub fn dst_not_changed(self) -> &'a mut crate::W<REG> {
816 self.variant(BKP::DstNotChanged)
817 }
818 #[inline(always)]
820 pub fn dst_changed(self) -> &'a mut crate::W<REG> {
821 self.variant(BKP::DstChanged)
822 }
823}
824#[cfg_attr(feature = "defmt", derive(defmt::Format))]
828#[derive(Clone, Copy, Debug, PartialEq, Eq)]
829pub enum COSEL {
830 CalFreq512hz = 0,
832 CalFreq1hz = 1,
834}
835impl From<COSEL> for bool {
836 #[inline(always)]
837 fn from(variant: COSEL) -> Self {
838 variant as u8 != 0
839 }
840}
841pub type COSEL_R = crate::BitReader<COSEL>;
843impl COSEL_R {
844 #[inline(always)]
846 pub const fn variant(&self) -> COSEL {
847 match self.bits {
848 false => COSEL::CalFreq512hz,
849 true => COSEL::CalFreq1hz,
850 }
851 }
852 #[inline(always)]
854 pub fn is_cal_freq_512hz(&self) -> bool {
855 *self == COSEL::CalFreq512hz
856 }
857 #[inline(always)]
859 pub fn is_cal_freq_1hz(&self) -> bool {
860 *self == COSEL::CalFreq1hz
861 }
862}
863pub type COSEL_W<'a, REG> = crate::BitWriter<'a, REG, COSEL>;
865impl<'a, REG> COSEL_W<'a, REG>
866where
867 REG: crate::Writable + crate::RegisterSpec,
868{
869 #[inline(always)]
871 pub fn cal_freq_512hz(self) -> &'a mut crate::W<REG> {
872 self.variant(COSEL::CalFreq512hz)
873 }
874 #[inline(always)]
876 pub fn cal_freq_1hz(self) -> &'a mut crate::W<REG> {
877 self.variant(COSEL::CalFreq1hz)
878 }
879}
880#[cfg_attr(feature = "defmt", derive(defmt::Format))]
884#[derive(Clone, Copy, Debug, PartialEq, Eq)]
885pub enum POL {
886 High = 0,
888 Low = 1,
890}
891impl From<POL> for bool {
892 #[inline(always)]
893 fn from(variant: POL) -> Self {
894 variant as u8 != 0
895 }
896}
897pub type POL_R = crate::BitReader<POL>;
899impl POL_R {
900 #[inline(always)]
902 pub const fn variant(&self) -> POL {
903 match self.bits {
904 false => POL::High,
905 true => POL::Low,
906 }
907 }
908 #[inline(always)]
910 pub fn is_high(&self) -> bool {
911 *self == POL::High
912 }
913 #[inline(always)]
915 pub fn is_low(&self) -> bool {
916 *self == POL::Low
917 }
918}
919pub type POL_W<'a, REG> = crate::BitWriter<'a, REG, POL>;
921impl<'a, REG> POL_W<'a, REG>
922where
923 REG: crate::Writable + crate::RegisterSpec,
924{
925 #[inline(always)]
927 pub fn high(self) -> &'a mut crate::W<REG> {
928 self.variant(POL::High)
929 }
930 #[inline(always)]
932 pub fn low(self) -> &'a mut crate::W<REG> {
933 self.variant(POL::Low)
934 }
935}
936#[cfg_attr(feature = "defmt", derive(defmt::Format))]
940#[derive(Clone, Copy, Debug, PartialEq, Eq)]
941#[repr(u8)]
942pub enum OSEL {
943 Disabled = 0,
945 AlarmA = 1,
947 AlarmB = 2,
949 Wakeup = 3,
951}
952impl From<OSEL> for u8 {
953 #[inline(always)]
954 fn from(variant: OSEL) -> Self {
955 variant as _
956 }
957}
958impl crate::FieldSpec for OSEL {
959 type Ux = u8;
960}
961impl crate::IsEnum for OSEL {}
962pub type OSEL_R = crate::FieldReader<OSEL>;
964impl OSEL_R {
965 #[inline(always)]
967 pub const fn variant(&self) -> OSEL {
968 match self.bits {
969 0 => OSEL::Disabled,
970 1 => OSEL::AlarmA,
971 2 => OSEL::AlarmB,
972 3 => OSEL::Wakeup,
973 _ => unreachable!(),
974 }
975 }
976 #[inline(always)]
978 pub fn is_disabled(&self) -> bool {
979 *self == OSEL::Disabled
980 }
981 #[inline(always)]
983 pub fn is_alarm_a(&self) -> bool {
984 *self == OSEL::AlarmA
985 }
986 #[inline(always)]
988 pub fn is_alarm_b(&self) -> bool {
989 *self == OSEL::AlarmB
990 }
991 #[inline(always)]
993 pub fn is_wakeup(&self) -> bool {
994 *self == OSEL::Wakeup
995 }
996}
997pub type OSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, OSEL, crate::Safe>;
999impl<'a, REG> OSEL_W<'a, REG>
1000where
1001 REG: crate::Writable + crate::RegisterSpec,
1002 REG::Ux: From<u8>,
1003{
1004 #[inline(always)]
1006 pub fn disabled(self) -> &'a mut crate::W<REG> {
1007 self.variant(OSEL::Disabled)
1008 }
1009 #[inline(always)]
1011 pub fn alarm_a(self) -> &'a mut crate::W<REG> {
1012 self.variant(OSEL::AlarmA)
1013 }
1014 #[inline(always)]
1016 pub fn alarm_b(self) -> &'a mut crate::W<REG> {
1017 self.variant(OSEL::AlarmB)
1018 }
1019 #[inline(always)]
1021 pub fn wakeup(self) -> &'a mut crate::W<REG> {
1022 self.variant(OSEL::Wakeup)
1023 }
1024}
1025#[cfg_attr(feature = "defmt", derive(defmt::Format))]
1029#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1030pub enum COE {
1031 Disabled = 0,
1033 Enabled = 1,
1035}
1036impl From<COE> for bool {
1037 #[inline(always)]
1038 fn from(variant: COE) -> Self {
1039 variant as u8 != 0
1040 }
1041}
1042pub type COE_R = crate::BitReader<COE>;
1044impl COE_R {
1045 #[inline(always)]
1047 pub const fn variant(&self) -> COE {
1048 match self.bits {
1049 false => COE::Disabled,
1050 true => COE::Enabled,
1051 }
1052 }
1053 #[inline(always)]
1055 pub fn is_disabled(&self) -> bool {
1056 *self == COE::Disabled
1057 }
1058 #[inline(always)]
1060 pub fn is_enabled(&self) -> bool {
1061 *self == COE::Enabled
1062 }
1063}
1064pub type COE_W<'a, REG> = crate::BitWriter<'a, REG, COE>;
1066impl<'a, REG> COE_W<'a, REG>
1067where
1068 REG: crate::Writable + crate::RegisterSpec,
1069{
1070 #[inline(always)]
1072 pub fn disabled(self) -> &'a mut crate::W<REG> {
1073 self.variant(COE::Disabled)
1074 }
1075 #[inline(always)]
1077 pub fn enabled(self) -> &'a mut crate::W<REG> {
1078 self.variant(COE::Enabled)
1079 }
1080}
1081pub type ITSE_R = crate::BitReader;
1083pub type ITSE_W<'a, REG> = crate::BitWriter<'a, REG>;
1085impl R {
1086 #[inline(always)]
1088 pub fn wucksel(&self) -> WUCKSEL_R {
1089 WUCKSEL_R::new((self.bits & 7) as u8)
1090 }
1091 #[inline(always)]
1093 pub fn tsedge(&self) -> TSEDGE_R {
1094 TSEDGE_R::new(((self.bits >> 3) & 1) != 0)
1095 }
1096 #[inline(always)]
1098 pub fn refckon(&self) -> REFCKON_R {
1099 REFCKON_R::new(((self.bits >> 4) & 1) != 0)
1100 }
1101 #[inline(always)]
1103 pub fn bypshad(&self) -> BYPSHAD_R {
1104 BYPSHAD_R::new(((self.bits >> 5) & 1) != 0)
1105 }
1106 #[inline(always)]
1108 pub fn fmt(&self) -> FMT_R {
1109 FMT_R::new(((self.bits >> 6) & 1) != 0)
1110 }
1111 #[inline(always)]
1115 pub fn alre(&self, n: u8) -> ALRE_R {
1116 #[allow(clippy::no_effect)]
1117 [(); 2][n as usize];
1118 ALRE_R::new(((self.bits >> (n + 8)) & 1) != 0)
1119 }
1120 #[inline(always)]
1123 pub fn alre_iter(&self) -> impl Iterator<Item = ALRE_R> + '_ {
1124 (0..2).map(move |n| ALRE_R::new(((self.bits >> (n + 8)) & 1) != 0))
1125 }
1126 #[inline(always)]
1128 pub fn alrae(&self) -> ALRE_R {
1129 ALRE_R::new(((self.bits >> 8) & 1) != 0)
1130 }
1131 #[inline(always)]
1133 pub fn alrbe(&self) -> ALRE_R {
1134 ALRE_R::new(((self.bits >> 9) & 1) != 0)
1135 }
1136 #[inline(always)]
1138 pub fn wute(&self) -> WUTE_R {
1139 WUTE_R::new(((self.bits >> 10) & 1) != 0)
1140 }
1141 #[inline(always)]
1143 pub fn tse(&self) -> TSE_R {
1144 TSE_R::new(((self.bits >> 11) & 1) != 0)
1145 }
1146 #[inline(always)]
1150 pub fn alrie(&self, n: u8) -> ALRIE_R {
1151 #[allow(clippy::no_effect)]
1152 [(); 2][n as usize];
1153 ALRIE_R::new(((self.bits >> (n + 12)) & 1) != 0)
1154 }
1155 #[inline(always)]
1158 pub fn alrie_iter(&self) -> impl Iterator<Item = ALRIE_R> + '_ {
1159 (0..2).map(move |n| ALRIE_R::new(((self.bits >> (n + 12)) & 1) != 0))
1160 }
1161 #[inline(always)]
1163 pub fn alraie(&self) -> ALRIE_R {
1164 ALRIE_R::new(((self.bits >> 12) & 1) != 0)
1165 }
1166 #[inline(always)]
1168 pub fn alrbie(&self) -> ALRIE_R {
1169 ALRIE_R::new(((self.bits >> 13) & 1) != 0)
1170 }
1171 #[inline(always)]
1173 pub fn wutie(&self) -> WUTIE_R {
1174 WUTIE_R::new(((self.bits >> 14) & 1) != 0)
1175 }
1176 #[inline(always)]
1178 pub fn tsie(&self) -> TSIE_R {
1179 TSIE_R::new(((self.bits >> 15) & 1) != 0)
1180 }
1181 #[inline(always)]
1183 pub fn add1h(&self) -> ADD1H_R {
1184 ADD1H_R::new(((self.bits >> 16) & 1) != 0)
1185 }
1186 #[inline(always)]
1188 pub fn sub1h(&self) -> SUB1H_R {
1189 SUB1H_R::new(((self.bits >> 17) & 1) != 0)
1190 }
1191 #[inline(always)]
1193 pub fn bkp(&self) -> BKP_R {
1194 BKP_R::new(((self.bits >> 18) & 1) != 0)
1195 }
1196 #[inline(always)]
1198 pub fn cosel(&self) -> COSEL_R {
1199 COSEL_R::new(((self.bits >> 19) & 1) != 0)
1200 }
1201 #[inline(always)]
1203 pub fn pol(&self) -> POL_R {
1204 POL_R::new(((self.bits >> 20) & 1) != 0)
1205 }
1206 #[inline(always)]
1208 pub fn osel(&self) -> OSEL_R {
1209 OSEL_R::new(((self.bits >> 21) & 3) as u8)
1210 }
1211 #[inline(always)]
1213 pub fn coe(&self) -> COE_R {
1214 COE_R::new(((self.bits >> 23) & 1) != 0)
1215 }
1216 #[inline(always)]
1218 pub fn itse(&self) -> ITSE_R {
1219 ITSE_R::new(((self.bits >> 24) & 1) != 0)
1220 }
1221}
1222impl core::fmt::Debug for R {
1223 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1224 f.debug_struct("CR")
1225 .field("wucksel", &self.wucksel())
1226 .field("tsedge", &self.tsedge())
1227 .field("refckon", &self.refckon())
1228 .field("bypshad", &self.bypshad())
1229 .field("fmt", &self.fmt())
1230 .field("alrae", &self.alrae())
1231 .field("alrbe", &self.alrbe())
1232 .field("wute", &self.wute())
1233 .field("tse", &self.tse())
1234 .field("alraie", &self.alraie())
1235 .field("alrbie", &self.alrbie())
1236 .field("wutie", &self.wutie())
1237 .field("tsie", &self.tsie())
1238 .field("add1h", &self.add1h())
1239 .field("sub1h", &self.sub1h())
1240 .field("bkp", &self.bkp())
1241 .field("cosel", &self.cosel())
1242 .field("pol", &self.pol())
1243 .field("osel", &self.osel())
1244 .field("coe", &self.coe())
1245 .field("itse", &self.itse())
1246 .finish()
1247 }
1248}
1249impl W {
1250 #[inline(always)]
1252 pub fn wucksel(&mut self) -> WUCKSEL_W<CRrs> {
1253 WUCKSEL_W::new(self, 0)
1254 }
1255 #[inline(always)]
1257 pub fn tsedge(&mut self) -> TSEDGE_W<CRrs> {
1258 TSEDGE_W::new(self, 3)
1259 }
1260 #[inline(always)]
1262 pub fn refckon(&mut self) -> REFCKON_W<CRrs> {
1263 REFCKON_W::new(self, 4)
1264 }
1265 #[inline(always)]
1267 pub fn bypshad(&mut self) -> BYPSHAD_W<CRrs> {
1268 BYPSHAD_W::new(self, 5)
1269 }
1270 #[inline(always)]
1272 pub fn fmt(&mut self) -> FMT_W<CRrs> {
1273 FMT_W::new(self, 6)
1274 }
1275 #[inline(always)]
1279 pub fn alre(&mut self, n: u8) -> ALRE_W<CRrs> {
1280 #[allow(clippy::no_effect)]
1281 [(); 2][n as usize];
1282 ALRE_W::new(self, n + 8)
1283 }
1284 #[inline(always)]
1286 pub fn alrae(&mut self) -> ALRE_W<CRrs> {
1287 ALRE_W::new(self, 8)
1288 }
1289 #[inline(always)]
1291 pub fn alrbe(&mut self) -> ALRE_W<CRrs> {
1292 ALRE_W::new(self, 9)
1293 }
1294 #[inline(always)]
1296 pub fn wute(&mut self) -> WUTE_W<CRrs> {
1297 WUTE_W::new(self, 10)
1298 }
1299 #[inline(always)]
1301 pub fn tse(&mut self) -> TSE_W<CRrs> {
1302 TSE_W::new(self, 11)
1303 }
1304 #[inline(always)]
1308 pub fn alrie(&mut self, n: u8) -> ALRIE_W<CRrs> {
1309 #[allow(clippy::no_effect)]
1310 [(); 2][n as usize];
1311 ALRIE_W::new(self, n + 12)
1312 }
1313 #[inline(always)]
1315 pub fn alraie(&mut self) -> ALRIE_W<CRrs> {
1316 ALRIE_W::new(self, 12)
1317 }
1318 #[inline(always)]
1320 pub fn alrbie(&mut self) -> ALRIE_W<CRrs> {
1321 ALRIE_W::new(self, 13)
1322 }
1323 #[inline(always)]
1325 pub fn wutie(&mut self) -> WUTIE_W<CRrs> {
1326 WUTIE_W::new(self, 14)
1327 }
1328 #[inline(always)]
1330 pub fn tsie(&mut self) -> TSIE_W<CRrs> {
1331 TSIE_W::new(self, 15)
1332 }
1333 #[inline(always)]
1335 pub fn add1h(&mut self) -> ADD1H_W<CRrs> {
1336 ADD1H_W::new(self, 16)
1337 }
1338 #[inline(always)]
1340 pub fn sub1h(&mut self) -> SUB1H_W<CRrs> {
1341 SUB1H_W::new(self, 17)
1342 }
1343 #[inline(always)]
1345 pub fn bkp(&mut self) -> BKP_W<CRrs> {
1346 BKP_W::new(self, 18)
1347 }
1348 #[inline(always)]
1350 pub fn cosel(&mut self) -> COSEL_W<CRrs> {
1351 COSEL_W::new(self, 19)
1352 }
1353 #[inline(always)]
1355 pub fn pol(&mut self) -> POL_W<CRrs> {
1356 POL_W::new(self, 20)
1357 }
1358 #[inline(always)]
1360 pub fn osel(&mut self) -> OSEL_W<CRrs> {
1361 OSEL_W::new(self, 21)
1362 }
1363 #[inline(always)]
1365 pub fn coe(&mut self) -> COE_W<CRrs> {
1366 COE_W::new(self, 23)
1367 }
1368 #[inline(always)]
1370 pub fn itse(&mut self) -> ITSE_W<CRrs> {
1371 ITSE_W::new(self, 24)
1372 }
1373}
1374pub struct CRrs;
1380impl crate::RegisterSpec for CRrs {
1381 type Ux = u32;
1382}
1383impl crate::Readable for CRrs {}
1385impl crate::Writable for CRrs {
1387 type Safety = crate::Unsafe;
1388}
1389impl crate::Resettable for CRrs {}