1pub type R = crate::R<SR1rs>;
3pub type W = crate::W<SR1rs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum SB {
11 NoStart = 0,
13 Start = 1,
15}
16impl From<SB> for bool {
17 #[inline(always)]
18 fn from(variant: SB) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type SB_R = crate::BitReader<SB>;
24impl SB_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> SB {
28 match self.bits {
29 false => SB::NoStart,
30 true => SB::Start,
31 }
32 }
33 #[inline(always)]
35 pub fn is_no_start(&self) -> bool {
36 *self == SB::NoStart
37 }
38 #[inline(always)]
40 pub fn is_start(&self) -> bool {
41 *self == SB::Start
42 }
43}
44#[cfg_attr(feature = "defmt", derive(defmt::Format))]
48#[derive(Clone, Copy, Debug, PartialEq, Eq)]
49pub enum ADDR {
50 NotMatch = 0,
52 Match = 1,
54}
55impl From<ADDR> for bool {
56 #[inline(always)]
57 fn from(variant: ADDR) -> Self {
58 variant as u8 != 0
59 }
60}
61pub type ADDR_R = crate::BitReader<ADDR>;
63impl ADDR_R {
64 #[inline(always)]
66 pub const fn variant(&self) -> ADDR {
67 match self.bits {
68 false => ADDR::NotMatch,
69 true => ADDR::Match,
70 }
71 }
72 #[inline(always)]
74 pub fn is_not_match(&self) -> bool {
75 *self == ADDR::NotMatch
76 }
77 #[inline(always)]
79 pub fn is_match(&self) -> bool {
80 *self == ADDR::Match
81 }
82}
83#[cfg_attr(feature = "defmt", derive(defmt::Format))]
87#[derive(Clone, Copy, Debug, PartialEq, Eq)]
88pub enum BTF {
89 NotFinished = 0,
91 Finished = 1,
93}
94impl From<BTF> for bool {
95 #[inline(always)]
96 fn from(variant: BTF) -> Self {
97 variant as u8 != 0
98 }
99}
100pub type BTF_R = crate::BitReader<BTF>;
102impl BTF_R {
103 #[inline(always)]
105 pub const fn variant(&self) -> BTF {
106 match self.bits {
107 false => BTF::NotFinished,
108 true => BTF::Finished,
109 }
110 }
111 #[inline(always)]
113 pub fn is_not_finished(&self) -> bool {
114 *self == BTF::NotFinished
115 }
116 #[inline(always)]
118 pub fn is_finished(&self) -> bool {
119 *self == BTF::Finished
120 }
121}
122pub type ADD10_R = crate::BitReader;
124#[cfg_attr(feature = "defmt", derive(defmt::Format))]
128#[derive(Clone, Copy, Debug, PartialEq, Eq)]
129pub enum STOPF {
130 NoStop = 0,
132 Stop = 1,
134}
135impl From<STOPF> for bool {
136 #[inline(always)]
137 fn from(variant: STOPF) -> Self {
138 variant as u8 != 0
139 }
140}
141pub type STOPF_R = crate::BitReader<STOPF>;
143impl STOPF_R {
144 #[inline(always)]
146 pub const fn variant(&self) -> STOPF {
147 match self.bits {
148 false => STOPF::NoStop,
149 true => STOPF::Stop,
150 }
151 }
152 #[inline(always)]
154 pub fn is_no_stop(&self) -> bool {
155 *self == STOPF::NoStop
156 }
157 #[inline(always)]
159 pub fn is_stop(&self) -> bool {
160 *self == STOPF::Stop
161 }
162}
163#[cfg_attr(feature = "defmt", derive(defmt::Format))]
167#[derive(Clone, Copy, Debug, PartialEq, Eq)]
168pub enum RX_NE {
169 Empty = 0,
171 NotEmpty = 1,
173}
174impl From<RX_NE> for bool {
175 #[inline(always)]
176 fn from(variant: RX_NE) -> Self {
177 variant as u8 != 0
178 }
179}
180pub type RX_NE_R = crate::BitReader<RX_NE>;
182impl RX_NE_R {
183 #[inline(always)]
185 pub const fn variant(&self) -> RX_NE {
186 match self.bits {
187 false => RX_NE::Empty,
188 true => RX_NE::NotEmpty,
189 }
190 }
191 #[inline(always)]
193 pub fn is_empty(&self) -> bool {
194 *self == RX_NE::Empty
195 }
196 #[inline(always)]
198 pub fn is_not_empty(&self) -> bool {
199 *self == RX_NE::NotEmpty
200 }
201}
202#[cfg_attr(feature = "defmt", derive(defmt::Format))]
206#[derive(Clone, Copy, Debug, PartialEq, Eq)]
207pub enum TX_E {
208 NotEmpty = 0,
210 Empty = 1,
212}
213impl From<TX_E> for bool {
214 #[inline(always)]
215 fn from(variant: TX_E) -> Self {
216 variant as u8 != 0
217 }
218}
219pub type TX_E_R = crate::BitReader<TX_E>;
221impl TX_E_R {
222 #[inline(always)]
224 pub const fn variant(&self) -> TX_E {
225 match self.bits {
226 false => TX_E::NotEmpty,
227 true => TX_E::Empty,
228 }
229 }
230 #[inline(always)]
232 pub fn is_not_empty(&self) -> bool {
233 *self == TX_E::NotEmpty
234 }
235 #[inline(always)]
237 pub fn is_empty(&self) -> bool {
238 *self == TX_E::Empty
239 }
240}
241#[cfg_attr(feature = "defmt", derive(defmt::Format))]
245#[derive(Clone, Copy, Debug, PartialEq, Eq)]
246pub enum BERRR {
247 NoError = 0,
249 Error = 1,
251}
252impl From<BERRR> for bool {
253 #[inline(always)]
254 fn from(variant: BERRR) -> Self {
255 variant as u8 != 0
256 }
257}
258pub type BERR_R = crate::BitReader<BERRR>;
260impl BERR_R {
261 #[inline(always)]
263 pub const fn variant(&self) -> BERRR {
264 match self.bits {
265 false => BERRR::NoError,
266 true => BERRR::Error,
267 }
268 }
269 #[inline(always)]
271 pub fn is_no_error(&self) -> bool {
272 *self == BERRR::NoError
273 }
274 #[inline(always)]
276 pub fn is_error(&self) -> bool {
277 *self == BERRR::Error
278 }
279}
280#[cfg_attr(feature = "defmt", derive(defmt::Format))]
284#[derive(Clone, Copy, Debug, PartialEq, Eq)]
285pub enum BERRW {
286 Clear = 0,
288}
289impl From<BERRW> for bool {
290 #[inline(always)]
291 fn from(variant: BERRW) -> Self {
292 variant as u8 != 0
293 }
294}
295pub type BERR_W<'a, REG> = crate::BitWriter0C<'a, REG, BERRW>;
297impl<'a, REG> BERR_W<'a, REG>
298where
299 REG: crate::Writable + crate::RegisterSpec,
300{
301 #[inline(always)]
303 pub fn clear(self) -> &'a mut crate::W<REG> {
304 self.variant(BERRW::Clear)
305 }
306}
307#[cfg_attr(feature = "defmt", derive(defmt::Format))]
311#[derive(Clone, Copy, Debug, PartialEq, Eq)]
312pub enum ARLOR {
313 NoLost = 0,
315 Lost = 1,
317}
318impl From<ARLOR> for bool {
319 #[inline(always)]
320 fn from(variant: ARLOR) -> Self {
321 variant as u8 != 0
322 }
323}
324pub type ARLO_R = crate::BitReader<ARLOR>;
326impl ARLO_R {
327 #[inline(always)]
329 pub const fn variant(&self) -> ARLOR {
330 match self.bits {
331 false => ARLOR::NoLost,
332 true => ARLOR::Lost,
333 }
334 }
335 #[inline(always)]
337 pub fn is_no_lost(&self) -> bool {
338 *self == ARLOR::NoLost
339 }
340 #[inline(always)]
342 pub fn is_lost(&self) -> bool {
343 *self == ARLOR::Lost
344 }
345}
346#[cfg_attr(feature = "defmt", derive(defmt::Format))]
350#[derive(Clone, Copy, Debug, PartialEq, Eq)]
351pub enum ARLOW {
352 Clear = 0,
354}
355impl From<ARLOW> for bool {
356 #[inline(always)]
357 fn from(variant: ARLOW) -> Self {
358 variant as u8 != 0
359 }
360}
361pub type ARLO_W<'a, REG> = crate::BitWriter0C<'a, REG, ARLOW>;
363impl<'a, REG> ARLO_W<'a, REG>
364where
365 REG: crate::Writable + crate::RegisterSpec,
366{
367 #[inline(always)]
369 pub fn clear(self) -> &'a mut crate::W<REG> {
370 self.variant(ARLOW::Clear)
371 }
372}
373#[cfg_attr(feature = "defmt", derive(defmt::Format))]
377#[derive(Clone, Copy, Debug, PartialEq, Eq)]
378pub enum AFR {
379 NoFailure = 0,
381 Failure = 1,
383}
384impl From<AFR> for bool {
385 #[inline(always)]
386 fn from(variant: AFR) -> Self {
387 variant as u8 != 0
388 }
389}
390pub type AF_R = crate::BitReader<AFR>;
392impl AF_R {
393 #[inline(always)]
395 pub const fn variant(&self) -> AFR {
396 match self.bits {
397 false => AFR::NoFailure,
398 true => AFR::Failure,
399 }
400 }
401 #[inline(always)]
403 pub fn is_no_failure(&self) -> bool {
404 *self == AFR::NoFailure
405 }
406 #[inline(always)]
408 pub fn is_failure(&self) -> bool {
409 *self == AFR::Failure
410 }
411}
412#[cfg_attr(feature = "defmt", derive(defmt::Format))]
416#[derive(Clone, Copy, Debug, PartialEq, Eq)]
417pub enum AFW {
418 Clear = 0,
420}
421impl From<AFW> for bool {
422 #[inline(always)]
423 fn from(variant: AFW) -> Self {
424 variant as u8 != 0
425 }
426}
427pub type AF_W<'a, REG> = crate::BitWriter0C<'a, REG, AFW>;
429impl<'a, REG> AF_W<'a, REG>
430where
431 REG: crate::Writable + crate::RegisterSpec,
432{
433 #[inline(always)]
435 pub fn clear(self) -> &'a mut crate::W<REG> {
436 self.variant(AFW::Clear)
437 }
438}
439#[cfg_attr(feature = "defmt", derive(defmt::Format))]
443#[derive(Clone, Copy, Debug, PartialEq, Eq)]
444pub enum OVRR {
445 NoOverrun = 0,
447 Overrun = 1,
449}
450impl From<OVRR> for bool {
451 #[inline(always)]
452 fn from(variant: OVRR) -> Self {
453 variant as u8 != 0
454 }
455}
456pub type OVR_R = crate::BitReader<OVRR>;
458impl OVR_R {
459 #[inline(always)]
461 pub const fn variant(&self) -> OVRR {
462 match self.bits {
463 false => OVRR::NoOverrun,
464 true => OVRR::Overrun,
465 }
466 }
467 #[inline(always)]
469 pub fn is_no_overrun(&self) -> bool {
470 *self == OVRR::NoOverrun
471 }
472 #[inline(always)]
474 pub fn is_overrun(&self) -> bool {
475 *self == OVRR::Overrun
476 }
477}
478#[cfg_attr(feature = "defmt", derive(defmt::Format))]
482#[derive(Clone, Copy, Debug, PartialEq, Eq)]
483pub enum OVRW {
484 Clear = 0,
486}
487impl From<OVRW> for bool {
488 #[inline(always)]
489 fn from(variant: OVRW) -> Self {
490 variant as u8 != 0
491 }
492}
493pub type OVR_W<'a, REG> = crate::BitWriter0C<'a, REG, OVRW>;
495impl<'a, REG> OVR_W<'a, REG>
496where
497 REG: crate::Writable + crate::RegisterSpec,
498{
499 #[inline(always)]
501 pub fn clear(self) -> &'a mut crate::W<REG> {
502 self.variant(OVRW::Clear)
503 }
504}
505#[cfg_attr(feature = "defmt", derive(defmt::Format))]
509#[derive(Clone, Copy, Debug, PartialEq, Eq)]
510pub enum PECERRR {
511 NoError = 0,
513 Error = 1,
515}
516impl From<PECERRR> for bool {
517 #[inline(always)]
518 fn from(variant: PECERRR) -> Self {
519 variant as u8 != 0
520 }
521}
522pub type PECERR_R = crate::BitReader<PECERRR>;
524impl PECERR_R {
525 #[inline(always)]
527 pub const fn variant(&self) -> PECERRR {
528 match self.bits {
529 false => PECERRR::NoError,
530 true => PECERRR::Error,
531 }
532 }
533 #[inline(always)]
535 pub fn is_no_error(&self) -> bool {
536 *self == PECERRR::NoError
537 }
538 #[inline(always)]
540 pub fn is_error(&self) -> bool {
541 *self == PECERRR::Error
542 }
543}
544#[cfg_attr(feature = "defmt", derive(defmt::Format))]
548#[derive(Clone, Copy, Debug, PartialEq, Eq)]
549pub enum PECERRW {
550 Clear = 0,
552}
553impl From<PECERRW> for bool {
554 #[inline(always)]
555 fn from(variant: PECERRW) -> Self {
556 variant as u8 != 0
557 }
558}
559pub type PECERR_W<'a, REG> = crate::BitWriter0C<'a, REG, PECERRW>;
561impl<'a, REG> PECERR_W<'a, REG>
562where
563 REG: crate::Writable + crate::RegisterSpec,
564{
565 #[inline(always)]
567 pub fn clear(self) -> &'a mut crate::W<REG> {
568 self.variant(PECERRW::Clear)
569 }
570}
571#[cfg_attr(feature = "defmt", derive(defmt::Format))]
575#[derive(Clone, Copy, Debug, PartialEq, Eq)]
576pub enum TIMEOUTR {
577 NoTimeout = 0,
579 Timeout = 1,
581}
582impl From<TIMEOUTR> for bool {
583 #[inline(always)]
584 fn from(variant: TIMEOUTR) -> Self {
585 variant as u8 != 0
586 }
587}
588pub type TIMEOUT_R = crate::BitReader<TIMEOUTR>;
590impl TIMEOUT_R {
591 #[inline(always)]
593 pub const fn variant(&self) -> TIMEOUTR {
594 match self.bits {
595 false => TIMEOUTR::NoTimeout,
596 true => TIMEOUTR::Timeout,
597 }
598 }
599 #[inline(always)]
601 pub fn is_no_timeout(&self) -> bool {
602 *self == TIMEOUTR::NoTimeout
603 }
604 #[inline(always)]
606 pub fn is_timeout(&self) -> bool {
607 *self == TIMEOUTR::Timeout
608 }
609}
610#[cfg_attr(feature = "defmt", derive(defmt::Format))]
614#[derive(Clone, Copy, Debug, PartialEq, Eq)]
615pub enum TIMEOUTW {
616 Clear = 0,
618}
619impl From<TIMEOUTW> for bool {
620 #[inline(always)]
621 fn from(variant: TIMEOUTW) -> Self {
622 variant as u8 != 0
623 }
624}
625pub type TIMEOUT_W<'a, REG> = crate::BitWriter0C<'a, REG, TIMEOUTW>;
627impl<'a, REG> TIMEOUT_W<'a, REG>
628where
629 REG: crate::Writable + crate::RegisterSpec,
630{
631 #[inline(always)]
633 pub fn clear(self) -> &'a mut crate::W<REG> {
634 self.variant(TIMEOUTW::Clear)
635 }
636}
637#[cfg_attr(feature = "defmt", derive(defmt::Format))]
641#[derive(Clone, Copy, Debug, PartialEq, Eq)]
642pub enum SMBALERTR {
643 NoAlert = 0,
645 Alert = 1,
647}
648impl From<SMBALERTR> for bool {
649 #[inline(always)]
650 fn from(variant: SMBALERTR) -> Self {
651 variant as u8 != 0
652 }
653}
654pub type SMBALERT_R = crate::BitReader<SMBALERTR>;
656impl SMBALERT_R {
657 #[inline(always)]
659 pub const fn variant(&self) -> SMBALERTR {
660 match self.bits {
661 false => SMBALERTR::NoAlert,
662 true => SMBALERTR::Alert,
663 }
664 }
665 #[inline(always)]
667 pub fn is_no_alert(&self) -> bool {
668 *self == SMBALERTR::NoAlert
669 }
670 #[inline(always)]
672 pub fn is_alert(&self) -> bool {
673 *self == SMBALERTR::Alert
674 }
675}
676#[cfg_attr(feature = "defmt", derive(defmt::Format))]
680#[derive(Clone, Copy, Debug, PartialEq, Eq)]
681pub enum SMBALERTW {
682 Clear = 0,
684}
685impl From<SMBALERTW> for bool {
686 #[inline(always)]
687 fn from(variant: SMBALERTW) -> Self {
688 variant as u8 != 0
689 }
690}
691pub type SMBALERT_W<'a, REG> = crate::BitWriter0C<'a, REG, SMBALERTW>;
693impl<'a, REG> SMBALERT_W<'a, REG>
694where
695 REG: crate::Writable + crate::RegisterSpec,
696{
697 #[inline(always)]
699 pub fn clear(self) -> &'a mut crate::W<REG> {
700 self.variant(SMBALERTW::Clear)
701 }
702}
703impl R {
704 #[inline(always)]
706 pub fn sb(&self) -> SB_R {
707 SB_R::new((self.bits & 1) != 0)
708 }
709 #[inline(always)]
711 pub fn addr(&self) -> ADDR_R {
712 ADDR_R::new(((self.bits >> 1) & 1) != 0)
713 }
714 #[inline(always)]
716 pub fn btf(&self) -> BTF_R {
717 BTF_R::new(((self.bits >> 2) & 1) != 0)
718 }
719 #[inline(always)]
721 pub fn add10(&self) -> ADD10_R {
722 ADD10_R::new(((self.bits >> 3) & 1) != 0)
723 }
724 #[inline(always)]
726 pub fn stopf(&self) -> STOPF_R {
727 STOPF_R::new(((self.bits >> 4) & 1) != 0)
728 }
729 #[inline(always)]
731 pub fn rx_ne(&self) -> RX_NE_R {
732 RX_NE_R::new(((self.bits >> 6) & 1) != 0)
733 }
734 #[inline(always)]
736 pub fn tx_e(&self) -> TX_E_R {
737 TX_E_R::new(((self.bits >> 7) & 1) != 0)
738 }
739 #[inline(always)]
741 pub fn berr(&self) -> BERR_R {
742 BERR_R::new(((self.bits >> 8) & 1) != 0)
743 }
744 #[inline(always)]
746 pub fn arlo(&self) -> ARLO_R {
747 ARLO_R::new(((self.bits >> 9) & 1) != 0)
748 }
749 #[inline(always)]
751 pub fn af(&self) -> AF_R {
752 AF_R::new(((self.bits >> 10) & 1) != 0)
753 }
754 #[inline(always)]
756 pub fn ovr(&self) -> OVR_R {
757 OVR_R::new(((self.bits >> 11) & 1) != 0)
758 }
759 #[inline(always)]
761 pub fn pecerr(&self) -> PECERR_R {
762 PECERR_R::new(((self.bits >> 12) & 1) != 0)
763 }
764 #[inline(always)]
766 pub fn timeout(&self) -> TIMEOUT_R {
767 TIMEOUT_R::new(((self.bits >> 14) & 1) != 0)
768 }
769 #[inline(always)]
771 pub fn smbalert(&self) -> SMBALERT_R {
772 SMBALERT_R::new(((self.bits >> 15) & 1) != 0)
773 }
774}
775impl core::fmt::Debug for R {
776 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
777 f.debug_struct("SR1")
778 .field("smbalert", &self.smbalert())
779 .field("timeout", &self.timeout())
780 .field("pecerr", &self.pecerr())
781 .field("ovr", &self.ovr())
782 .field("af", &self.af())
783 .field("arlo", &self.arlo())
784 .field("berr", &self.berr())
785 .field("tx_e", &self.tx_e())
786 .field("rx_ne", &self.rx_ne())
787 .field("stopf", &self.stopf())
788 .field("add10", &self.add10())
789 .field("btf", &self.btf())
790 .field("addr", &self.addr())
791 .field("sb", &self.sb())
792 .finish()
793 }
794}
795impl W {
796 #[inline(always)]
798 pub fn berr(&mut self) -> BERR_W<SR1rs> {
799 BERR_W::new(self, 8)
800 }
801 #[inline(always)]
803 pub fn arlo(&mut self) -> ARLO_W<SR1rs> {
804 ARLO_W::new(self, 9)
805 }
806 #[inline(always)]
808 pub fn af(&mut self) -> AF_W<SR1rs> {
809 AF_W::new(self, 10)
810 }
811 #[inline(always)]
813 pub fn ovr(&mut self) -> OVR_W<SR1rs> {
814 OVR_W::new(self, 11)
815 }
816 #[inline(always)]
818 pub fn pecerr(&mut self) -> PECERR_W<SR1rs> {
819 PECERR_W::new(self, 12)
820 }
821 #[inline(always)]
823 pub fn timeout(&mut self) -> TIMEOUT_W<SR1rs> {
824 TIMEOUT_W::new(self, 14)
825 }
826 #[inline(always)]
828 pub fn smbalert(&mut self) -> SMBALERT_W<SR1rs> {
829 SMBALERT_W::new(self, 15)
830 }
831}
832pub struct SR1rs;
838impl crate::RegisterSpec for SR1rs {
839 type Ux = u16;
840}
841impl crate::Readable for SR1rs {}
843impl crate::Writable for SR1rs {
845 type Safety = crate::Unsafe;
846 const ZERO_TO_MODIFY_FIELDS_BITMAP: u16 = 0xdf00;
847}
848impl crate::Resettable for SR1rs {}