1pub type R = crate::R<CR2rs>;
3pub type W = crate::W<CR2rs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum ADON {
11 Disabled = 0,
13 Enabled = 1,
15}
16impl From<ADON> for bool {
17 #[inline(always)]
18 fn from(variant: ADON) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type ADON_R = crate::BitReader<ADON>;
24impl ADON_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> ADON {
28 match self.bits {
29 false => ADON::Disabled,
30 true => ADON::Enabled,
31 }
32 }
33 #[inline(always)]
35 pub fn is_disabled(&self) -> bool {
36 *self == ADON::Disabled
37 }
38 #[inline(always)]
40 pub fn is_enabled(&self) -> bool {
41 *self == ADON::Enabled
42 }
43}
44pub type ADON_W<'a, REG> = crate::BitWriter<'a, REG, ADON>;
46impl<'a, REG> ADON_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(ADON::Disabled)
54 }
55 #[inline(always)]
57 pub fn enabled(self) -> &'a mut crate::W<REG> {
58 self.variant(ADON::Enabled)
59 }
60}
61#[cfg_attr(feature = "defmt", derive(defmt::Format))]
65#[derive(Clone, Copy, Debug, PartialEq, Eq)]
66pub enum CONT {
67 Single = 0,
69 Continuous = 1,
71}
72impl From<CONT> for bool {
73 #[inline(always)]
74 fn from(variant: CONT) -> Self {
75 variant as u8 != 0
76 }
77}
78pub type CONT_R = crate::BitReader<CONT>;
80impl CONT_R {
81 #[inline(always)]
83 pub const fn variant(&self) -> CONT {
84 match self.bits {
85 false => CONT::Single,
86 true => CONT::Continuous,
87 }
88 }
89 #[inline(always)]
91 pub fn is_single(&self) -> bool {
92 *self == CONT::Single
93 }
94 #[inline(always)]
96 pub fn is_continuous(&self) -> bool {
97 *self == CONT::Continuous
98 }
99}
100pub type CONT_W<'a, REG> = crate::BitWriter<'a, REG, CONT>;
102impl<'a, REG> CONT_W<'a, REG>
103where
104 REG: crate::Writable + crate::RegisterSpec,
105{
106 #[inline(always)]
108 pub fn single(self) -> &'a mut crate::W<REG> {
109 self.variant(CONT::Single)
110 }
111 #[inline(always)]
113 pub fn continuous(self) -> &'a mut crate::W<REG> {
114 self.variant(CONT::Continuous)
115 }
116}
117#[cfg_attr(feature = "defmt", derive(defmt::Format))]
121#[derive(Clone, Copy, Debug, PartialEq, Eq)]
122pub enum CALR {
123 Complete = 0,
125 NotComplete = 1,
127}
128impl From<CALR> for bool {
129 #[inline(always)]
130 fn from(variant: CALR) -> Self {
131 variant as u8 != 0
132 }
133}
134pub type CAL_R = crate::BitReader<CALR>;
136impl CAL_R {
137 #[inline(always)]
139 pub const fn variant(&self) -> CALR {
140 match self.bits {
141 false => CALR::Complete,
142 true => CALR::NotComplete,
143 }
144 }
145 #[inline(always)]
147 pub fn is_complete(&self) -> bool {
148 *self == CALR::Complete
149 }
150 #[inline(always)]
152 pub fn is_not_complete(&self) -> bool {
153 *self == CALR::NotComplete
154 }
155}
156#[cfg_attr(feature = "defmt", derive(defmt::Format))]
160#[derive(Clone, Copy, Debug, PartialEq, Eq)]
161pub enum CALW {
162 Start = 1,
164}
165impl From<CALW> for bool {
166 #[inline(always)]
167 fn from(variant: CALW) -> Self {
168 variant as u8 != 0
169 }
170}
171pub type CAL_W<'a, REG> = crate::BitWriter<'a, REG, CALW>;
173impl<'a, REG> CAL_W<'a, REG>
174where
175 REG: crate::Writable + crate::RegisterSpec,
176{
177 #[inline(always)]
179 pub fn start(self) -> &'a mut crate::W<REG> {
180 self.variant(CALW::Start)
181 }
182}
183#[cfg_attr(feature = "defmt", derive(defmt::Format))]
187#[derive(Clone, Copy, Debug, PartialEq, Eq)]
188pub enum RSTCALR {
189 Initialized = 0,
191 NotInitialized = 1,
193}
194impl From<RSTCALR> for bool {
195 #[inline(always)]
196 fn from(variant: RSTCALR) -> Self {
197 variant as u8 != 0
198 }
199}
200pub type RSTCAL_R = crate::BitReader<RSTCALR>;
202impl RSTCAL_R {
203 #[inline(always)]
205 pub const fn variant(&self) -> RSTCALR {
206 match self.bits {
207 false => RSTCALR::Initialized,
208 true => RSTCALR::NotInitialized,
209 }
210 }
211 #[inline(always)]
213 pub fn is_initialized(&self) -> bool {
214 *self == RSTCALR::Initialized
215 }
216 #[inline(always)]
218 pub fn is_not_initialized(&self) -> bool {
219 *self == RSTCALR::NotInitialized
220 }
221}
222#[cfg_attr(feature = "defmt", derive(defmt::Format))]
226#[derive(Clone, Copy, Debug, PartialEq, Eq)]
227pub enum RSTCALW {
228 Initialize = 1,
230}
231impl From<RSTCALW> for bool {
232 #[inline(always)]
233 fn from(variant: RSTCALW) -> Self {
234 variant as u8 != 0
235 }
236}
237pub type RSTCAL_W<'a, REG> = crate::BitWriter<'a, REG, RSTCALW>;
239impl<'a, REG> RSTCAL_W<'a, REG>
240where
241 REG: crate::Writable + crate::RegisterSpec,
242{
243 #[inline(always)]
245 pub fn initialize(self) -> &'a mut crate::W<REG> {
246 self.variant(RSTCALW::Initialize)
247 }
248}
249#[cfg_attr(feature = "defmt", derive(defmt::Format))]
253#[derive(Clone, Copy, Debug, PartialEq, Eq)]
254pub enum DMA {
255 Disabled = 0,
257 Enabled = 1,
259}
260impl From<DMA> for bool {
261 #[inline(always)]
262 fn from(variant: DMA) -> Self {
263 variant as u8 != 0
264 }
265}
266pub type DMA_R = crate::BitReader<DMA>;
268impl DMA_R {
269 #[inline(always)]
271 pub const fn variant(&self) -> DMA {
272 match self.bits {
273 false => DMA::Disabled,
274 true => DMA::Enabled,
275 }
276 }
277 #[inline(always)]
279 pub fn is_disabled(&self) -> bool {
280 *self == DMA::Disabled
281 }
282 #[inline(always)]
284 pub fn is_enabled(&self) -> bool {
285 *self == DMA::Enabled
286 }
287}
288pub type DMA_W<'a, REG> = crate::BitWriter<'a, REG, DMA>;
290impl<'a, REG> DMA_W<'a, REG>
291where
292 REG: crate::Writable + crate::RegisterSpec,
293{
294 #[inline(always)]
296 pub fn disabled(self) -> &'a mut crate::W<REG> {
297 self.variant(DMA::Disabled)
298 }
299 #[inline(always)]
301 pub fn enabled(self) -> &'a mut crate::W<REG> {
302 self.variant(DMA::Enabled)
303 }
304}
305#[cfg_attr(feature = "defmt", derive(defmt::Format))]
309#[derive(Clone, Copy, Debug, PartialEq, Eq)]
310pub enum ALIGN {
311 Right = 0,
313 Left = 1,
315}
316impl From<ALIGN> for bool {
317 #[inline(always)]
318 fn from(variant: ALIGN) -> Self {
319 variant as u8 != 0
320 }
321}
322pub type ALIGN_R = crate::BitReader<ALIGN>;
324impl ALIGN_R {
325 #[inline(always)]
327 pub const fn variant(&self) -> ALIGN {
328 match self.bits {
329 false => ALIGN::Right,
330 true => ALIGN::Left,
331 }
332 }
333 #[inline(always)]
335 pub fn is_right(&self) -> bool {
336 *self == ALIGN::Right
337 }
338 #[inline(always)]
340 pub fn is_left(&self) -> bool {
341 *self == ALIGN::Left
342 }
343}
344pub type ALIGN_W<'a, REG> = crate::BitWriter<'a, REG, ALIGN>;
346impl<'a, REG> ALIGN_W<'a, REG>
347where
348 REG: crate::Writable + crate::RegisterSpec,
349{
350 #[inline(always)]
352 pub fn right(self) -> &'a mut crate::W<REG> {
353 self.variant(ALIGN::Right)
354 }
355 #[inline(always)]
357 pub fn left(self) -> &'a mut crate::W<REG> {
358 self.variant(ALIGN::Left)
359 }
360}
361#[cfg_attr(feature = "defmt", derive(defmt::Format))]
365#[derive(Clone, Copy, Debug, PartialEq, Eq)]
366#[repr(u8)]
367pub enum JEXTSEL {
368 Tim1trgo = 0,
370 Tim1cc4 = 1,
372 Tim2trgo = 2,
374 Tim2cc1 = 3,
376 Tim3cc4 = 4,
378 Tim4trgo = 5,
380 Exti15 = 6,
382 Jswstart = 7,
384}
385impl From<JEXTSEL> for u8 {
386 #[inline(always)]
387 fn from(variant: JEXTSEL) -> Self {
388 variant as _
389 }
390}
391impl crate::FieldSpec for JEXTSEL {
392 type Ux = u8;
393}
394impl crate::IsEnum for JEXTSEL {}
395pub type JEXTSEL_R = crate::FieldReader<JEXTSEL>;
397impl JEXTSEL_R {
398 #[inline(always)]
400 pub const fn variant(&self) -> JEXTSEL {
401 match self.bits {
402 0 => JEXTSEL::Tim1trgo,
403 1 => JEXTSEL::Tim1cc4,
404 2 => JEXTSEL::Tim2trgo,
405 3 => JEXTSEL::Tim2cc1,
406 4 => JEXTSEL::Tim3cc4,
407 5 => JEXTSEL::Tim4trgo,
408 6 => JEXTSEL::Exti15,
409 7 => JEXTSEL::Jswstart,
410 _ => unreachable!(),
411 }
412 }
413 #[inline(always)]
415 pub fn is_tim1trgo(&self) -> bool {
416 *self == JEXTSEL::Tim1trgo
417 }
418 #[inline(always)]
420 pub fn is_tim1cc4(&self) -> bool {
421 *self == JEXTSEL::Tim1cc4
422 }
423 #[inline(always)]
425 pub fn is_tim2trgo(&self) -> bool {
426 *self == JEXTSEL::Tim2trgo
427 }
428 #[inline(always)]
430 pub fn is_tim2cc1(&self) -> bool {
431 *self == JEXTSEL::Tim2cc1
432 }
433 #[inline(always)]
435 pub fn is_tim3cc4(&self) -> bool {
436 *self == JEXTSEL::Tim3cc4
437 }
438 #[inline(always)]
440 pub fn is_tim4trgo(&self) -> bool {
441 *self == JEXTSEL::Tim4trgo
442 }
443 #[inline(always)]
445 pub fn is_exti15(&self) -> bool {
446 *self == JEXTSEL::Exti15
447 }
448 #[inline(always)]
450 pub fn is_jswstart(&self) -> bool {
451 *self == JEXTSEL::Jswstart
452 }
453}
454pub type JEXTSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, JEXTSEL, crate::Safe>;
456impl<'a, REG> JEXTSEL_W<'a, REG>
457where
458 REG: crate::Writable + crate::RegisterSpec,
459 REG::Ux: From<u8>,
460{
461 #[inline(always)]
463 pub fn tim1trgo(self) -> &'a mut crate::W<REG> {
464 self.variant(JEXTSEL::Tim1trgo)
465 }
466 #[inline(always)]
468 pub fn tim1cc4(self) -> &'a mut crate::W<REG> {
469 self.variant(JEXTSEL::Tim1cc4)
470 }
471 #[inline(always)]
473 pub fn tim2trgo(self) -> &'a mut crate::W<REG> {
474 self.variant(JEXTSEL::Tim2trgo)
475 }
476 #[inline(always)]
478 pub fn tim2cc1(self) -> &'a mut crate::W<REG> {
479 self.variant(JEXTSEL::Tim2cc1)
480 }
481 #[inline(always)]
483 pub fn tim3cc4(self) -> &'a mut crate::W<REG> {
484 self.variant(JEXTSEL::Tim3cc4)
485 }
486 #[inline(always)]
488 pub fn tim4trgo(self) -> &'a mut crate::W<REG> {
489 self.variant(JEXTSEL::Tim4trgo)
490 }
491 #[inline(always)]
493 pub fn exti15(self) -> &'a mut crate::W<REG> {
494 self.variant(JEXTSEL::Exti15)
495 }
496 #[inline(always)]
498 pub fn jswstart(self) -> &'a mut crate::W<REG> {
499 self.variant(JEXTSEL::Jswstart)
500 }
501}
502#[cfg_attr(feature = "defmt", derive(defmt::Format))]
506#[derive(Clone, Copy, Debug, PartialEq, Eq)]
507pub enum JEXTTRIG {
508 Disabled = 0,
510 Enabled = 1,
512}
513impl From<JEXTTRIG> for bool {
514 #[inline(always)]
515 fn from(variant: JEXTTRIG) -> Self {
516 variant as u8 != 0
517 }
518}
519pub type JEXTTRIG_R = crate::BitReader<JEXTTRIG>;
521impl JEXTTRIG_R {
522 #[inline(always)]
524 pub const fn variant(&self) -> JEXTTRIG {
525 match self.bits {
526 false => JEXTTRIG::Disabled,
527 true => JEXTTRIG::Enabled,
528 }
529 }
530 #[inline(always)]
532 pub fn is_disabled(&self) -> bool {
533 *self == JEXTTRIG::Disabled
534 }
535 #[inline(always)]
537 pub fn is_enabled(&self) -> bool {
538 *self == JEXTTRIG::Enabled
539 }
540}
541pub type JEXTTRIG_W<'a, REG> = crate::BitWriter<'a, REG, JEXTTRIG>;
543impl<'a, REG> JEXTTRIG_W<'a, REG>
544where
545 REG: crate::Writable + crate::RegisterSpec,
546{
547 #[inline(always)]
549 pub fn disabled(self) -> &'a mut crate::W<REG> {
550 self.variant(JEXTTRIG::Disabled)
551 }
552 #[inline(always)]
554 pub fn enabled(self) -> &'a mut crate::W<REG> {
555 self.variant(JEXTTRIG::Enabled)
556 }
557}
558#[cfg_attr(feature = "defmt", derive(defmt::Format))]
562#[derive(Clone, Copy, Debug, PartialEq, Eq)]
563#[repr(u8)]
564pub enum EXTSEL {
565 Tim1cc1 = 0,
567 Tim1cc2 = 1,
569 Tim1cc3 = 2,
571 Tim2cc2 = 3,
573 Tim3trgo = 4,
575 Tim4cc4 = 5,
577 Exti11 = 6,
579 Swstart = 7,
581}
582impl From<EXTSEL> for u8 {
583 #[inline(always)]
584 fn from(variant: EXTSEL) -> Self {
585 variant as _
586 }
587}
588impl crate::FieldSpec for EXTSEL {
589 type Ux = u8;
590}
591impl crate::IsEnum for EXTSEL {}
592pub type EXTSEL_R = crate::FieldReader<EXTSEL>;
594impl EXTSEL_R {
595 #[inline(always)]
597 pub const fn variant(&self) -> EXTSEL {
598 match self.bits {
599 0 => EXTSEL::Tim1cc1,
600 1 => EXTSEL::Tim1cc2,
601 2 => EXTSEL::Tim1cc3,
602 3 => EXTSEL::Tim2cc2,
603 4 => EXTSEL::Tim3trgo,
604 5 => EXTSEL::Tim4cc4,
605 6 => EXTSEL::Exti11,
606 7 => EXTSEL::Swstart,
607 _ => unreachable!(),
608 }
609 }
610 #[inline(always)]
612 pub fn is_tim1cc1(&self) -> bool {
613 *self == EXTSEL::Tim1cc1
614 }
615 #[inline(always)]
617 pub fn is_tim1cc2(&self) -> bool {
618 *self == EXTSEL::Tim1cc2
619 }
620 #[inline(always)]
622 pub fn is_tim1cc3(&self) -> bool {
623 *self == EXTSEL::Tim1cc3
624 }
625 #[inline(always)]
627 pub fn is_tim2cc2(&self) -> bool {
628 *self == EXTSEL::Tim2cc2
629 }
630 #[inline(always)]
632 pub fn is_tim3trgo(&self) -> bool {
633 *self == EXTSEL::Tim3trgo
634 }
635 #[inline(always)]
637 pub fn is_tim4cc4(&self) -> bool {
638 *self == EXTSEL::Tim4cc4
639 }
640 #[inline(always)]
642 pub fn is_exti11(&self) -> bool {
643 *self == EXTSEL::Exti11
644 }
645 #[inline(always)]
647 pub fn is_swstart(&self) -> bool {
648 *self == EXTSEL::Swstart
649 }
650}
651pub type EXTSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, EXTSEL, crate::Safe>;
653impl<'a, REG> EXTSEL_W<'a, REG>
654where
655 REG: crate::Writable + crate::RegisterSpec,
656 REG::Ux: From<u8>,
657{
658 #[inline(always)]
660 pub fn tim1cc1(self) -> &'a mut crate::W<REG> {
661 self.variant(EXTSEL::Tim1cc1)
662 }
663 #[inline(always)]
665 pub fn tim1cc2(self) -> &'a mut crate::W<REG> {
666 self.variant(EXTSEL::Tim1cc2)
667 }
668 #[inline(always)]
670 pub fn tim1cc3(self) -> &'a mut crate::W<REG> {
671 self.variant(EXTSEL::Tim1cc3)
672 }
673 #[inline(always)]
675 pub fn tim2cc2(self) -> &'a mut crate::W<REG> {
676 self.variant(EXTSEL::Tim2cc2)
677 }
678 #[inline(always)]
680 pub fn tim3trgo(self) -> &'a mut crate::W<REG> {
681 self.variant(EXTSEL::Tim3trgo)
682 }
683 #[inline(always)]
685 pub fn tim4cc4(self) -> &'a mut crate::W<REG> {
686 self.variant(EXTSEL::Tim4cc4)
687 }
688 #[inline(always)]
690 pub fn exti11(self) -> &'a mut crate::W<REG> {
691 self.variant(EXTSEL::Exti11)
692 }
693 #[inline(always)]
695 pub fn swstart(self) -> &'a mut crate::W<REG> {
696 self.variant(EXTSEL::Swstart)
697 }
698}
699#[cfg_attr(feature = "defmt", derive(defmt::Format))]
703#[derive(Clone, Copy, Debug, PartialEq, Eq)]
704pub enum EXTTRIG {
705 Disabled = 0,
707 Enabled = 1,
709}
710impl From<EXTTRIG> for bool {
711 #[inline(always)]
712 fn from(variant: EXTTRIG) -> Self {
713 variant as u8 != 0
714 }
715}
716pub type EXTTRIG_R = crate::BitReader<EXTTRIG>;
718impl EXTTRIG_R {
719 #[inline(always)]
721 pub const fn variant(&self) -> EXTTRIG {
722 match self.bits {
723 false => EXTTRIG::Disabled,
724 true => EXTTRIG::Enabled,
725 }
726 }
727 #[inline(always)]
729 pub fn is_disabled(&self) -> bool {
730 *self == EXTTRIG::Disabled
731 }
732 #[inline(always)]
734 pub fn is_enabled(&self) -> bool {
735 *self == EXTTRIG::Enabled
736 }
737}
738pub type EXTTRIG_W<'a, REG> = crate::BitWriter<'a, REG, EXTTRIG>;
740impl<'a, REG> EXTTRIG_W<'a, REG>
741where
742 REG: crate::Writable + crate::RegisterSpec,
743{
744 #[inline(always)]
746 pub fn disabled(self) -> &'a mut crate::W<REG> {
747 self.variant(EXTTRIG::Disabled)
748 }
749 #[inline(always)]
751 pub fn enabled(self) -> &'a mut crate::W<REG> {
752 self.variant(EXTTRIG::Enabled)
753 }
754}
755#[cfg_attr(feature = "defmt", derive(defmt::Format))]
759#[derive(Clone, Copy, Debug, PartialEq, Eq)]
760pub enum JSWSTARTR {
761 Started = 0,
763 NotStarted = 1,
765}
766impl From<JSWSTARTR> for bool {
767 #[inline(always)]
768 fn from(variant: JSWSTARTR) -> Self {
769 variant as u8 != 0
770 }
771}
772pub type JSWSTART_R = crate::BitReader<JSWSTARTR>;
774impl JSWSTART_R {
775 #[inline(always)]
777 pub const fn variant(&self) -> JSWSTARTR {
778 match self.bits {
779 false => JSWSTARTR::Started,
780 true => JSWSTARTR::NotStarted,
781 }
782 }
783 #[inline(always)]
785 pub fn is_started(&self) -> bool {
786 *self == JSWSTARTR::Started
787 }
788 #[inline(always)]
790 pub fn is_not_started(&self) -> bool {
791 *self == JSWSTARTR::NotStarted
792 }
793}
794#[cfg_attr(feature = "defmt", derive(defmt::Format))]
798#[derive(Clone, Copy, Debug, PartialEq, Eq)]
799pub enum JSWSTARTW {
800 Start = 1,
802}
803impl From<JSWSTARTW> for bool {
804 #[inline(always)]
805 fn from(variant: JSWSTARTW) -> Self {
806 variant as u8 != 0
807 }
808}
809pub type JSWSTART_W<'a, REG> = crate::BitWriter<'a, REG, JSWSTARTW>;
811impl<'a, REG> JSWSTART_W<'a, REG>
812where
813 REG: crate::Writable + crate::RegisterSpec,
814{
815 #[inline(always)]
817 pub fn start(self) -> &'a mut crate::W<REG> {
818 self.variant(JSWSTARTW::Start)
819 }
820}
821#[cfg_attr(feature = "defmt", derive(defmt::Format))]
825#[derive(Clone, Copy, Debug, PartialEq, Eq)]
826pub enum SWSTARTR {
827 Started = 0,
829 NotStarted = 1,
831}
832impl From<SWSTARTR> for bool {
833 #[inline(always)]
834 fn from(variant: SWSTARTR) -> Self {
835 variant as u8 != 0
836 }
837}
838pub type SWSTART_R = crate::BitReader<SWSTARTR>;
840impl SWSTART_R {
841 #[inline(always)]
843 pub const fn variant(&self) -> SWSTARTR {
844 match self.bits {
845 false => SWSTARTR::Started,
846 true => SWSTARTR::NotStarted,
847 }
848 }
849 #[inline(always)]
851 pub fn is_started(&self) -> bool {
852 *self == SWSTARTR::Started
853 }
854 #[inline(always)]
856 pub fn is_not_started(&self) -> bool {
857 *self == SWSTARTR::NotStarted
858 }
859}
860#[cfg_attr(feature = "defmt", derive(defmt::Format))]
864#[derive(Clone, Copy, Debug, PartialEq, Eq)]
865pub enum SWSTARTW {
866 Start = 1,
868}
869impl From<SWSTARTW> for bool {
870 #[inline(always)]
871 fn from(variant: SWSTARTW) -> Self {
872 variant as u8 != 0
873 }
874}
875pub type SWSTART_W<'a, REG> = crate::BitWriter<'a, REG, SWSTARTW>;
877impl<'a, REG> SWSTART_W<'a, REG>
878where
879 REG: crate::Writable + crate::RegisterSpec,
880{
881 #[inline(always)]
883 pub fn start(self) -> &'a mut crate::W<REG> {
884 self.variant(SWSTARTW::Start)
885 }
886}
887#[cfg_attr(feature = "defmt", derive(defmt::Format))]
891#[derive(Clone, Copy, Debug, PartialEq, Eq)]
892pub enum TSVREFE {
893 Disabled = 0,
895 Enabled = 1,
897}
898impl From<TSVREFE> for bool {
899 #[inline(always)]
900 fn from(variant: TSVREFE) -> Self {
901 variant as u8 != 0
902 }
903}
904pub type TSVREFE_R = crate::BitReader<TSVREFE>;
906impl TSVREFE_R {
907 #[inline(always)]
909 pub const fn variant(&self) -> TSVREFE {
910 match self.bits {
911 false => TSVREFE::Disabled,
912 true => TSVREFE::Enabled,
913 }
914 }
915 #[inline(always)]
917 pub fn is_disabled(&self) -> bool {
918 *self == TSVREFE::Disabled
919 }
920 #[inline(always)]
922 pub fn is_enabled(&self) -> bool {
923 *self == TSVREFE::Enabled
924 }
925}
926pub type TSVREFE_W<'a, REG> = crate::BitWriter<'a, REG, TSVREFE>;
928impl<'a, REG> TSVREFE_W<'a, REG>
929where
930 REG: crate::Writable + crate::RegisterSpec,
931{
932 #[inline(always)]
934 pub fn disabled(self) -> &'a mut crate::W<REG> {
935 self.variant(TSVREFE::Disabled)
936 }
937 #[inline(always)]
939 pub fn enabled(self) -> &'a mut crate::W<REG> {
940 self.variant(TSVREFE::Enabled)
941 }
942}
943impl R {
944 #[inline(always)]
946 pub fn adon(&self) -> ADON_R {
947 ADON_R::new((self.bits & 1) != 0)
948 }
949 #[inline(always)]
951 pub fn cont(&self) -> CONT_R {
952 CONT_R::new(((self.bits >> 1) & 1) != 0)
953 }
954 #[inline(always)]
956 pub fn cal(&self) -> CAL_R {
957 CAL_R::new(((self.bits >> 2) & 1) != 0)
958 }
959 #[inline(always)]
961 pub fn rstcal(&self) -> RSTCAL_R {
962 RSTCAL_R::new(((self.bits >> 3) & 1) != 0)
963 }
964 #[inline(always)]
966 pub fn dma(&self) -> DMA_R {
967 DMA_R::new(((self.bits >> 8) & 1) != 0)
968 }
969 #[inline(always)]
971 pub fn align(&self) -> ALIGN_R {
972 ALIGN_R::new(((self.bits >> 11) & 1) != 0)
973 }
974 #[inline(always)]
976 pub fn jextsel(&self) -> JEXTSEL_R {
977 JEXTSEL_R::new(((self.bits >> 12) & 7) as u8)
978 }
979 #[inline(always)]
981 pub fn jexttrig(&self) -> JEXTTRIG_R {
982 JEXTTRIG_R::new(((self.bits >> 15) & 1) != 0)
983 }
984 #[inline(always)]
986 pub fn extsel(&self) -> EXTSEL_R {
987 EXTSEL_R::new(((self.bits >> 17) & 7) as u8)
988 }
989 #[inline(always)]
991 pub fn exttrig(&self) -> EXTTRIG_R {
992 EXTTRIG_R::new(((self.bits >> 20) & 1) != 0)
993 }
994 #[inline(always)]
996 pub fn jswstart(&self) -> JSWSTART_R {
997 JSWSTART_R::new(((self.bits >> 21) & 1) != 0)
998 }
999 #[inline(always)]
1001 pub fn swstart(&self) -> SWSTART_R {
1002 SWSTART_R::new(((self.bits >> 22) & 1) != 0)
1003 }
1004 #[inline(always)]
1006 pub fn tsvrefe(&self) -> TSVREFE_R {
1007 TSVREFE_R::new(((self.bits >> 23) & 1) != 0)
1008 }
1009}
1010impl core::fmt::Debug for R {
1011 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1012 f.debug_struct("CR2")
1013 .field("tsvrefe", &self.tsvrefe())
1014 .field("swstart", &self.swstart())
1015 .field("jswstart", &self.jswstart())
1016 .field("exttrig", &self.exttrig())
1017 .field("extsel", &self.extsel())
1018 .field("jexttrig", &self.jexttrig())
1019 .field("jextsel", &self.jextsel())
1020 .field("align", &self.align())
1021 .field("dma", &self.dma())
1022 .field("rstcal", &self.rstcal())
1023 .field("cal", &self.cal())
1024 .field("cont", &self.cont())
1025 .field("adon", &self.adon())
1026 .finish()
1027 }
1028}
1029impl W {
1030 #[inline(always)]
1032 pub fn adon(&mut self) -> ADON_W<CR2rs> {
1033 ADON_W::new(self, 0)
1034 }
1035 #[inline(always)]
1037 pub fn cont(&mut self) -> CONT_W<CR2rs> {
1038 CONT_W::new(self, 1)
1039 }
1040 #[inline(always)]
1042 pub fn cal(&mut self) -> CAL_W<CR2rs> {
1043 CAL_W::new(self, 2)
1044 }
1045 #[inline(always)]
1047 pub fn rstcal(&mut self) -> RSTCAL_W<CR2rs> {
1048 RSTCAL_W::new(self, 3)
1049 }
1050 #[inline(always)]
1052 pub fn dma(&mut self) -> DMA_W<CR2rs> {
1053 DMA_W::new(self, 8)
1054 }
1055 #[inline(always)]
1057 pub fn align(&mut self) -> ALIGN_W<CR2rs> {
1058 ALIGN_W::new(self, 11)
1059 }
1060 #[inline(always)]
1062 pub fn jextsel(&mut self) -> JEXTSEL_W<CR2rs> {
1063 JEXTSEL_W::new(self, 12)
1064 }
1065 #[inline(always)]
1067 pub fn jexttrig(&mut self) -> JEXTTRIG_W<CR2rs> {
1068 JEXTTRIG_W::new(self, 15)
1069 }
1070 #[inline(always)]
1072 pub fn extsel(&mut self) -> EXTSEL_W<CR2rs> {
1073 EXTSEL_W::new(self, 17)
1074 }
1075 #[inline(always)]
1077 pub fn exttrig(&mut self) -> EXTTRIG_W<CR2rs> {
1078 EXTTRIG_W::new(self, 20)
1079 }
1080 #[inline(always)]
1082 pub fn jswstart(&mut self) -> JSWSTART_W<CR2rs> {
1083 JSWSTART_W::new(self, 21)
1084 }
1085 #[inline(always)]
1087 pub fn swstart(&mut self) -> SWSTART_W<CR2rs> {
1088 SWSTART_W::new(self, 22)
1089 }
1090 #[inline(always)]
1092 pub fn tsvrefe(&mut self) -> TSVREFE_W<CR2rs> {
1093 TSVREFE_W::new(self, 23)
1094 }
1095}
1096pub struct CR2rs;
1102impl crate::RegisterSpec for CR2rs {
1103 type Ux = u32;
1104}
1105impl crate::Readable for CR2rs {}
1107impl crate::Writable for CR2rs {
1109 type Safety = crate::Unsafe;
1110}
1111impl crate::Resettable for CR2rs {}