1pub struct R(crate::R<SR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<SR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<SR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<SR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16pub struct W(crate::W<SR_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<SR_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<SR_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<SR_SPEC>) -> Self {
34 W(writer)
35 }
36}
37pub type PE_R = crate::BitReader<bool>;
39pub type FE_R = crate::BitReader<bool>;
41pub type NE_R = crate::BitReader<bool>;
43pub type ORE_R = crate::BitReader<bool>;
45pub type IDLE_R = crate::BitReader<IDLER_A>;
47#[derive(Clone, Copy, Debug, PartialEq, Eq)]
51pub enum IDLER_A {
52 Busy = 0,
54 Idle = 1,
56}
57impl From<IDLER_A> for bool {
58 #[inline(always)]
59 fn from(variant: IDLER_A) -> Self {
60 variant as u8 != 0
61 }
62}
63impl IDLE_R {
64 #[inline(always)]
66 pub fn variant(&self) -> IDLER_A {
67 match self.bits {
68 false => IDLER_A::Busy,
69 true => IDLER_A::Idle,
70 }
71 }
72 #[inline(always)]
74 pub fn is_busy(&self) -> bool {
75 *self == IDLER_A::Busy
76 }
77 #[inline(always)]
79 pub fn is_idle(&self) -> bool {
80 *self == IDLER_A::Idle
81 }
82}
83pub type RXNE_R = crate::BitReader<RXNER_A>;
85#[derive(Clone, Copy, Debug, PartialEq, Eq)]
89pub enum RXNER_A {
90 Empty = 0,
92 NotEmpty = 1,
94}
95impl From<RXNER_A> for bool {
96 #[inline(always)]
97 fn from(variant: RXNER_A) -> Self {
98 variant as u8 != 0
99 }
100}
101impl RXNE_R {
102 #[inline(always)]
104 pub fn variant(&self) -> RXNER_A {
105 match self.bits {
106 false => RXNER_A::Empty,
107 true => RXNER_A::NotEmpty,
108 }
109 }
110 #[inline(always)]
112 pub fn is_empty(&self) -> bool {
113 *self == RXNER_A::Empty
114 }
115 #[inline(always)]
117 pub fn is_not_empty(&self) -> bool {
118 *self == RXNER_A::NotEmpty
119 }
120}
121#[derive(Clone, Copy, Debug, PartialEq, Eq)]
125pub enum RXNEW_AW {
126 Clear = 0,
128}
129impl From<RXNEW_AW> for bool {
130 #[inline(always)]
131 fn from(variant: RXNEW_AW) -> Self {
132 variant as u8 != 0
133 }
134}
135pub type RXNE_W<'a, const O: u8> = crate::BitWriter<'a, u32, SR_SPEC, RXNEW_AW, O>;
137impl<'a, const O: u8> RXNE_W<'a, O> {
138 #[inline(always)]
140 pub fn clear(self) -> &'a mut W {
141 self.variant(RXNEW_AW::Clear)
142 }
143}
144pub type TC_R = crate::BitReader<TCR_A>;
146#[derive(Clone, Copy, Debug, PartialEq, Eq)]
150pub enum TCR_A {
151 NotComplete = 0,
153 Complete = 1,
155}
156impl From<TCR_A> for bool {
157 #[inline(always)]
158 fn from(variant: TCR_A) -> Self {
159 variant as u8 != 0
160 }
161}
162impl TC_R {
163 #[inline(always)]
165 pub fn variant(&self) -> TCR_A {
166 match self.bits {
167 false => TCR_A::NotComplete,
168 true => TCR_A::Complete,
169 }
170 }
171 #[inline(always)]
173 pub fn is_not_complete(&self) -> bool {
174 *self == TCR_A::NotComplete
175 }
176 #[inline(always)]
178 pub fn is_complete(&self) -> bool {
179 *self == TCR_A::Complete
180 }
181}
182#[derive(Clone, Copy, Debug, PartialEq, Eq)]
186pub enum TCW_AW {
187 Clear = 0,
189}
190impl From<TCW_AW> for bool {
191 #[inline(always)]
192 fn from(variant: TCW_AW) -> Self {
193 variant as u8 != 0
194 }
195}
196pub type TC_W<'a, const O: u8> = crate::BitWriter<'a, u32, SR_SPEC, TCW_AW, O>;
198impl<'a, const O: u8> TC_W<'a, O> {
199 #[inline(always)]
201 pub fn clear(self) -> &'a mut W {
202 self.variant(TCW_AW::Clear)
203 }
204}
205pub type TXE_R = crate::BitReader<TXER_A>;
207#[derive(Clone, Copy, Debug, PartialEq, Eq)]
211pub enum TXER_A {
212 NotEmpty = 0,
214 Empty = 1,
216}
217impl From<TXER_A> for bool {
218 #[inline(always)]
219 fn from(variant: TXER_A) -> Self {
220 variant as u8 != 0
221 }
222}
223impl TXE_R {
224 #[inline(always)]
226 pub fn variant(&self) -> TXER_A {
227 match self.bits {
228 false => TXER_A::NotEmpty,
229 true => TXER_A::Empty,
230 }
231 }
232 #[inline(always)]
234 pub fn is_not_empty(&self) -> bool {
235 *self == TXER_A::NotEmpty
236 }
237 #[inline(always)]
239 pub fn is_empty(&self) -> bool {
240 *self == TXER_A::Empty
241 }
242}
243pub type CTS_R = crate::BitReader<CTSR_A>;
245#[derive(Clone, Copy, Debug, PartialEq, Eq)]
249pub enum CTSR_A {
250 NotChange = 0,
252 Toggle = 1,
254}
255impl From<CTSR_A> for bool {
256 #[inline(always)]
257 fn from(variant: CTSR_A) -> Self {
258 variant as u8 != 0
259 }
260}
261impl CTS_R {
262 #[inline(always)]
264 pub fn variant(&self) -> CTSR_A {
265 match self.bits {
266 false => CTSR_A::NotChange,
267 true => CTSR_A::Toggle,
268 }
269 }
270 #[inline(always)]
272 pub fn is_not_change(&self) -> bool {
273 *self == CTSR_A::NotChange
274 }
275 #[inline(always)]
277 pub fn is_toggle(&self) -> bool {
278 *self == CTSR_A::Toggle
279 }
280}
281#[derive(Clone, Copy, Debug, PartialEq, Eq)]
285pub enum CTSW_AW {
286 Clear = 0,
288}
289impl From<CTSW_AW> for bool {
290 #[inline(always)]
291 fn from(variant: CTSW_AW) -> Self {
292 variant as u8 != 0
293 }
294}
295pub type CTS_W<'a, const O: u8> = crate::BitWriter<'a, u32, SR_SPEC, CTSW_AW, O>;
297impl<'a, const O: u8> CTS_W<'a, O> {
298 #[inline(always)]
300 pub fn clear(self) -> &'a mut W {
301 self.variant(CTSW_AW::Clear)
302 }
303}
304pub type ABRF_R = crate::BitReader<ABRFR_A>;
306#[derive(Clone, Copy, Debug, PartialEq, Eq)]
310pub enum ABRFR_A {
311 Detected = 1,
313}
314impl From<ABRFR_A> for bool {
315 #[inline(always)]
316 fn from(variant: ABRFR_A) -> Self {
317 variant as u8 != 0
318 }
319}
320impl ABRF_R {
321 #[inline(always)]
323 pub fn variant(&self) -> Option<ABRFR_A> {
324 match self.bits {
325 true => Some(ABRFR_A::Detected),
326 _ => None,
327 }
328 }
329 #[inline(always)]
331 pub fn is_detected(&self) -> bool {
332 *self == ABRFR_A::Detected
333 }
334}
335pub type ABRE_R = crate::BitReader<ABRER_A>;
337#[derive(Clone, Copy, Debug, PartialEq, Eq)]
341pub enum ABRER_A {
342 Error = 1,
344}
345impl From<ABRER_A> for bool {
346 #[inline(always)]
347 fn from(variant: ABRER_A) -> Self {
348 variant as u8 != 0
349 }
350}
351impl ABRE_R {
352 #[inline(always)]
354 pub fn variant(&self) -> Option<ABRER_A> {
355 match self.bits {
356 true => Some(ABRER_A::Error),
357 _ => None,
358 }
359 }
360 #[inline(always)]
362 pub fn is_error(&self) -> bool {
363 *self == ABRER_A::Error
364 }
365}
366#[derive(Clone, Copy, Debug, PartialEq, Eq)]
370pub enum ABRRQW_AW {
371 Request = 1,
373}
374impl From<ABRRQW_AW> for bool {
375 #[inline(always)]
376 fn from(variant: ABRRQW_AW) -> Self {
377 variant as u8 != 0
378 }
379}
380pub type ABRRQ_W<'a, const O: u8> = crate::BitWriter<'a, u32, SR_SPEC, ABRRQW_AW, O>;
382impl<'a, const O: u8> ABRRQ_W<'a, O> {
383 #[inline(always)]
385 pub fn request(self) -> &'a mut W {
386 self.variant(ABRRQW_AW::Request)
387 }
388}
389impl R {
390 #[inline(always)]
392 pub fn pe(&self) -> PE_R {
393 PE_R::new((self.bits & 1) != 0)
394 }
395 #[inline(always)]
397 pub fn fe(&self) -> FE_R {
398 FE_R::new(((self.bits >> 1) & 1) != 0)
399 }
400 #[inline(always)]
402 pub fn ne(&self) -> NE_R {
403 NE_R::new(((self.bits >> 2) & 1) != 0)
404 }
405 #[inline(always)]
407 pub fn ore(&self) -> ORE_R {
408 ORE_R::new(((self.bits >> 3) & 1) != 0)
409 }
410 #[inline(always)]
412 pub fn idle(&self) -> IDLE_R {
413 IDLE_R::new(((self.bits >> 4) & 1) != 0)
414 }
415 #[inline(always)]
417 pub fn rxne(&self) -> RXNE_R {
418 RXNE_R::new(((self.bits >> 5) & 1) != 0)
419 }
420 #[inline(always)]
422 pub fn tc(&self) -> TC_R {
423 TC_R::new(((self.bits >> 6) & 1) != 0)
424 }
425 #[inline(always)]
427 pub fn txe(&self) -> TXE_R {
428 TXE_R::new(((self.bits >> 7) & 1) != 0)
429 }
430 #[inline(always)]
432 pub fn cts(&self) -> CTS_R {
433 CTS_R::new(((self.bits >> 9) & 1) != 0)
434 }
435 #[inline(always)]
437 pub fn abrf(&self) -> ABRF_R {
438 ABRF_R::new(((self.bits >> 10) & 1) != 0)
439 }
440 #[inline(always)]
442 pub fn abre(&self) -> ABRE_R {
443 ABRE_R::new(((self.bits >> 11) & 1) != 0)
444 }
445}
446impl W {
447 #[inline(always)]
449 #[must_use]
450 pub fn rxne(&mut self) -> RXNE_W<5> {
451 RXNE_W::new(self)
452 }
453 #[inline(always)]
455 #[must_use]
456 pub fn tc(&mut self) -> TC_W<6> {
457 TC_W::new(self)
458 }
459 #[inline(always)]
461 #[must_use]
462 pub fn cts(&mut self) -> CTS_W<9> {
463 CTS_W::new(self)
464 }
465 #[inline(always)]
467 #[must_use]
468 pub fn abrrq(&mut self) -> ABRRQ_W<12> {
469 ABRRQ_W::new(self)
470 }
471 #[inline(always)]
473 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
474 self.0.bits(bits);
475 self
476 }
477}
478pub struct SR_SPEC;
484impl crate::RegisterSpec for SR_SPEC {
485 type Ux = u32;
486}
487impl crate::Readable for SR_SPEC {
489 type Reader = R;
490}
491impl crate::Writable for SR_SPEC {
493 type Writer = W;
494 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
495 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
496}
497impl crate::Resettable for SR_SPEC {
499 const RESET_VALUE: Self::Ux = 0xc0;
500}