1pub type R = crate::R<CR3rs>;
3pub type W = crate::W<CR3rs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum EIE {
11 Disabled = 0,
13 Enabled = 1,
15}
16impl From<EIE> for bool {
17 #[inline(always)]
18 fn from(variant: EIE) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type EIE_R = crate::BitReader<EIE>;
24impl EIE_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> EIE {
28 match self.bits {
29 false => EIE::Disabled,
30 true => EIE::Enabled,
31 }
32 }
33 #[inline(always)]
35 pub fn is_disabled(&self) -> bool {
36 *self == EIE::Disabled
37 }
38 #[inline(always)]
40 pub fn is_enabled(&self) -> bool {
41 *self == EIE::Enabled
42 }
43}
44pub type EIE_W<'a, REG> = crate::BitWriter<'a, REG, EIE>;
46impl<'a, REG> EIE_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(EIE::Disabled)
54 }
55 #[inline(always)]
57 pub fn enabled(self) -> &'a mut crate::W<REG> {
58 self.variant(EIE::Enabled)
59 }
60}
61#[cfg_attr(feature = "defmt", derive(defmt::Format))]
65#[derive(Clone, Copy, Debug, PartialEq, Eq)]
66pub enum IREN {
67 Disabled = 0,
69 Enabled = 1,
71}
72impl From<IREN> for bool {
73 #[inline(always)]
74 fn from(variant: IREN) -> Self {
75 variant as u8 != 0
76 }
77}
78pub type IREN_R = crate::BitReader<IREN>;
80impl IREN_R {
81 #[inline(always)]
83 pub const fn variant(&self) -> IREN {
84 match self.bits {
85 false => IREN::Disabled,
86 true => IREN::Enabled,
87 }
88 }
89 #[inline(always)]
91 pub fn is_disabled(&self) -> bool {
92 *self == IREN::Disabled
93 }
94 #[inline(always)]
96 pub fn is_enabled(&self) -> bool {
97 *self == IREN::Enabled
98 }
99}
100pub type IREN_W<'a, REG> = crate::BitWriter<'a, REG, IREN>;
102impl<'a, REG> IREN_W<'a, REG>
103where
104 REG: crate::Writable + crate::RegisterSpec,
105{
106 #[inline(always)]
108 pub fn disabled(self) -> &'a mut crate::W<REG> {
109 self.variant(IREN::Disabled)
110 }
111 #[inline(always)]
113 pub fn enabled(self) -> &'a mut crate::W<REG> {
114 self.variant(IREN::Enabled)
115 }
116}
117#[cfg_attr(feature = "defmt", derive(defmt::Format))]
121#[derive(Clone, Copy, Debug, PartialEq, Eq)]
122pub enum IRLP {
123 Normal = 0,
125 LowPower = 1,
127}
128impl From<IRLP> for bool {
129 #[inline(always)]
130 fn from(variant: IRLP) -> Self {
131 variant as u8 != 0
132 }
133}
134pub type IRLP_R = crate::BitReader<IRLP>;
136impl IRLP_R {
137 #[inline(always)]
139 pub const fn variant(&self) -> IRLP {
140 match self.bits {
141 false => IRLP::Normal,
142 true => IRLP::LowPower,
143 }
144 }
145 #[inline(always)]
147 pub fn is_normal(&self) -> bool {
148 *self == IRLP::Normal
149 }
150 #[inline(always)]
152 pub fn is_low_power(&self) -> bool {
153 *self == IRLP::LowPower
154 }
155}
156pub type IRLP_W<'a, REG> = crate::BitWriter<'a, REG, IRLP>;
158impl<'a, REG> IRLP_W<'a, REG>
159where
160 REG: crate::Writable + crate::RegisterSpec,
161{
162 #[inline(always)]
164 pub fn normal(self) -> &'a mut crate::W<REG> {
165 self.variant(IRLP::Normal)
166 }
167 #[inline(always)]
169 pub fn low_power(self) -> &'a mut crate::W<REG> {
170 self.variant(IRLP::LowPower)
171 }
172}
173#[cfg_attr(feature = "defmt", derive(defmt::Format))]
177#[derive(Clone, Copy, Debug, PartialEq, Eq)]
178pub enum HDSEL {
179 FullDuplex = 0,
181 HalfDuplex = 1,
183}
184impl From<HDSEL> for bool {
185 #[inline(always)]
186 fn from(variant: HDSEL) -> Self {
187 variant as u8 != 0
188 }
189}
190pub type HDSEL_R = crate::BitReader<HDSEL>;
192impl HDSEL_R {
193 #[inline(always)]
195 pub const fn variant(&self) -> HDSEL {
196 match self.bits {
197 false => HDSEL::FullDuplex,
198 true => HDSEL::HalfDuplex,
199 }
200 }
201 #[inline(always)]
203 pub fn is_full_duplex(&self) -> bool {
204 *self == HDSEL::FullDuplex
205 }
206 #[inline(always)]
208 pub fn is_half_duplex(&self) -> bool {
209 *self == HDSEL::HalfDuplex
210 }
211}
212pub type HDSEL_W<'a, REG> = crate::BitWriter<'a, REG, HDSEL>;
214impl<'a, REG> HDSEL_W<'a, REG>
215where
216 REG: crate::Writable + crate::RegisterSpec,
217{
218 #[inline(always)]
220 pub fn full_duplex(self) -> &'a mut crate::W<REG> {
221 self.variant(HDSEL::FullDuplex)
222 }
223 #[inline(always)]
225 pub fn half_duplex(self) -> &'a mut crate::W<REG> {
226 self.variant(HDSEL::HalfDuplex)
227 }
228}
229#[cfg_attr(feature = "defmt", derive(defmt::Format))]
233#[derive(Clone, Copy, Debug, PartialEq, Eq)]
234pub enum NACK {
235 Disabled = 0,
237 Enabled = 1,
239}
240impl From<NACK> for bool {
241 #[inline(always)]
242 fn from(variant: NACK) -> Self {
243 variant as u8 != 0
244 }
245}
246pub type NACK_R = crate::BitReader<NACK>;
248impl NACK_R {
249 #[inline(always)]
251 pub const fn variant(&self) -> NACK {
252 match self.bits {
253 false => NACK::Disabled,
254 true => NACK::Enabled,
255 }
256 }
257 #[inline(always)]
259 pub fn is_disabled(&self) -> bool {
260 *self == NACK::Disabled
261 }
262 #[inline(always)]
264 pub fn is_enabled(&self) -> bool {
265 *self == NACK::Enabled
266 }
267}
268pub type NACK_W<'a, REG> = crate::BitWriter<'a, REG, NACK>;
270impl<'a, REG> NACK_W<'a, REG>
271where
272 REG: crate::Writable + crate::RegisterSpec,
273{
274 #[inline(always)]
276 pub fn disabled(self) -> &'a mut crate::W<REG> {
277 self.variant(NACK::Disabled)
278 }
279 #[inline(always)]
281 pub fn enabled(self) -> &'a mut crate::W<REG> {
282 self.variant(NACK::Enabled)
283 }
284}
285#[cfg_attr(feature = "defmt", derive(defmt::Format))]
289#[derive(Clone, Copy, Debug, PartialEq, Eq)]
290pub enum SCEN {
291 Disabled = 0,
293 Enabled = 1,
295}
296impl From<SCEN> for bool {
297 #[inline(always)]
298 fn from(variant: SCEN) -> Self {
299 variant as u8 != 0
300 }
301}
302pub type SCEN_R = crate::BitReader<SCEN>;
304impl SCEN_R {
305 #[inline(always)]
307 pub const fn variant(&self) -> SCEN {
308 match self.bits {
309 false => SCEN::Disabled,
310 true => SCEN::Enabled,
311 }
312 }
313 #[inline(always)]
315 pub fn is_disabled(&self) -> bool {
316 *self == SCEN::Disabled
317 }
318 #[inline(always)]
320 pub fn is_enabled(&self) -> bool {
321 *self == SCEN::Enabled
322 }
323}
324pub type SCEN_W<'a, REG> = crate::BitWriter<'a, REG, SCEN>;
326impl<'a, REG> SCEN_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(SCEN::Disabled)
334 }
335 #[inline(always)]
337 pub fn enabled(self) -> &'a mut crate::W<REG> {
338 self.variant(SCEN::Enabled)
339 }
340}
341#[cfg_attr(feature = "defmt", derive(defmt::Format))]
345#[derive(Clone, Copy, Debug, PartialEq, Eq)]
346pub enum DMAR {
347 Disabled = 0,
349 Enabled = 1,
351}
352impl From<DMAR> for bool {
353 #[inline(always)]
354 fn from(variant: DMAR) -> Self {
355 variant as u8 != 0
356 }
357}
358pub type DMAR_R = crate::BitReader<DMAR>;
360impl DMAR_R {
361 #[inline(always)]
363 pub const fn variant(&self) -> DMAR {
364 match self.bits {
365 false => DMAR::Disabled,
366 true => DMAR::Enabled,
367 }
368 }
369 #[inline(always)]
371 pub fn is_disabled(&self) -> bool {
372 *self == DMAR::Disabled
373 }
374 #[inline(always)]
376 pub fn is_enabled(&self) -> bool {
377 *self == DMAR::Enabled
378 }
379}
380pub type DMAR_W<'a, REG> = crate::BitWriter<'a, REG, DMAR>;
382impl<'a, REG> DMAR_W<'a, REG>
383where
384 REG: crate::Writable + crate::RegisterSpec,
385{
386 #[inline(always)]
388 pub fn disabled(self) -> &'a mut crate::W<REG> {
389 self.variant(DMAR::Disabled)
390 }
391 #[inline(always)]
393 pub fn enabled(self) -> &'a mut crate::W<REG> {
394 self.variant(DMAR::Enabled)
395 }
396}
397#[cfg_attr(feature = "defmt", derive(defmt::Format))]
401#[derive(Clone, Copy, Debug, PartialEq, Eq)]
402pub enum DMAT {
403 Disabled = 0,
405 Enabled = 1,
407}
408impl From<DMAT> for bool {
409 #[inline(always)]
410 fn from(variant: DMAT) -> Self {
411 variant as u8 != 0
412 }
413}
414pub type DMAT_R = crate::BitReader<DMAT>;
416impl DMAT_R {
417 #[inline(always)]
419 pub const fn variant(&self) -> DMAT {
420 match self.bits {
421 false => DMAT::Disabled,
422 true => DMAT::Enabled,
423 }
424 }
425 #[inline(always)]
427 pub fn is_disabled(&self) -> bool {
428 *self == DMAT::Disabled
429 }
430 #[inline(always)]
432 pub fn is_enabled(&self) -> bool {
433 *self == DMAT::Enabled
434 }
435}
436pub type DMAT_W<'a, REG> = crate::BitWriter<'a, REG, DMAT>;
438impl<'a, REG> DMAT_W<'a, REG>
439where
440 REG: crate::Writable + crate::RegisterSpec,
441{
442 #[inline(always)]
444 pub fn disabled(self) -> &'a mut crate::W<REG> {
445 self.variant(DMAT::Disabled)
446 }
447 #[inline(always)]
449 pub fn enabled(self) -> &'a mut crate::W<REG> {
450 self.variant(DMAT::Enabled)
451 }
452}
453#[cfg_attr(feature = "defmt", derive(defmt::Format))]
457#[derive(Clone, Copy, Debug, PartialEq, Eq)]
458pub enum RTSE {
459 Disabled = 0,
461 Enabled = 1,
463}
464impl From<RTSE> for bool {
465 #[inline(always)]
466 fn from(variant: RTSE) -> Self {
467 variant as u8 != 0
468 }
469}
470pub type RTSE_R = crate::BitReader<RTSE>;
472impl RTSE_R {
473 #[inline(always)]
475 pub const fn variant(&self) -> RTSE {
476 match self.bits {
477 false => RTSE::Disabled,
478 true => RTSE::Enabled,
479 }
480 }
481 #[inline(always)]
483 pub fn is_disabled(&self) -> bool {
484 *self == RTSE::Disabled
485 }
486 #[inline(always)]
488 pub fn is_enabled(&self) -> bool {
489 *self == RTSE::Enabled
490 }
491}
492pub type RTSE_W<'a, REG> = crate::BitWriter<'a, REG, RTSE>;
494impl<'a, REG> RTSE_W<'a, REG>
495where
496 REG: crate::Writable + crate::RegisterSpec,
497{
498 #[inline(always)]
500 pub fn disabled(self) -> &'a mut crate::W<REG> {
501 self.variant(RTSE::Disabled)
502 }
503 #[inline(always)]
505 pub fn enabled(self) -> &'a mut crate::W<REG> {
506 self.variant(RTSE::Enabled)
507 }
508}
509#[cfg_attr(feature = "defmt", derive(defmt::Format))]
513#[derive(Clone, Copy, Debug, PartialEq, Eq)]
514pub enum CTSE {
515 Disabled = 0,
517 Enabled = 1,
519}
520impl From<CTSE> for bool {
521 #[inline(always)]
522 fn from(variant: CTSE) -> Self {
523 variant as u8 != 0
524 }
525}
526pub type CTSE_R = crate::BitReader<CTSE>;
528impl CTSE_R {
529 #[inline(always)]
531 pub const fn variant(&self) -> CTSE {
532 match self.bits {
533 false => CTSE::Disabled,
534 true => CTSE::Enabled,
535 }
536 }
537 #[inline(always)]
539 pub fn is_disabled(&self) -> bool {
540 *self == CTSE::Disabled
541 }
542 #[inline(always)]
544 pub fn is_enabled(&self) -> bool {
545 *self == CTSE::Enabled
546 }
547}
548pub type CTSE_W<'a, REG> = crate::BitWriter<'a, REG, CTSE>;
550impl<'a, REG> CTSE_W<'a, REG>
551where
552 REG: crate::Writable + crate::RegisterSpec,
553{
554 #[inline(always)]
556 pub fn disabled(self) -> &'a mut crate::W<REG> {
557 self.variant(CTSE::Disabled)
558 }
559 #[inline(always)]
561 pub fn enabled(self) -> &'a mut crate::W<REG> {
562 self.variant(CTSE::Enabled)
563 }
564}
565#[cfg_attr(feature = "defmt", derive(defmt::Format))]
569#[derive(Clone, Copy, Debug, PartialEq, Eq)]
570pub enum CTSIE {
571 Disabled = 0,
573 Enabled = 1,
575}
576impl From<CTSIE> for bool {
577 #[inline(always)]
578 fn from(variant: CTSIE) -> Self {
579 variant as u8 != 0
580 }
581}
582pub type CTSIE_R = crate::BitReader<CTSIE>;
584impl CTSIE_R {
585 #[inline(always)]
587 pub const fn variant(&self) -> CTSIE {
588 match self.bits {
589 false => CTSIE::Disabled,
590 true => CTSIE::Enabled,
591 }
592 }
593 #[inline(always)]
595 pub fn is_disabled(&self) -> bool {
596 *self == CTSIE::Disabled
597 }
598 #[inline(always)]
600 pub fn is_enabled(&self) -> bool {
601 *self == CTSIE::Enabled
602 }
603}
604pub type CTSIE_W<'a, REG> = crate::BitWriter<'a, REG, CTSIE>;
606impl<'a, REG> CTSIE_W<'a, REG>
607where
608 REG: crate::Writable + crate::RegisterSpec,
609{
610 #[inline(always)]
612 pub fn disabled(self) -> &'a mut crate::W<REG> {
613 self.variant(CTSIE::Disabled)
614 }
615 #[inline(always)]
617 pub fn enabled(self) -> &'a mut crate::W<REG> {
618 self.variant(CTSIE::Enabled)
619 }
620}
621impl R {
622 #[inline(always)]
624 pub fn eie(&self) -> EIE_R {
625 EIE_R::new((self.bits & 1) != 0)
626 }
627 #[inline(always)]
629 pub fn iren(&self) -> IREN_R {
630 IREN_R::new(((self.bits >> 1) & 1) != 0)
631 }
632 #[inline(always)]
634 pub fn irlp(&self) -> IRLP_R {
635 IRLP_R::new(((self.bits >> 2) & 1) != 0)
636 }
637 #[inline(always)]
639 pub fn hdsel(&self) -> HDSEL_R {
640 HDSEL_R::new(((self.bits >> 3) & 1) != 0)
641 }
642 #[inline(always)]
644 pub fn nack(&self) -> NACK_R {
645 NACK_R::new(((self.bits >> 4) & 1) != 0)
646 }
647 #[inline(always)]
649 pub fn scen(&self) -> SCEN_R {
650 SCEN_R::new(((self.bits >> 5) & 1) != 0)
651 }
652 #[inline(always)]
654 pub fn dmar(&self) -> DMAR_R {
655 DMAR_R::new(((self.bits >> 6) & 1) != 0)
656 }
657 #[inline(always)]
659 pub fn dmat(&self) -> DMAT_R {
660 DMAT_R::new(((self.bits >> 7) & 1) != 0)
661 }
662 #[inline(always)]
664 pub fn rtse(&self) -> RTSE_R {
665 RTSE_R::new(((self.bits >> 8) & 1) != 0)
666 }
667 #[inline(always)]
669 pub fn ctse(&self) -> CTSE_R {
670 CTSE_R::new(((self.bits >> 9) & 1) != 0)
671 }
672 #[inline(always)]
674 pub fn ctsie(&self) -> CTSIE_R {
675 CTSIE_R::new(((self.bits >> 10) & 1) != 0)
676 }
677}
678impl core::fmt::Debug for R {
679 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
680 f.debug_struct("CR3")
681 .field("ctsie", &self.ctsie())
682 .field("ctse", &self.ctse())
683 .field("rtse", &self.rtse())
684 .field("dmat", &self.dmat())
685 .field("dmar", &self.dmar())
686 .field("scen", &self.scen())
687 .field("nack", &self.nack())
688 .field("hdsel", &self.hdsel())
689 .field("irlp", &self.irlp())
690 .field("iren", &self.iren())
691 .field("eie", &self.eie())
692 .finish()
693 }
694}
695impl W {
696 #[inline(always)]
698 pub fn eie(&mut self) -> EIE_W<CR3rs> {
699 EIE_W::new(self, 0)
700 }
701 #[inline(always)]
703 pub fn iren(&mut self) -> IREN_W<CR3rs> {
704 IREN_W::new(self, 1)
705 }
706 #[inline(always)]
708 pub fn irlp(&mut self) -> IRLP_W<CR3rs> {
709 IRLP_W::new(self, 2)
710 }
711 #[inline(always)]
713 pub fn hdsel(&mut self) -> HDSEL_W<CR3rs> {
714 HDSEL_W::new(self, 3)
715 }
716 #[inline(always)]
718 pub fn nack(&mut self) -> NACK_W<CR3rs> {
719 NACK_W::new(self, 4)
720 }
721 #[inline(always)]
723 pub fn scen(&mut self) -> SCEN_W<CR3rs> {
724 SCEN_W::new(self, 5)
725 }
726 #[inline(always)]
728 pub fn dmar(&mut self) -> DMAR_W<CR3rs> {
729 DMAR_W::new(self, 6)
730 }
731 #[inline(always)]
733 pub fn dmat(&mut self) -> DMAT_W<CR3rs> {
734 DMAT_W::new(self, 7)
735 }
736 #[inline(always)]
738 pub fn rtse(&mut self) -> RTSE_W<CR3rs> {
739 RTSE_W::new(self, 8)
740 }
741 #[inline(always)]
743 pub fn ctse(&mut self) -> CTSE_W<CR3rs> {
744 CTSE_W::new(self, 9)
745 }
746 #[inline(always)]
748 pub fn ctsie(&mut self) -> CTSIE_W<CR3rs> {
749 CTSIE_W::new(self, 10)
750 }
751}
752pub struct CR3rs;
758impl crate::RegisterSpec for CR3rs {
759 type Ux = u16;
760}
761impl crate::Readable for CR3rs {}
763impl crate::Writable for CR3rs {
765 type Safety = crate::Unsafe;
766}
767impl crate::Resettable for CR3rs {}