s32k144w_pac/can1/
ctrl1.rs

1#[doc = "Register `CTRL1` reader"]
2pub struct R(crate::R<CTRL1_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CTRL1_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CTRL1_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CTRL1_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CTRL1` writer"]
17pub struct W(crate::W<CTRL1_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CTRL1_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<CTRL1_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CTRL1_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `PROPSEG` reader - Propagation Segment"]
38pub struct PROPSEG_R(crate::FieldReader<u8, u8>);
39impl PROPSEG_R {
40    #[inline(always)]
41    pub(crate) fn new(bits: u8) -> Self {
42        PROPSEG_R(crate::FieldReader::new(bits))
43    }
44}
45impl core::ops::Deref for PROPSEG_R {
46    type Target = crate::FieldReader<u8, u8>;
47    #[inline(always)]
48    fn deref(&self) -> &Self::Target {
49        &self.0
50    }
51}
52#[doc = "Field `PROPSEG` writer - Propagation Segment"]
53pub struct PROPSEG_W<'a> {
54    w: &'a mut W,
55}
56impl<'a> PROPSEG_W<'a> {
57    #[doc = r"Writes raw bits to the field"]
58    #[inline(always)]
59    pub unsafe fn bits(self, value: u8) -> &'a mut W {
60        self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07);
61        self.w
62    }
63}
64#[doc = "Listen-Only Mode\n\nValue on reset: 0"]
65#[derive(Clone, Copy, Debug, PartialEq)]
66pub enum LOM_A {
67    #[doc = "0: Listen-Only mode is deactivated."]
68    LISTEN_ONLY_MODE_DISABLED = 0,
69    #[doc = "1: FlexCAN module operates in Listen-Only mode."]
70    LISTEN_ONLY_MODE_ENABLED = 1,
71}
72impl From<LOM_A> for bool {
73    #[inline(always)]
74    fn from(variant: LOM_A) -> Self {
75        variant as u8 != 0
76    }
77}
78#[doc = "Field `LOM` reader - Listen-Only Mode"]
79pub struct LOM_R(crate::FieldReader<bool, LOM_A>);
80impl LOM_R {
81    #[inline(always)]
82    pub(crate) fn new(bits: bool) -> Self {
83        LOM_R(crate::FieldReader::new(bits))
84    }
85    #[doc = r"Get enumerated values variant"]
86    #[inline(always)]
87    pub fn variant(&self) -> LOM_A {
88        match self.bits {
89            false => LOM_A::LISTEN_ONLY_MODE_DISABLED,
90            true => LOM_A::LISTEN_ONLY_MODE_ENABLED,
91        }
92    }
93    #[doc = "Checks if the value of the field is `LISTEN_ONLY_MODE_DISABLED`"]
94    #[inline(always)]
95    pub fn is_listen_only_mode_disabled(&self) -> bool {
96        **self == LOM_A::LISTEN_ONLY_MODE_DISABLED
97    }
98    #[doc = "Checks if the value of the field is `LISTEN_ONLY_MODE_ENABLED`"]
99    #[inline(always)]
100    pub fn is_listen_only_mode_enabled(&self) -> bool {
101        **self == LOM_A::LISTEN_ONLY_MODE_ENABLED
102    }
103}
104impl core::ops::Deref for LOM_R {
105    type Target = crate::FieldReader<bool, LOM_A>;
106    #[inline(always)]
107    fn deref(&self) -> &Self::Target {
108        &self.0
109    }
110}
111#[doc = "Field `LOM` writer - Listen-Only Mode"]
112pub struct LOM_W<'a> {
113    w: &'a mut W,
114}
115impl<'a> LOM_W<'a> {
116    #[doc = r"Writes `variant` to the field"]
117    #[inline(always)]
118    pub fn variant(self, variant: LOM_A) -> &'a mut W {
119        self.bit(variant.into())
120    }
121    #[doc = "Listen-Only mode is deactivated."]
122    #[inline(always)]
123    pub fn listen_only_mode_disabled(self) -> &'a mut W {
124        self.variant(LOM_A::LISTEN_ONLY_MODE_DISABLED)
125    }
126    #[doc = "FlexCAN module operates in Listen-Only mode."]
127    #[inline(always)]
128    pub fn listen_only_mode_enabled(self) -> &'a mut W {
129        self.variant(LOM_A::LISTEN_ONLY_MODE_ENABLED)
130    }
131    #[doc = r"Sets the field bit"]
132    #[inline(always)]
133    pub fn set_bit(self) -> &'a mut W {
134        self.bit(true)
135    }
136    #[doc = r"Clears the field bit"]
137    #[inline(always)]
138    pub fn clear_bit(self) -> &'a mut W {
139        self.bit(false)
140    }
141    #[doc = r"Writes raw bits to the field"]
142    #[inline(always)]
143    pub fn bit(self, value: bool) -> &'a mut W {
144        self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
145        self.w
146    }
147}
148#[doc = "Lowest Buffer Transmitted First\n\nValue on reset: 0"]
149#[derive(Clone, Copy, Debug, PartialEq)]
150pub enum LBUF_A {
151    #[doc = "0: Buffer with highest priority is transmitted first."]
152    HIGHEST_BUFFER_FIRST = 0,
153    #[doc = "1: Lowest number buffer is transmitted first."]
154    LOWEST_BUFFER_FIRST = 1,
155}
156impl From<LBUF_A> for bool {
157    #[inline(always)]
158    fn from(variant: LBUF_A) -> Self {
159        variant as u8 != 0
160    }
161}
162#[doc = "Field `LBUF` reader - Lowest Buffer Transmitted First"]
163pub struct LBUF_R(crate::FieldReader<bool, LBUF_A>);
164impl LBUF_R {
165    #[inline(always)]
166    pub(crate) fn new(bits: bool) -> Self {
167        LBUF_R(crate::FieldReader::new(bits))
168    }
169    #[doc = r"Get enumerated values variant"]
170    #[inline(always)]
171    pub fn variant(&self) -> LBUF_A {
172        match self.bits {
173            false => LBUF_A::HIGHEST_BUFFER_FIRST,
174            true => LBUF_A::LOWEST_BUFFER_FIRST,
175        }
176    }
177    #[doc = "Checks if the value of the field is `HIGHEST_BUFFER_FIRST`"]
178    #[inline(always)]
179    pub fn is_highest_buffer_first(&self) -> bool {
180        **self == LBUF_A::HIGHEST_BUFFER_FIRST
181    }
182    #[doc = "Checks if the value of the field is `LOWEST_BUFFER_FIRST`"]
183    #[inline(always)]
184    pub fn is_lowest_buffer_first(&self) -> bool {
185        **self == LBUF_A::LOWEST_BUFFER_FIRST
186    }
187}
188impl core::ops::Deref for LBUF_R {
189    type Target = crate::FieldReader<bool, LBUF_A>;
190    #[inline(always)]
191    fn deref(&self) -> &Self::Target {
192        &self.0
193    }
194}
195#[doc = "Field `LBUF` writer - Lowest Buffer Transmitted First"]
196pub struct LBUF_W<'a> {
197    w: &'a mut W,
198}
199impl<'a> LBUF_W<'a> {
200    #[doc = r"Writes `variant` to the field"]
201    #[inline(always)]
202    pub fn variant(self, variant: LBUF_A) -> &'a mut W {
203        self.bit(variant.into())
204    }
205    #[doc = "Buffer with highest priority is transmitted first."]
206    #[inline(always)]
207    pub fn highest_buffer_first(self) -> &'a mut W {
208        self.variant(LBUF_A::HIGHEST_BUFFER_FIRST)
209    }
210    #[doc = "Lowest number buffer is transmitted first."]
211    #[inline(always)]
212    pub fn lowest_buffer_first(self) -> &'a mut W {
213        self.variant(LBUF_A::LOWEST_BUFFER_FIRST)
214    }
215    #[doc = r"Sets the field bit"]
216    #[inline(always)]
217    pub fn set_bit(self) -> &'a mut W {
218        self.bit(true)
219    }
220    #[doc = r"Clears the field bit"]
221    #[inline(always)]
222    pub fn clear_bit(self) -> &'a mut W {
223        self.bit(false)
224    }
225    #[doc = r"Writes raw bits to the field"]
226    #[inline(always)]
227    pub fn bit(self, value: bool) -> &'a mut W {
228        self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
229        self.w
230    }
231}
232#[doc = "Timer Sync\n\nValue on reset: 0"]
233#[derive(Clone, Copy, Debug, PartialEq)]
234pub enum TSYN_A {
235    #[doc = "0: Timer sync feature disabled"]
236    TIMER_SYNC_DISABLED = 0,
237    #[doc = "1: Timer sync feature enabled"]
238    TIMER_SYNC_ENABLED = 1,
239}
240impl From<TSYN_A> for bool {
241    #[inline(always)]
242    fn from(variant: TSYN_A) -> Self {
243        variant as u8 != 0
244    }
245}
246#[doc = "Field `TSYN` reader - Timer Sync"]
247pub struct TSYN_R(crate::FieldReader<bool, TSYN_A>);
248impl TSYN_R {
249    #[inline(always)]
250    pub(crate) fn new(bits: bool) -> Self {
251        TSYN_R(crate::FieldReader::new(bits))
252    }
253    #[doc = r"Get enumerated values variant"]
254    #[inline(always)]
255    pub fn variant(&self) -> TSYN_A {
256        match self.bits {
257            false => TSYN_A::TIMER_SYNC_DISABLED,
258            true => TSYN_A::TIMER_SYNC_ENABLED,
259        }
260    }
261    #[doc = "Checks if the value of the field is `TIMER_SYNC_DISABLED`"]
262    #[inline(always)]
263    pub fn is_timer_sync_disabled(&self) -> bool {
264        **self == TSYN_A::TIMER_SYNC_DISABLED
265    }
266    #[doc = "Checks if the value of the field is `TIMER_SYNC_ENABLED`"]
267    #[inline(always)]
268    pub fn is_timer_sync_enabled(&self) -> bool {
269        **self == TSYN_A::TIMER_SYNC_ENABLED
270    }
271}
272impl core::ops::Deref for TSYN_R {
273    type Target = crate::FieldReader<bool, TSYN_A>;
274    #[inline(always)]
275    fn deref(&self) -> &Self::Target {
276        &self.0
277    }
278}
279#[doc = "Field `TSYN` writer - Timer Sync"]
280pub struct TSYN_W<'a> {
281    w: &'a mut W,
282}
283impl<'a> TSYN_W<'a> {
284    #[doc = r"Writes `variant` to the field"]
285    #[inline(always)]
286    pub fn variant(self, variant: TSYN_A) -> &'a mut W {
287        self.bit(variant.into())
288    }
289    #[doc = "Timer sync feature disabled"]
290    #[inline(always)]
291    pub fn timer_sync_disabled(self) -> &'a mut W {
292        self.variant(TSYN_A::TIMER_SYNC_DISABLED)
293    }
294    #[doc = "Timer sync feature enabled"]
295    #[inline(always)]
296    pub fn timer_sync_enabled(self) -> &'a mut W {
297        self.variant(TSYN_A::TIMER_SYNC_ENABLED)
298    }
299    #[doc = r"Sets the field bit"]
300    #[inline(always)]
301    pub fn set_bit(self) -> &'a mut W {
302        self.bit(true)
303    }
304    #[doc = r"Clears the field bit"]
305    #[inline(always)]
306    pub fn clear_bit(self) -> &'a mut W {
307        self.bit(false)
308    }
309    #[doc = r"Writes raw bits to the field"]
310    #[inline(always)]
311    pub fn bit(self, value: bool) -> &'a mut W {
312        self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5);
313        self.w
314    }
315}
316#[doc = "Bus Off Recovery\n\nValue on reset: 0"]
317#[derive(Clone, Copy, Debug, PartialEq)]
318pub enum BOFFREC_A {
319    #[doc = "0: Automatic recovering from Bus Off state enabled."]
320    AUTO_RECOVER_ENABLED = 0,
321    #[doc = "1: Automatic recovering from Bus Off state disabled."]
322    AUTO_RECOVER_DISABLED = 1,
323}
324impl From<BOFFREC_A> for bool {
325    #[inline(always)]
326    fn from(variant: BOFFREC_A) -> Self {
327        variant as u8 != 0
328    }
329}
330#[doc = "Field `BOFFREC` reader - Bus Off Recovery"]
331pub struct BOFFREC_R(crate::FieldReader<bool, BOFFREC_A>);
332impl BOFFREC_R {
333    #[inline(always)]
334    pub(crate) fn new(bits: bool) -> Self {
335        BOFFREC_R(crate::FieldReader::new(bits))
336    }
337    #[doc = r"Get enumerated values variant"]
338    #[inline(always)]
339    pub fn variant(&self) -> BOFFREC_A {
340        match self.bits {
341            false => BOFFREC_A::AUTO_RECOVER_ENABLED,
342            true => BOFFREC_A::AUTO_RECOVER_DISABLED,
343        }
344    }
345    #[doc = "Checks if the value of the field is `AUTO_RECOVER_ENABLED`"]
346    #[inline(always)]
347    pub fn is_auto_recover_enabled(&self) -> bool {
348        **self == BOFFREC_A::AUTO_RECOVER_ENABLED
349    }
350    #[doc = "Checks if the value of the field is `AUTO_RECOVER_DISABLED`"]
351    #[inline(always)]
352    pub fn is_auto_recover_disabled(&self) -> bool {
353        **self == BOFFREC_A::AUTO_RECOVER_DISABLED
354    }
355}
356impl core::ops::Deref for BOFFREC_R {
357    type Target = crate::FieldReader<bool, BOFFREC_A>;
358    #[inline(always)]
359    fn deref(&self) -> &Self::Target {
360        &self.0
361    }
362}
363#[doc = "Field `BOFFREC` writer - Bus Off Recovery"]
364pub struct BOFFREC_W<'a> {
365    w: &'a mut W,
366}
367impl<'a> BOFFREC_W<'a> {
368    #[doc = r"Writes `variant` to the field"]
369    #[inline(always)]
370    pub fn variant(self, variant: BOFFREC_A) -> &'a mut W {
371        self.bit(variant.into())
372    }
373    #[doc = "Automatic recovering from Bus Off state enabled."]
374    #[inline(always)]
375    pub fn auto_recover_enabled(self) -> &'a mut W {
376        self.variant(BOFFREC_A::AUTO_RECOVER_ENABLED)
377    }
378    #[doc = "Automatic recovering from Bus Off state disabled."]
379    #[inline(always)]
380    pub fn auto_recover_disabled(self) -> &'a mut W {
381        self.variant(BOFFREC_A::AUTO_RECOVER_DISABLED)
382    }
383    #[doc = r"Sets the field bit"]
384    #[inline(always)]
385    pub fn set_bit(self) -> &'a mut W {
386        self.bit(true)
387    }
388    #[doc = r"Clears the field bit"]
389    #[inline(always)]
390    pub fn clear_bit(self) -> &'a mut W {
391        self.bit(false)
392    }
393    #[doc = r"Writes raw bits to the field"]
394    #[inline(always)]
395    pub fn bit(self, value: bool) -> &'a mut W {
396        self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6);
397        self.w
398    }
399}
400#[doc = "CAN Bit Sampling\n\nValue on reset: 0"]
401#[derive(Clone, Copy, Debug, PartialEq)]
402pub enum SMP_A {
403    #[doc = "0: Just one sample is used to determine the bit value."]
404    ONE_SAMPLE = 0,
405    #[doc = "1: Three samples are used to determine the value of the received bit: the regular one (sample point) and two preceding samples; a majority rule is used."]
406    THREE_SAMPLE = 1,
407}
408impl From<SMP_A> for bool {
409    #[inline(always)]
410    fn from(variant: SMP_A) -> Self {
411        variant as u8 != 0
412    }
413}
414#[doc = "Field `SMP` reader - CAN Bit Sampling"]
415pub struct SMP_R(crate::FieldReader<bool, SMP_A>);
416impl SMP_R {
417    #[inline(always)]
418    pub(crate) fn new(bits: bool) -> Self {
419        SMP_R(crate::FieldReader::new(bits))
420    }
421    #[doc = r"Get enumerated values variant"]
422    #[inline(always)]
423    pub fn variant(&self) -> SMP_A {
424        match self.bits {
425            false => SMP_A::ONE_SAMPLE,
426            true => SMP_A::THREE_SAMPLE,
427        }
428    }
429    #[doc = "Checks if the value of the field is `ONE_SAMPLE`"]
430    #[inline(always)]
431    pub fn is_one_sample(&self) -> bool {
432        **self == SMP_A::ONE_SAMPLE
433    }
434    #[doc = "Checks if the value of the field is `THREE_SAMPLE`"]
435    #[inline(always)]
436    pub fn is_three_sample(&self) -> bool {
437        **self == SMP_A::THREE_SAMPLE
438    }
439}
440impl core::ops::Deref for SMP_R {
441    type Target = crate::FieldReader<bool, SMP_A>;
442    #[inline(always)]
443    fn deref(&self) -> &Self::Target {
444        &self.0
445    }
446}
447#[doc = "Field `SMP` writer - CAN Bit Sampling"]
448pub struct SMP_W<'a> {
449    w: &'a mut W,
450}
451impl<'a> SMP_W<'a> {
452    #[doc = r"Writes `variant` to the field"]
453    #[inline(always)]
454    pub fn variant(self, variant: SMP_A) -> &'a mut W {
455        self.bit(variant.into())
456    }
457    #[doc = "Just one sample is used to determine the bit value."]
458    #[inline(always)]
459    pub fn one_sample(self) -> &'a mut W {
460        self.variant(SMP_A::ONE_SAMPLE)
461    }
462    #[doc = "Three samples are used to determine the value of the received bit: the regular one (sample point) and two preceding samples; a majority rule is used."]
463    #[inline(always)]
464    pub fn three_sample(self) -> &'a mut W {
465        self.variant(SMP_A::THREE_SAMPLE)
466    }
467    #[doc = r"Sets the field bit"]
468    #[inline(always)]
469    pub fn set_bit(self) -> &'a mut W {
470        self.bit(true)
471    }
472    #[doc = r"Clears the field bit"]
473    #[inline(always)]
474    pub fn clear_bit(self) -> &'a mut W {
475        self.bit(false)
476    }
477    #[doc = r"Writes raw bits to the field"]
478    #[inline(always)]
479    pub fn bit(self, value: bool) -> &'a mut W {
480        self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7);
481        self.w
482    }
483}
484#[doc = "Rx Warning Interrupt Mask\n\nValue on reset: 0"]
485#[derive(Clone, Copy, Debug, PartialEq)]
486pub enum RWRNMSK_A {
487    #[doc = "0: Rx Warning interrupt disabled."]
488    RX_WARNING_INT_DISABLED = 0,
489    #[doc = "1: Rx Warning interrupt enabled."]
490    RX_WARNING_INT_ENABLED = 1,
491}
492impl From<RWRNMSK_A> for bool {
493    #[inline(always)]
494    fn from(variant: RWRNMSK_A) -> Self {
495        variant as u8 != 0
496    }
497}
498#[doc = "Field `RWRNMSK` reader - Rx Warning Interrupt Mask"]
499pub struct RWRNMSK_R(crate::FieldReader<bool, RWRNMSK_A>);
500impl RWRNMSK_R {
501    #[inline(always)]
502    pub(crate) fn new(bits: bool) -> Self {
503        RWRNMSK_R(crate::FieldReader::new(bits))
504    }
505    #[doc = r"Get enumerated values variant"]
506    #[inline(always)]
507    pub fn variant(&self) -> RWRNMSK_A {
508        match self.bits {
509            false => RWRNMSK_A::RX_WARNING_INT_DISABLED,
510            true => RWRNMSK_A::RX_WARNING_INT_ENABLED,
511        }
512    }
513    #[doc = "Checks if the value of the field is `RX_WARNING_INT_DISABLED`"]
514    #[inline(always)]
515    pub fn is_rx_warning_int_disabled(&self) -> bool {
516        **self == RWRNMSK_A::RX_WARNING_INT_DISABLED
517    }
518    #[doc = "Checks if the value of the field is `RX_WARNING_INT_ENABLED`"]
519    #[inline(always)]
520    pub fn is_rx_warning_int_enabled(&self) -> bool {
521        **self == RWRNMSK_A::RX_WARNING_INT_ENABLED
522    }
523}
524impl core::ops::Deref for RWRNMSK_R {
525    type Target = crate::FieldReader<bool, RWRNMSK_A>;
526    #[inline(always)]
527    fn deref(&self) -> &Self::Target {
528        &self.0
529    }
530}
531#[doc = "Field `RWRNMSK` writer - Rx Warning Interrupt Mask"]
532pub struct RWRNMSK_W<'a> {
533    w: &'a mut W,
534}
535impl<'a> RWRNMSK_W<'a> {
536    #[doc = r"Writes `variant` to the field"]
537    #[inline(always)]
538    pub fn variant(self, variant: RWRNMSK_A) -> &'a mut W {
539        self.bit(variant.into())
540    }
541    #[doc = "Rx Warning interrupt disabled."]
542    #[inline(always)]
543    pub fn rx_warning_int_disabled(self) -> &'a mut W {
544        self.variant(RWRNMSK_A::RX_WARNING_INT_DISABLED)
545    }
546    #[doc = "Rx Warning interrupt enabled."]
547    #[inline(always)]
548    pub fn rx_warning_int_enabled(self) -> &'a mut W {
549        self.variant(RWRNMSK_A::RX_WARNING_INT_ENABLED)
550    }
551    #[doc = r"Sets the field bit"]
552    #[inline(always)]
553    pub fn set_bit(self) -> &'a mut W {
554        self.bit(true)
555    }
556    #[doc = r"Clears the field bit"]
557    #[inline(always)]
558    pub fn clear_bit(self) -> &'a mut W {
559        self.bit(false)
560    }
561    #[doc = r"Writes raw bits to the field"]
562    #[inline(always)]
563    pub fn bit(self, value: bool) -> &'a mut W {
564        self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10);
565        self.w
566    }
567}
568#[doc = "Tx Warning Interrupt Mask\n\nValue on reset: 0"]
569#[derive(Clone, Copy, Debug, PartialEq)]
570pub enum TWRNMSK_A {
571    #[doc = "0: Tx Warning interrupt disabled."]
572    TX_WARNING_INT_DISABLED = 0,
573    #[doc = "1: Tx Warning interrupt enabled."]
574    TX_WARNING_INT_ENABLED = 1,
575}
576impl From<TWRNMSK_A> for bool {
577    #[inline(always)]
578    fn from(variant: TWRNMSK_A) -> Self {
579        variant as u8 != 0
580    }
581}
582#[doc = "Field `TWRNMSK` reader - Tx Warning Interrupt Mask"]
583pub struct TWRNMSK_R(crate::FieldReader<bool, TWRNMSK_A>);
584impl TWRNMSK_R {
585    #[inline(always)]
586    pub(crate) fn new(bits: bool) -> Self {
587        TWRNMSK_R(crate::FieldReader::new(bits))
588    }
589    #[doc = r"Get enumerated values variant"]
590    #[inline(always)]
591    pub fn variant(&self) -> TWRNMSK_A {
592        match self.bits {
593            false => TWRNMSK_A::TX_WARNING_INT_DISABLED,
594            true => TWRNMSK_A::TX_WARNING_INT_ENABLED,
595        }
596    }
597    #[doc = "Checks if the value of the field is `TX_WARNING_INT_DISABLED`"]
598    #[inline(always)]
599    pub fn is_tx_warning_int_disabled(&self) -> bool {
600        **self == TWRNMSK_A::TX_WARNING_INT_DISABLED
601    }
602    #[doc = "Checks if the value of the field is `TX_WARNING_INT_ENABLED`"]
603    #[inline(always)]
604    pub fn is_tx_warning_int_enabled(&self) -> bool {
605        **self == TWRNMSK_A::TX_WARNING_INT_ENABLED
606    }
607}
608impl core::ops::Deref for TWRNMSK_R {
609    type Target = crate::FieldReader<bool, TWRNMSK_A>;
610    #[inline(always)]
611    fn deref(&self) -> &Self::Target {
612        &self.0
613    }
614}
615#[doc = "Field `TWRNMSK` writer - Tx Warning Interrupt Mask"]
616pub struct TWRNMSK_W<'a> {
617    w: &'a mut W,
618}
619impl<'a> TWRNMSK_W<'a> {
620    #[doc = r"Writes `variant` to the field"]
621    #[inline(always)]
622    pub fn variant(self, variant: TWRNMSK_A) -> &'a mut W {
623        self.bit(variant.into())
624    }
625    #[doc = "Tx Warning interrupt disabled."]
626    #[inline(always)]
627    pub fn tx_warning_int_disabled(self) -> &'a mut W {
628        self.variant(TWRNMSK_A::TX_WARNING_INT_DISABLED)
629    }
630    #[doc = "Tx Warning interrupt enabled."]
631    #[inline(always)]
632    pub fn tx_warning_int_enabled(self) -> &'a mut W {
633        self.variant(TWRNMSK_A::TX_WARNING_INT_ENABLED)
634    }
635    #[doc = r"Sets the field bit"]
636    #[inline(always)]
637    pub fn set_bit(self) -> &'a mut W {
638        self.bit(true)
639    }
640    #[doc = r"Clears the field bit"]
641    #[inline(always)]
642    pub fn clear_bit(self) -> &'a mut W {
643        self.bit(false)
644    }
645    #[doc = r"Writes raw bits to the field"]
646    #[inline(always)]
647    pub fn bit(self, value: bool) -> &'a mut W {
648        self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11);
649        self.w
650    }
651}
652#[doc = "Loop Back Mode\n\nValue on reset: 0"]
653#[derive(Clone, Copy, Debug, PartialEq)]
654pub enum LPB_A {
655    #[doc = "0: Loop Back disabled."]
656    LOOPBACK_DISABLED = 0,
657    #[doc = "1: Loop Back enabled."]
658    LOOPBACK_ENABLED = 1,
659}
660impl From<LPB_A> for bool {
661    #[inline(always)]
662    fn from(variant: LPB_A) -> Self {
663        variant as u8 != 0
664    }
665}
666#[doc = "Field `LPB` reader - Loop Back Mode"]
667pub struct LPB_R(crate::FieldReader<bool, LPB_A>);
668impl LPB_R {
669    #[inline(always)]
670    pub(crate) fn new(bits: bool) -> Self {
671        LPB_R(crate::FieldReader::new(bits))
672    }
673    #[doc = r"Get enumerated values variant"]
674    #[inline(always)]
675    pub fn variant(&self) -> LPB_A {
676        match self.bits {
677            false => LPB_A::LOOPBACK_DISABLED,
678            true => LPB_A::LOOPBACK_ENABLED,
679        }
680    }
681    #[doc = "Checks if the value of the field is `LOOPBACK_DISABLED`"]
682    #[inline(always)]
683    pub fn is_loopback_disabled(&self) -> bool {
684        **self == LPB_A::LOOPBACK_DISABLED
685    }
686    #[doc = "Checks if the value of the field is `LOOPBACK_ENABLED`"]
687    #[inline(always)]
688    pub fn is_loopback_enabled(&self) -> bool {
689        **self == LPB_A::LOOPBACK_ENABLED
690    }
691}
692impl core::ops::Deref for LPB_R {
693    type Target = crate::FieldReader<bool, LPB_A>;
694    #[inline(always)]
695    fn deref(&self) -> &Self::Target {
696        &self.0
697    }
698}
699#[doc = "Field `LPB` writer - Loop Back Mode"]
700pub struct LPB_W<'a> {
701    w: &'a mut W,
702}
703impl<'a> LPB_W<'a> {
704    #[doc = r"Writes `variant` to the field"]
705    #[inline(always)]
706    pub fn variant(self, variant: LPB_A) -> &'a mut W {
707        self.bit(variant.into())
708    }
709    #[doc = "Loop Back disabled."]
710    #[inline(always)]
711    pub fn loopback_disabled(self) -> &'a mut W {
712        self.variant(LPB_A::LOOPBACK_DISABLED)
713    }
714    #[doc = "Loop Back enabled."]
715    #[inline(always)]
716    pub fn loopback_enabled(self) -> &'a mut W {
717        self.variant(LPB_A::LOOPBACK_ENABLED)
718    }
719    #[doc = r"Sets the field bit"]
720    #[inline(always)]
721    pub fn set_bit(self) -> &'a mut W {
722        self.bit(true)
723    }
724    #[doc = r"Clears the field bit"]
725    #[inline(always)]
726    pub fn clear_bit(self) -> &'a mut W {
727        self.bit(false)
728    }
729    #[doc = r"Writes raw bits to the field"]
730    #[inline(always)]
731    pub fn bit(self, value: bool) -> &'a mut W {
732        self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12);
733        self.w
734    }
735}
736#[doc = "CAN Engine Clock Source\n\nValue on reset: 0"]
737#[derive(Clone, Copy, Debug, PartialEq)]
738pub enum CLKSRC_A {
739    #[doc = "0: The CAN engine clock source is the oscillator clock. Under this condition, the oscillator clock frequency must be lower than the bus clock."]
740    OSCILLATOR_CLOCK = 0,
741    #[doc = "1: The CAN engine clock source is the peripheral clock."]
742    PERIPHERAL_CLOCK = 1,
743}
744impl From<CLKSRC_A> for bool {
745    #[inline(always)]
746    fn from(variant: CLKSRC_A) -> Self {
747        variant as u8 != 0
748    }
749}
750#[doc = "Field `CLKSRC` reader - CAN Engine Clock Source"]
751pub struct CLKSRC_R(crate::FieldReader<bool, CLKSRC_A>);
752impl CLKSRC_R {
753    #[inline(always)]
754    pub(crate) fn new(bits: bool) -> Self {
755        CLKSRC_R(crate::FieldReader::new(bits))
756    }
757    #[doc = r"Get enumerated values variant"]
758    #[inline(always)]
759    pub fn variant(&self) -> CLKSRC_A {
760        match self.bits {
761            false => CLKSRC_A::OSCILLATOR_CLOCK,
762            true => CLKSRC_A::PERIPHERAL_CLOCK,
763        }
764    }
765    #[doc = "Checks if the value of the field is `OSCILLATOR_CLOCK`"]
766    #[inline(always)]
767    pub fn is_oscillator_clock(&self) -> bool {
768        **self == CLKSRC_A::OSCILLATOR_CLOCK
769    }
770    #[doc = "Checks if the value of the field is `PERIPHERAL_CLOCK`"]
771    #[inline(always)]
772    pub fn is_peripheral_clock(&self) -> bool {
773        **self == CLKSRC_A::PERIPHERAL_CLOCK
774    }
775}
776impl core::ops::Deref for CLKSRC_R {
777    type Target = crate::FieldReader<bool, CLKSRC_A>;
778    #[inline(always)]
779    fn deref(&self) -> &Self::Target {
780        &self.0
781    }
782}
783#[doc = "Field `CLKSRC` writer - CAN Engine Clock Source"]
784pub struct CLKSRC_W<'a> {
785    w: &'a mut W,
786}
787impl<'a> CLKSRC_W<'a> {
788    #[doc = r"Writes `variant` to the field"]
789    #[inline(always)]
790    pub fn variant(self, variant: CLKSRC_A) -> &'a mut W {
791        self.bit(variant.into())
792    }
793    #[doc = "The CAN engine clock source is the oscillator clock. Under this condition, the oscillator clock frequency must be lower than the bus clock."]
794    #[inline(always)]
795    pub fn oscillator_clock(self) -> &'a mut W {
796        self.variant(CLKSRC_A::OSCILLATOR_CLOCK)
797    }
798    #[doc = "The CAN engine clock source is the peripheral clock."]
799    #[inline(always)]
800    pub fn peripheral_clock(self) -> &'a mut W {
801        self.variant(CLKSRC_A::PERIPHERAL_CLOCK)
802    }
803    #[doc = r"Sets the field bit"]
804    #[inline(always)]
805    pub fn set_bit(self) -> &'a mut W {
806        self.bit(true)
807    }
808    #[doc = r"Clears the field bit"]
809    #[inline(always)]
810    pub fn clear_bit(self) -> &'a mut W {
811        self.bit(false)
812    }
813    #[doc = r"Writes raw bits to the field"]
814    #[inline(always)]
815    pub fn bit(self, value: bool) -> &'a mut W {
816        self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13);
817        self.w
818    }
819}
820#[doc = "Error Interrupt Mask\n\nValue on reset: 0"]
821#[derive(Clone, Copy, Debug, PartialEq)]
822pub enum ERRMSK_A {
823    #[doc = "0: Error interrupt disabled."]
824    ERROR_INT_DISABLED = 0,
825    #[doc = "1: Error interrupt enabled."]
826    ERROR_INT_ENABLED = 1,
827}
828impl From<ERRMSK_A> for bool {
829    #[inline(always)]
830    fn from(variant: ERRMSK_A) -> Self {
831        variant as u8 != 0
832    }
833}
834#[doc = "Field `ERRMSK` reader - Error Interrupt Mask"]
835pub struct ERRMSK_R(crate::FieldReader<bool, ERRMSK_A>);
836impl ERRMSK_R {
837    #[inline(always)]
838    pub(crate) fn new(bits: bool) -> Self {
839        ERRMSK_R(crate::FieldReader::new(bits))
840    }
841    #[doc = r"Get enumerated values variant"]
842    #[inline(always)]
843    pub fn variant(&self) -> ERRMSK_A {
844        match self.bits {
845            false => ERRMSK_A::ERROR_INT_DISABLED,
846            true => ERRMSK_A::ERROR_INT_ENABLED,
847        }
848    }
849    #[doc = "Checks if the value of the field is `ERROR_INT_DISABLED`"]
850    #[inline(always)]
851    pub fn is_error_int_disabled(&self) -> bool {
852        **self == ERRMSK_A::ERROR_INT_DISABLED
853    }
854    #[doc = "Checks if the value of the field is `ERROR_INT_ENABLED`"]
855    #[inline(always)]
856    pub fn is_error_int_enabled(&self) -> bool {
857        **self == ERRMSK_A::ERROR_INT_ENABLED
858    }
859}
860impl core::ops::Deref for ERRMSK_R {
861    type Target = crate::FieldReader<bool, ERRMSK_A>;
862    #[inline(always)]
863    fn deref(&self) -> &Self::Target {
864        &self.0
865    }
866}
867#[doc = "Field `ERRMSK` writer - Error Interrupt Mask"]
868pub struct ERRMSK_W<'a> {
869    w: &'a mut W,
870}
871impl<'a> ERRMSK_W<'a> {
872    #[doc = r"Writes `variant` to the field"]
873    #[inline(always)]
874    pub fn variant(self, variant: ERRMSK_A) -> &'a mut W {
875        self.bit(variant.into())
876    }
877    #[doc = "Error interrupt disabled."]
878    #[inline(always)]
879    pub fn error_int_disabled(self) -> &'a mut W {
880        self.variant(ERRMSK_A::ERROR_INT_DISABLED)
881    }
882    #[doc = "Error interrupt enabled."]
883    #[inline(always)]
884    pub fn error_int_enabled(self) -> &'a mut W {
885        self.variant(ERRMSK_A::ERROR_INT_ENABLED)
886    }
887    #[doc = r"Sets the field bit"]
888    #[inline(always)]
889    pub fn set_bit(self) -> &'a mut W {
890        self.bit(true)
891    }
892    #[doc = r"Clears the field bit"]
893    #[inline(always)]
894    pub fn clear_bit(self) -> &'a mut W {
895        self.bit(false)
896    }
897    #[doc = r"Writes raw bits to the field"]
898    #[inline(always)]
899    pub fn bit(self, value: bool) -> &'a mut W {
900        self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14);
901        self.w
902    }
903}
904#[doc = "Bus Off Interrupt Mask\n\nValue on reset: 0"]
905#[derive(Clone, Copy, Debug, PartialEq)]
906pub enum BOFFMSK_A {
907    #[doc = "0: Bus Off interrupt disabled."]
908    BUS_OFF_INT_DISABLED = 0,
909    #[doc = "1: Bus Off interrupt enabled."]
910    BUS_OFF_INT_ENABLED = 1,
911}
912impl From<BOFFMSK_A> for bool {
913    #[inline(always)]
914    fn from(variant: BOFFMSK_A) -> Self {
915        variant as u8 != 0
916    }
917}
918#[doc = "Field `BOFFMSK` reader - Bus Off Interrupt Mask"]
919pub struct BOFFMSK_R(crate::FieldReader<bool, BOFFMSK_A>);
920impl BOFFMSK_R {
921    #[inline(always)]
922    pub(crate) fn new(bits: bool) -> Self {
923        BOFFMSK_R(crate::FieldReader::new(bits))
924    }
925    #[doc = r"Get enumerated values variant"]
926    #[inline(always)]
927    pub fn variant(&self) -> BOFFMSK_A {
928        match self.bits {
929            false => BOFFMSK_A::BUS_OFF_INT_DISABLED,
930            true => BOFFMSK_A::BUS_OFF_INT_ENABLED,
931        }
932    }
933    #[doc = "Checks if the value of the field is `BUS_OFF_INT_DISABLED`"]
934    #[inline(always)]
935    pub fn is_bus_off_int_disabled(&self) -> bool {
936        **self == BOFFMSK_A::BUS_OFF_INT_DISABLED
937    }
938    #[doc = "Checks if the value of the field is `BUS_OFF_INT_ENABLED`"]
939    #[inline(always)]
940    pub fn is_bus_off_int_enabled(&self) -> bool {
941        **self == BOFFMSK_A::BUS_OFF_INT_ENABLED
942    }
943}
944impl core::ops::Deref for BOFFMSK_R {
945    type Target = crate::FieldReader<bool, BOFFMSK_A>;
946    #[inline(always)]
947    fn deref(&self) -> &Self::Target {
948        &self.0
949    }
950}
951#[doc = "Field `BOFFMSK` writer - Bus Off Interrupt Mask"]
952pub struct BOFFMSK_W<'a> {
953    w: &'a mut W,
954}
955impl<'a> BOFFMSK_W<'a> {
956    #[doc = r"Writes `variant` to the field"]
957    #[inline(always)]
958    pub fn variant(self, variant: BOFFMSK_A) -> &'a mut W {
959        self.bit(variant.into())
960    }
961    #[doc = "Bus Off interrupt disabled."]
962    #[inline(always)]
963    pub fn bus_off_int_disabled(self) -> &'a mut W {
964        self.variant(BOFFMSK_A::BUS_OFF_INT_DISABLED)
965    }
966    #[doc = "Bus Off interrupt enabled."]
967    #[inline(always)]
968    pub fn bus_off_int_enabled(self) -> &'a mut W {
969        self.variant(BOFFMSK_A::BUS_OFF_INT_ENABLED)
970    }
971    #[doc = r"Sets the field bit"]
972    #[inline(always)]
973    pub fn set_bit(self) -> &'a mut W {
974        self.bit(true)
975    }
976    #[doc = r"Clears the field bit"]
977    #[inline(always)]
978    pub fn clear_bit(self) -> &'a mut W {
979        self.bit(false)
980    }
981    #[doc = r"Writes raw bits to the field"]
982    #[inline(always)]
983    pub fn bit(self, value: bool) -> &'a mut W {
984        self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15);
985        self.w
986    }
987}
988#[doc = "Field `PSEG2` reader - Phase Segment 2"]
989pub struct PSEG2_R(crate::FieldReader<u8, u8>);
990impl PSEG2_R {
991    #[inline(always)]
992    pub(crate) fn new(bits: u8) -> Self {
993        PSEG2_R(crate::FieldReader::new(bits))
994    }
995}
996impl core::ops::Deref for PSEG2_R {
997    type Target = crate::FieldReader<u8, u8>;
998    #[inline(always)]
999    fn deref(&self) -> &Self::Target {
1000        &self.0
1001    }
1002}
1003#[doc = "Field `PSEG2` writer - Phase Segment 2"]
1004pub struct PSEG2_W<'a> {
1005    w: &'a mut W,
1006}
1007impl<'a> PSEG2_W<'a> {
1008    #[doc = r"Writes raw bits to the field"]
1009    #[inline(always)]
1010    pub unsafe fn bits(self, value: u8) -> &'a mut W {
1011        self.w.bits = (self.w.bits & !(0x07 << 16)) | ((value as u32 & 0x07) << 16);
1012        self.w
1013    }
1014}
1015#[doc = "Field `PSEG1` reader - Phase Segment 1"]
1016pub struct PSEG1_R(crate::FieldReader<u8, u8>);
1017impl PSEG1_R {
1018    #[inline(always)]
1019    pub(crate) fn new(bits: u8) -> Self {
1020        PSEG1_R(crate::FieldReader::new(bits))
1021    }
1022}
1023impl core::ops::Deref for PSEG1_R {
1024    type Target = crate::FieldReader<u8, u8>;
1025    #[inline(always)]
1026    fn deref(&self) -> &Self::Target {
1027        &self.0
1028    }
1029}
1030#[doc = "Field `PSEG1` writer - Phase Segment 1"]
1031pub struct PSEG1_W<'a> {
1032    w: &'a mut W,
1033}
1034impl<'a> PSEG1_W<'a> {
1035    #[doc = r"Writes raw bits to the field"]
1036    #[inline(always)]
1037    pub unsafe fn bits(self, value: u8) -> &'a mut W {
1038        self.w.bits = (self.w.bits & !(0x07 << 19)) | ((value as u32 & 0x07) << 19);
1039        self.w
1040    }
1041}
1042#[doc = "Field `RJW` reader - Resync Jump Width"]
1043pub struct RJW_R(crate::FieldReader<u8, u8>);
1044impl RJW_R {
1045    #[inline(always)]
1046    pub(crate) fn new(bits: u8) -> Self {
1047        RJW_R(crate::FieldReader::new(bits))
1048    }
1049}
1050impl core::ops::Deref for RJW_R {
1051    type Target = crate::FieldReader<u8, u8>;
1052    #[inline(always)]
1053    fn deref(&self) -> &Self::Target {
1054        &self.0
1055    }
1056}
1057#[doc = "Field `RJW` writer - Resync Jump Width"]
1058pub struct RJW_W<'a> {
1059    w: &'a mut W,
1060}
1061impl<'a> RJW_W<'a> {
1062    #[doc = r"Writes raw bits to the field"]
1063    #[inline(always)]
1064    pub unsafe fn bits(self, value: u8) -> &'a mut W {
1065        self.w.bits = (self.w.bits & !(0x03 << 22)) | ((value as u32 & 0x03) << 22);
1066        self.w
1067    }
1068}
1069#[doc = "Field `PRESDIV` reader - Prescaler Division Factor"]
1070pub struct PRESDIV_R(crate::FieldReader<u8, u8>);
1071impl PRESDIV_R {
1072    #[inline(always)]
1073    pub(crate) fn new(bits: u8) -> Self {
1074        PRESDIV_R(crate::FieldReader::new(bits))
1075    }
1076}
1077impl core::ops::Deref for PRESDIV_R {
1078    type Target = crate::FieldReader<u8, u8>;
1079    #[inline(always)]
1080    fn deref(&self) -> &Self::Target {
1081        &self.0
1082    }
1083}
1084#[doc = "Field `PRESDIV` writer - Prescaler Division Factor"]
1085pub struct PRESDIV_W<'a> {
1086    w: &'a mut W,
1087}
1088impl<'a> PRESDIV_W<'a> {
1089    #[doc = r"Writes raw bits to the field"]
1090    #[inline(always)]
1091    pub unsafe fn bits(self, value: u8) -> &'a mut W {
1092        self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24);
1093        self.w
1094    }
1095}
1096impl R {
1097    #[doc = "Bits 0:2 - Propagation Segment"]
1098    #[inline(always)]
1099    pub fn propseg(&self) -> PROPSEG_R {
1100        PROPSEG_R::new((self.bits & 0x07) as u8)
1101    }
1102    #[doc = "Bit 3 - Listen-Only Mode"]
1103    #[inline(always)]
1104    pub fn lom(&self) -> LOM_R {
1105        LOM_R::new(((self.bits >> 3) & 0x01) != 0)
1106    }
1107    #[doc = "Bit 4 - Lowest Buffer Transmitted First"]
1108    #[inline(always)]
1109    pub fn lbuf(&self) -> LBUF_R {
1110        LBUF_R::new(((self.bits >> 4) & 0x01) != 0)
1111    }
1112    #[doc = "Bit 5 - Timer Sync"]
1113    #[inline(always)]
1114    pub fn tsyn(&self) -> TSYN_R {
1115        TSYN_R::new(((self.bits >> 5) & 0x01) != 0)
1116    }
1117    #[doc = "Bit 6 - Bus Off Recovery"]
1118    #[inline(always)]
1119    pub fn boffrec(&self) -> BOFFREC_R {
1120        BOFFREC_R::new(((self.bits >> 6) & 0x01) != 0)
1121    }
1122    #[doc = "Bit 7 - CAN Bit Sampling"]
1123    #[inline(always)]
1124    pub fn smp(&self) -> SMP_R {
1125        SMP_R::new(((self.bits >> 7) & 0x01) != 0)
1126    }
1127    #[doc = "Bit 10 - Rx Warning Interrupt Mask"]
1128    #[inline(always)]
1129    pub fn rwrnmsk(&self) -> RWRNMSK_R {
1130        RWRNMSK_R::new(((self.bits >> 10) & 0x01) != 0)
1131    }
1132    #[doc = "Bit 11 - Tx Warning Interrupt Mask"]
1133    #[inline(always)]
1134    pub fn twrnmsk(&self) -> TWRNMSK_R {
1135        TWRNMSK_R::new(((self.bits >> 11) & 0x01) != 0)
1136    }
1137    #[doc = "Bit 12 - Loop Back Mode"]
1138    #[inline(always)]
1139    pub fn lpb(&self) -> LPB_R {
1140        LPB_R::new(((self.bits >> 12) & 0x01) != 0)
1141    }
1142    #[doc = "Bit 13 - CAN Engine Clock Source"]
1143    #[inline(always)]
1144    pub fn clksrc(&self) -> CLKSRC_R {
1145        CLKSRC_R::new(((self.bits >> 13) & 0x01) != 0)
1146    }
1147    #[doc = "Bit 14 - Error Interrupt Mask"]
1148    #[inline(always)]
1149    pub fn errmsk(&self) -> ERRMSK_R {
1150        ERRMSK_R::new(((self.bits >> 14) & 0x01) != 0)
1151    }
1152    #[doc = "Bit 15 - Bus Off Interrupt Mask"]
1153    #[inline(always)]
1154    pub fn boffmsk(&self) -> BOFFMSK_R {
1155        BOFFMSK_R::new(((self.bits >> 15) & 0x01) != 0)
1156    }
1157    #[doc = "Bits 16:18 - Phase Segment 2"]
1158    #[inline(always)]
1159    pub fn pseg2(&self) -> PSEG2_R {
1160        PSEG2_R::new(((self.bits >> 16) & 0x07) as u8)
1161    }
1162    #[doc = "Bits 19:21 - Phase Segment 1"]
1163    #[inline(always)]
1164    pub fn pseg1(&self) -> PSEG1_R {
1165        PSEG1_R::new(((self.bits >> 19) & 0x07) as u8)
1166    }
1167    #[doc = "Bits 22:23 - Resync Jump Width"]
1168    #[inline(always)]
1169    pub fn rjw(&self) -> RJW_R {
1170        RJW_R::new(((self.bits >> 22) & 0x03) as u8)
1171    }
1172    #[doc = "Bits 24:31 - Prescaler Division Factor"]
1173    #[inline(always)]
1174    pub fn presdiv(&self) -> PRESDIV_R {
1175        PRESDIV_R::new(((self.bits >> 24) & 0xff) as u8)
1176    }
1177}
1178impl W {
1179    #[doc = "Bits 0:2 - Propagation Segment"]
1180    #[inline(always)]
1181    pub fn propseg(&mut self) -> PROPSEG_W {
1182        PROPSEG_W { w: self }
1183    }
1184    #[doc = "Bit 3 - Listen-Only Mode"]
1185    #[inline(always)]
1186    pub fn lom(&mut self) -> LOM_W {
1187        LOM_W { w: self }
1188    }
1189    #[doc = "Bit 4 - Lowest Buffer Transmitted First"]
1190    #[inline(always)]
1191    pub fn lbuf(&mut self) -> LBUF_W {
1192        LBUF_W { w: self }
1193    }
1194    #[doc = "Bit 5 - Timer Sync"]
1195    #[inline(always)]
1196    pub fn tsyn(&mut self) -> TSYN_W {
1197        TSYN_W { w: self }
1198    }
1199    #[doc = "Bit 6 - Bus Off Recovery"]
1200    #[inline(always)]
1201    pub fn boffrec(&mut self) -> BOFFREC_W {
1202        BOFFREC_W { w: self }
1203    }
1204    #[doc = "Bit 7 - CAN Bit Sampling"]
1205    #[inline(always)]
1206    pub fn smp(&mut self) -> SMP_W {
1207        SMP_W { w: self }
1208    }
1209    #[doc = "Bit 10 - Rx Warning Interrupt Mask"]
1210    #[inline(always)]
1211    pub fn rwrnmsk(&mut self) -> RWRNMSK_W {
1212        RWRNMSK_W { w: self }
1213    }
1214    #[doc = "Bit 11 - Tx Warning Interrupt Mask"]
1215    #[inline(always)]
1216    pub fn twrnmsk(&mut self) -> TWRNMSK_W {
1217        TWRNMSK_W { w: self }
1218    }
1219    #[doc = "Bit 12 - Loop Back Mode"]
1220    #[inline(always)]
1221    pub fn lpb(&mut self) -> LPB_W {
1222        LPB_W { w: self }
1223    }
1224    #[doc = "Bit 13 - CAN Engine Clock Source"]
1225    #[inline(always)]
1226    pub fn clksrc(&mut self) -> CLKSRC_W {
1227        CLKSRC_W { w: self }
1228    }
1229    #[doc = "Bit 14 - Error Interrupt Mask"]
1230    #[inline(always)]
1231    pub fn errmsk(&mut self) -> ERRMSK_W {
1232        ERRMSK_W { w: self }
1233    }
1234    #[doc = "Bit 15 - Bus Off Interrupt Mask"]
1235    #[inline(always)]
1236    pub fn boffmsk(&mut self) -> BOFFMSK_W {
1237        BOFFMSK_W { w: self }
1238    }
1239    #[doc = "Bits 16:18 - Phase Segment 2"]
1240    #[inline(always)]
1241    pub fn pseg2(&mut self) -> PSEG2_W {
1242        PSEG2_W { w: self }
1243    }
1244    #[doc = "Bits 19:21 - Phase Segment 1"]
1245    #[inline(always)]
1246    pub fn pseg1(&mut self) -> PSEG1_W {
1247        PSEG1_W { w: self }
1248    }
1249    #[doc = "Bits 22:23 - Resync Jump Width"]
1250    #[inline(always)]
1251    pub fn rjw(&mut self) -> RJW_W {
1252        RJW_W { w: self }
1253    }
1254    #[doc = "Bits 24:31 - Prescaler Division Factor"]
1255    #[inline(always)]
1256    pub fn presdiv(&mut self) -> PRESDIV_W {
1257        PRESDIV_W { w: self }
1258    }
1259    #[doc = "Writes raw bits to the register."]
1260    #[inline(always)]
1261    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
1262        self.0.bits(bits);
1263        self
1264    }
1265}
1266#[doc = "Control 1 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 [ctrl1](index.html) module"]
1267pub struct CTRL1_SPEC;
1268impl crate::RegisterSpec for CTRL1_SPEC {
1269    type Ux = u32;
1270}
1271#[doc = "`read()` method returns [ctrl1::R](R) reader structure"]
1272impl crate::Readable for CTRL1_SPEC {
1273    type Reader = R;
1274}
1275#[doc = "`write(|w| ..)` method takes [ctrl1::W](W) writer structure"]
1276impl crate::Writable for CTRL1_SPEC {
1277    type Writer = W;
1278}
1279#[doc = "`reset()` method sets CTRL1 to value 0"]
1280impl crate::Resettable for CTRL1_SPEC {
1281    #[inline(always)]
1282    fn reset_value() -> Self::Ux {
1283        0
1284    }
1285}