1pub type R = crate::R<CFGR1rs>;
3pub type W = crate::W<CFGR1rs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10#[repr(u8)]
11pub enum SITP {
12 SpirisingEdge = 0,
14 SpifallingEdge = 1,
16 Manchester = 2,
18 ManchesterInverted = 3,
20}
21impl From<SITP> for u8 {
22 #[inline(always)]
23 fn from(variant: SITP) -> Self {
24 variant as _
25 }
26}
27impl crate::FieldSpec for SITP {
28 type Ux = u8;
29}
30impl crate::IsEnum for SITP {}
31pub type SITP_R = crate::FieldReader<SITP>;
33impl SITP_R {
34 #[inline(always)]
36 pub const fn variant(&self) -> SITP {
37 match self.bits {
38 0 => SITP::SpirisingEdge,
39 1 => SITP::SpifallingEdge,
40 2 => SITP::Manchester,
41 3 => SITP::ManchesterInverted,
42 _ => unreachable!(),
43 }
44 }
45 #[inline(always)]
47 pub fn is_spirising_edge(&self) -> bool {
48 *self == SITP::SpirisingEdge
49 }
50 #[inline(always)]
52 pub fn is_spifalling_edge(&self) -> bool {
53 *self == SITP::SpifallingEdge
54 }
55 #[inline(always)]
57 pub fn is_manchester(&self) -> bool {
58 *self == SITP::Manchester
59 }
60 #[inline(always)]
62 pub fn is_manchester_inverted(&self) -> bool {
63 *self == SITP::ManchesterInverted
64 }
65}
66pub type SITP_W<'a, REG> = crate::FieldWriter<'a, REG, 2, SITP, crate::Safe>;
68impl<'a, REG> SITP_W<'a, REG>
69where
70 REG: crate::Writable + crate::RegisterSpec,
71 REG::Ux: From<u8>,
72{
73 #[inline(always)]
75 pub fn spirising_edge(self) -> &'a mut crate::W<REG> {
76 self.variant(SITP::SpirisingEdge)
77 }
78 #[inline(always)]
80 pub fn spifalling_edge(self) -> &'a mut crate::W<REG> {
81 self.variant(SITP::SpifallingEdge)
82 }
83 #[inline(always)]
85 pub fn manchester(self) -> &'a mut crate::W<REG> {
86 self.variant(SITP::Manchester)
87 }
88 #[inline(always)]
90 pub fn manchester_inverted(self) -> &'a mut crate::W<REG> {
91 self.variant(SITP::ManchesterInverted)
92 }
93}
94#[cfg_attr(feature = "defmt", derive(defmt::Format))]
98#[derive(Clone, Copy, Debug, PartialEq, Eq)]
99#[repr(u8)]
100pub enum SPICKSEL {
101 Ckin = 0,
103 Ckout = 1,
105 CkoutsecondFalling = 2,
107 CkoutsecondRising = 3,
109}
110impl From<SPICKSEL> for u8 {
111 #[inline(always)]
112 fn from(variant: SPICKSEL) -> Self {
113 variant as _
114 }
115}
116impl crate::FieldSpec for SPICKSEL {
117 type Ux = u8;
118}
119impl crate::IsEnum for SPICKSEL {}
120pub type SPICKSEL_R = crate::FieldReader<SPICKSEL>;
122impl SPICKSEL_R {
123 #[inline(always)]
125 pub const fn variant(&self) -> SPICKSEL {
126 match self.bits {
127 0 => SPICKSEL::Ckin,
128 1 => SPICKSEL::Ckout,
129 2 => SPICKSEL::CkoutsecondFalling,
130 3 => SPICKSEL::CkoutsecondRising,
131 _ => unreachable!(),
132 }
133 }
134 #[inline(always)]
136 pub fn is_ckin(&self) -> bool {
137 *self == SPICKSEL::Ckin
138 }
139 #[inline(always)]
141 pub fn is_ckout(&self) -> bool {
142 *self == SPICKSEL::Ckout
143 }
144 #[inline(always)]
146 pub fn is_ckoutsecond_falling(&self) -> bool {
147 *self == SPICKSEL::CkoutsecondFalling
148 }
149 #[inline(always)]
151 pub fn is_ckoutsecond_rising(&self) -> bool {
152 *self == SPICKSEL::CkoutsecondRising
153 }
154}
155pub type SPICKSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, SPICKSEL, crate::Safe>;
157impl<'a, REG> SPICKSEL_W<'a, REG>
158where
159 REG: crate::Writable + crate::RegisterSpec,
160 REG::Ux: From<u8>,
161{
162 #[inline(always)]
164 pub fn ckin(self) -> &'a mut crate::W<REG> {
165 self.variant(SPICKSEL::Ckin)
166 }
167 #[inline(always)]
169 pub fn ckout(self) -> &'a mut crate::W<REG> {
170 self.variant(SPICKSEL::Ckout)
171 }
172 #[inline(always)]
174 pub fn ckoutsecond_falling(self) -> &'a mut crate::W<REG> {
175 self.variant(SPICKSEL::CkoutsecondFalling)
176 }
177 #[inline(always)]
179 pub fn ckoutsecond_rising(self) -> &'a mut crate::W<REG> {
180 self.variant(SPICKSEL::CkoutsecondRising)
181 }
182}
183#[cfg_attr(feature = "defmt", derive(defmt::Format))]
187#[derive(Clone, Copy, Debug, PartialEq, Eq)]
188pub enum SCDEN {
189 Disabled = 0,
191 Enabled = 1,
193}
194impl From<SCDEN> for bool {
195 #[inline(always)]
196 fn from(variant: SCDEN) -> Self {
197 variant as u8 != 0
198 }
199}
200pub type SCDEN_R = crate::BitReader<SCDEN>;
202impl SCDEN_R {
203 #[inline(always)]
205 pub const fn variant(&self) -> SCDEN {
206 match self.bits {
207 false => SCDEN::Disabled,
208 true => SCDEN::Enabled,
209 }
210 }
211 #[inline(always)]
213 pub fn is_disabled(&self) -> bool {
214 *self == SCDEN::Disabled
215 }
216 #[inline(always)]
218 pub fn is_enabled(&self) -> bool {
219 *self == SCDEN::Enabled
220 }
221}
222pub type SCDEN_W<'a, REG> = crate::BitWriter<'a, REG, SCDEN>;
224impl<'a, REG> SCDEN_W<'a, REG>
225where
226 REG: crate::Writable + crate::RegisterSpec,
227{
228 #[inline(always)]
230 pub fn disabled(self) -> &'a mut crate::W<REG> {
231 self.variant(SCDEN::Disabled)
232 }
233 #[inline(always)]
235 pub fn enabled(self) -> &'a mut crate::W<REG> {
236 self.variant(SCDEN::Enabled)
237 }
238}
239#[cfg_attr(feature = "defmt", derive(defmt::Format))]
243#[derive(Clone, Copy, Debug, PartialEq, Eq)]
244pub enum CKABEN {
245 Disabled = 0,
247 Enabled = 1,
249}
250impl From<CKABEN> for bool {
251 #[inline(always)]
252 fn from(variant: CKABEN) -> Self {
253 variant as u8 != 0
254 }
255}
256pub type CKABEN_R = crate::BitReader<CKABEN>;
258impl CKABEN_R {
259 #[inline(always)]
261 pub const fn variant(&self) -> CKABEN {
262 match self.bits {
263 false => CKABEN::Disabled,
264 true => CKABEN::Enabled,
265 }
266 }
267 #[inline(always)]
269 pub fn is_disabled(&self) -> bool {
270 *self == CKABEN::Disabled
271 }
272 #[inline(always)]
274 pub fn is_enabled(&self) -> bool {
275 *self == CKABEN::Enabled
276 }
277}
278pub type CKABEN_W<'a, REG> = crate::BitWriter<'a, REG, CKABEN>;
280impl<'a, REG> CKABEN_W<'a, REG>
281where
282 REG: crate::Writable + crate::RegisterSpec,
283{
284 #[inline(always)]
286 pub fn disabled(self) -> &'a mut crate::W<REG> {
287 self.variant(CKABEN::Disabled)
288 }
289 #[inline(always)]
291 pub fn enabled(self) -> &'a mut crate::W<REG> {
292 self.variant(CKABEN::Enabled)
293 }
294}
295#[cfg_attr(feature = "defmt", derive(defmt::Format))]
299#[derive(Clone, Copy, Debug, PartialEq, Eq)]
300pub enum CHEN {
301 Disabled = 0,
303 Enabled = 1,
305}
306impl From<CHEN> for bool {
307 #[inline(always)]
308 fn from(variant: CHEN) -> Self {
309 variant as u8 != 0
310 }
311}
312pub type CHEN_R = crate::BitReader<CHEN>;
314impl CHEN_R {
315 #[inline(always)]
317 pub const fn variant(&self) -> CHEN {
318 match self.bits {
319 false => CHEN::Disabled,
320 true => CHEN::Enabled,
321 }
322 }
323 #[inline(always)]
325 pub fn is_disabled(&self) -> bool {
326 *self == CHEN::Disabled
327 }
328 #[inline(always)]
330 pub fn is_enabled(&self) -> bool {
331 *self == CHEN::Enabled
332 }
333}
334pub type CHEN_W<'a, REG> = crate::BitWriter<'a, REG, CHEN>;
336impl<'a, REG> CHEN_W<'a, REG>
337where
338 REG: crate::Writable + crate::RegisterSpec,
339{
340 #[inline(always)]
342 pub fn disabled(self) -> &'a mut crate::W<REG> {
343 self.variant(CHEN::Disabled)
344 }
345 #[inline(always)]
347 pub fn enabled(self) -> &'a mut crate::W<REG> {
348 self.variant(CHEN::Enabled)
349 }
350}
351#[cfg_attr(feature = "defmt", derive(defmt::Format))]
355#[derive(Clone, Copy, Debug, PartialEq, Eq)]
356pub enum CHINSEL {
357 SameChannel = 0,
359 FollowingChannel = 1,
361}
362impl From<CHINSEL> for bool {
363 #[inline(always)]
364 fn from(variant: CHINSEL) -> Self {
365 variant as u8 != 0
366 }
367}
368pub type CHINSEL_R = crate::BitReader<CHINSEL>;
370impl CHINSEL_R {
371 #[inline(always)]
373 pub const fn variant(&self) -> CHINSEL {
374 match self.bits {
375 false => CHINSEL::SameChannel,
376 true => CHINSEL::FollowingChannel,
377 }
378 }
379 #[inline(always)]
381 pub fn is_same_channel(&self) -> bool {
382 *self == CHINSEL::SameChannel
383 }
384 #[inline(always)]
386 pub fn is_following_channel(&self) -> bool {
387 *self == CHINSEL::FollowingChannel
388 }
389}
390pub type CHINSEL_W<'a, REG> = crate::BitWriter<'a, REG, CHINSEL>;
392impl<'a, REG> CHINSEL_W<'a, REG>
393where
394 REG: crate::Writable + crate::RegisterSpec,
395{
396 #[inline(always)]
398 pub fn same_channel(self) -> &'a mut crate::W<REG> {
399 self.variant(CHINSEL::SameChannel)
400 }
401 #[inline(always)]
403 pub fn following_channel(self) -> &'a mut crate::W<REG> {
404 self.variant(CHINSEL::FollowingChannel)
405 }
406}
407#[cfg_attr(feature = "defmt", derive(defmt::Format))]
411#[derive(Clone, Copy, Debug, PartialEq, Eq)]
412#[repr(u8)]
413pub enum DATMPX {
414 External = 0,
416 Adc = 1,
418 Internal = 2,
420}
421impl From<DATMPX> for u8 {
422 #[inline(always)]
423 fn from(variant: DATMPX) -> Self {
424 variant as _
425 }
426}
427impl crate::FieldSpec for DATMPX {
428 type Ux = u8;
429}
430impl crate::IsEnum for DATMPX {}
431pub type DATMPX_R = crate::FieldReader<DATMPX>;
433impl DATMPX_R {
434 #[inline(always)]
436 pub const fn variant(&self) -> Option<DATMPX> {
437 match self.bits {
438 0 => Some(DATMPX::External),
439 1 => Some(DATMPX::Adc),
440 2 => Some(DATMPX::Internal),
441 _ => None,
442 }
443 }
444 #[inline(always)]
446 pub fn is_external(&self) -> bool {
447 *self == DATMPX::External
448 }
449 #[inline(always)]
451 pub fn is_adc(&self) -> bool {
452 *self == DATMPX::Adc
453 }
454 #[inline(always)]
456 pub fn is_internal(&self) -> bool {
457 *self == DATMPX::Internal
458 }
459}
460pub type DATMPX_W<'a, REG> = crate::FieldWriter<'a, REG, 2, DATMPX>;
462impl<'a, REG> DATMPX_W<'a, REG>
463where
464 REG: crate::Writable + crate::RegisterSpec,
465 REG::Ux: From<u8>,
466{
467 #[inline(always)]
469 pub fn external(self) -> &'a mut crate::W<REG> {
470 self.variant(DATMPX::External)
471 }
472 #[inline(always)]
474 pub fn adc(self) -> &'a mut crate::W<REG> {
475 self.variant(DATMPX::Adc)
476 }
477 #[inline(always)]
479 pub fn internal(self) -> &'a mut crate::W<REG> {
480 self.variant(DATMPX::Internal)
481 }
482}
483#[cfg_attr(feature = "defmt", derive(defmt::Format))]
487#[derive(Clone, Copy, Debug, PartialEq, Eq)]
488#[repr(u8)]
489pub enum DATPACK {
490 Standard = 0,
492 Interleaved = 1,
494 Dual = 2,
496}
497impl From<DATPACK> for u8 {
498 #[inline(always)]
499 fn from(variant: DATPACK) -> Self {
500 variant as _
501 }
502}
503impl crate::FieldSpec for DATPACK {
504 type Ux = u8;
505}
506impl crate::IsEnum for DATPACK {}
507pub type DATPACK_R = crate::FieldReader<DATPACK>;
509impl DATPACK_R {
510 #[inline(always)]
512 pub const fn variant(&self) -> Option<DATPACK> {
513 match self.bits {
514 0 => Some(DATPACK::Standard),
515 1 => Some(DATPACK::Interleaved),
516 2 => Some(DATPACK::Dual),
517 _ => None,
518 }
519 }
520 #[inline(always)]
522 pub fn is_standard(&self) -> bool {
523 *self == DATPACK::Standard
524 }
525 #[inline(always)]
527 pub fn is_interleaved(&self) -> bool {
528 *self == DATPACK::Interleaved
529 }
530 #[inline(always)]
532 pub fn is_dual(&self) -> bool {
533 *self == DATPACK::Dual
534 }
535}
536pub type DATPACK_W<'a, REG> = crate::FieldWriter<'a, REG, 2, DATPACK>;
538impl<'a, REG> DATPACK_W<'a, REG>
539where
540 REG: crate::Writable + crate::RegisterSpec,
541 REG::Ux: From<u8>,
542{
543 #[inline(always)]
545 pub fn standard(self) -> &'a mut crate::W<REG> {
546 self.variant(DATPACK::Standard)
547 }
548 #[inline(always)]
550 pub fn interleaved(self) -> &'a mut crate::W<REG> {
551 self.variant(DATPACK::Interleaved)
552 }
553 #[inline(always)]
555 pub fn dual(self) -> &'a mut crate::W<REG> {
556 self.variant(DATPACK::Dual)
557 }
558}
559pub type CKOUTDIV_R = crate::FieldReader;
561pub type CKOUTDIV_W<'a, REG> = crate::FieldWriter<'a, REG, 8, u8, crate::Safe>;
563#[cfg_attr(feature = "defmt", derive(defmt::Format))]
567#[derive(Clone, Copy, Debug, PartialEq, Eq)]
568pub enum CKOUTSRC {
569 Sysclk = 0,
571 Audclk = 1,
573}
574impl From<CKOUTSRC> for bool {
575 #[inline(always)]
576 fn from(variant: CKOUTSRC) -> Self {
577 variant as u8 != 0
578 }
579}
580pub type CKOUTSRC_R = crate::BitReader<CKOUTSRC>;
582impl CKOUTSRC_R {
583 #[inline(always)]
585 pub const fn variant(&self) -> CKOUTSRC {
586 match self.bits {
587 false => CKOUTSRC::Sysclk,
588 true => CKOUTSRC::Audclk,
589 }
590 }
591 #[inline(always)]
593 pub fn is_sysclk(&self) -> bool {
594 *self == CKOUTSRC::Sysclk
595 }
596 #[inline(always)]
598 pub fn is_audclk(&self) -> bool {
599 *self == CKOUTSRC::Audclk
600 }
601}
602pub type CKOUTSRC_W<'a, REG> = crate::BitWriter<'a, REG, CKOUTSRC>;
604impl<'a, REG> CKOUTSRC_W<'a, REG>
605where
606 REG: crate::Writable + crate::RegisterSpec,
607{
608 #[inline(always)]
610 pub fn sysclk(self) -> &'a mut crate::W<REG> {
611 self.variant(CKOUTSRC::Sysclk)
612 }
613 #[inline(always)]
615 pub fn audclk(self) -> &'a mut crate::W<REG> {
616 self.variant(CKOUTSRC::Audclk)
617 }
618}
619#[cfg_attr(feature = "defmt", derive(defmt::Format))]
623#[derive(Clone, Copy, Debug, PartialEq, Eq)]
624pub enum DFSDMEN {
625 Disabled = 0,
627 Enabled = 1,
629}
630impl From<DFSDMEN> for bool {
631 #[inline(always)]
632 fn from(variant: DFSDMEN) -> Self {
633 variant as u8 != 0
634 }
635}
636pub type DFSDMEN_R = crate::BitReader<DFSDMEN>;
638impl DFSDMEN_R {
639 #[inline(always)]
641 pub const fn variant(&self) -> DFSDMEN {
642 match self.bits {
643 false => DFSDMEN::Disabled,
644 true => DFSDMEN::Enabled,
645 }
646 }
647 #[inline(always)]
649 pub fn is_disabled(&self) -> bool {
650 *self == DFSDMEN::Disabled
651 }
652 #[inline(always)]
654 pub fn is_enabled(&self) -> bool {
655 *self == DFSDMEN::Enabled
656 }
657}
658pub type DFSDMEN_W<'a, REG> = crate::BitWriter<'a, REG, DFSDMEN>;
660impl<'a, REG> DFSDMEN_W<'a, REG>
661where
662 REG: crate::Writable + crate::RegisterSpec,
663{
664 #[inline(always)]
666 pub fn disabled(self) -> &'a mut crate::W<REG> {
667 self.variant(DFSDMEN::Disabled)
668 }
669 #[inline(always)]
671 pub fn enabled(self) -> &'a mut crate::W<REG> {
672 self.variant(DFSDMEN::Enabled)
673 }
674}
675impl R {
676 #[inline(always)]
678 pub fn sitp(&self) -> SITP_R {
679 SITP_R::new((self.bits & 3) as u8)
680 }
681 #[inline(always)]
683 pub fn spicksel(&self) -> SPICKSEL_R {
684 SPICKSEL_R::new(((self.bits >> 2) & 3) as u8)
685 }
686 #[inline(always)]
688 pub fn scden(&self) -> SCDEN_R {
689 SCDEN_R::new(((self.bits >> 5) & 1) != 0)
690 }
691 #[inline(always)]
693 pub fn ckaben(&self) -> CKABEN_R {
694 CKABEN_R::new(((self.bits >> 6) & 1) != 0)
695 }
696 #[inline(always)]
698 pub fn chen(&self) -> CHEN_R {
699 CHEN_R::new(((self.bits >> 7) & 1) != 0)
700 }
701 #[inline(always)]
703 pub fn chinsel(&self) -> CHINSEL_R {
704 CHINSEL_R::new(((self.bits >> 8) & 1) != 0)
705 }
706 #[inline(always)]
708 pub fn datmpx(&self) -> DATMPX_R {
709 DATMPX_R::new(((self.bits >> 12) & 3) as u8)
710 }
711 #[inline(always)]
713 pub fn datpack(&self) -> DATPACK_R {
714 DATPACK_R::new(((self.bits >> 14) & 3) as u8)
715 }
716 #[inline(always)]
718 pub fn ckoutdiv(&self) -> CKOUTDIV_R {
719 CKOUTDIV_R::new(((self.bits >> 16) & 0xff) as u8)
720 }
721 #[inline(always)]
723 pub fn ckoutsrc(&self) -> CKOUTSRC_R {
724 CKOUTSRC_R::new(((self.bits >> 30) & 1) != 0)
725 }
726 #[inline(always)]
728 pub fn dfsdmen(&self) -> DFSDMEN_R {
729 DFSDMEN_R::new(((self.bits >> 31) & 1) != 0)
730 }
731}
732impl core::fmt::Debug for R {
733 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
734 f.debug_struct("CFGR1")
735 .field("dfsdmen", &self.dfsdmen())
736 .field("ckoutsrc", &self.ckoutsrc())
737 .field("ckoutdiv", &self.ckoutdiv())
738 .field("datpack", &self.datpack())
739 .field("datmpx", &self.datmpx())
740 .field("chinsel", &self.chinsel())
741 .field("chen", &self.chen())
742 .field("ckaben", &self.ckaben())
743 .field("scden", &self.scden())
744 .field("spicksel", &self.spicksel())
745 .field("sitp", &self.sitp())
746 .finish()
747 }
748}
749impl W {
750 #[inline(always)]
752 pub fn sitp(&mut self) -> SITP_W<CFGR1rs> {
753 SITP_W::new(self, 0)
754 }
755 #[inline(always)]
757 pub fn spicksel(&mut self) -> SPICKSEL_W<CFGR1rs> {
758 SPICKSEL_W::new(self, 2)
759 }
760 #[inline(always)]
762 pub fn scden(&mut self) -> SCDEN_W<CFGR1rs> {
763 SCDEN_W::new(self, 5)
764 }
765 #[inline(always)]
767 pub fn ckaben(&mut self) -> CKABEN_W<CFGR1rs> {
768 CKABEN_W::new(self, 6)
769 }
770 #[inline(always)]
772 pub fn chen(&mut self) -> CHEN_W<CFGR1rs> {
773 CHEN_W::new(self, 7)
774 }
775 #[inline(always)]
777 pub fn chinsel(&mut self) -> CHINSEL_W<CFGR1rs> {
778 CHINSEL_W::new(self, 8)
779 }
780 #[inline(always)]
782 pub fn datmpx(&mut self) -> DATMPX_W<CFGR1rs> {
783 DATMPX_W::new(self, 12)
784 }
785 #[inline(always)]
787 pub fn datpack(&mut self) -> DATPACK_W<CFGR1rs> {
788 DATPACK_W::new(self, 14)
789 }
790 #[inline(always)]
792 pub fn ckoutdiv(&mut self) -> CKOUTDIV_W<CFGR1rs> {
793 CKOUTDIV_W::new(self, 16)
794 }
795 #[inline(always)]
797 pub fn ckoutsrc(&mut self) -> CKOUTSRC_W<CFGR1rs> {
798 CKOUTSRC_W::new(self, 30)
799 }
800 #[inline(always)]
802 pub fn dfsdmen(&mut self) -> DFSDMEN_W<CFGR1rs> {
803 DFSDMEN_W::new(self, 31)
804 }
805}
806pub struct CFGR1rs;
810impl crate::RegisterSpec for CFGR1rs {
811 type Ux = u32;
812}
813impl crate::Readable for CFGR1rs {}
815impl crate::Writable for CFGR1rs {
817 type Safety = crate::Unsafe;
818}
819impl crate::Resettable for CFGR1rs {}