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