1#[doc = "Register `ESR1` reader"]
2pub type R = crate::R<Esr1Spec>;
3#[doc = "Register `ESR1` writer"]
4pub type W = crate::W<Esr1Spec>;
5#[doc = "Wake-up Interrupt Flag\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum Wakint {
9 #[doc = "0: No such occurrence."]
10 Disable = 0,
11 #[doc = "1: Indicates that a recessive-to-dominant transition was received on the CAN bus."]
12 Enable = 1,
13}
14impl From<Wakint> for bool {
15 #[inline(always)]
16 fn from(variant: Wakint) -> Self {
17 variant as u8 != 0
18 }
19}
20#[doc = "Field `WAKINT` reader - Wake-up Interrupt Flag"]
21pub type WakintR = crate::BitReader<Wakint>;
22impl WakintR {
23 #[doc = "Get enumerated values variant"]
24 #[inline(always)]
25 pub const fn variant(&self) -> Wakint {
26 match self.bits {
27 false => Wakint::Disable,
28 true => Wakint::Enable,
29 }
30 }
31 #[doc = "No such occurrence."]
32 #[inline(always)]
33 pub fn is_disable(&self) -> bool {
34 *self == Wakint::Disable
35 }
36 #[doc = "Indicates that a recessive-to-dominant transition was received on the CAN bus."]
37 #[inline(always)]
38 pub fn is_enable(&self) -> bool {
39 *self == Wakint::Enable
40 }
41}
42#[doc = "Field `WAKINT` writer - Wake-up Interrupt Flag"]
43pub type WakintW<'a, REG> = crate::BitWriter1C<'a, REG, Wakint>;
44impl<'a, REG> WakintW<'a, REG>
45where
46 REG: crate::Writable + crate::RegisterSpec,
47{
48 #[doc = "No such occurrence."]
49 #[inline(always)]
50 pub fn disable(self) -> &'a mut crate::W<REG> {
51 self.variant(Wakint::Disable)
52 }
53 #[doc = "Indicates that a recessive-to-dominant transition was received on the CAN bus."]
54 #[inline(always)]
55 pub fn enable(self) -> &'a mut crate::W<REG> {
56 self.variant(Wakint::Enable)
57 }
58}
59#[doc = "Error Interrupt Flag\n\nValue on reset: 0"]
60#[cfg_attr(feature = "defmt", derive(defmt::Format))]
61#[derive(Clone, Copy, Debug, PartialEq, Eq)]
62pub enum Errint {
63 #[doc = "0: No such occurrence."]
64 Disable = 0,
65 #[doc = "1: Indicates setting of any error flag in the Error and Status register."]
66 Enable = 1,
67}
68impl From<Errint> for bool {
69 #[inline(always)]
70 fn from(variant: Errint) -> Self {
71 variant as u8 != 0
72 }
73}
74#[doc = "Field `ERRINT` reader - Error Interrupt Flag"]
75pub type ErrintR = crate::BitReader<Errint>;
76impl ErrintR {
77 #[doc = "Get enumerated values variant"]
78 #[inline(always)]
79 pub const fn variant(&self) -> Errint {
80 match self.bits {
81 false => Errint::Disable,
82 true => Errint::Enable,
83 }
84 }
85 #[doc = "No such occurrence."]
86 #[inline(always)]
87 pub fn is_disable(&self) -> bool {
88 *self == Errint::Disable
89 }
90 #[doc = "Indicates setting of any error flag in the Error and Status register."]
91 #[inline(always)]
92 pub fn is_enable(&self) -> bool {
93 *self == Errint::Enable
94 }
95}
96#[doc = "Field `ERRINT` writer - Error Interrupt Flag"]
97pub type ErrintW<'a, REG> = crate::BitWriter1C<'a, REG, Errint>;
98impl<'a, REG> ErrintW<'a, REG>
99where
100 REG: crate::Writable + crate::RegisterSpec,
101{
102 #[doc = "No such occurrence."]
103 #[inline(always)]
104 pub fn disable(self) -> &'a mut crate::W<REG> {
105 self.variant(Errint::Disable)
106 }
107 #[doc = "Indicates setting of any error flag in the Error and Status register."]
108 #[inline(always)]
109 pub fn enable(self) -> &'a mut crate::W<REG> {
110 self.variant(Errint::Enable)
111 }
112}
113#[doc = "Bus Off Interrupt Flag\n\nValue on reset: 0"]
114#[cfg_attr(feature = "defmt", derive(defmt::Format))]
115#[derive(Clone, Copy, Debug, PartialEq, Eq)]
116pub enum Boffint {
117 #[doc = "0: No such occurrence."]
118 Disable = 0,
119 #[doc = "1: FlexCAN module entered Bus Off state."]
120 Enable = 1,
121}
122impl From<Boffint> for bool {
123 #[inline(always)]
124 fn from(variant: Boffint) -> Self {
125 variant as u8 != 0
126 }
127}
128#[doc = "Field `BOFFINT` reader - Bus Off Interrupt Flag"]
129pub type BoffintR = crate::BitReader<Boffint>;
130impl BoffintR {
131 #[doc = "Get enumerated values variant"]
132 #[inline(always)]
133 pub const fn variant(&self) -> Boffint {
134 match self.bits {
135 false => Boffint::Disable,
136 true => Boffint::Enable,
137 }
138 }
139 #[doc = "No such occurrence."]
140 #[inline(always)]
141 pub fn is_disable(&self) -> bool {
142 *self == Boffint::Disable
143 }
144 #[doc = "FlexCAN module entered Bus Off state."]
145 #[inline(always)]
146 pub fn is_enable(&self) -> bool {
147 *self == Boffint::Enable
148 }
149}
150#[doc = "Field `BOFFINT` writer - Bus Off Interrupt Flag"]
151pub type BoffintW<'a, REG> = crate::BitWriter1C<'a, REG, Boffint>;
152impl<'a, REG> BoffintW<'a, REG>
153where
154 REG: crate::Writable + crate::RegisterSpec,
155{
156 #[doc = "No such occurrence."]
157 #[inline(always)]
158 pub fn disable(self) -> &'a mut crate::W<REG> {
159 self.variant(Boffint::Disable)
160 }
161 #[doc = "FlexCAN module entered Bus Off state."]
162 #[inline(always)]
163 pub fn enable(self) -> &'a mut crate::W<REG> {
164 self.variant(Boffint::Enable)
165 }
166}
167#[doc = "FlexCAN in Reception Flag\n\nValue on reset: 0"]
168#[cfg_attr(feature = "defmt", derive(defmt::Format))]
169#[derive(Clone, Copy, Debug, PartialEq, Eq)]
170pub enum Rx {
171 #[doc = "0: Not receiving"]
172 Disable = 0,
173 #[doc = "1: Receiving"]
174 Enable = 1,
175}
176impl From<Rx> for bool {
177 #[inline(always)]
178 fn from(variant: Rx) -> Self {
179 variant as u8 != 0
180 }
181}
182#[doc = "Field `RX` reader - FlexCAN in Reception Flag"]
183pub type RxR = crate::BitReader<Rx>;
184impl RxR {
185 #[doc = "Get enumerated values variant"]
186 #[inline(always)]
187 pub const fn variant(&self) -> Rx {
188 match self.bits {
189 false => Rx::Disable,
190 true => Rx::Enable,
191 }
192 }
193 #[doc = "Not receiving"]
194 #[inline(always)]
195 pub fn is_disable(&self) -> bool {
196 *self == Rx::Disable
197 }
198 #[doc = "Receiving"]
199 #[inline(always)]
200 pub fn is_enable(&self) -> bool {
201 *self == Rx::Enable
202 }
203}
204#[doc = "Fault Confinement State\n\nValue on reset: 0"]
205#[cfg_attr(feature = "defmt", derive(defmt::Format))]
206#[derive(Clone, Copy, Debug, PartialEq, Eq)]
207#[repr(u8)]
208pub enum Fltconf {
209 #[doc = "0: Error Active"]
210 ErrorActive = 0,
211 #[doc = "1: Error Passive"]
212 ErrorPassive = 1,
213 #[doc = "2: Bus Off"]
214 BusOff = 2,
215}
216impl From<Fltconf> for u8 {
217 #[inline(always)]
218 fn from(variant: Fltconf) -> Self {
219 variant as _
220 }
221}
222impl crate::FieldSpec for Fltconf {
223 type Ux = u8;
224}
225impl crate::IsEnum for Fltconf {}
226#[doc = "Field `FLTCONF` reader - Fault Confinement State"]
227pub type FltconfR = crate::FieldReader<Fltconf>;
228impl FltconfR {
229 #[doc = "Get enumerated values variant"]
230 #[inline(always)]
231 pub const fn variant(&self) -> Option<Fltconf> {
232 match self.bits {
233 0 => Some(Fltconf::ErrorActive),
234 1 => Some(Fltconf::ErrorPassive),
235 2 => Some(Fltconf::BusOff),
236 _ => None,
237 }
238 }
239 #[doc = "Error Active"]
240 #[inline(always)]
241 pub fn is_error_active(&self) -> bool {
242 *self == Fltconf::ErrorActive
243 }
244 #[doc = "Error Passive"]
245 #[inline(always)]
246 pub fn is_error_passive(&self) -> bool {
247 *self == Fltconf::ErrorPassive
248 }
249 #[doc = "Bus Off"]
250 #[inline(always)]
251 pub fn is_bus_off(&self) -> bool {
252 *self == Fltconf::BusOff
253 }
254}
255#[doc = "FlexCAN In Transmission\n\nValue on reset: 0"]
256#[cfg_attr(feature = "defmt", derive(defmt::Format))]
257#[derive(Clone, Copy, Debug, PartialEq, Eq)]
258pub enum Tx {
259 #[doc = "0: Not transmitting"]
260 TransmitMessageNo = 0,
261 #[doc = "1: Transmitting"]
262 TransmitMessageYes = 1,
263}
264impl From<Tx> for bool {
265 #[inline(always)]
266 fn from(variant: Tx) -> Self {
267 variant as u8 != 0
268 }
269}
270#[doc = "Field `TX` reader - FlexCAN In Transmission"]
271pub type TxR = crate::BitReader<Tx>;
272impl TxR {
273 #[doc = "Get enumerated values variant"]
274 #[inline(always)]
275 pub const fn variant(&self) -> Tx {
276 match self.bits {
277 false => Tx::TransmitMessageNo,
278 true => Tx::TransmitMessageYes,
279 }
280 }
281 #[doc = "Not transmitting"]
282 #[inline(always)]
283 pub fn is_transmit_message_no(&self) -> bool {
284 *self == Tx::TransmitMessageNo
285 }
286 #[doc = "Transmitting"]
287 #[inline(always)]
288 pub fn is_transmit_message_yes(&self) -> bool {
289 *self == Tx::TransmitMessageYes
290 }
291}
292#[doc = "Idle\n\nValue on reset: 0"]
293#[cfg_attr(feature = "defmt", derive(defmt::Format))]
294#[derive(Clone, Copy, Debug, PartialEq, Eq)]
295pub enum Idle {
296 #[doc = "0: Not IDLE"]
297 CanBusNotIdle = 0,
298 #[doc = "1: IDLE"]
299 CanBusIdle = 1,
300}
301impl From<Idle> for bool {
302 #[inline(always)]
303 fn from(variant: Idle) -> Self {
304 variant as u8 != 0
305 }
306}
307#[doc = "Field `IDLE` reader - Idle"]
308pub type IdleR = crate::BitReader<Idle>;
309impl IdleR {
310 #[doc = "Get enumerated values variant"]
311 #[inline(always)]
312 pub const fn variant(&self) -> Idle {
313 match self.bits {
314 false => Idle::CanBusNotIdle,
315 true => Idle::CanBusIdle,
316 }
317 }
318 #[doc = "Not IDLE"]
319 #[inline(always)]
320 pub fn is_can_bus_not_idle(&self) -> bool {
321 *self == Idle::CanBusNotIdle
322 }
323 #[doc = "IDLE"]
324 #[inline(always)]
325 pub fn is_can_bus_idle(&self) -> bool {
326 *self == Idle::CanBusIdle
327 }
328}
329#[doc = "RX Error Warning Flag\n\nValue on reset: 0"]
330#[cfg_attr(feature = "defmt", derive(defmt::Format))]
331#[derive(Clone, Copy, Debug, PartialEq, Eq)]
332pub enum Rxwrn {
333 #[doc = "0: No such occurrence."]
334 RxerrcntLt96 = 0,
335 #[doc = "1: RXERRCNT is greater than or equal to 96."]
336 RxerrcntGte96 = 1,
337}
338impl From<Rxwrn> for bool {
339 #[inline(always)]
340 fn from(variant: Rxwrn) -> Self {
341 variant as u8 != 0
342 }
343}
344#[doc = "Field `RXWRN` reader - RX Error Warning Flag"]
345pub type RxwrnR = crate::BitReader<Rxwrn>;
346impl RxwrnR {
347 #[doc = "Get enumerated values variant"]
348 #[inline(always)]
349 pub const fn variant(&self) -> Rxwrn {
350 match self.bits {
351 false => Rxwrn::RxerrcntLt96,
352 true => Rxwrn::RxerrcntGte96,
353 }
354 }
355 #[doc = "No such occurrence."]
356 #[inline(always)]
357 pub fn is_rxerrcnt_lt_96(&self) -> bool {
358 *self == Rxwrn::RxerrcntLt96
359 }
360 #[doc = "RXERRCNT is greater than or equal to 96."]
361 #[inline(always)]
362 pub fn is_rxerrcnt_gte_96(&self) -> bool {
363 *self == Rxwrn::RxerrcntGte96
364 }
365}
366#[doc = "TX Error Warning Flag\n\nValue on reset: 0"]
367#[cfg_attr(feature = "defmt", derive(defmt::Format))]
368#[derive(Clone, Copy, Debug, PartialEq, Eq)]
369pub enum Txwrn {
370 #[doc = "0: No such occurrence."]
371 TxerrcntLt96 = 0,
372 #[doc = "1: TXERRCNT is 96 or greater."]
373 TxerrcntGte96 = 1,
374}
375impl From<Txwrn> for bool {
376 #[inline(always)]
377 fn from(variant: Txwrn) -> Self {
378 variant as u8 != 0
379 }
380}
381#[doc = "Field `TXWRN` reader - TX Error Warning Flag"]
382pub type TxwrnR = crate::BitReader<Txwrn>;
383impl TxwrnR {
384 #[doc = "Get enumerated values variant"]
385 #[inline(always)]
386 pub const fn variant(&self) -> Txwrn {
387 match self.bits {
388 false => Txwrn::TxerrcntLt96,
389 true => Txwrn::TxerrcntGte96,
390 }
391 }
392 #[doc = "No such occurrence."]
393 #[inline(always)]
394 pub fn is_txerrcnt_lt_96(&self) -> bool {
395 *self == Txwrn::TxerrcntLt96
396 }
397 #[doc = "TXERRCNT is 96 or greater."]
398 #[inline(always)]
399 pub fn is_txerrcnt_gte_96(&self) -> bool {
400 *self == Txwrn::TxerrcntGte96
401 }
402}
403#[doc = "Stuffing Error Flag\n\nValue on reset: 0"]
404#[cfg_attr(feature = "defmt", derive(defmt::Format))]
405#[derive(Clone, Copy, Debug, PartialEq, Eq)]
406pub enum Stferr {
407 #[doc = "0: No error"]
408 StuffingErrorNo = 0,
409 #[doc = "1: Error occurred since last read of this register."]
410 StuffingErrorYes = 1,
411}
412impl From<Stferr> for bool {
413 #[inline(always)]
414 fn from(variant: Stferr) -> Self {
415 variant as u8 != 0
416 }
417}
418#[doc = "Field `STFERR` reader - Stuffing Error Flag"]
419pub type StferrR = crate::BitReader<Stferr>;
420impl StferrR {
421 #[doc = "Get enumerated values variant"]
422 #[inline(always)]
423 pub const fn variant(&self) -> Stferr {
424 match self.bits {
425 false => Stferr::StuffingErrorNo,
426 true => Stferr::StuffingErrorYes,
427 }
428 }
429 #[doc = "No error"]
430 #[inline(always)]
431 pub fn is_stuffing_error_no(&self) -> bool {
432 *self == Stferr::StuffingErrorNo
433 }
434 #[doc = "Error occurred since last read of this register."]
435 #[inline(always)]
436 pub fn is_stuffing_error_yes(&self) -> bool {
437 *self == Stferr::StuffingErrorYes
438 }
439}
440#[doc = "Form Error Flag\n\nValue on reset: 0"]
441#[cfg_attr(feature = "defmt", derive(defmt::Format))]
442#[derive(Clone, Copy, Debug, PartialEq, Eq)]
443pub enum Frmerr {
444 #[doc = "0: No error"]
445 FormErrorNo = 0,
446 #[doc = "1: Error occurred since last read of this register."]
447 FormErrorYes = 1,
448}
449impl From<Frmerr> for bool {
450 #[inline(always)]
451 fn from(variant: Frmerr) -> Self {
452 variant as u8 != 0
453 }
454}
455#[doc = "Field `FRMERR` reader - Form Error Flag"]
456pub type FrmerrR = crate::BitReader<Frmerr>;
457impl FrmerrR {
458 #[doc = "Get enumerated values variant"]
459 #[inline(always)]
460 pub const fn variant(&self) -> Frmerr {
461 match self.bits {
462 false => Frmerr::FormErrorNo,
463 true => Frmerr::FormErrorYes,
464 }
465 }
466 #[doc = "No error"]
467 #[inline(always)]
468 pub fn is_form_error_no(&self) -> bool {
469 *self == Frmerr::FormErrorNo
470 }
471 #[doc = "Error occurred since last read of this register."]
472 #[inline(always)]
473 pub fn is_form_error_yes(&self) -> bool {
474 *self == Frmerr::FormErrorYes
475 }
476}
477#[doc = "Cyclic Redundancy Check Error Flag\n\nValue on reset: 0"]
478#[cfg_attr(feature = "defmt", derive(defmt::Format))]
479#[derive(Clone, Copy, Debug, PartialEq, Eq)]
480pub enum Crcerr {
481 #[doc = "0: No error"]
482 CrcErrorNo = 0,
483 #[doc = "1: Error occurred since last read of this register."]
484 CrcErrorYes = 1,
485}
486impl From<Crcerr> for bool {
487 #[inline(always)]
488 fn from(variant: Crcerr) -> Self {
489 variant as u8 != 0
490 }
491}
492#[doc = "Field `CRCERR` reader - Cyclic Redundancy Check Error Flag"]
493pub type CrcerrR = crate::BitReader<Crcerr>;
494impl CrcerrR {
495 #[doc = "Get enumerated values variant"]
496 #[inline(always)]
497 pub const fn variant(&self) -> Crcerr {
498 match self.bits {
499 false => Crcerr::CrcErrorNo,
500 true => Crcerr::CrcErrorYes,
501 }
502 }
503 #[doc = "No error"]
504 #[inline(always)]
505 pub fn is_crc_error_no(&self) -> bool {
506 *self == Crcerr::CrcErrorNo
507 }
508 #[doc = "Error occurred since last read of this register."]
509 #[inline(always)]
510 pub fn is_crc_error_yes(&self) -> bool {
511 *self == Crcerr::CrcErrorYes
512 }
513}
514#[doc = "Acknowledge Error Flag\n\nValue on reset: 0"]
515#[cfg_attr(feature = "defmt", derive(defmt::Format))]
516#[derive(Clone, Copy, Debug, PartialEq, Eq)]
517pub enum Ackerr {
518 #[doc = "0: No error"]
519 AckErrorNo = 0,
520 #[doc = "1: Error occurred since last read of this register."]
521 AckErrorYes = 1,
522}
523impl From<Ackerr> for bool {
524 #[inline(always)]
525 fn from(variant: Ackerr) -> Self {
526 variant as u8 != 0
527 }
528}
529#[doc = "Field `ACKERR` reader - Acknowledge Error Flag"]
530pub type AckerrR = crate::BitReader<Ackerr>;
531impl AckerrR {
532 #[doc = "Get enumerated values variant"]
533 #[inline(always)]
534 pub const fn variant(&self) -> Ackerr {
535 match self.bits {
536 false => Ackerr::AckErrorNo,
537 true => Ackerr::AckErrorYes,
538 }
539 }
540 #[doc = "No error"]
541 #[inline(always)]
542 pub fn is_ack_error_no(&self) -> bool {
543 *self == Ackerr::AckErrorNo
544 }
545 #[doc = "Error occurred since last read of this register."]
546 #[inline(always)]
547 pub fn is_ack_error_yes(&self) -> bool {
548 *self == Ackerr::AckErrorYes
549 }
550}
551#[doc = "Bit0 Error Flag\n\nValue on reset: 0"]
552#[cfg_attr(feature = "defmt", derive(defmt::Format))]
553#[derive(Clone, Copy, Debug, PartialEq, Eq)]
554pub enum Bit0err {
555 #[doc = "0: No such occurrence."]
556 Bit0ErrorNo = 0,
557 #[doc = "1: At least one bit sent as dominant is received as recessive."]
558 Bit0ErrorYes = 1,
559}
560impl From<Bit0err> for bool {
561 #[inline(always)]
562 fn from(variant: Bit0err) -> Self {
563 variant as u8 != 0
564 }
565}
566#[doc = "Field `BIT0ERR` reader - Bit0 Error Flag"]
567pub type Bit0errR = crate::BitReader<Bit0err>;
568impl Bit0errR {
569 #[doc = "Get enumerated values variant"]
570 #[inline(always)]
571 pub const fn variant(&self) -> Bit0err {
572 match self.bits {
573 false => Bit0err::Bit0ErrorNo,
574 true => Bit0err::Bit0ErrorYes,
575 }
576 }
577 #[doc = "No such occurrence."]
578 #[inline(always)]
579 pub fn is_bit0_error_no(&self) -> bool {
580 *self == Bit0err::Bit0ErrorNo
581 }
582 #[doc = "At least one bit sent as dominant is received as recessive."]
583 #[inline(always)]
584 pub fn is_bit0_error_yes(&self) -> bool {
585 *self == Bit0err::Bit0ErrorYes
586 }
587}
588#[doc = "Bit1 Error Flag\n\nValue on reset: 0"]
589#[cfg_attr(feature = "defmt", derive(defmt::Format))]
590#[derive(Clone, Copy, Debug, PartialEq, Eq)]
591pub enum Bit1err {
592 #[doc = "0: No such occurrence."]
593 Bit1ErrorNo = 0,
594 #[doc = "1: At least one bit sent as recessive is received as dominant."]
595 Bit1ErrorYes = 1,
596}
597impl From<Bit1err> for bool {
598 #[inline(always)]
599 fn from(variant: Bit1err) -> Self {
600 variant as u8 != 0
601 }
602}
603#[doc = "Field `BIT1ERR` reader - Bit1 Error Flag"]
604pub type Bit1errR = crate::BitReader<Bit1err>;
605impl Bit1errR {
606 #[doc = "Get enumerated values variant"]
607 #[inline(always)]
608 pub const fn variant(&self) -> Bit1err {
609 match self.bits {
610 false => Bit1err::Bit1ErrorNo,
611 true => Bit1err::Bit1ErrorYes,
612 }
613 }
614 #[doc = "No such occurrence."]
615 #[inline(always)]
616 pub fn is_bit1_error_no(&self) -> bool {
617 *self == Bit1err::Bit1ErrorNo
618 }
619 #[doc = "At least one bit sent as recessive is received as dominant."]
620 #[inline(always)]
621 pub fn is_bit1_error_yes(&self) -> bool {
622 *self == Bit1err::Bit1ErrorYes
623 }
624}
625#[doc = "RX Warning Interrupt Flag\n\nValue on reset: 0"]
626#[cfg_attr(feature = "defmt", derive(defmt::Format))]
627#[derive(Clone, Copy, Debug, PartialEq, Eq)]
628pub enum Rwrnint {
629 #[doc = "0: No such occurrence"]
630 RxWarningIntNo = 0,
631 #[doc = "1: RX error counter changed from less than 96 to greater than or equal to 96."]
632 RxWarningIntYes = 1,
633}
634impl From<Rwrnint> for bool {
635 #[inline(always)]
636 fn from(variant: Rwrnint) -> Self {
637 variant as u8 != 0
638 }
639}
640#[doc = "Field `RWRNINT` reader - RX Warning Interrupt Flag"]
641pub type RwrnintR = crate::BitReader<Rwrnint>;
642impl RwrnintR {
643 #[doc = "Get enumerated values variant"]
644 #[inline(always)]
645 pub const fn variant(&self) -> Rwrnint {
646 match self.bits {
647 false => Rwrnint::RxWarningIntNo,
648 true => Rwrnint::RxWarningIntYes,
649 }
650 }
651 #[doc = "No such occurrence"]
652 #[inline(always)]
653 pub fn is_rx_warning_int_no(&self) -> bool {
654 *self == Rwrnint::RxWarningIntNo
655 }
656 #[doc = "RX error counter changed from less than 96 to greater than or equal to 96."]
657 #[inline(always)]
658 pub fn is_rx_warning_int_yes(&self) -> bool {
659 *self == Rwrnint::RxWarningIntYes
660 }
661}
662#[doc = "Field `RWRNINT` writer - RX Warning Interrupt Flag"]
663pub type RwrnintW<'a, REG> = crate::BitWriter1C<'a, REG, Rwrnint>;
664impl<'a, REG> RwrnintW<'a, REG>
665where
666 REG: crate::Writable + crate::RegisterSpec,
667{
668 #[doc = "No such occurrence"]
669 #[inline(always)]
670 pub fn rx_warning_int_no(self) -> &'a mut crate::W<REG> {
671 self.variant(Rwrnint::RxWarningIntNo)
672 }
673 #[doc = "RX error counter changed from less than 96 to greater than or equal to 96."]
674 #[inline(always)]
675 pub fn rx_warning_int_yes(self) -> &'a mut crate::W<REG> {
676 self.variant(Rwrnint::RxWarningIntYes)
677 }
678}
679#[doc = "TX Warning Interrupt Flag\n\nValue on reset: 0"]
680#[cfg_attr(feature = "defmt", derive(defmt::Format))]
681#[derive(Clone, Copy, Debug, PartialEq, Eq)]
682pub enum Twrnint {
683 #[doc = "0: No such occurrence"]
684 TxWarningIntNo = 0,
685 #[doc = "1: TX error counter changed from less than 96 to greater than or equal to 96."]
686 TxWarningIntYes = 1,
687}
688impl From<Twrnint> for bool {
689 #[inline(always)]
690 fn from(variant: Twrnint) -> Self {
691 variant as u8 != 0
692 }
693}
694#[doc = "Field `TWRNINT` reader - TX Warning Interrupt Flag"]
695pub type TwrnintR = crate::BitReader<Twrnint>;
696impl TwrnintR {
697 #[doc = "Get enumerated values variant"]
698 #[inline(always)]
699 pub const fn variant(&self) -> Twrnint {
700 match self.bits {
701 false => Twrnint::TxWarningIntNo,
702 true => Twrnint::TxWarningIntYes,
703 }
704 }
705 #[doc = "No such occurrence"]
706 #[inline(always)]
707 pub fn is_tx_warning_int_no(&self) -> bool {
708 *self == Twrnint::TxWarningIntNo
709 }
710 #[doc = "TX error counter changed from less than 96 to greater than or equal to 96."]
711 #[inline(always)]
712 pub fn is_tx_warning_int_yes(&self) -> bool {
713 *self == Twrnint::TxWarningIntYes
714 }
715}
716#[doc = "Field `TWRNINT` writer - TX Warning Interrupt Flag"]
717pub type TwrnintW<'a, REG> = crate::BitWriter1C<'a, REG, Twrnint>;
718impl<'a, REG> TwrnintW<'a, REG>
719where
720 REG: crate::Writable + crate::RegisterSpec,
721{
722 #[doc = "No such occurrence"]
723 #[inline(always)]
724 pub fn tx_warning_int_no(self) -> &'a mut crate::W<REG> {
725 self.variant(Twrnint::TxWarningIntNo)
726 }
727 #[doc = "TX error counter changed from less than 96 to greater than or equal to 96."]
728 #[inline(always)]
729 pub fn tx_warning_int_yes(self) -> &'a mut crate::W<REG> {
730 self.variant(Twrnint::TxWarningIntYes)
731 }
732}
733#[doc = "CAN Synchronization Status Flag\n\nValue on reset: 0"]
734#[cfg_attr(feature = "defmt", derive(defmt::Format))]
735#[derive(Clone, Copy, Debug, PartialEq, Eq)]
736pub enum Synch {
737 #[doc = "0: Not synchronized"]
738 CanBusSyncNo = 0,
739 #[doc = "1: Synchronized"]
740 CanBusSyncYes = 1,
741}
742impl From<Synch> for bool {
743 #[inline(always)]
744 fn from(variant: Synch) -> Self {
745 variant as u8 != 0
746 }
747}
748#[doc = "Field `SYNCH` reader - CAN Synchronization Status Flag"]
749pub type SynchR = crate::BitReader<Synch>;
750impl SynchR {
751 #[doc = "Get enumerated values variant"]
752 #[inline(always)]
753 pub const fn variant(&self) -> Synch {
754 match self.bits {
755 false => Synch::CanBusSyncNo,
756 true => Synch::CanBusSyncYes,
757 }
758 }
759 #[doc = "Not synchronized"]
760 #[inline(always)]
761 pub fn is_can_bus_sync_no(&self) -> bool {
762 *self == Synch::CanBusSyncNo
763 }
764 #[doc = "Synchronized"]
765 #[inline(always)]
766 pub fn is_can_bus_sync_yes(&self) -> bool {
767 *self == Synch::CanBusSyncYes
768 }
769}
770#[doc = "Bus Off Done Interrupt Flag\n\nValue on reset: 0"]
771#[cfg_attr(feature = "defmt", derive(defmt::Format))]
772#[derive(Clone, Copy, Debug, PartialEq, Eq)]
773pub enum Boffdoneint {
774 #[doc = "0: No such occurrence"]
775 BusOffNotDone = 0,
776 #[doc = "1: FlexCAN module has completed Bus Off process."]
777 BusOffDone = 1,
778}
779impl From<Boffdoneint> for bool {
780 #[inline(always)]
781 fn from(variant: Boffdoneint) -> Self {
782 variant as u8 != 0
783 }
784}
785#[doc = "Field `BOFFDONEINT` reader - Bus Off Done Interrupt Flag"]
786pub type BoffdoneintR = crate::BitReader<Boffdoneint>;
787impl BoffdoneintR {
788 #[doc = "Get enumerated values variant"]
789 #[inline(always)]
790 pub const fn variant(&self) -> Boffdoneint {
791 match self.bits {
792 false => Boffdoneint::BusOffNotDone,
793 true => Boffdoneint::BusOffDone,
794 }
795 }
796 #[doc = "No such occurrence"]
797 #[inline(always)]
798 pub fn is_bus_off_not_done(&self) -> bool {
799 *self == Boffdoneint::BusOffNotDone
800 }
801 #[doc = "FlexCAN module has completed Bus Off process."]
802 #[inline(always)]
803 pub fn is_bus_off_done(&self) -> bool {
804 *self == Boffdoneint::BusOffDone
805 }
806}
807#[doc = "Field `BOFFDONEINT` writer - Bus Off Done Interrupt Flag"]
808pub type BoffdoneintW<'a, REG> = crate::BitWriter1C<'a, REG, Boffdoneint>;
809impl<'a, REG> BoffdoneintW<'a, REG>
810where
811 REG: crate::Writable + crate::RegisterSpec,
812{
813 #[doc = "No such occurrence"]
814 #[inline(always)]
815 pub fn bus_off_not_done(self) -> &'a mut crate::W<REG> {
816 self.variant(Boffdoneint::BusOffNotDone)
817 }
818 #[doc = "FlexCAN module has completed Bus Off process."]
819 #[inline(always)]
820 pub fn bus_off_done(self) -> &'a mut crate::W<REG> {
821 self.variant(Boffdoneint::BusOffDone)
822 }
823}
824#[doc = "Fast Error Interrupt Flag\n\nValue on reset: 0"]
825#[cfg_attr(feature = "defmt", derive(defmt::Format))]
826#[derive(Clone, Copy, Debug, PartialEq, Eq)]
827pub enum ErrintFast {
828 #[doc = "0: No such occurrence."]
829 ErrorsDataPhaseNo = 0,
830 #[doc = "1: Error flag set in the data phase of CAN FD frames that have BRS = 1."]
831 ErrorsDataPhaseYes = 1,
832}
833impl From<ErrintFast> for bool {
834 #[inline(always)]
835 fn from(variant: ErrintFast) -> Self {
836 variant as u8 != 0
837 }
838}
839#[doc = "Field `ERRINT_FAST` reader - Fast Error Interrupt Flag"]
840pub type ErrintFastR = crate::BitReader<ErrintFast>;
841impl ErrintFastR {
842 #[doc = "Get enumerated values variant"]
843 #[inline(always)]
844 pub const fn variant(&self) -> ErrintFast {
845 match self.bits {
846 false => ErrintFast::ErrorsDataPhaseNo,
847 true => ErrintFast::ErrorsDataPhaseYes,
848 }
849 }
850 #[doc = "No such occurrence."]
851 #[inline(always)]
852 pub fn is_errors_data_phase_no(&self) -> bool {
853 *self == ErrintFast::ErrorsDataPhaseNo
854 }
855 #[doc = "Error flag set in the data phase of CAN FD frames that have BRS = 1."]
856 #[inline(always)]
857 pub fn is_errors_data_phase_yes(&self) -> bool {
858 *self == ErrintFast::ErrorsDataPhaseYes
859 }
860}
861#[doc = "Field `ERRINT_FAST` writer - Fast Error Interrupt Flag"]
862pub type ErrintFastW<'a, REG> = crate::BitWriter1C<'a, REG, ErrintFast>;
863impl<'a, REG> ErrintFastW<'a, REG>
864where
865 REG: crate::Writable + crate::RegisterSpec,
866{
867 #[doc = "No such occurrence."]
868 #[inline(always)]
869 pub fn errors_data_phase_no(self) -> &'a mut crate::W<REG> {
870 self.variant(ErrintFast::ErrorsDataPhaseNo)
871 }
872 #[doc = "Error flag set in the data phase of CAN FD frames that have BRS = 1."]
873 #[inline(always)]
874 pub fn errors_data_phase_yes(self) -> &'a mut crate::W<REG> {
875 self.variant(ErrintFast::ErrorsDataPhaseYes)
876 }
877}
878#[doc = "Error Overrun Flag\n\nValue on reset: 0"]
879#[cfg_attr(feature = "defmt", derive(defmt::Format))]
880#[derive(Clone, Copy, Debug, PartialEq, Eq)]
881pub enum Errovr {
882 #[doc = "0: No overrun"]
883 OverrunNotOccurred = 0,
884 #[doc = "1: Overrun"]
885 OverrunOccurred = 1,
886}
887impl From<Errovr> for bool {
888 #[inline(always)]
889 fn from(variant: Errovr) -> Self {
890 variant as u8 != 0
891 }
892}
893#[doc = "Field `ERROVR` reader - Error Overrun Flag"]
894pub type ErrovrR = crate::BitReader<Errovr>;
895impl ErrovrR {
896 #[doc = "Get enumerated values variant"]
897 #[inline(always)]
898 pub const fn variant(&self) -> Errovr {
899 match self.bits {
900 false => Errovr::OverrunNotOccurred,
901 true => Errovr::OverrunOccurred,
902 }
903 }
904 #[doc = "No overrun"]
905 #[inline(always)]
906 pub fn is_overrun_not_occurred(&self) -> bool {
907 *self == Errovr::OverrunNotOccurred
908 }
909 #[doc = "Overrun"]
910 #[inline(always)]
911 pub fn is_overrun_occurred(&self) -> bool {
912 *self == Errovr::OverrunOccurred
913 }
914}
915#[doc = "Field `ERROVR` writer - Error Overrun Flag"]
916pub type ErrovrW<'a, REG> = crate::BitWriter1C<'a, REG, Errovr>;
917impl<'a, REG> ErrovrW<'a, REG>
918where
919 REG: crate::Writable + crate::RegisterSpec,
920{
921 #[doc = "No overrun"]
922 #[inline(always)]
923 pub fn overrun_not_occurred(self) -> &'a mut crate::W<REG> {
924 self.variant(Errovr::OverrunNotOccurred)
925 }
926 #[doc = "Overrun"]
927 #[inline(always)]
928 pub fn overrun_occurred(self) -> &'a mut crate::W<REG> {
929 self.variant(Errovr::OverrunOccurred)
930 }
931}
932#[doc = "Fast Stuffing Error Flag\n\nValue on reset: 0"]
933#[cfg_attr(feature = "defmt", derive(defmt::Format))]
934#[derive(Clone, Copy, Debug, PartialEq, Eq)]
935pub enum StferrFast {
936 #[doc = "0: No such occurrence."]
937 StuffingErrorNo = 0,
938 #[doc = "1: A stuffing error occurred since last read of this register."]
939 StuffingErrorYes = 1,
940}
941impl From<StferrFast> for bool {
942 #[inline(always)]
943 fn from(variant: StferrFast) -> Self {
944 variant as u8 != 0
945 }
946}
947#[doc = "Field `STFERR_FAST` reader - Fast Stuffing Error Flag"]
948pub type StferrFastR = crate::BitReader<StferrFast>;
949impl StferrFastR {
950 #[doc = "Get enumerated values variant"]
951 #[inline(always)]
952 pub const fn variant(&self) -> StferrFast {
953 match self.bits {
954 false => StferrFast::StuffingErrorNo,
955 true => StferrFast::StuffingErrorYes,
956 }
957 }
958 #[doc = "No such occurrence."]
959 #[inline(always)]
960 pub fn is_stuffing_error_no(&self) -> bool {
961 *self == StferrFast::StuffingErrorNo
962 }
963 #[doc = "A stuffing error occurred since last read of this register."]
964 #[inline(always)]
965 pub fn is_stuffing_error_yes(&self) -> bool {
966 *self == StferrFast::StuffingErrorYes
967 }
968}
969#[doc = "Fast Form Error Flag\n\nValue on reset: 0"]
970#[cfg_attr(feature = "defmt", derive(defmt::Format))]
971#[derive(Clone, Copy, Debug, PartialEq, Eq)]
972pub enum FrmerrFast {
973 #[doc = "0: No such occurrence."]
974 FormErrorNo = 0,
975 #[doc = "1: A form error occurred since last read of this register."]
976 FormErrorYes = 1,
977}
978impl From<FrmerrFast> for bool {
979 #[inline(always)]
980 fn from(variant: FrmerrFast) -> Self {
981 variant as u8 != 0
982 }
983}
984#[doc = "Field `FRMERR_FAST` reader - Fast Form Error Flag"]
985pub type FrmerrFastR = crate::BitReader<FrmerrFast>;
986impl FrmerrFastR {
987 #[doc = "Get enumerated values variant"]
988 #[inline(always)]
989 pub const fn variant(&self) -> FrmerrFast {
990 match self.bits {
991 false => FrmerrFast::FormErrorNo,
992 true => FrmerrFast::FormErrorYes,
993 }
994 }
995 #[doc = "No such occurrence."]
996 #[inline(always)]
997 pub fn is_form_error_no(&self) -> bool {
998 *self == FrmerrFast::FormErrorNo
999 }
1000 #[doc = "A form error occurred since last read of this register."]
1001 #[inline(always)]
1002 pub fn is_form_error_yes(&self) -> bool {
1003 *self == FrmerrFast::FormErrorYes
1004 }
1005}
1006#[doc = "Fast Cyclic Redundancy Check Error Flag\n\nValue on reset: 0"]
1007#[cfg_attr(feature = "defmt", derive(defmt::Format))]
1008#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1009pub enum CrcerrFast {
1010 #[doc = "0: No such occurrence."]
1011 CrcErrorNo = 0,
1012 #[doc = "1: A CRC error occurred since last read of this register."]
1013 CrcErrorYes = 1,
1014}
1015impl From<CrcerrFast> for bool {
1016 #[inline(always)]
1017 fn from(variant: CrcerrFast) -> Self {
1018 variant as u8 != 0
1019 }
1020}
1021#[doc = "Field `CRCERR_FAST` reader - Fast Cyclic Redundancy Check Error Flag"]
1022pub type CrcerrFastR = crate::BitReader<CrcerrFast>;
1023impl CrcerrFastR {
1024 #[doc = "Get enumerated values variant"]
1025 #[inline(always)]
1026 pub const fn variant(&self) -> CrcerrFast {
1027 match self.bits {
1028 false => CrcerrFast::CrcErrorNo,
1029 true => CrcerrFast::CrcErrorYes,
1030 }
1031 }
1032 #[doc = "No such occurrence."]
1033 #[inline(always)]
1034 pub fn is_crc_error_no(&self) -> bool {
1035 *self == CrcerrFast::CrcErrorNo
1036 }
1037 #[doc = "A CRC error occurred since last read of this register."]
1038 #[inline(always)]
1039 pub fn is_crc_error_yes(&self) -> bool {
1040 *self == CrcerrFast::CrcErrorYes
1041 }
1042}
1043#[doc = "Fast Bit0 Error Flag\n\nValue on reset: 0"]
1044#[cfg_attr(feature = "defmt", derive(defmt::Format))]
1045#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1046pub enum Bit0errFast {
1047 #[doc = "0: No such occurrence."]
1048 Bit0ErrorNo = 0,
1049 #[doc = "1: At least one bit transmitted as dominant is received as recessive."]
1050 Bit0ErrorYes = 1,
1051}
1052impl From<Bit0errFast> for bool {
1053 #[inline(always)]
1054 fn from(variant: Bit0errFast) -> Self {
1055 variant as u8 != 0
1056 }
1057}
1058#[doc = "Field `BIT0ERR_FAST` reader - Fast Bit0 Error Flag"]
1059pub type Bit0errFastR = crate::BitReader<Bit0errFast>;
1060impl Bit0errFastR {
1061 #[doc = "Get enumerated values variant"]
1062 #[inline(always)]
1063 pub const fn variant(&self) -> Bit0errFast {
1064 match self.bits {
1065 false => Bit0errFast::Bit0ErrorNo,
1066 true => Bit0errFast::Bit0ErrorYes,
1067 }
1068 }
1069 #[doc = "No such occurrence."]
1070 #[inline(always)]
1071 pub fn is_bit0_error_no(&self) -> bool {
1072 *self == Bit0errFast::Bit0ErrorNo
1073 }
1074 #[doc = "At least one bit transmitted as dominant is received as recessive."]
1075 #[inline(always)]
1076 pub fn is_bit0_error_yes(&self) -> bool {
1077 *self == Bit0errFast::Bit0ErrorYes
1078 }
1079}
1080#[doc = "Fast Bit1 Error Flag\n\nValue on reset: 0"]
1081#[cfg_attr(feature = "defmt", derive(defmt::Format))]
1082#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1083pub enum Bit1errFast {
1084 #[doc = "0: No such occurrence."]
1085 Bit1ErrorNo = 0,
1086 #[doc = "1: At least one bit transmitted as recessive is received as dominant."]
1087 Bit1ErrorYes = 1,
1088}
1089impl From<Bit1errFast> for bool {
1090 #[inline(always)]
1091 fn from(variant: Bit1errFast) -> Self {
1092 variant as u8 != 0
1093 }
1094}
1095#[doc = "Field `BIT1ERR_FAST` reader - Fast Bit1 Error Flag"]
1096pub type Bit1errFastR = crate::BitReader<Bit1errFast>;
1097impl Bit1errFastR {
1098 #[doc = "Get enumerated values variant"]
1099 #[inline(always)]
1100 pub const fn variant(&self) -> Bit1errFast {
1101 match self.bits {
1102 false => Bit1errFast::Bit1ErrorNo,
1103 true => Bit1errFast::Bit1ErrorYes,
1104 }
1105 }
1106 #[doc = "No such occurrence."]
1107 #[inline(always)]
1108 pub fn is_bit1_error_no(&self) -> bool {
1109 *self == Bit1errFast::Bit1ErrorNo
1110 }
1111 #[doc = "At least one bit transmitted as recessive is received as dominant."]
1112 #[inline(always)]
1113 pub fn is_bit1_error_yes(&self) -> bool {
1114 *self == Bit1errFast::Bit1ErrorYes
1115 }
1116}
1117impl R {
1118 #[doc = "Bit 0 - Wake-up Interrupt Flag"]
1119 #[inline(always)]
1120 pub fn wakint(&self) -> WakintR {
1121 WakintR::new((self.bits & 1) != 0)
1122 }
1123 #[doc = "Bit 1 - Error Interrupt Flag"]
1124 #[inline(always)]
1125 pub fn errint(&self) -> ErrintR {
1126 ErrintR::new(((self.bits >> 1) & 1) != 0)
1127 }
1128 #[doc = "Bit 2 - Bus Off Interrupt Flag"]
1129 #[inline(always)]
1130 pub fn boffint(&self) -> BoffintR {
1131 BoffintR::new(((self.bits >> 2) & 1) != 0)
1132 }
1133 #[doc = "Bit 3 - FlexCAN in Reception Flag"]
1134 #[inline(always)]
1135 pub fn rx(&self) -> RxR {
1136 RxR::new(((self.bits >> 3) & 1) != 0)
1137 }
1138 #[doc = "Bits 4:5 - Fault Confinement State"]
1139 #[inline(always)]
1140 pub fn fltconf(&self) -> FltconfR {
1141 FltconfR::new(((self.bits >> 4) & 3) as u8)
1142 }
1143 #[doc = "Bit 6 - FlexCAN In Transmission"]
1144 #[inline(always)]
1145 pub fn tx(&self) -> TxR {
1146 TxR::new(((self.bits >> 6) & 1) != 0)
1147 }
1148 #[doc = "Bit 7 - Idle"]
1149 #[inline(always)]
1150 pub fn idle(&self) -> IdleR {
1151 IdleR::new(((self.bits >> 7) & 1) != 0)
1152 }
1153 #[doc = "Bit 8 - RX Error Warning Flag"]
1154 #[inline(always)]
1155 pub fn rxwrn(&self) -> RxwrnR {
1156 RxwrnR::new(((self.bits >> 8) & 1) != 0)
1157 }
1158 #[doc = "Bit 9 - TX Error Warning Flag"]
1159 #[inline(always)]
1160 pub fn txwrn(&self) -> TxwrnR {
1161 TxwrnR::new(((self.bits >> 9) & 1) != 0)
1162 }
1163 #[doc = "Bit 10 - Stuffing Error Flag"]
1164 #[inline(always)]
1165 pub fn stferr(&self) -> StferrR {
1166 StferrR::new(((self.bits >> 10) & 1) != 0)
1167 }
1168 #[doc = "Bit 11 - Form Error Flag"]
1169 #[inline(always)]
1170 pub fn frmerr(&self) -> FrmerrR {
1171 FrmerrR::new(((self.bits >> 11) & 1) != 0)
1172 }
1173 #[doc = "Bit 12 - Cyclic Redundancy Check Error Flag"]
1174 #[inline(always)]
1175 pub fn crcerr(&self) -> CrcerrR {
1176 CrcerrR::new(((self.bits >> 12) & 1) != 0)
1177 }
1178 #[doc = "Bit 13 - Acknowledge Error Flag"]
1179 #[inline(always)]
1180 pub fn ackerr(&self) -> AckerrR {
1181 AckerrR::new(((self.bits >> 13) & 1) != 0)
1182 }
1183 #[doc = "Bit 14 - Bit0 Error Flag"]
1184 #[inline(always)]
1185 pub fn bit0err(&self) -> Bit0errR {
1186 Bit0errR::new(((self.bits >> 14) & 1) != 0)
1187 }
1188 #[doc = "Bit 15 - Bit1 Error Flag"]
1189 #[inline(always)]
1190 pub fn bit1err(&self) -> Bit1errR {
1191 Bit1errR::new(((self.bits >> 15) & 1) != 0)
1192 }
1193 #[doc = "Bit 16 - RX Warning Interrupt Flag"]
1194 #[inline(always)]
1195 pub fn rwrnint(&self) -> RwrnintR {
1196 RwrnintR::new(((self.bits >> 16) & 1) != 0)
1197 }
1198 #[doc = "Bit 17 - TX Warning Interrupt Flag"]
1199 #[inline(always)]
1200 pub fn twrnint(&self) -> TwrnintR {
1201 TwrnintR::new(((self.bits >> 17) & 1) != 0)
1202 }
1203 #[doc = "Bit 18 - CAN Synchronization Status Flag"]
1204 #[inline(always)]
1205 pub fn synch(&self) -> SynchR {
1206 SynchR::new(((self.bits >> 18) & 1) != 0)
1207 }
1208 #[doc = "Bit 19 - Bus Off Done Interrupt Flag"]
1209 #[inline(always)]
1210 pub fn boffdoneint(&self) -> BoffdoneintR {
1211 BoffdoneintR::new(((self.bits >> 19) & 1) != 0)
1212 }
1213 #[doc = "Bit 20 - Fast Error Interrupt Flag"]
1214 #[inline(always)]
1215 pub fn errint_fast(&self) -> ErrintFastR {
1216 ErrintFastR::new(((self.bits >> 20) & 1) != 0)
1217 }
1218 #[doc = "Bit 21 - Error Overrun Flag"]
1219 #[inline(always)]
1220 pub fn errovr(&self) -> ErrovrR {
1221 ErrovrR::new(((self.bits >> 21) & 1) != 0)
1222 }
1223 #[doc = "Bit 26 - Fast Stuffing Error Flag"]
1224 #[inline(always)]
1225 pub fn stferr_fast(&self) -> StferrFastR {
1226 StferrFastR::new(((self.bits >> 26) & 1) != 0)
1227 }
1228 #[doc = "Bit 27 - Fast Form Error Flag"]
1229 #[inline(always)]
1230 pub fn frmerr_fast(&self) -> FrmerrFastR {
1231 FrmerrFastR::new(((self.bits >> 27) & 1) != 0)
1232 }
1233 #[doc = "Bit 28 - Fast Cyclic Redundancy Check Error Flag"]
1234 #[inline(always)]
1235 pub fn crcerr_fast(&self) -> CrcerrFastR {
1236 CrcerrFastR::new(((self.bits >> 28) & 1) != 0)
1237 }
1238 #[doc = "Bit 30 - Fast Bit0 Error Flag"]
1239 #[inline(always)]
1240 pub fn bit0err_fast(&self) -> Bit0errFastR {
1241 Bit0errFastR::new(((self.bits >> 30) & 1) != 0)
1242 }
1243 #[doc = "Bit 31 - Fast Bit1 Error Flag"]
1244 #[inline(always)]
1245 pub fn bit1err_fast(&self) -> Bit1errFastR {
1246 Bit1errFastR::new(((self.bits >> 31) & 1) != 0)
1247 }
1248}
1249#[cfg(feature = "debug")]
1250impl core::fmt::Debug for R {
1251 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1252 f.debug_struct("ESR1")
1253 .field("wakint", &self.wakint())
1254 .field("errint", &self.errint())
1255 .field("boffint", &self.boffint())
1256 .field("rx", &self.rx())
1257 .field("fltconf", &self.fltconf())
1258 .field("tx", &self.tx())
1259 .field("idle", &self.idle())
1260 .field("rxwrn", &self.rxwrn())
1261 .field("txwrn", &self.txwrn())
1262 .field("stferr", &self.stferr())
1263 .field("frmerr", &self.frmerr())
1264 .field("crcerr", &self.crcerr())
1265 .field("ackerr", &self.ackerr())
1266 .field("bit0err", &self.bit0err())
1267 .field("bit1err", &self.bit1err())
1268 .field("rwrnint", &self.rwrnint())
1269 .field("twrnint", &self.twrnint())
1270 .field("synch", &self.synch())
1271 .field("boffdoneint", &self.boffdoneint())
1272 .field("errint_fast", &self.errint_fast())
1273 .field("errovr", &self.errovr())
1274 .field("stferr_fast", &self.stferr_fast())
1275 .field("frmerr_fast", &self.frmerr_fast())
1276 .field("crcerr_fast", &self.crcerr_fast())
1277 .field("bit0err_fast", &self.bit0err_fast())
1278 .field("bit1err_fast", &self.bit1err_fast())
1279 .finish()
1280 }
1281}
1282impl W {
1283 #[doc = "Bit 0 - Wake-up Interrupt Flag"]
1284 #[inline(always)]
1285 pub fn wakint(&mut self) -> WakintW<'_, Esr1Spec> {
1286 WakintW::new(self, 0)
1287 }
1288 #[doc = "Bit 1 - Error Interrupt Flag"]
1289 #[inline(always)]
1290 pub fn errint(&mut self) -> ErrintW<'_, Esr1Spec> {
1291 ErrintW::new(self, 1)
1292 }
1293 #[doc = "Bit 2 - Bus Off Interrupt Flag"]
1294 #[inline(always)]
1295 pub fn boffint(&mut self) -> BoffintW<'_, Esr1Spec> {
1296 BoffintW::new(self, 2)
1297 }
1298 #[doc = "Bit 16 - RX Warning Interrupt Flag"]
1299 #[inline(always)]
1300 pub fn rwrnint(&mut self) -> RwrnintW<'_, Esr1Spec> {
1301 RwrnintW::new(self, 16)
1302 }
1303 #[doc = "Bit 17 - TX Warning Interrupt Flag"]
1304 #[inline(always)]
1305 pub fn twrnint(&mut self) -> TwrnintW<'_, Esr1Spec> {
1306 TwrnintW::new(self, 17)
1307 }
1308 #[doc = "Bit 19 - Bus Off Done Interrupt Flag"]
1309 #[inline(always)]
1310 pub fn boffdoneint(&mut self) -> BoffdoneintW<'_, Esr1Spec> {
1311 BoffdoneintW::new(self, 19)
1312 }
1313 #[doc = "Bit 20 - Fast Error Interrupt Flag"]
1314 #[inline(always)]
1315 pub fn errint_fast(&mut self) -> ErrintFastW<'_, Esr1Spec> {
1316 ErrintFastW::new(self, 20)
1317 }
1318 #[doc = "Bit 21 - Error Overrun Flag"]
1319 #[inline(always)]
1320 pub fn errovr(&mut self) -> ErrovrW<'_, Esr1Spec> {
1321 ErrovrW::new(self, 21)
1322 }
1323}
1324#[doc = "Error and Status 1\n\nYou can [`read`](crate::Reg::read) this register and get [`esr1::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`esr1::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
1325pub struct Esr1Spec;
1326impl crate::RegisterSpec for Esr1Spec {
1327 type Ux = u32;
1328}
1329#[doc = "`read()` method returns [`esr1::R`](R) reader structure"]
1330impl crate::Readable for Esr1Spec {}
1331#[doc = "`write(|w| ..)` method takes [`esr1::W`](W) writer structure"]
1332impl crate::Writable for Esr1Spec {
1333 type Safety = crate::Unsafe;
1334 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0x003b_0007;
1335}
1336#[doc = "`reset()` method sets ESR1 to value 0"]
1337impl crate::Resettable for Esr1Spec {}