Skip to main content

mcxa_pac/lpuart0/
stat.rs

1#[doc = "Register `STAT` reader"]
2pub type R = crate::R<StatSpec>;
3#[doc = "Register `STAT` writer"]
4pub type W = crate::W<StatSpec>;
5#[doc = "LIN Break Flag Enable\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum Lbkfe {
9    #[doc = "0: Disable"]
10    Disabled = 0,
11    #[doc = "1: Enable"]
12    Enabled = 1,
13}
14impl From<Lbkfe> for bool {
15    #[inline(always)]
16    fn from(variant: Lbkfe) -> Self {
17        variant as u8 != 0
18    }
19}
20#[doc = "Field `LBKFE` reader - LIN Break Flag Enable"]
21pub type LbkfeR = crate::BitReader<Lbkfe>;
22impl LbkfeR {
23    #[doc = "Get enumerated values variant"]
24    #[inline(always)]
25    pub const fn variant(&self) -> Lbkfe {
26        match self.bits {
27            false => Lbkfe::Disabled,
28            true => Lbkfe::Enabled,
29        }
30    }
31    #[doc = "Disable"]
32    #[inline(always)]
33    pub fn is_disabled(&self) -> bool {
34        *self == Lbkfe::Disabled
35    }
36    #[doc = "Enable"]
37    #[inline(always)]
38    pub fn is_enabled(&self) -> bool {
39        *self == Lbkfe::Enabled
40    }
41}
42#[doc = "Field `LBKFE` writer - LIN Break Flag Enable"]
43pub type LbkfeW<'a, REG> = crate::BitWriter<'a, REG, Lbkfe>;
44impl<'a, REG> LbkfeW<'a, REG>
45where
46    REG: crate::Writable + crate::RegisterSpec,
47{
48    #[doc = "Disable"]
49    #[inline(always)]
50    pub fn disabled(self) -> &'a mut crate::W<REG> {
51        self.variant(Lbkfe::Disabled)
52    }
53    #[doc = "Enable"]
54    #[inline(always)]
55    pub fn enabled(self) -> &'a mut crate::W<REG> {
56        self.variant(Lbkfe::Enabled)
57    }
58}
59#[doc = "Address Mark Enable\n\nValue on reset: 0"]
60#[cfg_attr(feature = "defmt", derive(defmt::Format))]
61#[derive(Clone, Copy, Debug, PartialEq, Eq)]
62pub enum Ame {
63    #[doc = "0: Disable"]
64    Disabled = 0,
65    #[doc = "1: Enable"]
66    Enabled = 1,
67}
68impl From<Ame> for bool {
69    #[inline(always)]
70    fn from(variant: Ame) -> Self {
71        variant as u8 != 0
72    }
73}
74#[doc = "Field `AME` reader - Address Mark Enable"]
75pub type AmeR = crate::BitReader<Ame>;
76impl AmeR {
77    #[doc = "Get enumerated values variant"]
78    #[inline(always)]
79    pub const fn variant(&self) -> Ame {
80        match self.bits {
81            false => Ame::Disabled,
82            true => Ame::Enabled,
83        }
84    }
85    #[doc = "Disable"]
86    #[inline(always)]
87    pub fn is_disabled(&self) -> bool {
88        *self == Ame::Disabled
89    }
90    #[doc = "Enable"]
91    #[inline(always)]
92    pub fn is_enabled(&self) -> bool {
93        *self == Ame::Enabled
94    }
95}
96#[doc = "Field `AME` writer - Address Mark Enable"]
97pub type AmeW<'a, REG> = crate::BitWriter<'a, REG, Ame>;
98impl<'a, REG> AmeW<'a, REG>
99where
100    REG: crate::Writable + crate::RegisterSpec,
101{
102    #[doc = "Disable"]
103    #[inline(always)]
104    pub fn disabled(self) -> &'a mut crate::W<REG> {
105        self.variant(Ame::Disabled)
106    }
107    #[doc = "Enable"]
108    #[inline(always)]
109    pub fn enabled(self) -> &'a mut crate::W<REG> {
110        self.variant(Ame::Enabled)
111    }
112}
113#[doc = "Match 2 Flag\n\nValue on reset: 0"]
114#[cfg_attr(feature = "defmt", derive(defmt::Format))]
115#[derive(Clone, Copy, Debug, PartialEq, Eq)]
116pub enum Ma2f {
117    #[doc = "0: Not equal to MA2"]
118    Nomatch = 0,
119    #[doc = "1: Equal to MA2"]
120    Match = 1,
121}
122impl From<Ma2f> for bool {
123    #[inline(always)]
124    fn from(variant: Ma2f) -> Self {
125        variant as u8 != 0
126    }
127}
128#[doc = "Field `MA2F` reader - Match 2 Flag"]
129pub type Ma2fR = crate::BitReader<Ma2f>;
130impl Ma2fR {
131    #[doc = "Get enumerated values variant"]
132    #[inline(always)]
133    pub const fn variant(&self) -> Ma2f {
134        match self.bits {
135            false => Ma2f::Nomatch,
136            true => Ma2f::Match,
137        }
138    }
139    #[doc = "Not equal to MA2"]
140    #[inline(always)]
141    pub fn is_nomatch(&self) -> bool {
142        *self == Ma2f::Nomatch
143    }
144    #[doc = "Equal to MA2"]
145    #[inline(always)]
146    pub fn is_match(&self) -> bool {
147        *self == Ma2f::Match
148    }
149}
150#[doc = "Field `MA2F` writer - Match 2 Flag"]
151pub type Ma2fW<'a, REG> = crate::BitWriter1C<'a, REG, Ma2f>;
152impl<'a, REG> Ma2fW<'a, REG>
153where
154    REG: crate::Writable + crate::RegisterSpec,
155{
156    #[doc = "Not equal to MA2"]
157    #[inline(always)]
158    pub fn nomatch(self) -> &'a mut crate::W<REG> {
159        self.variant(Ma2f::Nomatch)
160    }
161    #[doc = "Equal to MA2"]
162    #[inline(always)]
163    pub fn match_(self) -> &'a mut crate::W<REG> {
164        self.variant(Ma2f::Match)
165    }
166}
167#[doc = "Match 1 Flag\n\nValue on reset: 0"]
168#[cfg_attr(feature = "defmt", derive(defmt::Format))]
169#[derive(Clone, Copy, Debug, PartialEq, Eq)]
170pub enum Ma1f {
171    #[doc = "0: Not equal to MA1"]
172    Nomatch = 0,
173    #[doc = "1: Equal to MA1"]
174    Match = 1,
175}
176impl From<Ma1f> for bool {
177    #[inline(always)]
178    fn from(variant: Ma1f) -> Self {
179        variant as u8 != 0
180    }
181}
182#[doc = "Field `MA1F` reader - Match 1 Flag"]
183pub type Ma1fR = crate::BitReader<Ma1f>;
184impl Ma1fR {
185    #[doc = "Get enumerated values variant"]
186    #[inline(always)]
187    pub const fn variant(&self) -> Ma1f {
188        match self.bits {
189            false => Ma1f::Nomatch,
190            true => Ma1f::Match,
191        }
192    }
193    #[doc = "Not equal to MA1"]
194    #[inline(always)]
195    pub fn is_nomatch(&self) -> bool {
196        *self == Ma1f::Nomatch
197    }
198    #[doc = "Equal to MA1"]
199    #[inline(always)]
200    pub fn is_match(&self) -> bool {
201        *self == Ma1f::Match
202    }
203}
204#[doc = "Field `MA1F` writer - Match 1 Flag"]
205pub type Ma1fW<'a, REG> = crate::BitWriter1C<'a, REG, Ma1f>;
206impl<'a, REG> Ma1fW<'a, REG>
207where
208    REG: crate::Writable + crate::RegisterSpec,
209{
210    #[doc = "Not equal to MA1"]
211    #[inline(always)]
212    pub fn nomatch(self) -> &'a mut crate::W<REG> {
213        self.variant(Ma1f::Nomatch)
214    }
215    #[doc = "Equal to MA1"]
216    #[inline(always)]
217    pub fn match_(self) -> &'a mut crate::W<REG> {
218        self.variant(Ma1f::Match)
219    }
220}
221#[doc = "Parity Error Flag\n\nValue on reset: 0"]
222#[cfg_attr(feature = "defmt", derive(defmt::Format))]
223#[derive(Clone, Copy, Debug, PartialEq, Eq)]
224pub enum Pf {
225    #[doc = "0: No parity error detected"]
226    Noparity = 0,
227    #[doc = "1: Parity error detected"]
228    Parity = 1,
229}
230impl From<Pf> for bool {
231    #[inline(always)]
232    fn from(variant: Pf) -> Self {
233        variant as u8 != 0
234    }
235}
236#[doc = "Field `PF` reader - Parity Error Flag"]
237pub type PfR = crate::BitReader<Pf>;
238impl PfR {
239    #[doc = "Get enumerated values variant"]
240    #[inline(always)]
241    pub const fn variant(&self) -> Pf {
242        match self.bits {
243            false => Pf::Noparity,
244            true => Pf::Parity,
245        }
246    }
247    #[doc = "No parity error detected"]
248    #[inline(always)]
249    pub fn is_noparity(&self) -> bool {
250        *self == Pf::Noparity
251    }
252    #[doc = "Parity error detected"]
253    #[inline(always)]
254    pub fn is_parity(&self) -> bool {
255        *self == Pf::Parity
256    }
257}
258#[doc = "Field `PF` writer - Parity Error Flag"]
259pub type PfW<'a, REG> = crate::BitWriter1C<'a, REG, Pf>;
260impl<'a, REG> PfW<'a, REG>
261where
262    REG: crate::Writable + crate::RegisterSpec,
263{
264    #[doc = "No parity error detected"]
265    #[inline(always)]
266    pub fn noparity(self) -> &'a mut crate::W<REG> {
267        self.variant(Pf::Noparity)
268    }
269    #[doc = "Parity error detected"]
270    #[inline(always)]
271    pub fn parity(self) -> &'a mut crate::W<REG> {
272        self.variant(Pf::Parity)
273    }
274}
275#[doc = "Framing Error Flag\n\nValue on reset: 0"]
276#[cfg_attr(feature = "defmt", derive(defmt::Format))]
277#[derive(Clone, Copy, Debug, PartialEq, Eq)]
278pub enum Fe {
279    #[doc = "0: No framing error detected (this does not guarantee that the framing is correct)"]
280    Noerror = 0,
281    #[doc = "1: Framing error detected"]
282    Error = 1,
283}
284impl From<Fe> for bool {
285    #[inline(always)]
286    fn from(variant: Fe) -> Self {
287        variant as u8 != 0
288    }
289}
290#[doc = "Field `FE` reader - Framing Error Flag"]
291pub type FeR = crate::BitReader<Fe>;
292impl FeR {
293    #[doc = "Get enumerated values variant"]
294    #[inline(always)]
295    pub const fn variant(&self) -> Fe {
296        match self.bits {
297            false => Fe::Noerror,
298            true => Fe::Error,
299        }
300    }
301    #[doc = "No framing error detected (this does not guarantee that the framing is correct)"]
302    #[inline(always)]
303    pub fn is_noerror(&self) -> bool {
304        *self == Fe::Noerror
305    }
306    #[doc = "Framing error detected"]
307    #[inline(always)]
308    pub fn is_error(&self) -> bool {
309        *self == Fe::Error
310    }
311}
312#[doc = "Field `FE` writer - Framing Error Flag"]
313pub type FeW<'a, REG> = crate::BitWriter1C<'a, REG, Fe>;
314impl<'a, REG> FeW<'a, REG>
315where
316    REG: crate::Writable + crate::RegisterSpec,
317{
318    #[doc = "No framing error detected (this does not guarantee that the framing is correct)"]
319    #[inline(always)]
320    pub fn noerror(self) -> &'a mut crate::W<REG> {
321        self.variant(Fe::Noerror)
322    }
323    #[doc = "Framing error detected"]
324    #[inline(always)]
325    pub fn error(self) -> &'a mut crate::W<REG> {
326        self.variant(Fe::Error)
327    }
328}
329#[doc = "Noise Flag\n\nValue on reset: 0"]
330#[cfg_attr(feature = "defmt", derive(defmt::Format))]
331#[derive(Clone, Copy, Debug, PartialEq, Eq)]
332pub enum Nf {
333    #[doc = "0: No noise detected"]
334    Nonoise = 0,
335    #[doc = "1: Noise detected"]
336    Noise = 1,
337}
338impl From<Nf> for bool {
339    #[inline(always)]
340    fn from(variant: Nf) -> Self {
341        variant as u8 != 0
342    }
343}
344#[doc = "Field `NF` reader - Noise Flag"]
345pub type NfR = crate::BitReader<Nf>;
346impl NfR {
347    #[doc = "Get enumerated values variant"]
348    #[inline(always)]
349    pub const fn variant(&self) -> Nf {
350        match self.bits {
351            false => Nf::Nonoise,
352            true => Nf::Noise,
353        }
354    }
355    #[doc = "No noise detected"]
356    #[inline(always)]
357    pub fn is_nonoise(&self) -> bool {
358        *self == Nf::Nonoise
359    }
360    #[doc = "Noise detected"]
361    #[inline(always)]
362    pub fn is_noise(&self) -> bool {
363        *self == Nf::Noise
364    }
365}
366#[doc = "Field `NF` writer - Noise Flag"]
367pub type NfW<'a, REG> = crate::BitWriter1C<'a, REG, Nf>;
368impl<'a, REG> NfW<'a, REG>
369where
370    REG: crate::Writable + crate::RegisterSpec,
371{
372    #[doc = "No noise detected"]
373    #[inline(always)]
374    pub fn nonoise(self) -> &'a mut crate::W<REG> {
375        self.variant(Nf::Nonoise)
376    }
377    #[doc = "Noise detected"]
378    #[inline(always)]
379    pub fn noise(self) -> &'a mut crate::W<REG> {
380        self.variant(Nf::Noise)
381    }
382}
383#[doc = "Receiver Overrun Flag\n\nValue on reset: 0"]
384#[cfg_attr(feature = "defmt", derive(defmt::Format))]
385#[derive(Clone, Copy, Debug, PartialEq, Eq)]
386pub enum Or {
387    #[doc = "0: No overrun"]
388    NoOverrun = 0,
389    #[doc = "1: Receive overrun (new LPUART data is lost)"]
390    Overrun = 1,
391}
392impl From<Or> for bool {
393    #[inline(always)]
394    fn from(variant: Or) -> Self {
395        variant as u8 != 0
396    }
397}
398#[doc = "Field `OR` reader - Receiver Overrun Flag"]
399pub type OrR = crate::BitReader<Or>;
400impl OrR {
401    #[doc = "Get enumerated values variant"]
402    #[inline(always)]
403    pub const fn variant(&self) -> Or {
404        match self.bits {
405            false => Or::NoOverrun,
406            true => Or::Overrun,
407        }
408    }
409    #[doc = "No overrun"]
410    #[inline(always)]
411    pub fn is_no_overrun(&self) -> bool {
412        *self == Or::NoOverrun
413    }
414    #[doc = "Receive overrun (new LPUART data is lost)"]
415    #[inline(always)]
416    pub fn is_overrun(&self) -> bool {
417        *self == Or::Overrun
418    }
419}
420#[doc = "Field `OR` writer - Receiver Overrun Flag"]
421pub type OrW<'a, REG> = crate::BitWriter1C<'a, REG, Or>;
422impl<'a, REG> OrW<'a, REG>
423where
424    REG: crate::Writable + crate::RegisterSpec,
425{
426    #[doc = "No overrun"]
427    #[inline(always)]
428    pub fn no_overrun(self) -> &'a mut crate::W<REG> {
429        self.variant(Or::NoOverrun)
430    }
431    #[doc = "Receive overrun (new LPUART data is lost)"]
432    #[inline(always)]
433    pub fn overrun(self) -> &'a mut crate::W<REG> {
434        self.variant(Or::Overrun)
435    }
436}
437#[doc = "Idle Line Flag\n\nValue on reset: 0"]
438#[cfg_attr(feature = "defmt", derive(defmt::Format))]
439#[derive(Clone, Copy, Debug, PartialEq, Eq)]
440pub enum Idle {
441    #[doc = "0: Idle line detected"]
442    Noidle = 0,
443    #[doc = "1: Idle line not detected"]
444    Idle = 1,
445}
446impl From<Idle> for bool {
447    #[inline(always)]
448    fn from(variant: Idle) -> Self {
449        variant as u8 != 0
450    }
451}
452#[doc = "Field `IDLE` reader - Idle Line Flag"]
453pub type IdleR = crate::BitReader<Idle>;
454impl IdleR {
455    #[doc = "Get enumerated values variant"]
456    #[inline(always)]
457    pub const fn variant(&self) -> Idle {
458        match self.bits {
459            false => Idle::Noidle,
460            true => Idle::Idle,
461        }
462    }
463    #[doc = "Idle line detected"]
464    #[inline(always)]
465    pub fn is_noidle(&self) -> bool {
466        *self == Idle::Noidle
467    }
468    #[doc = "Idle line not detected"]
469    #[inline(always)]
470    pub fn is_idle(&self) -> bool {
471        *self == Idle::Idle
472    }
473}
474#[doc = "Field `IDLE` writer - Idle Line Flag"]
475pub type IdleW<'a, REG> = crate::BitWriter1C<'a, REG, Idle>;
476impl<'a, REG> IdleW<'a, REG>
477where
478    REG: crate::Writable + crate::RegisterSpec,
479{
480    #[doc = "Idle line detected"]
481    #[inline(always)]
482    pub fn noidle(self) -> &'a mut crate::W<REG> {
483        self.variant(Idle::Noidle)
484    }
485    #[doc = "Idle line not detected"]
486    #[inline(always)]
487    pub fn idle(self) -> &'a mut crate::W<REG> {
488        self.variant(Idle::Idle)
489    }
490}
491#[doc = "Receive Data Register Full Flag\n\nValue on reset: 0"]
492#[cfg_attr(feature = "defmt", derive(defmt::Format))]
493#[derive(Clone, Copy, Debug, PartialEq, Eq)]
494pub enum Rdrf {
495    #[doc = "0: Equal to or less than watermark"]
496    NoRxdata = 0,
497    #[doc = "1: Greater than watermark"]
498    Rxdata = 1,
499}
500impl From<Rdrf> for bool {
501    #[inline(always)]
502    fn from(variant: Rdrf) -> Self {
503        variant as u8 != 0
504    }
505}
506#[doc = "Field `RDRF` reader - Receive Data Register Full Flag"]
507pub type RdrfR = crate::BitReader<Rdrf>;
508impl RdrfR {
509    #[doc = "Get enumerated values variant"]
510    #[inline(always)]
511    pub const fn variant(&self) -> Rdrf {
512        match self.bits {
513            false => Rdrf::NoRxdata,
514            true => Rdrf::Rxdata,
515        }
516    }
517    #[doc = "Equal to or less than watermark"]
518    #[inline(always)]
519    pub fn is_no_rxdata(&self) -> bool {
520        *self == Rdrf::NoRxdata
521    }
522    #[doc = "Greater than watermark"]
523    #[inline(always)]
524    pub fn is_rxdata(&self) -> bool {
525        *self == Rdrf::Rxdata
526    }
527}
528#[doc = "Transmission Complete Flag\n\nValue on reset: 1"]
529#[cfg_attr(feature = "defmt", derive(defmt::Format))]
530#[derive(Clone, Copy, Debug, PartialEq, Eq)]
531pub enum Tc {
532    #[doc = "0: Transmitter active"]
533    Active = 0,
534    #[doc = "1: Transmitter idle"]
535    Complete = 1,
536}
537impl From<Tc> for bool {
538    #[inline(always)]
539    fn from(variant: Tc) -> Self {
540        variant as u8 != 0
541    }
542}
543#[doc = "Field `TC` reader - Transmission Complete Flag"]
544pub type TcR = crate::BitReader<Tc>;
545impl TcR {
546    #[doc = "Get enumerated values variant"]
547    #[inline(always)]
548    pub const fn variant(&self) -> Tc {
549        match self.bits {
550            false => Tc::Active,
551            true => Tc::Complete,
552        }
553    }
554    #[doc = "Transmitter active"]
555    #[inline(always)]
556    pub fn is_active(&self) -> bool {
557        *self == Tc::Active
558    }
559    #[doc = "Transmitter idle"]
560    #[inline(always)]
561    pub fn is_complete(&self) -> bool {
562        *self == Tc::Complete
563    }
564}
565#[doc = "Transmit Data Register Empty Flag\n\nValue on reset: 1"]
566#[cfg_attr(feature = "defmt", derive(defmt::Format))]
567#[derive(Clone, Copy, Debug, PartialEq, Eq)]
568pub enum Tdre {
569    #[doc = "0: Greater than watermark"]
570    Txdata = 0,
571    #[doc = "1: Equal to or less than watermark"]
572    NoTxdata = 1,
573}
574impl From<Tdre> for bool {
575    #[inline(always)]
576    fn from(variant: Tdre) -> Self {
577        variant as u8 != 0
578    }
579}
580#[doc = "Field `TDRE` reader - Transmit Data Register Empty Flag"]
581pub type TdreR = crate::BitReader<Tdre>;
582impl TdreR {
583    #[doc = "Get enumerated values variant"]
584    #[inline(always)]
585    pub const fn variant(&self) -> Tdre {
586        match self.bits {
587            false => Tdre::Txdata,
588            true => Tdre::NoTxdata,
589        }
590    }
591    #[doc = "Greater than watermark"]
592    #[inline(always)]
593    pub fn is_txdata(&self) -> bool {
594        *self == Tdre::Txdata
595    }
596    #[doc = "Equal to or less than watermark"]
597    #[inline(always)]
598    pub fn is_no_txdata(&self) -> bool {
599        *self == Tdre::NoTxdata
600    }
601}
602#[doc = "Receiver Active Flag\n\nValue on reset: 0"]
603#[cfg_attr(feature = "defmt", derive(defmt::Format))]
604#[derive(Clone, Copy, Debug, PartialEq, Eq)]
605pub enum Raf {
606    #[doc = "0: Idle, waiting for a start bit"]
607    Idle = 0,
608    #[doc = "1: Receiver active (RXD pin input not idle)"]
609    Active = 1,
610}
611impl From<Raf> for bool {
612    #[inline(always)]
613    fn from(variant: Raf) -> Self {
614        variant as u8 != 0
615    }
616}
617#[doc = "Field `RAF` reader - Receiver Active Flag"]
618pub type RafR = crate::BitReader<Raf>;
619impl RafR {
620    #[doc = "Get enumerated values variant"]
621    #[inline(always)]
622    pub const fn variant(&self) -> Raf {
623        match self.bits {
624            false => Raf::Idle,
625            true => Raf::Active,
626        }
627    }
628    #[doc = "Idle, waiting for a start bit"]
629    #[inline(always)]
630    pub fn is_idle(&self) -> bool {
631        *self == Raf::Idle
632    }
633    #[doc = "Receiver active (RXD pin input not idle)"]
634    #[inline(always)]
635    pub fn is_active(&self) -> bool {
636        *self == Raf::Active
637    }
638}
639#[doc = "LIN Break Detection Enable\n\nValue on reset: 0"]
640#[cfg_attr(feature = "defmt", derive(defmt::Format))]
641#[derive(Clone, Copy, Debug, PartialEq, Eq)]
642pub enum Lbkde {
643    #[doc = "0: Disable"]
644    Disabled = 0,
645    #[doc = "1: Enable"]
646    Enabled = 1,
647}
648impl From<Lbkde> for bool {
649    #[inline(always)]
650    fn from(variant: Lbkde) -> Self {
651        variant as u8 != 0
652    }
653}
654#[doc = "Field `LBKDE` reader - LIN Break Detection Enable"]
655pub type LbkdeR = crate::BitReader<Lbkde>;
656impl LbkdeR {
657    #[doc = "Get enumerated values variant"]
658    #[inline(always)]
659    pub const fn variant(&self) -> Lbkde {
660        match self.bits {
661            false => Lbkde::Disabled,
662            true => Lbkde::Enabled,
663        }
664    }
665    #[doc = "Disable"]
666    #[inline(always)]
667    pub fn is_disabled(&self) -> bool {
668        *self == Lbkde::Disabled
669    }
670    #[doc = "Enable"]
671    #[inline(always)]
672    pub fn is_enabled(&self) -> bool {
673        *self == Lbkde::Enabled
674    }
675}
676#[doc = "Field `LBKDE` writer - LIN Break Detection Enable"]
677pub type LbkdeW<'a, REG> = crate::BitWriter<'a, REG, Lbkde>;
678impl<'a, REG> LbkdeW<'a, REG>
679where
680    REG: crate::Writable + crate::RegisterSpec,
681{
682    #[doc = "Disable"]
683    #[inline(always)]
684    pub fn disabled(self) -> &'a mut crate::W<REG> {
685        self.variant(Lbkde::Disabled)
686    }
687    #[doc = "Enable"]
688    #[inline(always)]
689    pub fn enabled(self) -> &'a mut crate::W<REG> {
690        self.variant(Lbkde::Enabled)
691    }
692}
693#[doc = "Break Character Generation Length\n\nValue on reset: 0"]
694#[cfg_attr(feature = "defmt", derive(defmt::Format))]
695#[derive(Clone, Copy, Debug, PartialEq, Eq)]
696pub enum Brk13 {
697    #[doc = "0: 9 to 13 bit times"]
698    Short = 0,
699    #[doc = "1: 12 to 15 bit times"]
700    Long = 1,
701}
702impl From<Brk13> for bool {
703    #[inline(always)]
704    fn from(variant: Brk13) -> Self {
705        variant as u8 != 0
706    }
707}
708#[doc = "Field `BRK13` reader - Break Character Generation Length"]
709pub type Brk13R = crate::BitReader<Brk13>;
710impl Brk13R {
711    #[doc = "Get enumerated values variant"]
712    #[inline(always)]
713    pub const fn variant(&self) -> Brk13 {
714        match self.bits {
715            false => Brk13::Short,
716            true => Brk13::Long,
717        }
718    }
719    #[doc = "9 to 13 bit times"]
720    #[inline(always)]
721    pub fn is_short(&self) -> bool {
722        *self == Brk13::Short
723    }
724    #[doc = "12 to 15 bit times"]
725    #[inline(always)]
726    pub fn is_long(&self) -> bool {
727        *self == Brk13::Long
728    }
729}
730#[doc = "Field `BRK13` writer - Break Character Generation Length"]
731pub type Brk13W<'a, REG> = crate::BitWriter<'a, REG, Brk13>;
732impl<'a, REG> Brk13W<'a, REG>
733where
734    REG: crate::Writable + crate::RegisterSpec,
735{
736    #[doc = "9 to 13 bit times"]
737    #[inline(always)]
738    pub fn short(self) -> &'a mut crate::W<REG> {
739        self.variant(Brk13::Short)
740    }
741    #[doc = "12 to 15 bit times"]
742    #[inline(always)]
743    pub fn long(self) -> &'a mut crate::W<REG> {
744        self.variant(Brk13::Long)
745    }
746}
747#[doc = "Receive Wake Up Idle Detect\n\nValue on reset: 0"]
748#[cfg_attr(feature = "defmt", derive(defmt::Format))]
749#[derive(Clone, Copy, Debug, PartialEq, Eq)]
750pub enum Rwuid {
751    #[doc = "0: STAT\\[IDLE\\] does not become 1"]
752    IdleNotset = 0,
753    #[doc = "1: STAT\\[IDLE\\] becomes 1"]
754    IdleSet = 1,
755}
756impl From<Rwuid> for bool {
757    #[inline(always)]
758    fn from(variant: Rwuid) -> Self {
759        variant as u8 != 0
760    }
761}
762#[doc = "Field `RWUID` reader - Receive Wake Up Idle Detect"]
763pub type RwuidR = crate::BitReader<Rwuid>;
764impl RwuidR {
765    #[doc = "Get enumerated values variant"]
766    #[inline(always)]
767    pub const fn variant(&self) -> Rwuid {
768        match self.bits {
769            false => Rwuid::IdleNotset,
770            true => Rwuid::IdleSet,
771        }
772    }
773    #[doc = "STAT\\[IDLE\\] does not become 1"]
774    #[inline(always)]
775    pub fn is_idle_notset(&self) -> bool {
776        *self == Rwuid::IdleNotset
777    }
778    #[doc = "STAT\\[IDLE\\] becomes 1"]
779    #[inline(always)]
780    pub fn is_idle_set(&self) -> bool {
781        *self == Rwuid::IdleSet
782    }
783}
784#[doc = "Field `RWUID` writer - Receive Wake Up Idle Detect"]
785pub type RwuidW<'a, REG> = crate::BitWriter<'a, REG, Rwuid>;
786impl<'a, REG> RwuidW<'a, REG>
787where
788    REG: crate::Writable + crate::RegisterSpec,
789{
790    #[doc = "STAT\\[IDLE\\] does not become 1"]
791    #[inline(always)]
792    pub fn idle_notset(self) -> &'a mut crate::W<REG> {
793        self.variant(Rwuid::IdleNotset)
794    }
795    #[doc = "STAT\\[IDLE\\] becomes 1"]
796    #[inline(always)]
797    pub fn idle_set(self) -> &'a mut crate::W<REG> {
798        self.variant(Rwuid::IdleSet)
799    }
800}
801#[doc = "Receive Data Inversion\n\nValue on reset: 0"]
802#[cfg_attr(feature = "defmt", derive(defmt::Format))]
803#[derive(Clone, Copy, Debug, PartialEq, Eq)]
804pub enum Rxinv {
805    #[doc = "0: Inverted"]
806    NotInverted = 0,
807    #[doc = "1: Not inverted"]
808    Inverted = 1,
809}
810impl From<Rxinv> for bool {
811    #[inline(always)]
812    fn from(variant: Rxinv) -> Self {
813        variant as u8 != 0
814    }
815}
816#[doc = "Field `RXINV` reader - Receive Data Inversion"]
817pub type RxinvR = crate::BitReader<Rxinv>;
818impl RxinvR {
819    #[doc = "Get enumerated values variant"]
820    #[inline(always)]
821    pub const fn variant(&self) -> Rxinv {
822        match self.bits {
823            false => Rxinv::NotInverted,
824            true => Rxinv::Inverted,
825        }
826    }
827    #[doc = "Inverted"]
828    #[inline(always)]
829    pub fn is_not_inverted(&self) -> bool {
830        *self == Rxinv::NotInverted
831    }
832    #[doc = "Not inverted"]
833    #[inline(always)]
834    pub fn is_inverted(&self) -> bool {
835        *self == Rxinv::Inverted
836    }
837}
838#[doc = "Field `RXINV` writer - Receive Data Inversion"]
839pub type RxinvW<'a, REG> = crate::BitWriter<'a, REG, Rxinv>;
840impl<'a, REG> RxinvW<'a, REG>
841where
842    REG: crate::Writable + crate::RegisterSpec,
843{
844    #[doc = "Inverted"]
845    #[inline(always)]
846    pub fn not_inverted(self) -> &'a mut crate::W<REG> {
847        self.variant(Rxinv::NotInverted)
848    }
849    #[doc = "Not inverted"]
850    #[inline(always)]
851    pub fn inverted(self) -> &'a mut crate::W<REG> {
852        self.variant(Rxinv::Inverted)
853    }
854}
855#[doc = "MSB First\n\nValue on reset: 0"]
856#[cfg_attr(feature = "defmt", derive(defmt::Format))]
857#[derive(Clone, Copy, Debug, PartialEq, Eq)]
858pub enum Msbf {
859    #[doc = "0: LSB"]
860    LsbFirst = 0,
861    #[doc = "1: MSB"]
862    MsbFirst = 1,
863}
864impl From<Msbf> for bool {
865    #[inline(always)]
866    fn from(variant: Msbf) -> Self {
867        variant as u8 != 0
868    }
869}
870#[doc = "Field `MSBF` reader - MSB First"]
871pub type MsbfR = crate::BitReader<Msbf>;
872impl MsbfR {
873    #[doc = "Get enumerated values variant"]
874    #[inline(always)]
875    pub const fn variant(&self) -> Msbf {
876        match self.bits {
877            false => Msbf::LsbFirst,
878            true => Msbf::MsbFirst,
879        }
880    }
881    #[doc = "LSB"]
882    #[inline(always)]
883    pub fn is_lsb_first(&self) -> bool {
884        *self == Msbf::LsbFirst
885    }
886    #[doc = "MSB"]
887    #[inline(always)]
888    pub fn is_msb_first(&self) -> bool {
889        *self == Msbf::MsbFirst
890    }
891}
892#[doc = "Field `MSBF` writer - MSB First"]
893pub type MsbfW<'a, REG> = crate::BitWriter<'a, REG, Msbf>;
894impl<'a, REG> MsbfW<'a, REG>
895where
896    REG: crate::Writable + crate::RegisterSpec,
897{
898    #[doc = "LSB"]
899    #[inline(always)]
900    pub fn lsb_first(self) -> &'a mut crate::W<REG> {
901        self.variant(Msbf::LsbFirst)
902    }
903    #[doc = "MSB"]
904    #[inline(always)]
905    pub fn msb_first(self) -> &'a mut crate::W<REG> {
906        self.variant(Msbf::MsbFirst)
907    }
908}
909#[doc = "RXD Pin Active Edge Interrupt Flag\n\nValue on reset: 0"]
910#[cfg_attr(feature = "defmt", derive(defmt::Format))]
911#[derive(Clone, Copy, Debug, PartialEq, Eq)]
912pub enum Rxedgif {
913    #[doc = "0: Not occurred"]
914    NoEdge = 0,
915    #[doc = "1: Occurred"]
916    Edge = 1,
917}
918impl From<Rxedgif> for bool {
919    #[inline(always)]
920    fn from(variant: Rxedgif) -> Self {
921        variant as u8 != 0
922    }
923}
924#[doc = "Field `RXEDGIF` reader - RXD Pin Active Edge Interrupt Flag"]
925pub type RxedgifR = crate::BitReader<Rxedgif>;
926impl RxedgifR {
927    #[doc = "Get enumerated values variant"]
928    #[inline(always)]
929    pub const fn variant(&self) -> Rxedgif {
930        match self.bits {
931            false => Rxedgif::NoEdge,
932            true => Rxedgif::Edge,
933        }
934    }
935    #[doc = "Not occurred"]
936    #[inline(always)]
937    pub fn is_no_edge(&self) -> bool {
938        *self == Rxedgif::NoEdge
939    }
940    #[doc = "Occurred"]
941    #[inline(always)]
942    pub fn is_edge(&self) -> bool {
943        *self == Rxedgif::Edge
944    }
945}
946#[doc = "Field `RXEDGIF` writer - RXD Pin Active Edge Interrupt Flag"]
947pub type RxedgifW<'a, REG> = crate::BitWriter1C<'a, REG, Rxedgif>;
948impl<'a, REG> RxedgifW<'a, REG>
949where
950    REG: crate::Writable + crate::RegisterSpec,
951{
952    #[doc = "Not occurred"]
953    #[inline(always)]
954    pub fn no_edge(self) -> &'a mut crate::W<REG> {
955        self.variant(Rxedgif::NoEdge)
956    }
957    #[doc = "Occurred"]
958    #[inline(always)]
959    pub fn edge(self) -> &'a mut crate::W<REG> {
960        self.variant(Rxedgif::Edge)
961    }
962}
963#[doc = "LIN Break Detect Interrupt Flag\n\nValue on reset: 0"]
964#[cfg_attr(feature = "defmt", derive(defmt::Format))]
965#[derive(Clone, Copy, Debug, PartialEq, Eq)]
966pub enum Lbkdif {
967    #[doc = "0: Not detected"]
968    NotDetected = 0,
969    #[doc = "1: Detected"]
970    Detected = 1,
971}
972impl From<Lbkdif> for bool {
973    #[inline(always)]
974    fn from(variant: Lbkdif) -> Self {
975        variant as u8 != 0
976    }
977}
978#[doc = "Field `LBKDIF` reader - LIN Break Detect Interrupt Flag"]
979pub type LbkdifR = crate::BitReader<Lbkdif>;
980impl LbkdifR {
981    #[doc = "Get enumerated values variant"]
982    #[inline(always)]
983    pub const fn variant(&self) -> Lbkdif {
984        match self.bits {
985            false => Lbkdif::NotDetected,
986            true => Lbkdif::Detected,
987        }
988    }
989    #[doc = "Not detected"]
990    #[inline(always)]
991    pub fn is_not_detected(&self) -> bool {
992        *self == Lbkdif::NotDetected
993    }
994    #[doc = "Detected"]
995    #[inline(always)]
996    pub fn is_detected(&self) -> bool {
997        *self == Lbkdif::Detected
998    }
999}
1000#[doc = "Field `LBKDIF` writer - LIN Break Detect Interrupt Flag"]
1001pub type LbkdifW<'a, REG> = crate::BitWriter1C<'a, REG, Lbkdif>;
1002impl<'a, REG> LbkdifW<'a, REG>
1003where
1004    REG: crate::Writable + crate::RegisterSpec,
1005{
1006    #[doc = "Not detected"]
1007    #[inline(always)]
1008    pub fn not_detected(self) -> &'a mut crate::W<REG> {
1009        self.variant(Lbkdif::NotDetected)
1010    }
1011    #[doc = "Detected"]
1012    #[inline(always)]
1013    pub fn detected(self) -> &'a mut crate::W<REG> {
1014        self.variant(Lbkdif::Detected)
1015    }
1016}
1017impl R {
1018    #[doc = "Bit 0 - LIN Break Flag Enable"]
1019    #[inline(always)]
1020    pub fn lbkfe(&self) -> LbkfeR {
1021        LbkfeR::new((self.bits & 1) != 0)
1022    }
1023    #[doc = "Bit 1 - Address Mark Enable"]
1024    #[inline(always)]
1025    pub fn ame(&self) -> AmeR {
1026        AmeR::new(((self.bits >> 1) & 1) != 0)
1027    }
1028    #[doc = "Bit 14 - Match 2 Flag"]
1029    #[inline(always)]
1030    pub fn ma2f(&self) -> Ma2fR {
1031        Ma2fR::new(((self.bits >> 14) & 1) != 0)
1032    }
1033    #[doc = "Bit 15 - Match 1 Flag"]
1034    #[inline(always)]
1035    pub fn ma1f(&self) -> Ma1fR {
1036        Ma1fR::new(((self.bits >> 15) & 1) != 0)
1037    }
1038    #[doc = "Bit 16 - Parity Error Flag"]
1039    #[inline(always)]
1040    pub fn pf(&self) -> PfR {
1041        PfR::new(((self.bits >> 16) & 1) != 0)
1042    }
1043    #[doc = "Bit 17 - Framing Error Flag"]
1044    #[inline(always)]
1045    pub fn fe(&self) -> FeR {
1046        FeR::new(((self.bits >> 17) & 1) != 0)
1047    }
1048    #[doc = "Bit 18 - Noise Flag"]
1049    #[inline(always)]
1050    pub fn nf(&self) -> NfR {
1051        NfR::new(((self.bits >> 18) & 1) != 0)
1052    }
1053    #[doc = "Bit 19 - Receiver Overrun Flag"]
1054    #[inline(always)]
1055    pub fn or(&self) -> OrR {
1056        OrR::new(((self.bits >> 19) & 1) != 0)
1057    }
1058    #[doc = "Bit 20 - Idle Line Flag"]
1059    #[inline(always)]
1060    pub fn idle(&self) -> IdleR {
1061        IdleR::new(((self.bits >> 20) & 1) != 0)
1062    }
1063    #[doc = "Bit 21 - Receive Data Register Full Flag"]
1064    #[inline(always)]
1065    pub fn rdrf(&self) -> RdrfR {
1066        RdrfR::new(((self.bits >> 21) & 1) != 0)
1067    }
1068    #[doc = "Bit 22 - Transmission Complete Flag"]
1069    #[inline(always)]
1070    pub fn tc(&self) -> TcR {
1071        TcR::new(((self.bits >> 22) & 1) != 0)
1072    }
1073    #[doc = "Bit 23 - Transmit Data Register Empty Flag"]
1074    #[inline(always)]
1075    pub fn tdre(&self) -> TdreR {
1076        TdreR::new(((self.bits >> 23) & 1) != 0)
1077    }
1078    #[doc = "Bit 24 - Receiver Active Flag"]
1079    #[inline(always)]
1080    pub fn raf(&self) -> RafR {
1081        RafR::new(((self.bits >> 24) & 1) != 0)
1082    }
1083    #[doc = "Bit 25 - LIN Break Detection Enable"]
1084    #[inline(always)]
1085    pub fn lbkde(&self) -> LbkdeR {
1086        LbkdeR::new(((self.bits >> 25) & 1) != 0)
1087    }
1088    #[doc = "Bit 26 - Break Character Generation Length"]
1089    #[inline(always)]
1090    pub fn brk13(&self) -> Brk13R {
1091        Brk13R::new(((self.bits >> 26) & 1) != 0)
1092    }
1093    #[doc = "Bit 27 - Receive Wake Up Idle Detect"]
1094    #[inline(always)]
1095    pub fn rwuid(&self) -> RwuidR {
1096        RwuidR::new(((self.bits >> 27) & 1) != 0)
1097    }
1098    #[doc = "Bit 28 - Receive Data Inversion"]
1099    #[inline(always)]
1100    pub fn rxinv(&self) -> RxinvR {
1101        RxinvR::new(((self.bits >> 28) & 1) != 0)
1102    }
1103    #[doc = "Bit 29 - MSB First"]
1104    #[inline(always)]
1105    pub fn msbf(&self) -> MsbfR {
1106        MsbfR::new(((self.bits >> 29) & 1) != 0)
1107    }
1108    #[doc = "Bit 30 - RXD Pin Active Edge Interrupt Flag"]
1109    #[inline(always)]
1110    pub fn rxedgif(&self) -> RxedgifR {
1111        RxedgifR::new(((self.bits >> 30) & 1) != 0)
1112    }
1113    #[doc = "Bit 31 - LIN Break Detect Interrupt Flag"]
1114    #[inline(always)]
1115    pub fn lbkdif(&self) -> LbkdifR {
1116        LbkdifR::new(((self.bits >> 31) & 1) != 0)
1117    }
1118}
1119#[cfg(feature = "debug")]
1120impl core::fmt::Debug for R {
1121    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1122        f.debug_struct("STAT")
1123            .field("lbkfe", &self.lbkfe())
1124            .field("ame", &self.ame())
1125            .field("ma2f", &self.ma2f())
1126            .field("ma1f", &self.ma1f())
1127            .field("pf", &self.pf())
1128            .field("fe", &self.fe())
1129            .field("nf", &self.nf())
1130            .field("or", &self.or())
1131            .field("idle", &self.idle())
1132            .field("rdrf", &self.rdrf())
1133            .field("tc", &self.tc())
1134            .field("tdre", &self.tdre())
1135            .field("raf", &self.raf())
1136            .field("lbkde", &self.lbkde())
1137            .field("brk13", &self.brk13())
1138            .field("rwuid", &self.rwuid())
1139            .field("rxinv", &self.rxinv())
1140            .field("msbf", &self.msbf())
1141            .field("rxedgif", &self.rxedgif())
1142            .field("lbkdif", &self.lbkdif())
1143            .finish()
1144    }
1145}
1146impl W {
1147    #[doc = "Bit 0 - LIN Break Flag Enable"]
1148    #[inline(always)]
1149    pub fn lbkfe(&mut self) -> LbkfeW<'_, StatSpec> {
1150        LbkfeW::new(self, 0)
1151    }
1152    #[doc = "Bit 1 - Address Mark Enable"]
1153    #[inline(always)]
1154    pub fn ame(&mut self) -> AmeW<'_, StatSpec> {
1155        AmeW::new(self, 1)
1156    }
1157    #[doc = "Bit 14 - Match 2 Flag"]
1158    #[inline(always)]
1159    pub fn ma2f(&mut self) -> Ma2fW<'_, StatSpec> {
1160        Ma2fW::new(self, 14)
1161    }
1162    #[doc = "Bit 15 - Match 1 Flag"]
1163    #[inline(always)]
1164    pub fn ma1f(&mut self) -> Ma1fW<'_, StatSpec> {
1165        Ma1fW::new(self, 15)
1166    }
1167    #[doc = "Bit 16 - Parity Error Flag"]
1168    #[inline(always)]
1169    pub fn pf(&mut self) -> PfW<'_, StatSpec> {
1170        PfW::new(self, 16)
1171    }
1172    #[doc = "Bit 17 - Framing Error Flag"]
1173    #[inline(always)]
1174    pub fn fe(&mut self) -> FeW<'_, StatSpec> {
1175        FeW::new(self, 17)
1176    }
1177    #[doc = "Bit 18 - Noise Flag"]
1178    #[inline(always)]
1179    pub fn nf(&mut self) -> NfW<'_, StatSpec> {
1180        NfW::new(self, 18)
1181    }
1182    #[doc = "Bit 19 - Receiver Overrun Flag"]
1183    #[inline(always)]
1184    pub fn or(&mut self) -> OrW<'_, StatSpec> {
1185        OrW::new(self, 19)
1186    }
1187    #[doc = "Bit 20 - Idle Line Flag"]
1188    #[inline(always)]
1189    pub fn idle(&mut self) -> IdleW<'_, StatSpec> {
1190        IdleW::new(self, 20)
1191    }
1192    #[doc = "Bit 25 - LIN Break Detection Enable"]
1193    #[inline(always)]
1194    pub fn lbkde(&mut self) -> LbkdeW<'_, StatSpec> {
1195        LbkdeW::new(self, 25)
1196    }
1197    #[doc = "Bit 26 - Break Character Generation Length"]
1198    #[inline(always)]
1199    pub fn brk13(&mut self) -> Brk13W<'_, StatSpec> {
1200        Brk13W::new(self, 26)
1201    }
1202    #[doc = "Bit 27 - Receive Wake Up Idle Detect"]
1203    #[inline(always)]
1204    pub fn rwuid(&mut self) -> RwuidW<'_, StatSpec> {
1205        RwuidW::new(self, 27)
1206    }
1207    #[doc = "Bit 28 - Receive Data Inversion"]
1208    #[inline(always)]
1209    pub fn rxinv(&mut self) -> RxinvW<'_, StatSpec> {
1210        RxinvW::new(self, 28)
1211    }
1212    #[doc = "Bit 29 - MSB First"]
1213    #[inline(always)]
1214    pub fn msbf(&mut self) -> MsbfW<'_, StatSpec> {
1215        MsbfW::new(self, 29)
1216    }
1217    #[doc = "Bit 30 - RXD Pin Active Edge Interrupt Flag"]
1218    #[inline(always)]
1219    pub fn rxedgif(&mut self) -> RxedgifW<'_, StatSpec> {
1220        RxedgifW::new(self, 30)
1221    }
1222    #[doc = "Bit 31 - LIN Break Detect Interrupt Flag"]
1223    #[inline(always)]
1224    pub fn lbkdif(&mut self) -> LbkdifW<'_, StatSpec> {
1225        LbkdifW::new(self, 31)
1226    }
1227}
1228#[doc = "Status\n\nYou can [`read`](crate::Reg::read) this register and get [`stat::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`stat::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
1229pub struct StatSpec;
1230impl crate::RegisterSpec for StatSpec {
1231    type Ux = u32;
1232}
1233#[doc = "`read()` method returns [`stat::R`](R) reader structure"]
1234impl crate::Readable for StatSpec {}
1235#[doc = "`write(|w| ..)` method takes [`stat::W`](W) writer structure"]
1236impl crate::Writable for StatSpec {
1237    type Safety = crate::Unsafe;
1238    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0xc01f_c000;
1239}
1240#[doc = "`reset()` method sets STAT to value 0x00c0_0000"]
1241impl crate::Resettable for StatSpec {
1242    const RESET_VALUE: u32 = 0x00c0_0000;
1243}