1#[doc = "Register `MCR` reader"]
2pub type R = crate::R<McrSpec>;
3#[doc = "Register `MCR` writer"]
4pub type W = crate::W<McrSpec>;
5#[doc = "Field `MAXMB` reader - Number of the Last Message Buffer"]
6pub type MaxmbR = crate::FieldReader;
7#[doc = "Field `MAXMB` writer - Number of the Last Message Buffer"]
8pub type MaxmbW<'a, REG> = crate::FieldWriter<'a, REG, 7>;
9#[doc = "ID Acceptance Mode\n\nValue on reset: 0"]
10#[cfg_attr(feature = "defmt", derive(defmt::Format))]
11#[derive(Clone, Copy, Debug, PartialEq, Eq)]
12#[repr(u8)]
13pub enum Idam {
14 #[doc = "0: Format A: One full ID (standard and extended) per ID filter table element."]
15 OneFullId = 0,
16 #[doc = "1: Format B: Two full standard IDs or two partial 14-bit (standard and extended) IDs per ID filter table element."]
17 TwoFullId = 1,
18 #[doc = "2: Format C: Four partial 8-bit standard IDs per ID filter table element."]
19 FourPartialId = 2,
20 #[doc = "3: Format D: All frames rejected."]
21 AllFramesRejected = 3,
22}
23impl From<Idam> for u8 {
24 #[inline(always)]
25 fn from(variant: Idam) -> Self {
26 variant as _
27 }
28}
29impl crate::FieldSpec for Idam {
30 type Ux = u8;
31}
32impl crate::IsEnum for Idam {}
33#[doc = "Field `IDAM` reader - ID Acceptance Mode"]
34pub type IdamR = crate::FieldReader<Idam>;
35impl IdamR {
36 #[doc = "Get enumerated values variant"]
37 #[inline(always)]
38 pub const fn variant(&self) -> Idam {
39 match self.bits {
40 0 => Idam::OneFullId,
41 1 => Idam::TwoFullId,
42 2 => Idam::FourPartialId,
43 3 => Idam::AllFramesRejected,
44 _ => unreachable!(),
45 }
46 }
47 #[doc = "Format A: One full ID (standard and extended) per ID filter table element."]
48 #[inline(always)]
49 pub fn is_one_full_id(&self) -> bool {
50 *self == Idam::OneFullId
51 }
52 #[doc = "Format B: Two full standard IDs or two partial 14-bit (standard and extended) IDs per ID filter table element."]
53 #[inline(always)]
54 pub fn is_two_full_id(&self) -> bool {
55 *self == Idam::TwoFullId
56 }
57 #[doc = "Format C: Four partial 8-bit standard IDs per ID filter table element."]
58 #[inline(always)]
59 pub fn is_four_partial_id(&self) -> bool {
60 *self == Idam::FourPartialId
61 }
62 #[doc = "Format D: All frames rejected."]
63 #[inline(always)]
64 pub fn is_all_frames_rejected(&self) -> bool {
65 *self == Idam::AllFramesRejected
66 }
67}
68#[doc = "Field `IDAM` writer - ID Acceptance Mode"]
69pub type IdamW<'a, REG> = crate::FieldWriter<'a, REG, 2, Idam, crate::Safe>;
70impl<'a, REG> IdamW<'a, REG>
71where
72 REG: crate::Writable + crate::RegisterSpec,
73 REG::Ux: From<u8>,
74{
75 #[doc = "Format A: One full ID (standard and extended) per ID filter table element."]
76 #[inline(always)]
77 pub fn one_full_id(self) -> &'a mut crate::W<REG> {
78 self.variant(Idam::OneFullId)
79 }
80 #[doc = "Format B: Two full standard IDs or two partial 14-bit (standard and extended) IDs per ID filter table element."]
81 #[inline(always)]
82 pub fn two_full_id(self) -> &'a mut crate::W<REG> {
83 self.variant(Idam::TwoFullId)
84 }
85 #[doc = "Format C: Four partial 8-bit standard IDs per ID filter table element."]
86 #[inline(always)]
87 pub fn four_partial_id(self) -> &'a mut crate::W<REG> {
88 self.variant(Idam::FourPartialId)
89 }
90 #[doc = "Format D: All frames rejected."]
91 #[inline(always)]
92 pub fn all_frames_rejected(self) -> &'a mut crate::W<REG> {
93 self.variant(Idam::AllFramesRejected)
94 }
95}
96#[doc = "CAN FD Operation Enable\n\nValue on reset: 0"]
97#[cfg_attr(feature = "defmt", derive(defmt::Format))]
98#[derive(Clone, Copy, Debug, PartialEq, Eq)]
99pub enum Fden {
100 #[doc = "0: Disable"]
101 CanFdDisabled = 0,
102 #[doc = "1: Enable"]
103 CanFdEnabled = 1,
104}
105impl From<Fden> for bool {
106 #[inline(always)]
107 fn from(variant: Fden) -> Self {
108 variant as u8 != 0
109 }
110}
111#[doc = "Field `FDEN` reader - CAN FD Operation Enable"]
112pub type FdenR = crate::BitReader<Fden>;
113impl FdenR {
114 #[doc = "Get enumerated values variant"]
115 #[inline(always)]
116 pub const fn variant(&self) -> Fden {
117 match self.bits {
118 false => Fden::CanFdDisabled,
119 true => Fden::CanFdEnabled,
120 }
121 }
122 #[doc = "Disable"]
123 #[inline(always)]
124 pub fn is_can_fd_disabled(&self) -> bool {
125 *self == Fden::CanFdDisabled
126 }
127 #[doc = "Enable"]
128 #[inline(always)]
129 pub fn is_can_fd_enabled(&self) -> bool {
130 *self == Fden::CanFdEnabled
131 }
132}
133#[doc = "Field `FDEN` writer - CAN FD Operation Enable"]
134pub type FdenW<'a, REG> = crate::BitWriter<'a, REG, Fden>;
135impl<'a, REG> FdenW<'a, REG>
136where
137 REG: crate::Writable + crate::RegisterSpec,
138{
139 #[doc = "Disable"]
140 #[inline(always)]
141 pub fn can_fd_disabled(self) -> &'a mut crate::W<REG> {
142 self.variant(Fden::CanFdDisabled)
143 }
144 #[doc = "Enable"]
145 #[inline(always)]
146 pub fn can_fd_enabled(self) -> &'a mut crate::W<REG> {
147 self.variant(Fden::CanFdEnabled)
148 }
149}
150#[doc = "Abort Enable\n\nValue on reset: 0"]
151#[cfg_attr(feature = "defmt", derive(defmt::Format))]
152#[derive(Clone, Copy, Debug, PartialEq, Eq)]
153pub enum Aen {
154 #[doc = "0: Disabled"]
155 AbortDisabled = 0,
156 #[doc = "1: Enabled"]
157 AbortEnabled = 1,
158}
159impl From<Aen> for bool {
160 #[inline(always)]
161 fn from(variant: Aen) -> Self {
162 variant as u8 != 0
163 }
164}
165#[doc = "Field `AEN` reader - Abort Enable"]
166pub type AenR = crate::BitReader<Aen>;
167impl AenR {
168 #[doc = "Get enumerated values variant"]
169 #[inline(always)]
170 pub const fn variant(&self) -> Aen {
171 match self.bits {
172 false => Aen::AbortDisabled,
173 true => Aen::AbortEnabled,
174 }
175 }
176 #[doc = "Disabled"]
177 #[inline(always)]
178 pub fn is_abort_disabled(&self) -> bool {
179 *self == Aen::AbortDisabled
180 }
181 #[doc = "Enabled"]
182 #[inline(always)]
183 pub fn is_abort_enabled(&self) -> bool {
184 *self == Aen::AbortEnabled
185 }
186}
187#[doc = "Field `AEN` writer - Abort Enable"]
188pub type AenW<'a, REG> = crate::BitWriter<'a, REG, Aen>;
189impl<'a, REG> AenW<'a, REG>
190where
191 REG: crate::Writable + crate::RegisterSpec,
192{
193 #[doc = "Disabled"]
194 #[inline(always)]
195 pub fn abort_disabled(self) -> &'a mut crate::W<REG> {
196 self.variant(Aen::AbortDisabled)
197 }
198 #[doc = "Enabled"]
199 #[inline(always)]
200 pub fn abort_enabled(self) -> &'a mut crate::W<REG> {
201 self.variant(Aen::AbortEnabled)
202 }
203}
204#[doc = "Local Priority Enable\n\nValue on reset: 0"]
205#[cfg_attr(feature = "defmt", derive(defmt::Format))]
206#[derive(Clone, Copy, Debug, PartialEq, Eq)]
207pub enum Lprioen {
208 #[doc = "0: Disable"]
209 LocalPriorityDisabled = 0,
210 #[doc = "1: Enable"]
211 LocalPriorityEnabled = 1,
212}
213impl From<Lprioen> for bool {
214 #[inline(always)]
215 fn from(variant: Lprioen) -> Self {
216 variant as u8 != 0
217 }
218}
219#[doc = "Field `LPRIOEN` reader - Local Priority Enable"]
220pub type LprioenR = crate::BitReader<Lprioen>;
221impl LprioenR {
222 #[doc = "Get enumerated values variant"]
223 #[inline(always)]
224 pub const fn variant(&self) -> Lprioen {
225 match self.bits {
226 false => Lprioen::LocalPriorityDisabled,
227 true => Lprioen::LocalPriorityEnabled,
228 }
229 }
230 #[doc = "Disable"]
231 #[inline(always)]
232 pub fn is_local_priority_disabled(&self) -> bool {
233 *self == Lprioen::LocalPriorityDisabled
234 }
235 #[doc = "Enable"]
236 #[inline(always)]
237 pub fn is_local_priority_enabled(&self) -> bool {
238 *self == Lprioen::LocalPriorityEnabled
239 }
240}
241#[doc = "Field `LPRIOEN` writer - Local Priority Enable"]
242pub type LprioenW<'a, REG> = crate::BitWriter<'a, REG, Lprioen>;
243impl<'a, REG> LprioenW<'a, REG>
244where
245 REG: crate::Writable + crate::RegisterSpec,
246{
247 #[doc = "Disable"]
248 #[inline(always)]
249 pub fn local_priority_disabled(self) -> &'a mut crate::W<REG> {
250 self.variant(Lprioen::LocalPriorityDisabled)
251 }
252 #[doc = "Enable"]
253 #[inline(always)]
254 pub fn local_priority_enabled(self) -> &'a mut crate::W<REG> {
255 self.variant(Lprioen::LocalPriorityEnabled)
256 }
257}
258#[doc = "Pretended Networking Enable\n\nValue on reset: 0"]
259#[cfg_attr(feature = "defmt", derive(defmt::Format))]
260#[derive(Clone, Copy, Debug, PartialEq, Eq)]
261pub enum PnetEn {
262 #[doc = "0: Disable"]
263 PnDisabled = 0,
264 #[doc = "1: Enable"]
265 PnEnabled = 1,
266}
267impl From<PnetEn> for bool {
268 #[inline(always)]
269 fn from(variant: PnetEn) -> Self {
270 variant as u8 != 0
271 }
272}
273#[doc = "Field `PNET_EN` reader - Pretended Networking Enable"]
274pub type PnetEnR = crate::BitReader<PnetEn>;
275impl PnetEnR {
276 #[doc = "Get enumerated values variant"]
277 #[inline(always)]
278 pub const fn variant(&self) -> PnetEn {
279 match self.bits {
280 false => PnetEn::PnDisabled,
281 true => PnetEn::PnEnabled,
282 }
283 }
284 #[doc = "Disable"]
285 #[inline(always)]
286 pub fn is_pn_disabled(&self) -> bool {
287 *self == PnetEn::PnDisabled
288 }
289 #[doc = "Enable"]
290 #[inline(always)]
291 pub fn is_pn_enabled(&self) -> bool {
292 *self == PnetEn::PnEnabled
293 }
294}
295#[doc = "Field `PNET_EN` writer - Pretended Networking Enable"]
296pub type PnetEnW<'a, REG> = crate::BitWriter<'a, REG, PnetEn>;
297impl<'a, REG> PnetEnW<'a, REG>
298where
299 REG: crate::Writable + crate::RegisterSpec,
300{
301 #[doc = "Disable"]
302 #[inline(always)]
303 pub fn pn_disabled(self) -> &'a mut crate::W<REG> {
304 self.variant(PnetEn::PnDisabled)
305 }
306 #[doc = "Enable"]
307 #[inline(always)]
308 pub fn pn_enabled(self) -> &'a mut crate::W<REG> {
309 self.variant(PnetEn::PnEnabled)
310 }
311}
312#[doc = "DMA Enable\n\nValue on reset: 0"]
313#[cfg_attr(feature = "defmt", derive(defmt::Format))]
314#[derive(Clone, Copy, Debug, PartialEq, Eq)]
315pub enum Dma {
316 #[doc = "0: Disable"]
317 Id1 = 0,
318 #[doc = "1: Enable"]
319 Id2 = 1,
320}
321impl From<Dma> for bool {
322 #[inline(always)]
323 fn from(variant: Dma) -> Self {
324 variant as u8 != 0
325 }
326}
327#[doc = "Field `DMA` reader - DMA Enable"]
328pub type DmaR = crate::BitReader<Dma>;
329impl DmaR {
330 #[doc = "Get enumerated values variant"]
331 #[inline(always)]
332 pub const fn variant(&self) -> Dma {
333 match self.bits {
334 false => Dma::Id1,
335 true => Dma::Id2,
336 }
337 }
338 #[doc = "Disable"]
339 #[inline(always)]
340 pub fn is_id1(&self) -> bool {
341 *self == Dma::Id1
342 }
343 #[doc = "Enable"]
344 #[inline(always)]
345 pub fn is_id2(&self) -> bool {
346 *self == Dma::Id2
347 }
348}
349#[doc = "Field `DMA` writer - DMA Enable"]
350pub type DmaW<'a, REG> = crate::BitWriter<'a, REG, Dma>;
351impl<'a, REG> DmaW<'a, REG>
352where
353 REG: crate::Writable + crate::RegisterSpec,
354{
355 #[doc = "Disable"]
356 #[inline(always)]
357 pub fn id1(self) -> &'a mut crate::W<REG> {
358 self.variant(Dma::Id1)
359 }
360 #[doc = "Enable"]
361 #[inline(always)]
362 pub fn id2(self) -> &'a mut crate::W<REG> {
363 self.variant(Dma::Id2)
364 }
365}
366#[doc = "Individual RX Masking and Queue Enable\n\nValue on reset: 0"]
367#[cfg_attr(feature = "defmt", derive(defmt::Format))]
368#[derive(Clone, Copy, Debug, PartialEq, Eq)]
369pub enum Irmq {
370 #[doc = "0: Disable"]
371 IndividualRxMaskingDisabled = 0,
372 #[doc = "1: Enable"]
373 IndividualRxMaskingEnabled = 1,
374}
375impl From<Irmq> for bool {
376 #[inline(always)]
377 fn from(variant: Irmq) -> Self {
378 variant as u8 != 0
379 }
380}
381#[doc = "Field `IRMQ` reader - Individual RX Masking and Queue Enable"]
382pub type IrmqR = crate::BitReader<Irmq>;
383impl IrmqR {
384 #[doc = "Get enumerated values variant"]
385 #[inline(always)]
386 pub const fn variant(&self) -> Irmq {
387 match self.bits {
388 false => Irmq::IndividualRxMaskingDisabled,
389 true => Irmq::IndividualRxMaskingEnabled,
390 }
391 }
392 #[doc = "Disable"]
393 #[inline(always)]
394 pub fn is_individual_rx_masking_disabled(&self) -> bool {
395 *self == Irmq::IndividualRxMaskingDisabled
396 }
397 #[doc = "Enable"]
398 #[inline(always)]
399 pub fn is_individual_rx_masking_enabled(&self) -> bool {
400 *self == Irmq::IndividualRxMaskingEnabled
401 }
402}
403#[doc = "Field `IRMQ` writer - Individual RX Masking and Queue Enable"]
404pub type IrmqW<'a, REG> = crate::BitWriter<'a, REG, Irmq>;
405impl<'a, REG> IrmqW<'a, REG>
406where
407 REG: crate::Writable + crate::RegisterSpec,
408{
409 #[doc = "Disable"]
410 #[inline(always)]
411 pub fn individual_rx_masking_disabled(self) -> &'a mut crate::W<REG> {
412 self.variant(Irmq::IndividualRxMaskingDisabled)
413 }
414 #[doc = "Enable"]
415 #[inline(always)]
416 pub fn individual_rx_masking_enabled(self) -> &'a mut crate::W<REG> {
417 self.variant(Irmq::IndividualRxMaskingEnabled)
418 }
419}
420#[doc = "Self-Reception Disable\n\nValue on reset: 0"]
421#[cfg_attr(feature = "defmt", derive(defmt::Format))]
422#[derive(Clone, Copy, Debug, PartialEq, Eq)]
423pub enum Srxdis {
424 #[doc = "0: Enable"]
425 SelfReceptionEnabled = 0,
426 #[doc = "1: Disable"]
427 SelfReceptionDisabled = 1,
428}
429impl From<Srxdis> for bool {
430 #[inline(always)]
431 fn from(variant: Srxdis) -> Self {
432 variant as u8 != 0
433 }
434}
435#[doc = "Field `SRXDIS` reader - Self-Reception Disable"]
436pub type SrxdisR = crate::BitReader<Srxdis>;
437impl SrxdisR {
438 #[doc = "Get enumerated values variant"]
439 #[inline(always)]
440 pub const fn variant(&self) -> Srxdis {
441 match self.bits {
442 false => Srxdis::SelfReceptionEnabled,
443 true => Srxdis::SelfReceptionDisabled,
444 }
445 }
446 #[doc = "Enable"]
447 #[inline(always)]
448 pub fn is_self_reception_enabled(&self) -> bool {
449 *self == Srxdis::SelfReceptionEnabled
450 }
451 #[doc = "Disable"]
452 #[inline(always)]
453 pub fn is_self_reception_disabled(&self) -> bool {
454 *self == Srxdis::SelfReceptionDisabled
455 }
456}
457#[doc = "Field `SRXDIS` writer - Self-Reception Disable"]
458pub type SrxdisW<'a, REG> = crate::BitWriter<'a, REG, Srxdis>;
459impl<'a, REG> SrxdisW<'a, REG>
460where
461 REG: crate::Writable + crate::RegisterSpec,
462{
463 #[doc = "Enable"]
464 #[inline(always)]
465 pub fn self_reception_enabled(self) -> &'a mut crate::W<REG> {
466 self.variant(Srxdis::SelfReceptionEnabled)
467 }
468 #[doc = "Disable"]
469 #[inline(always)]
470 pub fn self_reception_disabled(self) -> &'a mut crate::W<REG> {
471 self.variant(Srxdis::SelfReceptionDisabled)
472 }
473}
474#[doc = "Doze Mode Enable\n\nValue on reset: 0"]
475#[cfg_attr(feature = "defmt", derive(defmt::Format))]
476#[derive(Clone, Copy, Debug, PartialEq, Eq)]
477pub enum Doze {
478 #[doc = "0: Disable"]
479 LowPowerDozeDisabled = 0,
480 #[doc = "1: Enable"]
481 LowPowerDozeEnabled = 1,
482}
483impl From<Doze> for bool {
484 #[inline(always)]
485 fn from(variant: Doze) -> Self {
486 variant as u8 != 0
487 }
488}
489#[doc = "Field `DOZE` reader - Doze Mode Enable"]
490pub type DozeR = crate::BitReader<Doze>;
491impl DozeR {
492 #[doc = "Get enumerated values variant"]
493 #[inline(always)]
494 pub const fn variant(&self) -> Doze {
495 match self.bits {
496 false => Doze::LowPowerDozeDisabled,
497 true => Doze::LowPowerDozeEnabled,
498 }
499 }
500 #[doc = "Disable"]
501 #[inline(always)]
502 pub fn is_low_power_doze_disabled(&self) -> bool {
503 *self == Doze::LowPowerDozeDisabled
504 }
505 #[doc = "Enable"]
506 #[inline(always)]
507 pub fn is_low_power_doze_enabled(&self) -> bool {
508 *self == Doze::LowPowerDozeEnabled
509 }
510}
511#[doc = "Field `DOZE` writer - Doze Mode Enable"]
512pub type DozeW<'a, REG> = crate::BitWriter<'a, REG, Doze>;
513impl<'a, REG> DozeW<'a, REG>
514where
515 REG: crate::Writable + crate::RegisterSpec,
516{
517 #[doc = "Disable"]
518 #[inline(always)]
519 pub fn low_power_doze_disabled(self) -> &'a mut crate::W<REG> {
520 self.variant(Doze::LowPowerDozeDisabled)
521 }
522 #[doc = "Enable"]
523 #[inline(always)]
524 pub fn low_power_doze_enabled(self) -> &'a mut crate::W<REG> {
525 self.variant(Doze::LowPowerDozeEnabled)
526 }
527}
528#[doc = "Wake-Up Source\n\nValue on reset: 0"]
529#[cfg_attr(feature = "defmt", derive(defmt::Format))]
530#[derive(Clone, Copy, Debug, PartialEq, Eq)]
531pub enum Waksrc {
532 #[doc = "0: No filter applied"]
533 UnfilteredRxInput = 0,
534 #[doc = "1: Filter applied"]
535 FilteredRxInput = 1,
536}
537impl From<Waksrc> for bool {
538 #[inline(always)]
539 fn from(variant: Waksrc) -> Self {
540 variant as u8 != 0
541 }
542}
543#[doc = "Field `WAKSRC` reader - Wake-Up Source"]
544pub type WaksrcR = crate::BitReader<Waksrc>;
545impl WaksrcR {
546 #[doc = "Get enumerated values variant"]
547 #[inline(always)]
548 pub const fn variant(&self) -> Waksrc {
549 match self.bits {
550 false => Waksrc::UnfilteredRxInput,
551 true => Waksrc::FilteredRxInput,
552 }
553 }
554 #[doc = "No filter applied"]
555 #[inline(always)]
556 pub fn is_unfiltered_rx_input(&self) -> bool {
557 *self == Waksrc::UnfilteredRxInput
558 }
559 #[doc = "Filter applied"]
560 #[inline(always)]
561 pub fn is_filtered_rx_input(&self) -> bool {
562 *self == Waksrc::FilteredRxInput
563 }
564}
565#[doc = "Field `WAKSRC` writer - Wake-Up Source"]
566pub type WaksrcW<'a, REG> = crate::BitWriter<'a, REG, Waksrc>;
567impl<'a, REG> WaksrcW<'a, REG>
568where
569 REG: crate::Writable + crate::RegisterSpec,
570{
571 #[doc = "No filter applied"]
572 #[inline(always)]
573 pub fn unfiltered_rx_input(self) -> &'a mut crate::W<REG> {
574 self.variant(Waksrc::UnfilteredRxInput)
575 }
576 #[doc = "Filter applied"]
577 #[inline(always)]
578 pub fn filtered_rx_input(self) -> &'a mut crate::W<REG> {
579 self.variant(Waksrc::FilteredRxInput)
580 }
581}
582#[doc = "Low-Power Mode Acknowledge\n\nValue on reset: 1"]
583#[cfg_attr(feature = "defmt", derive(defmt::Format))]
584#[derive(Clone, Copy, Debug, PartialEq, Eq)]
585pub enum Lpmack {
586 #[doc = "0: Not in a low-power mode"]
587 LowPowerNo = 0,
588 #[doc = "1: In a low-power mode"]
589 LowPowerYes = 1,
590}
591impl From<Lpmack> for bool {
592 #[inline(always)]
593 fn from(variant: Lpmack) -> Self {
594 variant as u8 != 0
595 }
596}
597#[doc = "Field `LPMACK` reader - Low-Power Mode Acknowledge"]
598pub type LpmackR = crate::BitReader<Lpmack>;
599impl LpmackR {
600 #[doc = "Get enumerated values variant"]
601 #[inline(always)]
602 pub const fn variant(&self) -> Lpmack {
603 match self.bits {
604 false => Lpmack::LowPowerNo,
605 true => Lpmack::LowPowerYes,
606 }
607 }
608 #[doc = "Not in a low-power mode"]
609 #[inline(always)]
610 pub fn is_low_power_no(&self) -> bool {
611 *self == Lpmack::LowPowerNo
612 }
613 #[doc = "In a low-power mode"]
614 #[inline(always)]
615 pub fn is_low_power_yes(&self) -> bool {
616 *self == Lpmack::LowPowerYes
617 }
618}
619#[doc = "Warning Interrupt Enable\n\nValue on reset: 0"]
620#[cfg_attr(feature = "defmt", derive(defmt::Format))]
621#[derive(Clone, Copy, Debug, PartialEq, Eq)]
622pub enum Wrnen {
623 #[doc = "0: Disable"]
624 TwrnintRwrnintInactive = 0,
625 #[doc = "1: Enable"]
626 TwrnintRwrnintActive = 1,
627}
628impl From<Wrnen> for bool {
629 #[inline(always)]
630 fn from(variant: Wrnen) -> Self {
631 variant as u8 != 0
632 }
633}
634#[doc = "Field `WRNEN` reader - Warning Interrupt Enable"]
635pub type WrnenR = crate::BitReader<Wrnen>;
636impl WrnenR {
637 #[doc = "Get enumerated values variant"]
638 #[inline(always)]
639 pub const fn variant(&self) -> Wrnen {
640 match self.bits {
641 false => Wrnen::TwrnintRwrnintInactive,
642 true => Wrnen::TwrnintRwrnintActive,
643 }
644 }
645 #[doc = "Disable"]
646 #[inline(always)]
647 pub fn is_twrnint_rwrnint_inactive(&self) -> bool {
648 *self == Wrnen::TwrnintRwrnintInactive
649 }
650 #[doc = "Enable"]
651 #[inline(always)]
652 pub fn is_twrnint_rwrnint_active(&self) -> bool {
653 *self == Wrnen::TwrnintRwrnintActive
654 }
655}
656#[doc = "Field `WRNEN` writer - Warning Interrupt Enable"]
657pub type WrnenW<'a, REG> = crate::BitWriter<'a, REG, Wrnen>;
658impl<'a, REG> WrnenW<'a, REG>
659where
660 REG: crate::Writable + crate::RegisterSpec,
661{
662 #[doc = "Disable"]
663 #[inline(always)]
664 pub fn twrnint_rwrnint_inactive(self) -> &'a mut crate::W<REG> {
665 self.variant(Wrnen::TwrnintRwrnintInactive)
666 }
667 #[doc = "Enable"]
668 #[inline(always)]
669 pub fn twrnint_rwrnint_active(self) -> &'a mut crate::W<REG> {
670 self.variant(Wrnen::TwrnintRwrnintActive)
671 }
672}
673#[doc = "Self Wake-up\n\nValue on reset: 0"]
674#[cfg_attr(feature = "defmt", derive(defmt::Format))]
675#[derive(Clone, Copy, Debug, PartialEq, Eq)]
676pub enum Slfwak {
677 #[doc = "0: Disable"]
678 SelfWakeupDisabled = 0,
679 #[doc = "1: Enable"]
680 SelfWakeupEnabled = 1,
681}
682impl From<Slfwak> for bool {
683 #[inline(always)]
684 fn from(variant: Slfwak) -> Self {
685 variant as u8 != 0
686 }
687}
688#[doc = "Field `SLFWAK` reader - Self Wake-up"]
689pub type SlfwakR = crate::BitReader<Slfwak>;
690impl SlfwakR {
691 #[doc = "Get enumerated values variant"]
692 #[inline(always)]
693 pub const fn variant(&self) -> Slfwak {
694 match self.bits {
695 false => Slfwak::SelfWakeupDisabled,
696 true => Slfwak::SelfWakeupEnabled,
697 }
698 }
699 #[doc = "Disable"]
700 #[inline(always)]
701 pub fn is_self_wakeup_disabled(&self) -> bool {
702 *self == Slfwak::SelfWakeupDisabled
703 }
704 #[doc = "Enable"]
705 #[inline(always)]
706 pub fn is_self_wakeup_enabled(&self) -> bool {
707 *self == Slfwak::SelfWakeupEnabled
708 }
709}
710#[doc = "Field `SLFWAK` writer - Self Wake-up"]
711pub type SlfwakW<'a, REG> = crate::BitWriter<'a, REG, Slfwak>;
712impl<'a, REG> SlfwakW<'a, REG>
713where
714 REG: crate::Writable + crate::RegisterSpec,
715{
716 #[doc = "Disable"]
717 #[inline(always)]
718 pub fn self_wakeup_disabled(self) -> &'a mut crate::W<REG> {
719 self.variant(Slfwak::SelfWakeupDisabled)
720 }
721 #[doc = "Enable"]
722 #[inline(always)]
723 pub fn self_wakeup_enabled(self) -> &'a mut crate::W<REG> {
724 self.variant(Slfwak::SelfWakeupEnabled)
725 }
726}
727#[doc = "Supervisor Mode\n\nValue on reset: 1"]
728#[cfg_attr(feature = "defmt", derive(defmt::Format))]
729#[derive(Clone, Copy, Debug, PartialEq, Eq)]
730pub enum Supv {
731 #[doc = "0: User mode"]
732 Id1 = 0,
733 #[doc = "1: Supervisor mode"]
734 Id2 = 1,
735}
736impl From<Supv> for bool {
737 #[inline(always)]
738 fn from(variant: Supv) -> Self {
739 variant as u8 != 0
740 }
741}
742#[doc = "Field `SUPV` reader - Supervisor Mode"]
743pub type SupvR = crate::BitReader<Supv>;
744impl SupvR {
745 #[doc = "Get enumerated values variant"]
746 #[inline(always)]
747 pub const fn variant(&self) -> Supv {
748 match self.bits {
749 false => Supv::Id1,
750 true => Supv::Id2,
751 }
752 }
753 #[doc = "User mode"]
754 #[inline(always)]
755 pub fn is_id1(&self) -> bool {
756 *self == Supv::Id1
757 }
758 #[doc = "Supervisor mode"]
759 #[inline(always)]
760 pub fn is_id2(&self) -> bool {
761 *self == Supv::Id2
762 }
763}
764#[doc = "Field `SUPV` writer - Supervisor Mode"]
765pub type SupvW<'a, REG> = crate::BitWriter<'a, REG, Supv>;
766impl<'a, REG> SupvW<'a, REG>
767where
768 REG: crate::Writable + crate::RegisterSpec,
769{
770 #[doc = "User mode"]
771 #[inline(always)]
772 pub fn id1(self) -> &'a mut crate::W<REG> {
773 self.variant(Supv::Id1)
774 }
775 #[doc = "Supervisor mode"]
776 #[inline(always)]
777 pub fn id2(self) -> &'a mut crate::W<REG> {
778 self.variant(Supv::Id2)
779 }
780}
781#[doc = "Freeze Mode Acknowledge\n\nValue on reset: 0"]
782#[cfg_attr(feature = "defmt", derive(defmt::Format))]
783#[derive(Clone, Copy, Debug, PartialEq, Eq)]
784pub enum Frzack {
785 #[doc = "0: Not in Freeze mode, prescaler running."]
786 FreezeModeNo = 0,
787 #[doc = "1: In Freeze mode, prescaler stopped."]
788 FreezeModeYes = 1,
789}
790impl From<Frzack> for bool {
791 #[inline(always)]
792 fn from(variant: Frzack) -> Self {
793 variant as u8 != 0
794 }
795}
796#[doc = "Field `FRZACK` reader - Freeze Mode Acknowledge"]
797pub type FrzackR = crate::BitReader<Frzack>;
798impl FrzackR {
799 #[doc = "Get enumerated values variant"]
800 #[inline(always)]
801 pub const fn variant(&self) -> Frzack {
802 match self.bits {
803 false => Frzack::FreezeModeNo,
804 true => Frzack::FreezeModeYes,
805 }
806 }
807 #[doc = "Not in Freeze mode, prescaler running."]
808 #[inline(always)]
809 pub fn is_freeze_mode_no(&self) -> bool {
810 *self == Frzack::FreezeModeNo
811 }
812 #[doc = "In Freeze mode, prescaler stopped."]
813 #[inline(always)]
814 pub fn is_freeze_mode_yes(&self) -> bool {
815 *self == Frzack::FreezeModeYes
816 }
817}
818#[doc = "Soft Reset\n\nValue on reset: 0"]
819#[cfg_attr(feature = "defmt", derive(defmt::Format))]
820#[derive(Clone, Copy, Debug, PartialEq, Eq)]
821pub enum Softrst {
822 #[doc = "0: No reset"]
823 SoftrstNoResetRequest = 0,
824 #[doc = "1: Soft reset affects reset registers"]
825 SoftrstResetRegisters = 1,
826}
827impl From<Softrst> for bool {
828 #[inline(always)]
829 fn from(variant: Softrst) -> Self {
830 variant as u8 != 0
831 }
832}
833#[doc = "Field `SOFTRST` reader - Soft Reset"]
834pub type SoftrstR = crate::BitReader<Softrst>;
835impl SoftrstR {
836 #[doc = "Get enumerated values variant"]
837 #[inline(always)]
838 pub const fn variant(&self) -> Softrst {
839 match self.bits {
840 false => Softrst::SoftrstNoResetRequest,
841 true => Softrst::SoftrstResetRegisters,
842 }
843 }
844 #[doc = "No reset"]
845 #[inline(always)]
846 pub fn is_softrst_no_reset_request(&self) -> bool {
847 *self == Softrst::SoftrstNoResetRequest
848 }
849 #[doc = "Soft reset affects reset registers"]
850 #[inline(always)]
851 pub fn is_softrst_reset_registers(&self) -> bool {
852 *self == Softrst::SoftrstResetRegisters
853 }
854}
855#[doc = "Field `SOFTRST` writer - Soft Reset"]
856pub type SoftrstW<'a, REG> = crate::BitWriter<'a, REG, Softrst>;
857impl<'a, REG> SoftrstW<'a, REG>
858where
859 REG: crate::Writable + crate::RegisterSpec,
860{
861 #[doc = "No reset"]
862 #[inline(always)]
863 pub fn softrst_no_reset_request(self) -> &'a mut crate::W<REG> {
864 self.variant(Softrst::SoftrstNoResetRequest)
865 }
866 #[doc = "Soft reset affects reset registers"]
867 #[inline(always)]
868 pub fn softrst_reset_registers(self) -> &'a mut crate::W<REG> {
869 self.variant(Softrst::SoftrstResetRegisters)
870 }
871}
872#[doc = "Wake-up Interrupt Mask\n\nValue on reset: 0"]
873#[cfg_attr(feature = "defmt", derive(defmt::Format))]
874#[derive(Clone, Copy, Debug, PartialEq, Eq)]
875pub enum Wakmsk {
876 #[doc = "0: Disabled"]
877 WakeupInterruptDisabled = 0,
878 #[doc = "1: Enabled"]
879 WakeupInterruptEnabled = 1,
880}
881impl From<Wakmsk> for bool {
882 #[inline(always)]
883 fn from(variant: Wakmsk) -> Self {
884 variant as u8 != 0
885 }
886}
887#[doc = "Field `WAKMSK` reader - Wake-up Interrupt Mask"]
888pub type WakmskR = crate::BitReader<Wakmsk>;
889impl WakmskR {
890 #[doc = "Get enumerated values variant"]
891 #[inline(always)]
892 pub const fn variant(&self) -> Wakmsk {
893 match self.bits {
894 false => Wakmsk::WakeupInterruptDisabled,
895 true => Wakmsk::WakeupInterruptEnabled,
896 }
897 }
898 #[doc = "Disabled"]
899 #[inline(always)]
900 pub fn is_wakeup_interrupt_disabled(&self) -> bool {
901 *self == Wakmsk::WakeupInterruptDisabled
902 }
903 #[doc = "Enabled"]
904 #[inline(always)]
905 pub fn is_wakeup_interrupt_enabled(&self) -> bool {
906 *self == Wakmsk::WakeupInterruptEnabled
907 }
908}
909#[doc = "Field `WAKMSK` writer - Wake-up Interrupt Mask"]
910pub type WakmskW<'a, REG> = crate::BitWriter<'a, REG, Wakmsk>;
911impl<'a, REG> WakmskW<'a, REG>
912where
913 REG: crate::Writable + crate::RegisterSpec,
914{
915 #[doc = "Disabled"]
916 #[inline(always)]
917 pub fn wakeup_interrupt_disabled(self) -> &'a mut crate::W<REG> {
918 self.variant(Wakmsk::WakeupInterruptDisabled)
919 }
920 #[doc = "Enabled"]
921 #[inline(always)]
922 pub fn wakeup_interrupt_enabled(self) -> &'a mut crate::W<REG> {
923 self.variant(Wakmsk::WakeupInterruptEnabled)
924 }
925}
926#[doc = "FlexCAN Not Ready\n\nValue on reset: 1"]
927#[cfg_attr(feature = "defmt", derive(defmt::Format))]
928#[derive(Clone, Copy, Debug, PartialEq, Eq)]
929pub enum Notrdy {
930 #[doc = "0: FlexCAN is in Normal mode, Listen-Only mode, or Loopback mode."]
931 Id1 = 0,
932 #[doc = "1: FlexCAN is in Disable mode, Doze mode, Stop mode, or Freeze mode."]
933 Id2 = 1,
934}
935impl From<Notrdy> for bool {
936 #[inline(always)]
937 fn from(variant: Notrdy) -> Self {
938 variant as u8 != 0
939 }
940}
941#[doc = "Field `NOTRDY` reader - FlexCAN Not Ready"]
942pub type NotrdyR = crate::BitReader<Notrdy>;
943impl NotrdyR {
944 #[doc = "Get enumerated values variant"]
945 #[inline(always)]
946 pub const fn variant(&self) -> Notrdy {
947 match self.bits {
948 false => Notrdy::Id1,
949 true => Notrdy::Id2,
950 }
951 }
952 #[doc = "FlexCAN is in Normal mode, Listen-Only mode, or Loopback mode."]
953 #[inline(always)]
954 pub fn is_id1(&self) -> bool {
955 *self == Notrdy::Id1
956 }
957 #[doc = "FlexCAN is in Disable mode, Doze mode, Stop mode, or Freeze mode."]
958 #[inline(always)]
959 pub fn is_id2(&self) -> bool {
960 *self == Notrdy::Id2
961 }
962}
963#[doc = "Halt FlexCAN\n\nValue on reset: 1"]
964#[cfg_attr(feature = "defmt", derive(defmt::Format))]
965#[derive(Clone, Copy, Debug, PartialEq, Eq)]
966pub enum Halt {
967 #[doc = "0: No request"]
968 HaltDisable = 0,
969 #[doc = "1: Enter Freeze mode, if MCR\\[FRZ\\] = 1."]
970 HaltEnable = 1,
971}
972impl From<Halt> for bool {
973 #[inline(always)]
974 fn from(variant: Halt) -> Self {
975 variant as u8 != 0
976 }
977}
978#[doc = "Field `HALT` reader - Halt FlexCAN"]
979pub type HaltR = crate::BitReader<Halt>;
980impl HaltR {
981 #[doc = "Get enumerated values variant"]
982 #[inline(always)]
983 pub const fn variant(&self) -> Halt {
984 match self.bits {
985 false => Halt::HaltDisable,
986 true => Halt::HaltEnable,
987 }
988 }
989 #[doc = "No request"]
990 #[inline(always)]
991 pub fn is_halt_disable(&self) -> bool {
992 *self == Halt::HaltDisable
993 }
994 #[doc = "Enter Freeze mode, if MCR\\[FRZ\\] = 1."]
995 #[inline(always)]
996 pub fn is_halt_enable(&self) -> bool {
997 *self == Halt::HaltEnable
998 }
999}
1000#[doc = "Field `HALT` writer - Halt FlexCAN"]
1001pub type HaltW<'a, REG> = crate::BitWriter<'a, REG, Halt>;
1002impl<'a, REG> HaltW<'a, REG>
1003where
1004 REG: crate::Writable + crate::RegisterSpec,
1005{
1006 #[doc = "No request"]
1007 #[inline(always)]
1008 pub fn halt_disable(self) -> &'a mut crate::W<REG> {
1009 self.variant(Halt::HaltDisable)
1010 }
1011 #[doc = "Enter Freeze mode, if MCR\\[FRZ\\] = 1."]
1012 #[inline(always)]
1013 pub fn halt_enable(self) -> &'a mut crate::W<REG> {
1014 self.variant(Halt::HaltEnable)
1015 }
1016}
1017#[doc = "Legacy RX FIFO Enable\n\nValue on reset: 0"]
1018#[cfg_attr(feature = "defmt", derive(defmt::Format))]
1019#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1020pub enum Rfen {
1021 #[doc = "0: Disable"]
1022 Id1 = 0,
1023 #[doc = "1: Enable"]
1024 Id2 = 1,
1025}
1026impl From<Rfen> for bool {
1027 #[inline(always)]
1028 fn from(variant: Rfen) -> Self {
1029 variant as u8 != 0
1030 }
1031}
1032#[doc = "Field `RFEN` reader - Legacy RX FIFO Enable"]
1033pub type RfenR = crate::BitReader<Rfen>;
1034impl RfenR {
1035 #[doc = "Get enumerated values variant"]
1036 #[inline(always)]
1037 pub const fn variant(&self) -> Rfen {
1038 match self.bits {
1039 false => Rfen::Id1,
1040 true => Rfen::Id2,
1041 }
1042 }
1043 #[doc = "Disable"]
1044 #[inline(always)]
1045 pub fn is_id1(&self) -> bool {
1046 *self == Rfen::Id1
1047 }
1048 #[doc = "Enable"]
1049 #[inline(always)]
1050 pub fn is_id2(&self) -> bool {
1051 *self == Rfen::Id2
1052 }
1053}
1054#[doc = "Field `RFEN` writer - Legacy RX FIFO Enable"]
1055pub type RfenW<'a, REG> = crate::BitWriter<'a, REG, Rfen>;
1056impl<'a, REG> RfenW<'a, REG>
1057where
1058 REG: crate::Writable + crate::RegisterSpec,
1059{
1060 #[doc = "Disable"]
1061 #[inline(always)]
1062 pub fn id1(self) -> &'a mut crate::W<REG> {
1063 self.variant(Rfen::Id1)
1064 }
1065 #[doc = "Enable"]
1066 #[inline(always)]
1067 pub fn id2(self) -> &'a mut crate::W<REG> {
1068 self.variant(Rfen::Id2)
1069 }
1070}
1071#[doc = "Freeze Enable\n\nValue on reset: 1"]
1072#[cfg_attr(feature = "defmt", derive(defmt::Format))]
1073#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1074pub enum Frz {
1075 #[doc = "0: Disable"]
1076 FreezeModeDisabled = 0,
1077 #[doc = "1: Enable"]
1078 FreezeModeEnabled = 1,
1079}
1080impl From<Frz> for bool {
1081 #[inline(always)]
1082 fn from(variant: Frz) -> Self {
1083 variant as u8 != 0
1084 }
1085}
1086#[doc = "Field `FRZ` reader - Freeze Enable"]
1087pub type FrzR = crate::BitReader<Frz>;
1088impl FrzR {
1089 #[doc = "Get enumerated values variant"]
1090 #[inline(always)]
1091 pub const fn variant(&self) -> Frz {
1092 match self.bits {
1093 false => Frz::FreezeModeDisabled,
1094 true => Frz::FreezeModeEnabled,
1095 }
1096 }
1097 #[doc = "Disable"]
1098 #[inline(always)]
1099 pub fn is_freeze_mode_disabled(&self) -> bool {
1100 *self == Frz::FreezeModeDisabled
1101 }
1102 #[doc = "Enable"]
1103 #[inline(always)]
1104 pub fn is_freeze_mode_enabled(&self) -> bool {
1105 *self == Frz::FreezeModeEnabled
1106 }
1107}
1108#[doc = "Field `FRZ` writer - Freeze Enable"]
1109pub type FrzW<'a, REG> = crate::BitWriter<'a, REG, Frz>;
1110impl<'a, REG> FrzW<'a, REG>
1111where
1112 REG: crate::Writable + crate::RegisterSpec,
1113{
1114 #[doc = "Disable"]
1115 #[inline(always)]
1116 pub fn freeze_mode_disabled(self) -> &'a mut crate::W<REG> {
1117 self.variant(Frz::FreezeModeDisabled)
1118 }
1119 #[doc = "Enable"]
1120 #[inline(always)]
1121 pub fn freeze_mode_enabled(self) -> &'a mut crate::W<REG> {
1122 self.variant(Frz::FreezeModeEnabled)
1123 }
1124}
1125#[doc = "Module Disable\n\nValue on reset: 1"]
1126#[cfg_attr(feature = "defmt", derive(defmt::Format))]
1127#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1128pub enum Mdis {
1129 #[doc = "0: Enable"]
1130 FlexcanEnabled = 0,
1131 #[doc = "1: Disable"]
1132 FlexcanDisabled = 1,
1133}
1134impl From<Mdis> for bool {
1135 #[inline(always)]
1136 fn from(variant: Mdis) -> Self {
1137 variant as u8 != 0
1138 }
1139}
1140#[doc = "Field `MDIS` reader - Module Disable"]
1141pub type MdisR = crate::BitReader<Mdis>;
1142impl MdisR {
1143 #[doc = "Get enumerated values variant"]
1144 #[inline(always)]
1145 pub const fn variant(&self) -> Mdis {
1146 match self.bits {
1147 false => Mdis::FlexcanEnabled,
1148 true => Mdis::FlexcanDisabled,
1149 }
1150 }
1151 #[doc = "Enable"]
1152 #[inline(always)]
1153 pub fn is_flexcan_enabled(&self) -> bool {
1154 *self == Mdis::FlexcanEnabled
1155 }
1156 #[doc = "Disable"]
1157 #[inline(always)]
1158 pub fn is_flexcan_disabled(&self) -> bool {
1159 *self == Mdis::FlexcanDisabled
1160 }
1161}
1162#[doc = "Field `MDIS` writer - Module Disable"]
1163pub type MdisW<'a, REG> = crate::BitWriter<'a, REG, Mdis>;
1164impl<'a, REG> MdisW<'a, REG>
1165where
1166 REG: crate::Writable + crate::RegisterSpec,
1167{
1168 #[doc = "Enable"]
1169 #[inline(always)]
1170 pub fn flexcan_enabled(self) -> &'a mut crate::W<REG> {
1171 self.variant(Mdis::FlexcanEnabled)
1172 }
1173 #[doc = "Disable"]
1174 #[inline(always)]
1175 pub fn flexcan_disabled(self) -> &'a mut crate::W<REG> {
1176 self.variant(Mdis::FlexcanDisabled)
1177 }
1178}
1179impl R {
1180 #[doc = "Bits 0:6 - Number of the Last Message Buffer"]
1181 #[inline(always)]
1182 pub fn maxmb(&self) -> MaxmbR {
1183 MaxmbR::new((self.bits & 0x7f) as u8)
1184 }
1185 #[doc = "Bits 8:9 - ID Acceptance Mode"]
1186 #[inline(always)]
1187 pub fn idam(&self) -> IdamR {
1188 IdamR::new(((self.bits >> 8) & 3) as u8)
1189 }
1190 #[doc = "Bit 11 - CAN FD Operation Enable"]
1191 #[inline(always)]
1192 pub fn fden(&self) -> FdenR {
1193 FdenR::new(((self.bits >> 11) & 1) != 0)
1194 }
1195 #[doc = "Bit 12 - Abort Enable"]
1196 #[inline(always)]
1197 pub fn aen(&self) -> AenR {
1198 AenR::new(((self.bits >> 12) & 1) != 0)
1199 }
1200 #[doc = "Bit 13 - Local Priority Enable"]
1201 #[inline(always)]
1202 pub fn lprioen(&self) -> LprioenR {
1203 LprioenR::new(((self.bits >> 13) & 1) != 0)
1204 }
1205 #[doc = "Bit 14 - Pretended Networking Enable"]
1206 #[inline(always)]
1207 pub fn pnet_en(&self) -> PnetEnR {
1208 PnetEnR::new(((self.bits >> 14) & 1) != 0)
1209 }
1210 #[doc = "Bit 15 - DMA Enable"]
1211 #[inline(always)]
1212 pub fn dma(&self) -> DmaR {
1213 DmaR::new(((self.bits >> 15) & 1) != 0)
1214 }
1215 #[doc = "Bit 16 - Individual RX Masking and Queue Enable"]
1216 #[inline(always)]
1217 pub fn irmq(&self) -> IrmqR {
1218 IrmqR::new(((self.bits >> 16) & 1) != 0)
1219 }
1220 #[doc = "Bit 17 - Self-Reception Disable"]
1221 #[inline(always)]
1222 pub fn srxdis(&self) -> SrxdisR {
1223 SrxdisR::new(((self.bits >> 17) & 1) != 0)
1224 }
1225 #[doc = "Bit 18 - Doze Mode Enable"]
1226 #[inline(always)]
1227 pub fn doze(&self) -> DozeR {
1228 DozeR::new(((self.bits >> 18) & 1) != 0)
1229 }
1230 #[doc = "Bit 19 - Wake-Up Source"]
1231 #[inline(always)]
1232 pub fn waksrc(&self) -> WaksrcR {
1233 WaksrcR::new(((self.bits >> 19) & 1) != 0)
1234 }
1235 #[doc = "Bit 20 - Low-Power Mode Acknowledge"]
1236 #[inline(always)]
1237 pub fn lpmack(&self) -> LpmackR {
1238 LpmackR::new(((self.bits >> 20) & 1) != 0)
1239 }
1240 #[doc = "Bit 21 - Warning Interrupt Enable"]
1241 #[inline(always)]
1242 pub fn wrnen(&self) -> WrnenR {
1243 WrnenR::new(((self.bits >> 21) & 1) != 0)
1244 }
1245 #[doc = "Bit 22 - Self Wake-up"]
1246 #[inline(always)]
1247 pub fn slfwak(&self) -> SlfwakR {
1248 SlfwakR::new(((self.bits >> 22) & 1) != 0)
1249 }
1250 #[doc = "Bit 23 - Supervisor Mode"]
1251 #[inline(always)]
1252 pub fn supv(&self) -> SupvR {
1253 SupvR::new(((self.bits >> 23) & 1) != 0)
1254 }
1255 #[doc = "Bit 24 - Freeze Mode Acknowledge"]
1256 #[inline(always)]
1257 pub fn frzack(&self) -> FrzackR {
1258 FrzackR::new(((self.bits >> 24) & 1) != 0)
1259 }
1260 #[doc = "Bit 25 - Soft Reset"]
1261 #[inline(always)]
1262 pub fn softrst(&self) -> SoftrstR {
1263 SoftrstR::new(((self.bits >> 25) & 1) != 0)
1264 }
1265 #[doc = "Bit 26 - Wake-up Interrupt Mask"]
1266 #[inline(always)]
1267 pub fn wakmsk(&self) -> WakmskR {
1268 WakmskR::new(((self.bits >> 26) & 1) != 0)
1269 }
1270 #[doc = "Bit 27 - FlexCAN Not Ready"]
1271 #[inline(always)]
1272 pub fn notrdy(&self) -> NotrdyR {
1273 NotrdyR::new(((self.bits >> 27) & 1) != 0)
1274 }
1275 #[doc = "Bit 28 - Halt FlexCAN"]
1276 #[inline(always)]
1277 pub fn halt(&self) -> HaltR {
1278 HaltR::new(((self.bits >> 28) & 1) != 0)
1279 }
1280 #[doc = "Bit 29 - Legacy RX FIFO Enable"]
1281 #[inline(always)]
1282 pub fn rfen(&self) -> RfenR {
1283 RfenR::new(((self.bits >> 29) & 1) != 0)
1284 }
1285 #[doc = "Bit 30 - Freeze Enable"]
1286 #[inline(always)]
1287 pub fn frz(&self) -> FrzR {
1288 FrzR::new(((self.bits >> 30) & 1) != 0)
1289 }
1290 #[doc = "Bit 31 - Module Disable"]
1291 #[inline(always)]
1292 pub fn mdis(&self) -> MdisR {
1293 MdisR::new(((self.bits >> 31) & 1) != 0)
1294 }
1295}
1296#[cfg(feature = "debug")]
1297impl core::fmt::Debug for R {
1298 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1299 f.debug_struct("MCR")
1300 .field("maxmb", &self.maxmb())
1301 .field("idam", &self.idam())
1302 .field("fden", &self.fden())
1303 .field("aen", &self.aen())
1304 .field("lprioen", &self.lprioen())
1305 .field("pnet_en", &self.pnet_en())
1306 .field("dma", &self.dma())
1307 .field("irmq", &self.irmq())
1308 .field("srxdis", &self.srxdis())
1309 .field("doze", &self.doze())
1310 .field("waksrc", &self.waksrc())
1311 .field("lpmack", &self.lpmack())
1312 .field("wrnen", &self.wrnen())
1313 .field("slfwak", &self.slfwak())
1314 .field("supv", &self.supv())
1315 .field("frzack", &self.frzack())
1316 .field("softrst", &self.softrst())
1317 .field("wakmsk", &self.wakmsk())
1318 .field("notrdy", &self.notrdy())
1319 .field("halt", &self.halt())
1320 .field("rfen", &self.rfen())
1321 .field("frz", &self.frz())
1322 .field("mdis", &self.mdis())
1323 .finish()
1324 }
1325}
1326impl W {
1327 #[doc = "Bits 0:6 - Number of the Last Message Buffer"]
1328 #[inline(always)]
1329 pub fn maxmb(&mut self) -> MaxmbW<'_, McrSpec> {
1330 MaxmbW::new(self, 0)
1331 }
1332 #[doc = "Bits 8:9 - ID Acceptance Mode"]
1333 #[inline(always)]
1334 pub fn idam(&mut self) -> IdamW<'_, McrSpec> {
1335 IdamW::new(self, 8)
1336 }
1337 #[doc = "Bit 11 - CAN FD Operation Enable"]
1338 #[inline(always)]
1339 pub fn fden(&mut self) -> FdenW<'_, McrSpec> {
1340 FdenW::new(self, 11)
1341 }
1342 #[doc = "Bit 12 - Abort Enable"]
1343 #[inline(always)]
1344 pub fn aen(&mut self) -> AenW<'_, McrSpec> {
1345 AenW::new(self, 12)
1346 }
1347 #[doc = "Bit 13 - Local Priority Enable"]
1348 #[inline(always)]
1349 pub fn lprioen(&mut self) -> LprioenW<'_, McrSpec> {
1350 LprioenW::new(self, 13)
1351 }
1352 #[doc = "Bit 14 - Pretended Networking Enable"]
1353 #[inline(always)]
1354 pub fn pnet_en(&mut self) -> PnetEnW<'_, McrSpec> {
1355 PnetEnW::new(self, 14)
1356 }
1357 #[doc = "Bit 15 - DMA Enable"]
1358 #[inline(always)]
1359 pub fn dma(&mut self) -> DmaW<'_, McrSpec> {
1360 DmaW::new(self, 15)
1361 }
1362 #[doc = "Bit 16 - Individual RX Masking and Queue Enable"]
1363 #[inline(always)]
1364 pub fn irmq(&mut self) -> IrmqW<'_, McrSpec> {
1365 IrmqW::new(self, 16)
1366 }
1367 #[doc = "Bit 17 - Self-Reception Disable"]
1368 #[inline(always)]
1369 pub fn srxdis(&mut self) -> SrxdisW<'_, McrSpec> {
1370 SrxdisW::new(self, 17)
1371 }
1372 #[doc = "Bit 18 - Doze Mode Enable"]
1373 #[inline(always)]
1374 pub fn doze(&mut self) -> DozeW<'_, McrSpec> {
1375 DozeW::new(self, 18)
1376 }
1377 #[doc = "Bit 19 - Wake-Up Source"]
1378 #[inline(always)]
1379 pub fn waksrc(&mut self) -> WaksrcW<'_, McrSpec> {
1380 WaksrcW::new(self, 19)
1381 }
1382 #[doc = "Bit 21 - Warning Interrupt Enable"]
1383 #[inline(always)]
1384 pub fn wrnen(&mut self) -> WrnenW<'_, McrSpec> {
1385 WrnenW::new(self, 21)
1386 }
1387 #[doc = "Bit 22 - Self Wake-up"]
1388 #[inline(always)]
1389 pub fn slfwak(&mut self) -> SlfwakW<'_, McrSpec> {
1390 SlfwakW::new(self, 22)
1391 }
1392 #[doc = "Bit 23 - Supervisor Mode"]
1393 #[inline(always)]
1394 pub fn supv(&mut self) -> SupvW<'_, McrSpec> {
1395 SupvW::new(self, 23)
1396 }
1397 #[doc = "Bit 25 - Soft Reset"]
1398 #[inline(always)]
1399 pub fn softrst(&mut self) -> SoftrstW<'_, McrSpec> {
1400 SoftrstW::new(self, 25)
1401 }
1402 #[doc = "Bit 26 - Wake-up Interrupt Mask"]
1403 #[inline(always)]
1404 pub fn wakmsk(&mut self) -> WakmskW<'_, McrSpec> {
1405 WakmskW::new(self, 26)
1406 }
1407 #[doc = "Bit 28 - Halt FlexCAN"]
1408 #[inline(always)]
1409 pub fn halt(&mut self) -> HaltW<'_, McrSpec> {
1410 HaltW::new(self, 28)
1411 }
1412 #[doc = "Bit 29 - Legacy RX FIFO Enable"]
1413 #[inline(always)]
1414 pub fn rfen(&mut self) -> RfenW<'_, McrSpec> {
1415 RfenW::new(self, 29)
1416 }
1417 #[doc = "Bit 30 - Freeze Enable"]
1418 #[inline(always)]
1419 pub fn frz(&mut self) -> FrzW<'_, McrSpec> {
1420 FrzW::new(self, 30)
1421 }
1422 #[doc = "Bit 31 - Module Disable"]
1423 #[inline(always)]
1424 pub fn mdis(&mut self) -> MdisW<'_, McrSpec> {
1425 MdisW::new(self, 31)
1426 }
1427}
1428#[doc = "Module Configuration\n\nYou can [`read`](crate::Reg::read) this register and get [`mcr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mcr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
1429pub struct McrSpec;
1430impl crate::RegisterSpec for McrSpec {
1431 type Ux = u32;
1432}
1433#[doc = "`read()` method returns [`mcr::R`](R) reader structure"]
1434impl crate::Readable for McrSpec {}
1435#[doc = "`write(|w| ..)` method takes [`mcr::W`](W) writer structure"]
1436impl crate::Writable for McrSpec {
1437 type Safety = crate::Unsafe;
1438}
1439#[doc = "`reset()` method sets MCR to value 0xd890_000f"]
1440impl crate::Resettable for McrSpec {
1441 const RESET_VALUE: u32 = 0xd890_000f;
1442}