1pub type R = crate::R<ISRrs>;
3pub type W = crate::W<ISRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum TXER {
11 NotEmpty = 0,
13 Empty = 1,
15}
16impl From<TXER> for bool {
17 #[inline(always)]
18 fn from(variant: TXER) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type TXE_R = crate::BitReader<TXER>;
24impl TXE_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> TXER {
28 match self.bits {
29 false => TXER::NotEmpty,
30 true => TXER::Empty,
31 }
32 }
33 #[inline(always)]
35 pub fn is_not_empty(&self) -> bool {
36 *self == TXER::NotEmpty
37 }
38 #[inline(always)]
40 pub fn is_empty(&self) -> bool {
41 *self == TXER::Empty
42 }
43}
44#[cfg_attr(feature = "defmt", derive(defmt::Format))]
48#[derive(Clone, Copy, Debug, PartialEq, Eq)]
49pub enum TXEW {
50 Flush = 1,
52}
53impl From<TXEW> for bool {
54 #[inline(always)]
55 fn from(variant: TXEW) -> Self {
56 variant as u8 != 0
57 }
58}
59pub type TXE_W<'a, REG> = crate::BitWriter1S<'a, REG, TXEW>;
61impl<'a, REG> TXE_W<'a, REG>
62where
63 REG: crate::Writable + crate::RegisterSpec,
64{
65 #[inline(always)]
67 pub fn flush(self) -> &'a mut crate::W<REG> {
68 self.variant(TXEW::Flush)
69 }
70}
71#[cfg_attr(feature = "defmt", derive(defmt::Format))]
75#[derive(Clone, Copy, Debug, PartialEq, Eq)]
76pub enum TXISR {
77 NotEmpty = 0,
79 Empty = 1,
81}
82impl From<TXISR> for bool {
83 #[inline(always)]
84 fn from(variant: TXISR) -> Self {
85 variant as u8 != 0
86 }
87}
88pub type TXIS_R = crate::BitReader<TXISR>;
90impl TXIS_R {
91 #[inline(always)]
93 pub const fn variant(&self) -> TXISR {
94 match self.bits {
95 false => TXISR::NotEmpty,
96 true => TXISR::Empty,
97 }
98 }
99 #[inline(always)]
101 pub fn is_not_empty(&self) -> bool {
102 *self == TXISR::NotEmpty
103 }
104 #[inline(always)]
106 pub fn is_empty(&self) -> bool {
107 *self == TXISR::Empty
108 }
109}
110#[cfg_attr(feature = "defmt", derive(defmt::Format))]
114#[derive(Clone, Copy, Debug, PartialEq, Eq)]
115pub enum TXISW {
116 Trigger = 1,
118}
119impl From<TXISW> for bool {
120 #[inline(always)]
121 fn from(variant: TXISW) -> Self {
122 variant as u8 != 0
123 }
124}
125pub type TXIS_W<'a, REG> = crate::BitWriter1S<'a, REG, TXISW>;
127impl<'a, REG> TXIS_W<'a, REG>
128where
129 REG: crate::Writable + crate::RegisterSpec,
130{
131 #[inline(always)]
133 pub fn trigger(self) -> &'a mut crate::W<REG> {
134 self.variant(TXISW::Trigger)
135 }
136}
137#[cfg_attr(feature = "defmt", derive(defmt::Format))]
141#[derive(Clone, Copy, Debug, PartialEq, Eq)]
142pub enum RXNE {
143 Empty = 0,
145 NotEmpty = 1,
147}
148impl From<RXNE> for bool {
149 #[inline(always)]
150 fn from(variant: RXNE) -> Self {
151 variant as u8 != 0
152 }
153}
154pub type RXNE_R = crate::BitReader<RXNE>;
156impl RXNE_R {
157 #[inline(always)]
159 pub const fn variant(&self) -> RXNE {
160 match self.bits {
161 false => RXNE::Empty,
162 true => RXNE::NotEmpty,
163 }
164 }
165 #[inline(always)]
167 pub fn is_empty(&self) -> bool {
168 *self == RXNE::Empty
169 }
170 #[inline(always)]
172 pub fn is_not_empty(&self) -> bool {
173 *self == RXNE::NotEmpty
174 }
175}
176#[cfg_attr(feature = "defmt", derive(defmt::Format))]
180#[derive(Clone, Copy, Debug, PartialEq, Eq)]
181pub enum ADDR {
182 NotMatch = 0,
184 Match = 1,
186}
187impl From<ADDR> for bool {
188 #[inline(always)]
189 fn from(variant: ADDR) -> Self {
190 variant as u8 != 0
191 }
192}
193pub type ADDR_R = crate::BitReader<ADDR>;
195impl ADDR_R {
196 #[inline(always)]
198 pub const fn variant(&self) -> ADDR {
199 match self.bits {
200 false => ADDR::NotMatch,
201 true => ADDR::Match,
202 }
203 }
204 #[inline(always)]
206 pub fn is_not_match(&self) -> bool {
207 *self == ADDR::NotMatch
208 }
209 #[inline(always)]
211 pub fn is_match(&self) -> bool {
212 *self == ADDR::Match
213 }
214}
215#[cfg_attr(feature = "defmt", derive(defmt::Format))]
219#[derive(Clone, Copy, Debug, PartialEq, Eq)]
220pub enum NACKF {
221 NoNack = 0,
223 Nack = 1,
225}
226impl From<NACKF> for bool {
227 #[inline(always)]
228 fn from(variant: NACKF) -> Self {
229 variant as u8 != 0
230 }
231}
232pub type NACKF_R = crate::BitReader<NACKF>;
234impl NACKF_R {
235 #[inline(always)]
237 pub const fn variant(&self) -> NACKF {
238 match self.bits {
239 false => NACKF::NoNack,
240 true => NACKF::Nack,
241 }
242 }
243 #[inline(always)]
245 pub fn is_no_nack(&self) -> bool {
246 *self == NACKF::NoNack
247 }
248 #[inline(always)]
250 pub fn is_nack(&self) -> bool {
251 *self == NACKF::Nack
252 }
253}
254#[cfg_attr(feature = "defmt", derive(defmt::Format))]
258#[derive(Clone, Copy, Debug, PartialEq, Eq)]
259pub enum STOPF {
260 NoStop = 0,
262 Stop = 1,
264}
265impl From<STOPF> for bool {
266 #[inline(always)]
267 fn from(variant: STOPF) -> Self {
268 variant as u8 != 0
269 }
270}
271pub type STOPF_R = crate::BitReader<STOPF>;
273impl STOPF_R {
274 #[inline(always)]
276 pub const fn variant(&self) -> STOPF {
277 match self.bits {
278 false => STOPF::NoStop,
279 true => STOPF::Stop,
280 }
281 }
282 #[inline(always)]
284 pub fn is_no_stop(&self) -> bool {
285 *self == STOPF::NoStop
286 }
287 #[inline(always)]
289 pub fn is_stop(&self) -> bool {
290 *self == STOPF::Stop
291 }
292}
293#[cfg_attr(feature = "defmt", derive(defmt::Format))]
297#[derive(Clone, Copy, Debug, PartialEq, Eq)]
298pub enum TC {
299 NotComplete = 0,
301 Complete = 1,
303}
304impl From<TC> for bool {
305 #[inline(always)]
306 fn from(variant: TC) -> Self {
307 variant as u8 != 0
308 }
309}
310pub type TC_R = crate::BitReader<TC>;
312impl TC_R {
313 #[inline(always)]
315 pub const fn variant(&self) -> TC {
316 match self.bits {
317 false => TC::NotComplete,
318 true => TC::Complete,
319 }
320 }
321 #[inline(always)]
323 pub fn is_not_complete(&self) -> bool {
324 *self == TC::NotComplete
325 }
326 #[inline(always)]
328 pub fn is_complete(&self) -> bool {
329 *self == TC::Complete
330 }
331}
332#[cfg_attr(feature = "defmt", derive(defmt::Format))]
336#[derive(Clone, Copy, Debug, PartialEq, Eq)]
337pub enum TCR {
338 NotComplete = 0,
340 Complete = 1,
342}
343impl From<TCR> for bool {
344 #[inline(always)]
345 fn from(variant: TCR) -> Self {
346 variant as u8 != 0
347 }
348}
349pub type TCR_R = crate::BitReader<TCR>;
351impl TCR_R {
352 #[inline(always)]
354 pub const fn variant(&self) -> TCR {
355 match self.bits {
356 false => TCR::NotComplete,
357 true => TCR::Complete,
358 }
359 }
360 #[inline(always)]
362 pub fn is_not_complete(&self) -> bool {
363 *self == TCR::NotComplete
364 }
365 #[inline(always)]
367 pub fn is_complete(&self) -> bool {
368 *self == TCR::Complete
369 }
370}
371#[cfg_attr(feature = "defmt", derive(defmt::Format))]
375#[derive(Clone, Copy, Debug, PartialEq, Eq)]
376pub enum BERR {
377 NoError = 0,
379 Error = 1,
381}
382impl From<BERR> for bool {
383 #[inline(always)]
384 fn from(variant: BERR) -> Self {
385 variant as u8 != 0
386 }
387}
388pub type BERR_R = crate::BitReader<BERR>;
390impl BERR_R {
391 #[inline(always)]
393 pub const fn variant(&self) -> BERR {
394 match self.bits {
395 false => BERR::NoError,
396 true => BERR::Error,
397 }
398 }
399 #[inline(always)]
401 pub fn is_no_error(&self) -> bool {
402 *self == BERR::NoError
403 }
404 #[inline(always)]
406 pub fn is_error(&self) -> bool {
407 *self == BERR::Error
408 }
409}
410#[cfg_attr(feature = "defmt", derive(defmt::Format))]
414#[derive(Clone, Copy, Debug, PartialEq, Eq)]
415pub enum ARLO {
416 NotLost = 0,
418 Lost = 1,
420}
421impl From<ARLO> for bool {
422 #[inline(always)]
423 fn from(variant: ARLO) -> Self {
424 variant as u8 != 0
425 }
426}
427pub type ARLO_R = crate::BitReader<ARLO>;
429impl ARLO_R {
430 #[inline(always)]
432 pub const fn variant(&self) -> ARLO {
433 match self.bits {
434 false => ARLO::NotLost,
435 true => ARLO::Lost,
436 }
437 }
438 #[inline(always)]
440 pub fn is_not_lost(&self) -> bool {
441 *self == ARLO::NotLost
442 }
443 #[inline(always)]
445 pub fn is_lost(&self) -> bool {
446 *self == ARLO::Lost
447 }
448}
449#[cfg_attr(feature = "defmt", derive(defmt::Format))]
453#[derive(Clone, Copy, Debug, PartialEq, Eq)]
454pub enum OVR {
455 NoOverrun = 0,
457 Overrun = 1,
459}
460impl From<OVR> for bool {
461 #[inline(always)]
462 fn from(variant: OVR) -> Self {
463 variant as u8 != 0
464 }
465}
466pub type OVR_R = crate::BitReader<OVR>;
468impl OVR_R {
469 #[inline(always)]
471 pub const fn variant(&self) -> OVR {
472 match self.bits {
473 false => OVR::NoOverrun,
474 true => OVR::Overrun,
475 }
476 }
477 #[inline(always)]
479 pub fn is_no_overrun(&self) -> bool {
480 *self == OVR::NoOverrun
481 }
482 #[inline(always)]
484 pub fn is_overrun(&self) -> bool {
485 *self == OVR::Overrun
486 }
487}
488#[cfg_attr(feature = "defmt", derive(defmt::Format))]
492#[derive(Clone, Copy, Debug, PartialEq, Eq)]
493pub enum PECERR {
494 Match = 0,
496 NoMatch = 1,
498}
499impl From<PECERR> for bool {
500 #[inline(always)]
501 fn from(variant: PECERR) -> Self {
502 variant as u8 != 0
503 }
504}
505pub type PECERR_R = crate::BitReader<PECERR>;
507impl PECERR_R {
508 #[inline(always)]
510 pub const fn variant(&self) -> PECERR {
511 match self.bits {
512 false => PECERR::Match,
513 true => PECERR::NoMatch,
514 }
515 }
516 #[inline(always)]
518 pub fn is_match(&self) -> bool {
519 *self == PECERR::Match
520 }
521 #[inline(always)]
523 pub fn is_no_match(&self) -> bool {
524 *self == PECERR::NoMatch
525 }
526}
527#[cfg_attr(feature = "defmt", derive(defmt::Format))]
531#[derive(Clone, Copy, Debug, PartialEq, Eq)]
532pub enum TIMEOUT {
533 NoTimeout = 0,
535 Timeout = 1,
537}
538impl From<TIMEOUT> for bool {
539 #[inline(always)]
540 fn from(variant: TIMEOUT) -> Self {
541 variant as u8 != 0
542 }
543}
544pub type TIMEOUT_R = crate::BitReader<TIMEOUT>;
546impl TIMEOUT_R {
547 #[inline(always)]
549 pub const fn variant(&self) -> TIMEOUT {
550 match self.bits {
551 false => TIMEOUT::NoTimeout,
552 true => TIMEOUT::Timeout,
553 }
554 }
555 #[inline(always)]
557 pub fn is_no_timeout(&self) -> bool {
558 *self == TIMEOUT::NoTimeout
559 }
560 #[inline(always)]
562 pub fn is_timeout(&self) -> bool {
563 *self == TIMEOUT::Timeout
564 }
565}
566#[cfg_attr(feature = "defmt", derive(defmt::Format))]
570#[derive(Clone, Copy, Debug, PartialEq, Eq)]
571pub enum ALERT {
572 NoAlert = 0,
574 Alert = 1,
576}
577impl From<ALERT> for bool {
578 #[inline(always)]
579 fn from(variant: ALERT) -> Self {
580 variant as u8 != 0
581 }
582}
583pub type ALERT_R = crate::BitReader<ALERT>;
585impl ALERT_R {
586 #[inline(always)]
588 pub const fn variant(&self) -> ALERT {
589 match self.bits {
590 false => ALERT::NoAlert,
591 true => ALERT::Alert,
592 }
593 }
594 #[inline(always)]
596 pub fn is_no_alert(&self) -> bool {
597 *self == ALERT::NoAlert
598 }
599 #[inline(always)]
601 pub fn is_alert(&self) -> bool {
602 *self == ALERT::Alert
603 }
604}
605#[cfg_attr(feature = "defmt", derive(defmt::Format))]
609#[derive(Clone, Copy, Debug, PartialEq, Eq)]
610pub enum BUSY {
611 NotBusy = 0,
613 Busy = 1,
615}
616impl From<BUSY> for bool {
617 #[inline(always)]
618 fn from(variant: BUSY) -> Self {
619 variant as u8 != 0
620 }
621}
622pub type BUSY_R = crate::BitReader<BUSY>;
624impl BUSY_R {
625 #[inline(always)]
627 pub const fn variant(&self) -> BUSY {
628 match self.bits {
629 false => BUSY::NotBusy,
630 true => BUSY::Busy,
631 }
632 }
633 #[inline(always)]
635 pub fn is_not_busy(&self) -> bool {
636 *self == BUSY::NotBusy
637 }
638 #[inline(always)]
640 pub fn is_busy(&self) -> bool {
641 *self == BUSY::Busy
642 }
643}
644#[cfg_attr(feature = "defmt", derive(defmt::Format))]
648#[derive(Clone, Copy, Debug, PartialEq, Eq)]
649pub enum DIR {
650 Write = 0,
652 Read = 1,
654}
655impl From<DIR> for bool {
656 #[inline(always)]
657 fn from(variant: DIR) -> Self {
658 variant as u8 != 0
659 }
660}
661pub type DIR_R = crate::BitReader<DIR>;
663impl DIR_R {
664 #[inline(always)]
666 pub const fn variant(&self) -> DIR {
667 match self.bits {
668 false => DIR::Write,
669 true => DIR::Read,
670 }
671 }
672 #[inline(always)]
674 pub fn is_write(&self) -> bool {
675 *self == DIR::Write
676 }
677 #[inline(always)]
679 pub fn is_read(&self) -> bool {
680 *self == DIR::Read
681 }
682}
683pub type ADDCODE_R = crate::FieldReader;
685impl R {
686 #[inline(always)]
688 pub fn txe(&self) -> TXE_R {
689 TXE_R::new((self.bits & 1) != 0)
690 }
691 #[inline(always)]
693 pub fn txis(&self) -> TXIS_R {
694 TXIS_R::new(((self.bits >> 1) & 1) != 0)
695 }
696 #[inline(always)]
698 pub fn rxne(&self) -> RXNE_R {
699 RXNE_R::new(((self.bits >> 2) & 1) != 0)
700 }
701 #[inline(always)]
703 pub fn addr(&self) -> ADDR_R {
704 ADDR_R::new(((self.bits >> 3) & 1) != 0)
705 }
706 #[inline(always)]
708 pub fn nackf(&self) -> NACKF_R {
709 NACKF_R::new(((self.bits >> 4) & 1) != 0)
710 }
711 #[inline(always)]
713 pub fn stopf(&self) -> STOPF_R {
714 STOPF_R::new(((self.bits >> 5) & 1) != 0)
715 }
716 #[inline(always)]
718 pub fn tc(&self) -> TC_R {
719 TC_R::new(((self.bits >> 6) & 1) != 0)
720 }
721 #[inline(always)]
723 pub fn tcr(&self) -> TCR_R {
724 TCR_R::new(((self.bits >> 7) & 1) != 0)
725 }
726 #[inline(always)]
728 pub fn berr(&self) -> BERR_R {
729 BERR_R::new(((self.bits >> 8) & 1) != 0)
730 }
731 #[inline(always)]
733 pub fn arlo(&self) -> ARLO_R {
734 ARLO_R::new(((self.bits >> 9) & 1) != 0)
735 }
736 #[inline(always)]
738 pub fn ovr(&self) -> OVR_R {
739 OVR_R::new(((self.bits >> 10) & 1) != 0)
740 }
741 #[inline(always)]
743 pub fn pecerr(&self) -> PECERR_R {
744 PECERR_R::new(((self.bits >> 11) & 1) != 0)
745 }
746 #[inline(always)]
748 pub fn timeout(&self) -> TIMEOUT_R {
749 TIMEOUT_R::new(((self.bits >> 12) & 1) != 0)
750 }
751 #[inline(always)]
753 pub fn alert(&self) -> ALERT_R {
754 ALERT_R::new(((self.bits >> 13) & 1) != 0)
755 }
756 #[inline(always)]
758 pub fn busy(&self) -> BUSY_R {
759 BUSY_R::new(((self.bits >> 15) & 1) != 0)
760 }
761 #[inline(always)]
763 pub fn dir(&self) -> DIR_R {
764 DIR_R::new(((self.bits >> 16) & 1) != 0)
765 }
766 #[inline(always)]
768 pub fn addcode(&self) -> ADDCODE_R {
769 ADDCODE_R::new(((self.bits >> 17) & 0x7f) as u8)
770 }
771}
772impl core::fmt::Debug for R {
773 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
774 f.debug_struct("ISR")
775 .field("addcode", &self.addcode())
776 .field("dir", &self.dir())
777 .field("busy", &self.busy())
778 .field("alert", &self.alert())
779 .field("timeout", &self.timeout())
780 .field("pecerr", &self.pecerr())
781 .field("ovr", &self.ovr())
782 .field("arlo", &self.arlo())
783 .field("berr", &self.berr())
784 .field("tcr", &self.tcr())
785 .field("tc", &self.tc())
786 .field("stopf", &self.stopf())
787 .field("nackf", &self.nackf())
788 .field("addr", &self.addr())
789 .field("rxne", &self.rxne())
790 .field("txis", &self.txis())
791 .field("txe", &self.txe())
792 .finish()
793 }
794}
795impl W {
796 #[inline(always)]
798 pub fn txe(&mut self) -> TXE_W<ISRrs> {
799 TXE_W::new(self, 0)
800 }
801 #[inline(always)]
803 pub fn txis(&mut self) -> TXIS_W<ISRrs> {
804 TXIS_W::new(self, 1)
805 }
806}
807pub struct ISRrs;
813impl crate::RegisterSpec for ISRrs {
814 type Ux = u32;
815}
816impl crate::Readable for ISRrs {}
818impl crate::Writable for ISRrs {
820 type Safety = crate::Unsafe;
821 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0x03;
822}
823impl crate::Resettable for ISRrs {
825 const RESET_VALUE: u32 = 0x01;
826}