ra2a1/can0/
ctlr.rs

1#[doc = "Register `CTLR` reader"]
2pub struct R(crate::R<CTLR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CTLR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CTLR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CTLR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CTLR` writer"]
17pub struct W(crate::W<CTLR_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CTLR_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<CTLR_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CTLR_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `MBM` reader - CAN Mailbox Mode Select"]
38pub type MBM_R = crate::BitReader<MBM_A>;
39#[doc = "CAN Mailbox Mode Select\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum MBM_A {
42    #[doc = "0: Normal mailbox mode"]
43    _0 = 0,
44    #[doc = "1: FIFO mailbox mode"]
45    _1 = 1,
46}
47impl From<MBM_A> for bool {
48    #[inline(always)]
49    fn from(variant: MBM_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl MBM_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> MBM_A {
57        match self.bits {
58            false => MBM_A::_0,
59            true => MBM_A::_1,
60        }
61    }
62    #[doc = "Checks if the value of the field is `_0`"]
63    #[inline(always)]
64    pub fn is_0(&self) -> bool {
65        *self == MBM_A::_0
66    }
67    #[doc = "Checks if the value of the field is `_1`"]
68    #[inline(always)]
69    pub fn is_1(&self) -> bool {
70        *self == MBM_A::_1
71    }
72}
73#[doc = "Field `MBM` writer - CAN Mailbox Mode Select"]
74pub type MBM_W<'a, const O: u8> = crate::BitWriter<'a, u16, CTLR_SPEC, MBM_A, O>;
75impl<'a, const O: u8> MBM_W<'a, O> {
76    #[doc = "Normal mailbox mode"]
77    #[inline(always)]
78    pub fn _0(self) -> &'a mut W {
79        self.variant(MBM_A::_0)
80    }
81    #[doc = "FIFO mailbox mode"]
82    #[inline(always)]
83    pub fn _1(self) -> &'a mut W {
84        self.variant(MBM_A::_1)
85    }
86}
87#[doc = "Field `IDFM` reader - ID Format Mode Select"]
88pub type IDFM_R = crate::FieldReader<u8, IDFM_A>;
89#[doc = "ID Format Mode Select\n\nValue on reset: 0"]
90#[derive(Clone, Copy, Debug, PartialEq, Eq)]
91#[repr(u8)]
92pub enum IDFM_A {
93    #[doc = "0: Standard ID mode.All mailboxes (including FIFO mailboxes) handle only standard Ids."]
94    _00 = 0,
95    #[doc = "1: Extended ID mode.All mailboxes (including FIFO mailboxes) handle only extended IDs."]
96    _01 = 1,
97    #[doc = "2: Mixed ID mode.All mailboxes (including FIFO mailboxes) handle both standard IDs and extended IDs. Standard IDs or extended IDs are specified by using the IDE bit in the corresponding mailbox in normal mailbox mode. In FIFO mailbox mode, the IDE bit in the corresponding mailbox is used for mailboxes \\[0\\]
98to \\[23\\], the IDE bits in FIDCR0 and FIDCR1 are used for the receive FIFO, and the IDE bit in mailbox \\[24\\]
99is used for the transmit FIFO."]
100    _10 = 2,
101    #[doc = "3: Do not use this combination"]
102    _11 = 3,
103}
104impl From<IDFM_A> for u8 {
105    #[inline(always)]
106    fn from(variant: IDFM_A) -> Self {
107        variant as _
108    }
109}
110impl IDFM_R {
111    #[doc = "Get enumerated values variant"]
112    #[inline(always)]
113    pub fn variant(&self) -> IDFM_A {
114        match self.bits {
115            0 => IDFM_A::_00,
116            1 => IDFM_A::_01,
117            2 => IDFM_A::_10,
118            3 => IDFM_A::_11,
119            _ => unreachable!(),
120        }
121    }
122    #[doc = "Checks if the value of the field is `_00`"]
123    #[inline(always)]
124    pub fn is_00(&self) -> bool {
125        *self == IDFM_A::_00
126    }
127    #[doc = "Checks if the value of the field is `_01`"]
128    #[inline(always)]
129    pub fn is_01(&self) -> bool {
130        *self == IDFM_A::_01
131    }
132    #[doc = "Checks if the value of the field is `_10`"]
133    #[inline(always)]
134    pub fn is_10(&self) -> bool {
135        *self == IDFM_A::_10
136    }
137    #[doc = "Checks if the value of the field is `_11`"]
138    #[inline(always)]
139    pub fn is_11(&self) -> bool {
140        *self == IDFM_A::_11
141    }
142}
143#[doc = "Field `IDFM` writer - ID Format Mode Select"]
144pub type IDFM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u16, CTLR_SPEC, u8, IDFM_A, 2, O>;
145impl<'a, const O: u8> IDFM_W<'a, O> {
146    #[doc = "Standard ID mode.All mailboxes (including FIFO mailboxes) handle only standard Ids."]
147    #[inline(always)]
148    pub fn _00(self) -> &'a mut W {
149        self.variant(IDFM_A::_00)
150    }
151    #[doc = "Extended ID mode.All mailboxes (including FIFO mailboxes) handle only extended IDs."]
152    #[inline(always)]
153    pub fn _01(self) -> &'a mut W {
154        self.variant(IDFM_A::_01)
155    }
156    #[doc = "Mixed ID mode.All mailboxes (including FIFO mailboxes) handle both standard IDs and extended IDs. Standard IDs or extended IDs are specified by using the IDE bit in the corresponding mailbox in normal mailbox mode. In FIFO mailbox mode, the IDE bit in the corresponding mailbox is used for mailboxes \\[0\\]
157to \\[23\\], the IDE bits in FIDCR0 and FIDCR1 are used for the receive FIFO, and the IDE bit in mailbox \\[24\\]
158is used for the transmit FIFO."]
159    #[inline(always)]
160    pub fn _10(self) -> &'a mut W {
161        self.variant(IDFM_A::_10)
162    }
163    #[doc = "Do not use this combination"]
164    #[inline(always)]
165    pub fn _11(self) -> &'a mut W {
166        self.variant(IDFM_A::_11)
167    }
168}
169#[doc = "Field `MLM` reader - Message Lost Mode Select"]
170pub type MLM_R = crate::BitReader<MLM_A>;
171#[doc = "Message Lost Mode Select\n\nValue on reset: 0"]
172#[derive(Clone, Copy, Debug, PartialEq, Eq)]
173pub enum MLM_A {
174    #[doc = "0: Overwrite mode"]
175    _0 = 0,
176    #[doc = "1: Overrun mode"]
177    _1 = 1,
178}
179impl From<MLM_A> for bool {
180    #[inline(always)]
181    fn from(variant: MLM_A) -> Self {
182        variant as u8 != 0
183    }
184}
185impl MLM_R {
186    #[doc = "Get enumerated values variant"]
187    #[inline(always)]
188    pub fn variant(&self) -> MLM_A {
189        match self.bits {
190            false => MLM_A::_0,
191            true => MLM_A::_1,
192        }
193    }
194    #[doc = "Checks if the value of the field is `_0`"]
195    #[inline(always)]
196    pub fn is_0(&self) -> bool {
197        *self == MLM_A::_0
198    }
199    #[doc = "Checks if the value of the field is `_1`"]
200    #[inline(always)]
201    pub fn is_1(&self) -> bool {
202        *self == MLM_A::_1
203    }
204}
205#[doc = "Field `MLM` writer - Message Lost Mode Select"]
206pub type MLM_W<'a, const O: u8> = crate::BitWriter<'a, u16, CTLR_SPEC, MLM_A, O>;
207impl<'a, const O: u8> MLM_W<'a, O> {
208    #[doc = "Overwrite mode"]
209    #[inline(always)]
210    pub fn _0(self) -> &'a mut W {
211        self.variant(MLM_A::_0)
212    }
213    #[doc = "Overrun mode"]
214    #[inline(always)]
215    pub fn _1(self) -> &'a mut W {
216        self.variant(MLM_A::_1)
217    }
218}
219#[doc = "Field `TPM` reader - Transmission Priority Mode Select"]
220pub type TPM_R = crate::BitReader<TPM_A>;
221#[doc = "Transmission Priority Mode Select\n\nValue on reset: 0"]
222#[derive(Clone, Copy, Debug, PartialEq, Eq)]
223pub enum TPM_A {
224    #[doc = "0: ID priority transmit mode"]
225    _0 = 0,
226    #[doc = "1: Mailbox number priority transmit mode"]
227    _1 = 1,
228}
229impl From<TPM_A> for bool {
230    #[inline(always)]
231    fn from(variant: TPM_A) -> Self {
232        variant as u8 != 0
233    }
234}
235impl TPM_R {
236    #[doc = "Get enumerated values variant"]
237    #[inline(always)]
238    pub fn variant(&self) -> TPM_A {
239        match self.bits {
240            false => TPM_A::_0,
241            true => TPM_A::_1,
242        }
243    }
244    #[doc = "Checks if the value of the field is `_0`"]
245    #[inline(always)]
246    pub fn is_0(&self) -> bool {
247        *self == TPM_A::_0
248    }
249    #[doc = "Checks if the value of the field is `_1`"]
250    #[inline(always)]
251    pub fn is_1(&self) -> bool {
252        *self == TPM_A::_1
253    }
254}
255#[doc = "Field `TPM` writer - Transmission Priority Mode Select"]
256pub type TPM_W<'a, const O: u8> = crate::BitWriter<'a, u16, CTLR_SPEC, TPM_A, O>;
257impl<'a, const O: u8> TPM_W<'a, O> {
258    #[doc = "ID priority transmit mode"]
259    #[inline(always)]
260    pub fn _0(self) -> &'a mut W {
261        self.variant(TPM_A::_0)
262    }
263    #[doc = "Mailbox number priority transmit mode"]
264    #[inline(always)]
265    pub fn _1(self) -> &'a mut W {
266        self.variant(TPM_A::_1)
267    }
268}
269#[doc = "Field `TSRC` reader - Time Stamp Counter Reset Command"]
270pub type TSRC_R = crate::BitReader<TSRC_A>;
271#[doc = "Time Stamp Counter Reset Command\n\nValue on reset: 0"]
272#[derive(Clone, Copy, Debug, PartialEq, Eq)]
273pub enum TSRC_A {
274    #[doc = "0: Nothing occurred"]
275    _0 = 0,
276    #[doc = "1: Reset"]
277    _1 = 1,
278}
279impl From<TSRC_A> for bool {
280    #[inline(always)]
281    fn from(variant: TSRC_A) -> Self {
282        variant as u8 != 0
283    }
284}
285impl TSRC_R {
286    #[doc = "Get enumerated values variant"]
287    #[inline(always)]
288    pub fn variant(&self) -> TSRC_A {
289        match self.bits {
290            false => TSRC_A::_0,
291            true => TSRC_A::_1,
292        }
293    }
294    #[doc = "Checks if the value of the field is `_0`"]
295    #[inline(always)]
296    pub fn is_0(&self) -> bool {
297        *self == TSRC_A::_0
298    }
299    #[doc = "Checks if the value of the field is `_1`"]
300    #[inline(always)]
301    pub fn is_1(&self) -> bool {
302        *self == TSRC_A::_1
303    }
304}
305#[doc = "Field `TSRC` writer - Time Stamp Counter Reset Command"]
306pub type TSRC_W<'a, const O: u8> = crate::BitWriter<'a, u16, CTLR_SPEC, TSRC_A, O>;
307impl<'a, const O: u8> TSRC_W<'a, O> {
308    #[doc = "Nothing occurred"]
309    #[inline(always)]
310    pub fn _0(self) -> &'a mut W {
311        self.variant(TSRC_A::_0)
312    }
313    #[doc = "Reset"]
314    #[inline(always)]
315    pub fn _1(self) -> &'a mut W {
316        self.variant(TSRC_A::_1)
317    }
318}
319#[doc = "Field `TSPS` reader - Time Stamp Prescaler Select"]
320pub type TSPS_R = crate::FieldReader<u8, TSPS_A>;
321#[doc = "Time Stamp Prescaler Select\n\nValue on reset: 0"]
322#[derive(Clone, Copy, Debug, PartialEq, Eq)]
323#[repr(u8)]
324pub enum TSPS_A {
325    #[doc = "0: Every bit time"]
326    _00 = 0,
327    #[doc = "1: Every 2-bit time"]
328    _01 = 1,
329    #[doc = "2: Every 4-bit time"]
330    _10 = 2,
331    #[doc = "3: Every 8-bit time"]
332    _11 = 3,
333}
334impl From<TSPS_A> for u8 {
335    #[inline(always)]
336    fn from(variant: TSPS_A) -> Self {
337        variant as _
338    }
339}
340impl TSPS_R {
341    #[doc = "Get enumerated values variant"]
342    #[inline(always)]
343    pub fn variant(&self) -> TSPS_A {
344        match self.bits {
345            0 => TSPS_A::_00,
346            1 => TSPS_A::_01,
347            2 => TSPS_A::_10,
348            3 => TSPS_A::_11,
349            _ => unreachable!(),
350        }
351    }
352    #[doc = "Checks if the value of the field is `_00`"]
353    #[inline(always)]
354    pub fn is_00(&self) -> bool {
355        *self == TSPS_A::_00
356    }
357    #[doc = "Checks if the value of the field is `_01`"]
358    #[inline(always)]
359    pub fn is_01(&self) -> bool {
360        *self == TSPS_A::_01
361    }
362    #[doc = "Checks if the value of the field is `_10`"]
363    #[inline(always)]
364    pub fn is_10(&self) -> bool {
365        *self == TSPS_A::_10
366    }
367    #[doc = "Checks if the value of the field is `_11`"]
368    #[inline(always)]
369    pub fn is_11(&self) -> bool {
370        *self == TSPS_A::_11
371    }
372}
373#[doc = "Field `TSPS` writer - Time Stamp Prescaler Select"]
374pub type TSPS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u16, CTLR_SPEC, u8, TSPS_A, 2, O>;
375impl<'a, const O: u8> TSPS_W<'a, O> {
376    #[doc = "Every bit time"]
377    #[inline(always)]
378    pub fn _00(self) -> &'a mut W {
379        self.variant(TSPS_A::_00)
380    }
381    #[doc = "Every 2-bit time"]
382    #[inline(always)]
383    pub fn _01(self) -> &'a mut W {
384        self.variant(TSPS_A::_01)
385    }
386    #[doc = "Every 4-bit time"]
387    #[inline(always)]
388    pub fn _10(self) -> &'a mut W {
389        self.variant(TSPS_A::_10)
390    }
391    #[doc = "Every 8-bit time"]
392    #[inline(always)]
393    pub fn _11(self) -> &'a mut W {
394        self.variant(TSPS_A::_11)
395    }
396}
397#[doc = "Field `CANM` reader - CAN Mode of Operation Select"]
398pub type CANM_R = crate::FieldReader<u8, CANM_A>;
399#[doc = "CAN Mode of Operation Select\n\nValue on reset: 1"]
400#[derive(Clone, Copy, Debug, PartialEq, Eq)]
401#[repr(u8)]
402pub enum CANM_A {
403    #[doc = "0: CAN operation mode"]
404    _00 = 0,
405    #[doc = "1: CAN reset mode"]
406    _01 = 1,
407    #[doc = "2: CAN halt mode"]
408    _10 = 2,
409    #[doc = "3: CAN reset mode (forcible transition)"]
410    _11 = 3,
411}
412impl From<CANM_A> for u8 {
413    #[inline(always)]
414    fn from(variant: CANM_A) -> Self {
415        variant as _
416    }
417}
418impl CANM_R {
419    #[doc = "Get enumerated values variant"]
420    #[inline(always)]
421    pub fn variant(&self) -> CANM_A {
422        match self.bits {
423            0 => CANM_A::_00,
424            1 => CANM_A::_01,
425            2 => CANM_A::_10,
426            3 => CANM_A::_11,
427            _ => unreachable!(),
428        }
429    }
430    #[doc = "Checks if the value of the field is `_00`"]
431    #[inline(always)]
432    pub fn is_00(&self) -> bool {
433        *self == CANM_A::_00
434    }
435    #[doc = "Checks if the value of the field is `_01`"]
436    #[inline(always)]
437    pub fn is_01(&self) -> bool {
438        *self == CANM_A::_01
439    }
440    #[doc = "Checks if the value of the field is `_10`"]
441    #[inline(always)]
442    pub fn is_10(&self) -> bool {
443        *self == CANM_A::_10
444    }
445    #[doc = "Checks if the value of the field is `_11`"]
446    #[inline(always)]
447    pub fn is_11(&self) -> bool {
448        *self == CANM_A::_11
449    }
450}
451#[doc = "Field `CANM` writer - CAN Mode of Operation Select"]
452pub type CANM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u16, CTLR_SPEC, u8, CANM_A, 2, O>;
453impl<'a, const O: u8> CANM_W<'a, O> {
454    #[doc = "CAN operation mode"]
455    #[inline(always)]
456    pub fn _00(self) -> &'a mut W {
457        self.variant(CANM_A::_00)
458    }
459    #[doc = "CAN reset mode"]
460    #[inline(always)]
461    pub fn _01(self) -> &'a mut W {
462        self.variant(CANM_A::_01)
463    }
464    #[doc = "CAN halt mode"]
465    #[inline(always)]
466    pub fn _10(self) -> &'a mut W {
467        self.variant(CANM_A::_10)
468    }
469    #[doc = "CAN reset mode (forcible transition)"]
470    #[inline(always)]
471    pub fn _11(self) -> &'a mut W {
472        self.variant(CANM_A::_11)
473    }
474}
475#[doc = "Field `SLPM` reader - CAN Sleep Mode"]
476pub type SLPM_R = crate::BitReader<SLPM_A>;
477#[doc = "CAN Sleep Mode\n\nValue on reset: 1"]
478#[derive(Clone, Copy, Debug, PartialEq, Eq)]
479pub enum SLPM_A {
480    #[doc = "0: Other than CAN sleep mode"]
481    _0 = 0,
482    #[doc = "1: CAN sleep mode"]
483    _1 = 1,
484}
485impl From<SLPM_A> for bool {
486    #[inline(always)]
487    fn from(variant: SLPM_A) -> Self {
488        variant as u8 != 0
489    }
490}
491impl SLPM_R {
492    #[doc = "Get enumerated values variant"]
493    #[inline(always)]
494    pub fn variant(&self) -> SLPM_A {
495        match self.bits {
496            false => SLPM_A::_0,
497            true => SLPM_A::_1,
498        }
499    }
500    #[doc = "Checks if the value of the field is `_0`"]
501    #[inline(always)]
502    pub fn is_0(&self) -> bool {
503        *self == SLPM_A::_0
504    }
505    #[doc = "Checks if the value of the field is `_1`"]
506    #[inline(always)]
507    pub fn is_1(&self) -> bool {
508        *self == SLPM_A::_1
509    }
510}
511#[doc = "Field `SLPM` writer - CAN Sleep Mode"]
512pub type SLPM_W<'a, const O: u8> = crate::BitWriter<'a, u16, CTLR_SPEC, SLPM_A, O>;
513impl<'a, const O: u8> SLPM_W<'a, O> {
514    #[doc = "Other than CAN sleep mode"]
515    #[inline(always)]
516    pub fn _0(self) -> &'a mut W {
517        self.variant(SLPM_A::_0)
518    }
519    #[doc = "CAN sleep mode"]
520    #[inline(always)]
521    pub fn _1(self) -> &'a mut W {
522        self.variant(SLPM_A::_1)
523    }
524}
525#[doc = "Field `BOM` reader - Bus-Off Recovery Mode"]
526pub type BOM_R = crate::FieldReader<u8, BOM_A>;
527#[doc = "Bus-Off Recovery Mode\n\nValue on reset: 0"]
528#[derive(Clone, Copy, Debug, PartialEq, Eq)]
529#[repr(u8)]
530pub enum BOM_A {
531    #[doc = "0: Normal mode (ISO11898-1 compliant)"]
532    _00 = 0,
533    #[doc = "1: Entry to CAN halt mode automatically at bus-off entry"]
534    _01 = 1,
535    #[doc = "2: Entry to CAN halt mode automatically at bus-off end"]
536    _10 = 2,
537    #[doc = "3: Entry to CAN halt mode (during bus-off recovery period) by a program request"]
538    _11 = 3,
539}
540impl From<BOM_A> for u8 {
541    #[inline(always)]
542    fn from(variant: BOM_A) -> Self {
543        variant as _
544    }
545}
546impl BOM_R {
547    #[doc = "Get enumerated values variant"]
548    #[inline(always)]
549    pub fn variant(&self) -> BOM_A {
550        match self.bits {
551            0 => BOM_A::_00,
552            1 => BOM_A::_01,
553            2 => BOM_A::_10,
554            3 => BOM_A::_11,
555            _ => unreachable!(),
556        }
557    }
558    #[doc = "Checks if the value of the field is `_00`"]
559    #[inline(always)]
560    pub fn is_00(&self) -> bool {
561        *self == BOM_A::_00
562    }
563    #[doc = "Checks if the value of the field is `_01`"]
564    #[inline(always)]
565    pub fn is_01(&self) -> bool {
566        *self == BOM_A::_01
567    }
568    #[doc = "Checks if the value of the field is `_10`"]
569    #[inline(always)]
570    pub fn is_10(&self) -> bool {
571        *self == BOM_A::_10
572    }
573    #[doc = "Checks if the value of the field is `_11`"]
574    #[inline(always)]
575    pub fn is_11(&self) -> bool {
576        *self == BOM_A::_11
577    }
578}
579#[doc = "Field `BOM` writer - Bus-Off Recovery Mode"]
580pub type BOM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u16, CTLR_SPEC, u8, BOM_A, 2, O>;
581impl<'a, const O: u8> BOM_W<'a, O> {
582    #[doc = "Normal mode (ISO11898-1 compliant)"]
583    #[inline(always)]
584    pub fn _00(self) -> &'a mut W {
585        self.variant(BOM_A::_00)
586    }
587    #[doc = "Entry to CAN halt mode automatically at bus-off entry"]
588    #[inline(always)]
589    pub fn _01(self) -> &'a mut W {
590        self.variant(BOM_A::_01)
591    }
592    #[doc = "Entry to CAN halt mode automatically at bus-off end"]
593    #[inline(always)]
594    pub fn _10(self) -> &'a mut W {
595        self.variant(BOM_A::_10)
596    }
597    #[doc = "Entry to CAN halt mode (during bus-off recovery period) by a program request"]
598    #[inline(always)]
599    pub fn _11(self) -> &'a mut W {
600        self.variant(BOM_A::_11)
601    }
602}
603#[doc = "Field `RBOC` reader - Forcible Return From Bus-Off"]
604pub type RBOC_R = crate::BitReader<RBOC_A>;
605#[doc = "Forcible Return From Bus-Off\n\nValue on reset: 0"]
606#[derive(Clone, Copy, Debug, PartialEq, Eq)]
607pub enum RBOC_A {
608    #[doc = "0: Nothing occurred"]
609    _0 = 0,
610    #[doc = "1: Forcible return from bus-off"]
611    _1 = 1,
612}
613impl From<RBOC_A> for bool {
614    #[inline(always)]
615    fn from(variant: RBOC_A) -> Self {
616        variant as u8 != 0
617    }
618}
619impl RBOC_R {
620    #[doc = "Get enumerated values variant"]
621    #[inline(always)]
622    pub fn variant(&self) -> RBOC_A {
623        match self.bits {
624            false => RBOC_A::_0,
625            true => RBOC_A::_1,
626        }
627    }
628    #[doc = "Checks if the value of the field is `_0`"]
629    #[inline(always)]
630    pub fn is_0(&self) -> bool {
631        *self == RBOC_A::_0
632    }
633    #[doc = "Checks if the value of the field is `_1`"]
634    #[inline(always)]
635    pub fn is_1(&self) -> bool {
636        *self == RBOC_A::_1
637    }
638}
639#[doc = "Field `RBOC` writer - Forcible Return From Bus-Off"]
640pub type RBOC_W<'a, const O: u8> = crate::BitWriter<'a, u16, CTLR_SPEC, RBOC_A, O>;
641impl<'a, const O: u8> RBOC_W<'a, O> {
642    #[doc = "Nothing occurred"]
643    #[inline(always)]
644    pub fn _0(self) -> &'a mut W {
645        self.variant(RBOC_A::_0)
646    }
647    #[doc = "Forcible return from bus-off"]
648    #[inline(always)]
649    pub fn _1(self) -> &'a mut W {
650        self.variant(RBOC_A::_1)
651    }
652}
653impl R {
654    #[doc = "Bit 0 - CAN Mailbox Mode Select"]
655    #[inline(always)]
656    pub fn mbm(&self) -> MBM_R {
657        MBM_R::new((self.bits & 1) != 0)
658    }
659    #[doc = "Bits 1:2 - ID Format Mode Select"]
660    #[inline(always)]
661    pub fn idfm(&self) -> IDFM_R {
662        IDFM_R::new(((self.bits >> 1) & 3) as u8)
663    }
664    #[doc = "Bit 3 - Message Lost Mode Select"]
665    #[inline(always)]
666    pub fn mlm(&self) -> MLM_R {
667        MLM_R::new(((self.bits >> 3) & 1) != 0)
668    }
669    #[doc = "Bit 4 - Transmission Priority Mode Select"]
670    #[inline(always)]
671    pub fn tpm(&self) -> TPM_R {
672        TPM_R::new(((self.bits >> 4) & 1) != 0)
673    }
674    #[doc = "Bit 5 - Time Stamp Counter Reset Command"]
675    #[inline(always)]
676    pub fn tsrc(&self) -> TSRC_R {
677        TSRC_R::new(((self.bits >> 5) & 1) != 0)
678    }
679    #[doc = "Bits 6:7 - Time Stamp Prescaler Select"]
680    #[inline(always)]
681    pub fn tsps(&self) -> TSPS_R {
682        TSPS_R::new(((self.bits >> 6) & 3) as u8)
683    }
684    #[doc = "Bits 8:9 - CAN Mode of Operation Select"]
685    #[inline(always)]
686    pub fn canm(&self) -> CANM_R {
687        CANM_R::new(((self.bits >> 8) & 3) as u8)
688    }
689    #[doc = "Bit 10 - CAN Sleep Mode"]
690    #[inline(always)]
691    pub fn slpm(&self) -> SLPM_R {
692        SLPM_R::new(((self.bits >> 10) & 1) != 0)
693    }
694    #[doc = "Bits 11:12 - Bus-Off Recovery Mode"]
695    #[inline(always)]
696    pub fn bom(&self) -> BOM_R {
697        BOM_R::new(((self.bits >> 11) & 3) as u8)
698    }
699    #[doc = "Bit 13 - Forcible Return From Bus-Off"]
700    #[inline(always)]
701    pub fn rboc(&self) -> RBOC_R {
702        RBOC_R::new(((self.bits >> 13) & 1) != 0)
703    }
704}
705impl W {
706    #[doc = "Bit 0 - CAN Mailbox Mode Select"]
707    #[inline(always)]
708    #[must_use]
709    pub fn mbm(&mut self) -> MBM_W<0> {
710        MBM_W::new(self)
711    }
712    #[doc = "Bits 1:2 - ID Format Mode Select"]
713    #[inline(always)]
714    #[must_use]
715    pub fn idfm(&mut self) -> IDFM_W<1> {
716        IDFM_W::new(self)
717    }
718    #[doc = "Bit 3 - Message Lost Mode Select"]
719    #[inline(always)]
720    #[must_use]
721    pub fn mlm(&mut self) -> MLM_W<3> {
722        MLM_W::new(self)
723    }
724    #[doc = "Bit 4 - Transmission Priority Mode Select"]
725    #[inline(always)]
726    #[must_use]
727    pub fn tpm(&mut self) -> TPM_W<4> {
728        TPM_W::new(self)
729    }
730    #[doc = "Bit 5 - Time Stamp Counter Reset Command"]
731    #[inline(always)]
732    #[must_use]
733    pub fn tsrc(&mut self) -> TSRC_W<5> {
734        TSRC_W::new(self)
735    }
736    #[doc = "Bits 6:7 - Time Stamp Prescaler Select"]
737    #[inline(always)]
738    #[must_use]
739    pub fn tsps(&mut self) -> TSPS_W<6> {
740        TSPS_W::new(self)
741    }
742    #[doc = "Bits 8:9 - CAN Mode of Operation Select"]
743    #[inline(always)]
744    #[must_use]
745    pub fn canm(&mut self) -> CANM_W<8> {
746        CANM_W::new(self)
747    }
748    #[doc = "Bit 10 - CAN Sleep Mode"]
749    #[inline(always)]
750    #[must_use]
751    pub fn slpm(&mut self) -> SLPM_W<10> {
752        SLPM_W::new(self)
753    }
754    #[doc = "Bits 11:12 - Bus-Off Recovery Mode"]
755    #[inline(always)]
756    #[must_use]
757    pub fn bom(&mut self) -> BOM_W<11> {
758        BOM_W::new(self)
759    }
760    #[doc = "Bit 13 - Forcible Return From Bus-Off"]
761    #[inline(always)]
762    #[must_use]
763    pub fn rboc(&mut self) -> RBOC_W<13> {
764        RBOC_W::new(self)
765    }
766    #[doc = "Writes raw bits to the register."]
767    #[inline(always)]
768    pub unsafe fn bits(&mut self, bits: u16) -> &mut Self {
769        self.0.bits(bits);
770        self
771    }
772}
773#[doc = "Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ctlr](index.html) module"]
774pub struct CTLR_SPEC;
775impl crate::RegisterSpec for CTLR_SPEC {
776    type Ux = u16;
777}
778#[doc = "`read()` method returns [ctlr::R](R) reader structure"]
779impl crate::Readable for CTLR_SPEC {
780    type Reader = R;
781}
782#[doc = "`write(|w| ..)` method takes [ctlr::W](W) writer structure"]
783impl crate::Writable for CTLR_SPEC {
784    type Writer = W;
785    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
786    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
787}
788#[doc = "`reset()` method sets CTLR to value 0x0500"]
789impl crate::Resettable for CTLR_SPEC {
790    const RESET_VALUE: Self::Ux = 0x0500;
791}