1pub struct R(crate::R<SR1_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<SR1_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<SR1_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<SR1_SPEC>) -> Self {
13 R(reader)
14 }
15}
16pub struct W(crate::W<SR1_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<SR1_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<SR1_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<SR1_SPEC>) -> Self {
34 W(writer)
35 }
36}
37pub type SB_R = crate::BitReader<SB_A>;
39#[derive(Clone, Copy, Debug, PartialEq, Eq)]
43pub enum SB_A {
44 NoStart = 0,
46 Start = 1,
48}
49impl From<SB_A> for bool {
50 #[inline(always)]
51 fn from(variant: SB_A) -> Self {
52 variant as u8 != 0
53 }
54}
55impl SB_R {
56 #[inline(always)]
58 pub fn variant(&self) -> SB_A {
59 match self.bits {
60 false => SB_A::NoStart,
61 true => SB_A::Start,
62 }
63 }
64 #[inline(always)]
66 pub fn is_no_start(&self) -> bool {
67 *self == SB_A::NoStart
68 }
69 #[inline(always)]
71 pub fn is_start(&self) -> bool {
72 *self == SB_A::Start
73 }
74}
75pub type ADDR_R = crate::BitReader<ADDR_A>;
77#[derive(Clone, Copy, Debug, PartialEq, Eq)]
81pub enum ADDR_A {
82 NotMatch = 0,
84 Match = 1,
86}
87impl From<ADDR_A> for bool {
88 #[inline(always)]
89 fn from(variant: ADDR_A) -> Self {
90 variant as u8 != 0
91 }
92}
93impl ADDR_R {
94 #[inline(always)]
96 pub fn variant(&self) -> ADDR_A {
97 match self.bits {
98 false => ADDR_A::NotMatch,
99 true => ADDR_A::Match,
100 }
101 }
102 #[inline(always)]
104 pub fn is_not_match(&self) -> bool {
105 *self == ADDR_A::NotMatch
106 }
107 #[inline(always)]
109 pub fn is_match(&self) -> bool {
110 *self == ADDR_A::Match
111 }
112}
113pub type BTF_R = crate::BitReader<BTF_A>;
115#[derive(Clone, Copy, Debug, PartialEq, Eq)]
119pub enum BTF_A {
120 NotFinished = 0,
122 Finished = 1,
124}
125impl From<BTF_A> for bool {
126 #[inline(always)]
127 fn from(variant: BTF_A) -> Self {
128 variant as u8 != 0
129 }
130}
131impl BTF_R {
132 #[inline(always)]
134 pub fn variant(&self) -> BTF_A {
135 match self.bits {
136 false => BTF_A::NotFinished,
137 true => BTF_A::Finished,
138 }
139 }
140 #[inline(always)]
142 pub fn is_not_finished(&self) -> bool {
143 *self == BTF_A::NotFinished
144 }
145 #[inline(always)]
147 pub fn is_finished(&self) -> bool {
148 *self == BTF_A::Finished
149 }
150}
151pub type STOPF_R = crate::BitReader<STOPF_A>;
153#[derive(Clone, Copy, Debug, PartialEq, Eq)]
157pub enum STOPF_A {
158 NoStop = 0,
160 Stop = 1,
162}
163impl From<STOPF_A> for bool {
164 #[inline(always)]
165 fn from(variant: STOPF_A) -> Self {
166 variant as u8 != 0
167 }
168}
169impl STOPF_R {
170 #[inline(always)]
172 pub fn variant(&self) -> STOPF_A {
173 match self.bits {
174 false => STOPF_A::NoStop,
175 true => STOPF_A::Stop,
176 }
177 }
178 #[inline(always)]
180 pub fn is_no_stop(&self) -> bool {
181 *self == STOPF_A::NoStop
182 }
183 #[inline(always)]
185 pub fn is_stop(&self) -> bool {
186 *self == STOPF_A::Stop
187 }
188}
189pub type RXNE_R = crate::BitReader<RXNE_A>;
191#[derive(Clone, Copy, Debug, PartialEq, Eq)]
195pub enum RXNE_A {
196 Empty = 0,
198 NotEmpty = 1,
200}
201impl From<RXNE_A> for bool {
202 #[inline(always)]
203 fn from(variant: RXNE_A) -> Self {
204 variant as u8 != 0
205 }
206}
207impl RXNE_R {
208 #[inline(always)]
210 pub fn variant(&self) -> RXNE_A {
211 match self.bits {
212 false => RXNE_A::Empty,
213 true => RXNE_A::NotEmpty,
214 }
215 }
216 #[inline(always)]
218 pub fn is_empty(&self) -> bool {
219 *self == RXNE_A::Empty
220 }
221 #[inline(always)]
223 pub fn is_not_empty(&self) -> bool {
224 *self == RXNE_A::NotEmpty
225 }
226}
227pub type TXE_R = crate::BitReader<TXE_A>;
229#[derive(Clone, Copy, Debug, PartialEq, Eq)]
233pub enum TXE_A {
234 NotEmpty = 0,
236 Empty = 1,
238}
239impl From<TXE_A> for bool {
240 #[inline(always)]
241 fn from(variant: TXE_A) -> Self {
242 variant as u8 != 0
243 }
244}
245impl TXE_R {
246 #[inline(always)]
248 pub fn variant(&self) -> TXE_A {
249 match self.bits {
250 false => TXE_A::NotEmpty,
251 true => TXE_A::Empty,
252 }
253 }
254 #[inline(always)]
256 pub fn is_not_empty(&self) -> bool {
257 *self == TXE_A::NotEmpty
258 }
259 #[inline(always)]
261 pub fn is_empty(&self) -> bool {
262 *self == TXE_A::Empty
263 }
264}
265pub type BERR_R = crate::BitReader<BERRR_A>;
267#[derive(Clone, Copy, Debug, PartialEq, Eq)]
271pub enum BERRR_A {
272 NoError = 0,
274 Error = 1,
276}
277impl From<BERRR_A> for bool {
278 #[inline(always)]
279 fn from(variant: BERRR_A) -> Self {
280 variant as u8 != 0
281 }
282}
283impl BERR_R {
284 #[inline(always)]
286 pub fn variant(&self) -> BERRR_A {
287 match self.bits {
288 false => BERRR_A::NoError,
289 true => BERRR_A::Error,
290 }
291 }
292 #[inline(always)]
294 pub fn is_no_error(&self) -> bool {
295 *self == BERRR_A::NoError
296 }
297 #[inline(always)]
299 pub fn is_error(&self) -> bool {
300 *self == BERRR_A::Error
301 }
302}
303#[derive(Clone, Copy, Debug, PartialEq, Eq)]
307pub enum BERRW_AW {
308 Clear = 0,
310}
311impl From<BERRW_AW> for bool {
312 #[inline(always)]
313 fn from(variant: BERRW_AW) -> Self {
314 variant as u8 != 0
315 }
316}
317pub type BERR_W<'a, const O: u8> = crate::BitWriter0C<'a, u32, SR1_SPEC, BERRW_AW, O>;
319impl<'a, const O: u8> BERR_W<'a, O> {
320 #[inline(always)]
322 pub fn clear(self) -> &'a mut W {
323 self.variant(BERRW_AW::Clear)
324 }
325}
326pub type ARLO_R = crate::BitReader<ARLOR_A>;
328#[derive(Clone, Copy, Debug, PartialEq, Eq)]
332pub enum ARLOR_A {
333 NoLost = 0,
335 Lost = 1,
337}
338impl From<ARLOR_A> for bool {
339 #[inline(always)]
340 fn from(variant: ARLOR_A) -> Self {
341 variant as u8 != 0
342 }
343}
344impl ARLO_R {
345 #[inline(always)]
347 pub fn variant(&self) -> ARLOR_A {
348 match self.bits {
349 false => ARLOR_A::NoLost,
350 true => ARLOR_A::Lost,
351 }
352 }
353 #[inline(always)]
355 pub fn is_no_lost(&self) -> bool {
356 *self == ARLOR_A::NoLost
357 }
358 #[inline(always)]
360 pub fn is_lost(&self) -> bool {
361 *self == ARLOR_A::Lost
362 }
363}
364#[derive(Clone, Copy, Debug, PartialEq, Eq)]
368pub enum ARLOW_AW {
369 Clear = 0,
371}
372impl From<ARLOW_AW> for bool {
373 #[inline(always)]
374 fn from(variant: ARLOW_AW) -> Self {
375 variant as u8 != 0
376 }
377}
378pub type ARLO_W<'a, const O: u8> = crate::BitWriter0C<'a, u32, SR1_SPEC, ARLOW_AW, O>;
380impl<'a, const O: u8> ARLO_W<'a, O> {
381 #[inline(always)]
383 pub fn clear(self) -> &'a mut W {
384 self.variant(ARLOW_AW::Clear)
385 }
386}
387pub type AF_R = crate::BitReader<AFR_A>;
389#[derive(Clone, Copy, Debug, PartialEq, Eq)]
393pub enum AFR_A {
394 NoFailure = 0,
396 Failure = 1,
398}
399impl From<AFR_A> for bool {
400 #[inline(always)]
401 fn from(variant: AFR_A) -> Self {
402 variant as u8 != 0
403 }
404}
405impl AF_R {
406 #[inline(always)]
408 pub fn variant(&self) -> AFR_A {
409 match self.bits {
410 false => AFR_A::NoFailure,
411 true => AFR_A::Failure,
412 }
413 }
414 #[inline(always)]
416 pub fn is_no_failure(&self) -> bool {
417 *self == AFR_A::NoFailure
418 }
419 #[inline(always)]
421 pub fn is_failure(&self) -> bool {
422 *self == AFR_A::Failure
423 }
424}
425#[derive(Clone, Copy, Debug, PartialEq, Eq)]
429pub enum AFW_AW {
430 Clear = 0,
432}
433impl From<AFW_AW> for bool {
434 #[inline(always)]
435 fn from(variant: AFW_AW) -> Self {
436 variant as u8 != 0
437 }
438}
439pub type AF_W<'a, const O: u8> = crate::BitWriter0C<'a, u32, SR1_SPEC, AFW_AW, O>;
441impl<'a, const O: u8> AF_W<'a, O> {
442 #[inline(always)]
444 pub fn clear(self) -> &'a mut W {
445 self.variant(AFW_AW::Clear)
446 }
447}
448pub type OVR_R = crate::BitReader<OVRR_A>;
450#[derive(Clone, Copy, Debug, PartialEq, Eq)]
454pub enum OVRR_A {
455 NoOverrun = 0,
457 Overrun = 1,
459}
460impl From<OVRR_A> for bool {
461 #[inline(always)]
462 fn from(variant: OVRR_A) -> Self {
463 variant as u8 != 0
464 }
465}
466impl OVR_R {
467 #[inline(always)]
469 pub fn variant(&self) -> OVRR_A {
470 match self.bits {
471 false => OVRR_A::NoOverrun,
472 true => OVRR_A::Overrun,
473 }
474 }
475 #[inline(always)]
477 pub fn is_no_overrun(&self) -> bool {
478 *self == OVRR_A::NoOverrun
479 }
480 #[inline(always)]
482 pub fn is_overrun(&self) -> bool {
483 *self == OVRR_A::Overrun
484 }
485}
486#[derive(Clone, Copy, Debug, PartialEq, Eq)]
490pub enum OVRW_AW {
491 Clear = 0,
493}
494impl From<OVRW_AW> for bool {
495 #[inline(always)]
496 fn from(variant: OVRW_AW) -> Self {
497 variant as u8 != 0
498 }
499}
500pub type OVR_W<'a, const O: u8> = crate::BitWriter0C<'a, u32, SR1_SPEC, OVRW_AW, O>;
502impl<'a, const O: u8> OVR_W<'a, O> {
503 #[inline(always)]
505 pub fn clear(self) -> &'a mut W {
506 self.variant(OVRW_AW::Clear)
507 }
508}
509pub type PECERR_R = crate::BitReader<PECERRR_A>;
511#[derive(Clone, Copy, Debug, PartialEq, Eq)]
515pub enum PECERRR_A {
516 NoError = 0,
518 Error = 1,
520}
521impl From<PECERRR_A> for bool {
522 #[inline(always)]
523 fn from(variant: PECERRR_A) -> Self {
524 variant as u8 != 0
525 }
526}
527impl PECERR_R {
528 #[inline(always)]
530 pub fn variant(&self) -> PECERRR_A {
531 match self.bits {
532 false => PECERRR_A::NoError,
533 true => PECERRR_A::Error,
534 }
535 }
536 #[inline(always)]
538 pub fn is_no_error(&self) -> bool {
539 *self == PECERRR_A::NoError
540 }
541 #[inline(always)]
543 pub fn is_error(&self) -> bool {
544 *self == PECERRR_A::Error
545 }
546}
547#[derive(Clone, Copy, Debug, PartialEq, Eq)]
551pub enum PECERRW_AW {
552 Clear = 0,
554}
555impl From<PECERRW_AW> for bool {
556 #[inline(always)]
557 fn from(variant: PECERRW_AW) -> Self {
558 variant as u8 != 0
559 }
560}
561pub type PECERR_W<'a, const O: u8> = crate::BitWriter0C<'a, u32, SR1_SPEC, PECERRW_AW, O>;
563impl<'a, const O: u8> PECERR_W<'a, O> {
564 #[inline(always)]
566 pub fn clear(self) -> &'a mut W {
567 self.variant(PECERRW_AW::Clear)
568 }
569}
570impl R {
571 #[inline(always)]
573 pub fn sb(&self) -> SB_R {
574 SB_R::new((self.bits & 1) != 0)
575 }
576 #[inline(always)]
578 pub fn addr(&self) -> ADDR_R {
579 ADDR_R::new(((self.bits >> 1) & 1) != 0)
580 }
581 #[inline(always)]
583 pub fn btf(&self) -> BTF_R {
584 BTF_R::new(((self.bits >> 2) & 1) != 0)
585 }
586 #[inline(always)]
588 pub fn stopf(&self) -> STOPF_R {
589 STOPF_R::new(((self.bits >> 4) & 1) != 0)
590 }
591 #[inline(always)]
593 pub fn rxne(&self) -> RXNE_R {
594 RXNE_R::new(((self.bits >> 6) & 1) != 0)
595 }
596 #[inline(always)]
598 pub fn txe(&self) -> TXE_R {
599 TXE_R::new(((self.bits >> 7) & 1) != 0)
600 }
601 #[inline(always)]
603 pub fn berr(&self) -> BERR_R {
604 BERR_R::new(((self.bits >> 8) & 1) != 0)
605 }
606 #[inline(always)]
608 pub fn arlo(&self) -> ARLO_R {
609 ARLO_R::new(((self.bits >> 9) & 1) != 0)
610 }
611 #[inline(always)]
613 pub fn af(&self) -> AF_R {
614 AF_R::new(((self.bits >> 10) & 1) != 0)
615 }
616 #[inline(always)]
618 pub fn ovr(&self) -> OVR_R {
619 OVR_R::new(((self.bits >> 11) & 1) != 0)
620 }
621 #[inline(always)]
623 pub fn pecerr(&self) -> PECERR_R {
624 PECERR_R::new(((self.bits >> 12) & 1) != 0)
625 }
626}
627impl W {
628 #[inline(always)]
630 #[must_use]
631 pub fn berr(&mut self) -> BERR_W<8> {
632 BERR_W::new(self)
633 }
634 #[inline(always)]
636 #[must_use]
637 pub fn arlo(&mut self) -> ARLO_W<9> {
638 ARLO_W::new(self)
639 }
640 #[inline(always)]
642 #[must_use]
643 pub fn af(&mut self) -> AF_W<10> {
644 AF_W::new(self)
645 }
646 #[inline(always)]
648 #[must_use]
649 pub fn ovr(&mut self) -> OVR_W<11> {
650 OVR_W::new(self)
651 }
652 #[inline(always)]
654 #[must_use]
655 pub fn pecerr(&mut self) -> PECERR_W<12> {
656 PECERR_W::new(self)
657 }
658 #[inline(always)]
660 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
661 self.0.bits(bits);
662 self
663 }
664}
665pub struct SR1_SPEC;
671impl crate::RegisterSpec for SR1_SPEC {
672 type Ux = u32;
673}
674impl crate::Readable for SR1_SPEC {
676 type Reader = R;
677}
678impl crate::Writable for SR1_SPEC {
680 type Writer = W;
681 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0x1f00;
682 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
683}
684impl crate::Resettable for SR1_SPEC {
686 const RESET_VALUE: Self::Ux = 0;
687}