efm32pg22_pac/efm32pg22c200/euart0_s/
cfg0.rs

1#[doc = "Register `CFG0` reader"]
2pub struct R(crate::R<CFG0_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CFG0_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CFG0_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CFG0_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CFG0` writer"]
17pub struct W(crate::W<CFG0_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CFG0_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<CFG0_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CFG0_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `LOOPBK` reader - Loopback Enable"]
38pub type LOOPBK_R = crate::BitReader<LOOPBK_A>;
39#[doc = "Loopback Enable\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum LOOPBK_A {
42    #[doc = "0: The receiver is connected to and receives data from UARTn_RX"]
43    DISABLE = 0,
44    #[doc = "1: The receiver is connected to and receives data from UARTn_TX"]
45    ENABLE = 1,
46}
47impl From<LOOPBK_A> for bool {
48    #[inline(always)]
49    fn from(variant: LOOPBK_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl LOOPBK_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> LOOPBK_A {
57        match self.bits {
58            false => LOOPBK_A::DISABLE,
59            true => LOOPBK_A::ENABLE,
60        }
61    }
62    #[doc = "Checks if the value of the field is `DISABLE`"]
63    #[inline(always)]
64    pub fn is_disable(&self) -> bool {
65        *self == LOOPBK_A::DISABLE
66    }
67    #[doc = "Checks if the value of the field is `ENABLE`"]
68    #[inline(always)]
69    pub fn is_enable(&self) -> bool {
70        *self == LOOPBK_A::ENABLE
71    }
72}
73#[doc = "Field `LOOPBK` writer - Loopback Enable"]
74pub type LOOPBK_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG0_SPEC, LOOPBK_A, O>;
75impl<'a, const O: u8> LOOPBK_W<'a, O> {
76    #[doc = "The receiver is connected to and receives data from UARTn_RX"]
77    #[inline(always)]
78    pub fn disable(self) -> &'a mut W {
79        self.variant(LOOPBK_A::DISABLE)
80    }
81    #[doc = "The receiver is connected to and receives data from UARTn_TX"]
82    #[inline(always)]
83    pub fn enable(self) -> &'a mut W {
84        self.variant(LOOPBK_A::ENABLE)
85    }
86}
87#[doc = "Field `CCEN` reader - Collision Check Enable"]
88pub type CCEN_R = crate::BitReader<CCEN_A>;
89#[doc = "Collision Check Enable\n\nValue on reset: 0"]
90#[derive(Clone, Copy, Debug, PartialEq, Eq)]
91pub enum CCEN_A {
92    #[doc = "0: Collision check is disabled"]
93    DISABLE = 0,
94    #[doc = "1: Collision check is enabled. The receiver must be enabled for the check to be performed"]
95    ENABLE = 1,
96}
97impl From<CCEN_A> for bool {
98    #[inline(always)]
99    fn from(variant: CCEN_A) -> Self {
100        variant as u8 != 0
101    }
102}
103impl CCEN_R {
104    #[doc = "Get enumerated values variant"]
105    #[inline(always)]
106    pub fn variant(&self) -> CCEN_A {
107        match self.bits {
108            false => CCEN_A::DISABLE,
109            true => CCEN_A::ENABLE,
110        }
111    }
112    #[doc = "Checks if the value of the field is `DISABLE`"]
113    #[inline(always)]
114    pub fn is_disable(&self) -> bool {
115        *self == CCEN_A::DISABLE
116    }
117    #[doc = "Checks if the value of the field is `ENABLE`"]
118    #[inline(always)]
119    pub fn is_enable(&self) -> bool {
120        *self == CCEN_A::ENABLE
121    }
122}
123#[doc = "Field `CCEN` writer - Collision Check Enable"]
124pub type CCEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG0_SPEC, CCEN_A, O>;
125impl<'a, const O: u8> CCEN_W<'a, O> {
126    #[doc = "Collision check is disabled"]
127    #[inline(always)]
128    pub fn disable(self) -> &'a mut W {
129        self.variant(CCEN_A::DISABLE)
130    }
131    #[doc = "Collision check is enabled. The receiver must be enabled for the check to be performed"]
132    #[inline(always)]
133    pub fn enable(self) -> &'a mut W {
134        self.variant(CCEN_A::ENABLE)
135    }
136}
137#[doc = "Field `MPM` reader - Multi-Processor Mode"]
138pub type MPM_R = crate::BitReader<MPM_A>;
139#[doc = "Multi-Processor Mode\n\nValue on reset: 0"]
140#[derive(Clone, Copy, Debug, PartialEq, Eq)]
141pub enum MPM_A {
142    #[doc = "0: The 9th bit of incoming frames has no special function"]
143    DISABLE = 0,
144    #[doc = "1: An incoming frame with the 9th bit equal to MPAB will be loaded into the RX FIFO regardless of RXBLOCK and will result in the MPAB interrupt flag being set"]
145    ENABLE = 1,
146}
147impl From<MPM_A> for bool {
148    #[inline(always)]
149    fn from(variant: MPM_A) -> Self {
150        variant as u8 != 0
151    }
152}
153impl MPM_R {
154    #[doc = "Get enumerated values variant"]
155    #[inline(always)]
156    pub fn variant(&self) -> MPM_A {
157        match self.bits {
158            false => MPM_A::DISABLE,
159            true => MPM_A::ENABLE,
160        }
161    }
162    #[doc = "Checks if the value of the field is `DISABLE`"]
163    #[inline(always)]
164    pub fn is_disable(&self) -> bool {
165        *self == MPM_A::DISABLE
166    }
167    #[doc = "Checks if the value of the field is `ENABLE`"]
168    #[inline(always)]
169    pub fn is_enable(&self) -> bool {
170        *self == MPM_A::ENABLE
171    }
172}
173#[doc = "Field `MPM` writer - Multi-Processor Mode"]
174pub type MPM_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG0_SPEC, MPM_A, O>;
175impl<'a, const O: u8> MPM_W<'a, O> {
176    #[doc = "The 9th bit of incoming frames has no special function"]
177    #[inline(always)]
178    pub fn disable(self) -> &'a mut W {
179        self.variant(MPM_A::DISABLE)
180    }
181    #[doc = "An incoming frame with the 9th bit equal to MPAB will be loaded into the RX FIFO regardless of RXBLOCK and will result in the MPAB interrupt flag being set"]
182    #[inline(always)]
183    pub fn enable(self) -> &'a mut W {
184        self.variant(MPM_A::ENABLE)
185    }
186}
187#[doc = "Field `MPAB` reader - Multi-Processor Address-Bit"]
188pub type MPAB_R = crate::BitReader<bool>;
189#[doc = "Field `MPAB` writer - Multi-Processor Address-Bit"]
190pub type MPAB_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG0_SPEC, bool, O>;
191#[doc = "Field `OVS` reader - Oversampling"]
192pub type OVS_R = crate::FieldReader<u8, OVS_A>;
193#[doc = "Oversampling\n\nValue on reset: 0"]
194#[derive(Clone, Copy, Debug, PartialEq, Eq)]
195#[repr(u8)]
196pub enum OVS_A {
197    #[doc = "0: 16X oversampling"]
198    X16 = 0,
199    #[doc = "1: 8X oversampling"]
200    X8 = 1,
201    #[doc = "2: 6X oversampling"]
202    X6 = 2,
203    #[doc = "3: 4X oversampling"]
204    X4 = 3,
205    #[doc = "4: Disable oversampling (for LF operation)"]
206    DISABLE = 4,
207}
208impl From<OVS_A> for u8 {
209    #[inline(always)]
210    fn from(variant: OVS_A) -> Self {
211        variant as _
212    }
213}
214impl OVS_R {
215    #[doc = "Get enumerated values variant"]
216    #[inline(always)]
217    pub fn variant(&self) -> Option<OVS_A> {
218        match self.bits {
219            0 => Some(OVS_A::X16),
220            1 => Some(OVS_A::X8),
221            2 => Some(OVS_A::X6),
222            3 => Some(OVS_A::X4),
223            4 => Some(OVS_A::DISABLE),
224            _ => None,
225        }
226    }
227    #[doc = "Checks if the value of the field is `X16`"]
228    #[inline(always)]
229    pub fn is_x16(&self) -> bool {
230        *self == OVS_A::X16
231    }
232    #[doc = "Checks if the value of the field is `X8`"]
233    #[inline(always)]
234    pub fn is_x8(&self) -> bool {
235        *self == OVS_A::X8
236    }
237    #[doc = "Checks if the value of the field is `X6`"]
238    #[inline(always)]
239    pub fn is_x6(&self) -> bool {
240        *self == OVS_A::X6
241    }
242    #[doc = "Checks if the value of the field is `X4`"]
243    #[inline(always)]
244    pub fn is_x4(&self) -> bool {
245        *self == OVS_A::X4
246    }
247    #[doc = "Checks if the value of the field is `DISABLE`"]
248    #[inline(always)]
249    pub fn is_disable(&self) -> bool {
250        *self == OVS_A::DISABLE
251    }
252}
253#[doc = "Field `OVS` writer - Oversampling"]
254pub type OVS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFG0_SPEC, u8, OVS_A, 3, O>;
255impl<'a, const O: u8> OVS_W<'a, O> {
256    #[doc = "16X oversampling"]
257    #[inline(always)]
258    pub fn x16(self) -> &'a mut W {
259        self.variant(OVS_A::X16)
260    }
261    #[doc = "8X oversampling"]
262    #[inline(always)]
263    pub fn x8(self) -> &'a mut W {
264        self.variant(OVS_A::X8)
265    }
266    #[doc = "6X oversampling"]
267    #[inline(always)]
268    pub fn x6(self) -> &'a mut W {
269        self.variant(OVS_A::X6)
270    }
271    #[doc = "4X oversampling"]
272    #[inline(always)]
273    pub fn x4(self) -> &'a mut W {
274        self.variant(OVS_A::X4)
275    }
276    #[doc = "Disable oversampling (for LF operation)"]
277    #[inline(always)]
278    pub fn disable(self) -> &'a mut W {
279        self.variant(OVS_A::DISABLE)
280    }
281}
282#[doc = "Field `MSBF` reader - Most Significant Bit First"]
283pub type MSBF_R = crate::BitReader<MSBF_A>;
284#[doc = "Most Significant Bit First\n\nValue on reset: 0"]
285#[derive(Clone, Copy, Debug, PartialEq, Eq)]
286pub enum MSBF_A {
287    #[doc = "0: Data is sent with the least significant bit first"]
288    DISABLE = 0,
289    #[doc = "1: Data is sent with the most significant bit first"]
290    ENABLE = 1,
291}
292impl From<MSBF_A> for bool {
293    #[inline(always)]
294    fn from(variant: MSBF_A) -> Self {
295        variant as u8 != 0
296    }
297}
298impl MSBF_R {
299    #[doc = "Get enumerated values variant"]
300    #[inline(always)]
301    pub fn variant(&self) -> MSBF_A {
302        match self.bits {
303            false => MSBF_A::DISABLE,
304            true => MSBF_A::ENABLE,
305        }
306    }
307    #[doc = "Checks if the value of the field is `DISABLE`"]
308    #[inline(always)]
309    pub fn is_disable(&self) -> bool {
310        *self == MSBF_A::DISABLE
311    }
312    #[doc = "Checks if the value of the field is `ENABLE`"]
313    #[inline(always)]
314    pub fn is_enable(&self) -> bool {
315        *self == MSBF_A::ENABLE
316    }
317}
318#[doc = "Field `MSBF` writer - Most Significant Bit First"]
319pub type MSBF_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG0_SPEC, MSBF_A, O>;
320impl<'a, const O: u8> MSBF_W<'a, O> {
321    #[doc = "Data is sent with the least significant bit first"]
322    #[inline(always)]
323    pub fn disable(self) -> &'a mut W {
324        self.variant(MSBF_A::DISABLE)
325    }
326    #[doc = "Data is sent with the most significant bit first"]
327    #[inline(always)]
328    pub fn enable(self) -> &'a mut W {
329        self.variant(MSBF_A::ENABLE)
330    }
331}
332#[doc = "Field `RXINV` reader - Receiver Input Invert"]
333pub type RXINV_R = crate::BitReader<RXINV_A>;
334#[doc = "Receiver Input Invert\n\nValue on reset: 0"]
335#[derive(Clone, Copy, Debug, PartialEq, Eq)]
336pub enum RXINV_A {
337    #[doc = "0: Input is passed directly to the receiver"]
338    DISABLE = 0,
339    #[doc = "1: Input is inverted before it is passed to the receiver"]
340    ENABLE = 1,
341}
342impl From<RXINV_A> for bool {
343    #[inline(always)]
344    fn from(variant: RXINV_A) -> Self {
345        variant as u8 != 0
346    }
347}
348impl RXINV_R {
349    #[doc = "Get enumerated values variant"]
350    #[inline(always)]
351    pub fn variant(&self) -> RXINV_A {
352        match self.bits {
353            false => RXINV_A::DISABLE,
354            true => RXINV_A::ENABLE,
355        }
356    }
357    #[doc = "Checks if the value of the field is `DISABLE`"]
358    #[inline(always)]
359    pub fn is_disable(&self) -> bool {
360        *self == RXINV_A::DISABLE
361    }
362    #[doc = "Checks if the value of the field is `ENABLE`"]
363    #[inline(always)]
364    pub fn is_enable(&self) -> bool {
365        *self == RXINV_A::ENABLE
366    }
367}
368#[doc = "Field `RXINV` writer - Receiver Input Invert"]
369pub type RXINV_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG0_SPEC, RXINV_A, O>;
370impl<'a, const O: u8> RXINV_W<'a, O> {
371    #[doc = "Input is passed directly to the receiver"]
372    #[inline(always)]
373    pub fn disable(self) -> &'a mut W {
374        self.variant(RXINV_A::DISABLE)
375    }
376    #[doc = "Input is inverted before it is passed to the receiver"]
377    #[inline(always)]
378    pub fn enable(self) -> &'a mut W {
379        self.variant(RXINV_A::ENABLE)
380    }
381}
382#[doc = "Field `TXINV` reader - Transmitter output Invert"]
383pub type TXINV_R = crate::BitReader<TXINV_A>;
384#[doc = "Transmitter output Invert\n\nValue on reset: 0"]
385#[derive(Clone, Copy, Debug, PartialEq, Eq)]
386pub enum TXINV_A {
387    #[doc = "0: Output from the transmitter is passed unchanged to UARTn_TX"]
388    DISABLE = 0,
389    #[doc = "1: Output from the transmitter is inverted before it is passed to UARTn_TX"]
390    ENABLE = 1,
391}
392impl From<TXINV_A> for bool {
393    #[inline(always)]
394    fn from(variant: TXINV_A) -> Self {
395        variant as u8 != 0
396    }
397}
398impl TXINV_R {
399    #[doc = "Get enumerated values variant"]
400    #[inline(always)]
401    pub fn variant(&self) -> TXINV_A {
402        match self.bits {
403            false => TXINV_A::DISABLE,
404            true => TXINV_A::ENABLE,
405        }
406    }
407    #[doc = "Checks if the value of the field is `DISABLE`"]
408    #[inline(always)]
409    pub fn is_disable(&self) -> bool {
410        *self == TXINV_A::DISABLE
411    }
412    #[doc = "Checks if the value of the field is `ENABLE`"]
413    #[inline(always)]
414    pub fn is_enable(&self) -> bool {
415        *self == TXINV_A::ENABLE
416    }
417}
418#[doc = "Field `TXINV` writer - Transmitter output Invert"]
419pub type TXINV_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG0_SPEC, TXINV_A, O>;
420impl<'a, const O: u8> TXINV_W<'a, O> {
421    #[doc = "Output from the transmitter is passed unchanged to UARTn_TX"]
422    #[inline(always)]
423    pub fn disable(self) -> &'a mut W {
424        self.variant(TXINV_A::DISABLE)
425    }
426    #[doc = "Output from the transmitter is inverted before it is passed to UARTn_TX"]
427    #[inline(always)]
428    pub fn enable(self) -> &'a mut W {
429        self.variant(TXINV_A::ENABLE)
430    }
431}
432#[doc = "Field `AUTOTRI` reader - Automatic TX Tristate"]
433pub type AUTOTRI_R = crate::BitReader<AUTOTRI_A>;
434#[doc = "Automatic TX Tristate\n\nValue on reset: 0"]
435#[derive(Clone, Copy, Debug, PartialEq, Eq)]
436pub enum AUTOTRI_A {
437    #[doc = "0: The output on UARTn_TX when the transmitter is idle is defined by TXINV"]
438    DISABLE = 0,
439    #[doc = "1: UARTn_TX is tristated whenever the transmitter is idle"]
440    ENABLE = 1,
441}
442impl From<AUTOTRI_A> for bool {
443    #[inline(always)]
444    fn from(variant: AUTOTRI_A) -> Self {
445        variant as u8 != 0
446    }
447}
448impl AUTOTRI_R {
449    #[doc = "Get enumerated values variant"]
450    #[inline(always)]
451    pub fn variant(&self) -> AUTOTRI_A {
452        match self.bits {
453            false => AUTOTRI_A::DISABLE,
454            true => AUTOTRI_A::ENABLE,
455        }
456    }
457    #[doc = "Checks if the value of the field is `DISABLE`"]
458    #[inline(always)]
459    pub fn is_disable(&self) -> bool {
460        *self == AUTOTRI_A::DISABLE
461    }
462    #[doc = "Checks if the value of the field is `ENABLE`"]
463    #[inline(always)]
464    pub fn is_enable(&self) -> bool {
465        *self == AUTOTRI_A::ENABLE
466    }
467}
468#[doc = "Field `AUTOTRI` writer - Automatic TX Tristate"]
469pub type AUTOTRI_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG0_SPEC, AUTOTRI_A, O>;
470impl<'a, const O: u8> AUTOTRI_W<'a, O> {
471    #[doc = "The output on UARTn_TX when the transmitter is idle is defined by TXINV"]
472    #[inline(always)]
473    pub fn disable(self) -> &'a mut W {
474        self.variant(AUTOTRI_A::DISABLE)
475    }
476    #[doc = "UARTn_TX is tristated whenever the transmitter is idle"]
477    #[inline(always)]
478    pub fn enable(self) -> &'a mut W {
479        self.variant(AUTOTRI_A::ENABLE)
480    }
481}
482#[doc = "Field `SKIPPERRF` reader - Skip Parity Error Frames"]
483pub type SKIPPERRF_R = crate::BitReader<bool>;
484#[doc = "Field `SKIPPERRF` writer - Skip Parity Error Frames"]
485pub type SKIPPERRF_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG0_SPEC, bool, O>;
486#[doc = "Field `ERRSDMA` reader - Halt DMA Read On Error"]
487pub type ERRSDMA_R = crate::BitReader<ERRSDMA_A>;
488#[doc = "Halt DMA Read On Error\n\nValue on reset: 0"]
489#[derive(Clone, Copy, Debug, PartialEq, Eq)]
490pub enum ERRSDMA_A {
491    #[doc = "0: Framing and parity errors have no effect on DMA requests from the UART"]
492    DISABLE = 0,
493    #[doc = "1: DMA requests from the UART are blocked while the PERR or FERR interrupt flags are set"]
494    ENABLE = 1,
495}
496impl From<ERRSDMA_A> for bool {
497    #[inline(always)]
498    fn from(variant: ERRSDMA_A) -> Self {
499        variant as u8 != 0
500    }
501}
502impl ERRSDMA_R {
503    #[doc = "Get enumerated values variant"]
504    #[inline(always)]
505    pub fn variant(&self) -> ERRSDMA_A {
506        match self.bits {
507            false => ERRSDMA_A::DISABLE,
508            true => ERRSDMA_A::ENABLE,
509        }
510    }
511    #[doc = "Checks if the value of the field is `DISABLE`"]
512    #[inline(always)]
513    pub fn is_disable(&self) -> bool {
514        *self == ERRSDMA_A::DISABLE
515    }
516    #[doc = "Checks if the value of the field is `ENABLE`"]
517    #[inline(always)]
518    pub fn is_enable(&self) -> bool {
519        *self == ERRSDMA_A::ENABLE
520    }
521}
522#[doc = "Field `ERRSDMA` writer - Halt DMA Read On Error"]
523pub type ERRSDMA_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG0_SPEC, ERRSDMA_A, O>;
524impl<'a, const O: u8> ERRSDMA_W<'a, O> {
525    #[doc = "Framing and parity errors have no effect on DMA requests from the UART"]
526    #[inline(always)]
527    pub fn disable(self) -> &'a mut W {
528        self.variant(ERRSDMA_A::DISABLE)
529    }
530    #[doc = "DMA requests from the UART are blocked while the PERR or FERR interrupt flags are set"]
531    #[inline(always)]
532    pub fn enable(self) -> &'a mut W {
533        self.variant(ERRSDMA_A::ENABLE)
534    }
535}
536#[doc = "Field `ERRSRX` reader - Disable RX On Error"]
537pub type ERRSRX_R = crate::BitReader<ERRSRX_A>;
538#[doc = "Disable RX On Error\n\nValue on reset: 0"]
539#[derive(Clone, Copy, Debug, PartialEq, Eq)]
540pub enum ERRSRX_A {
541    #[doc = "0: Framing and parity errors have no effect on receiver"]
542    DISABLE = 0,
543    #[doc = "1: Framing and parity errors disable the receiver"]
544    ENABLE = 1,
545}
546impl From<ERRSRX_A> for bool {
547    #[inline(always)]
548    fn from(variant: ERRSRX_A) -> Self {
549        variant as u8 != 0
550    }
551}
552impl ERRSRX_R {
553    #[doc = "Get enumerated values variant"]
554    #[inline(always)]
555    pub fn variant(&self) -> ERRSRX_A {
556        match self.bits {
557            false => ERRSRX_A::DISABLE,
558            true => ERRSRX_A::ENABLE,
559        }
560    }
561    #[doc = "Checks if the value of the field is `DISABLE`"]
562    #[inline(always)]
563    pub fn is_disable(&self) -> bool {
564        *self == ERRSRX_A::DISABLE
565    }
566    #[doc = "Checks if the value of the field is `ENABLE`"]
567    #[inline(always)]
568    pub fn is_enable(&self) -> bool {
569        *self == ERRSRX_A::ENABLE
570    }
571}
572#[doc = "Field `ERRSRX` writer - Disable RX On Error"]
573pub type ERRSRX_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG0_SPEC, ERRSRX_A, O>;
574impl<'a, const O: u8> ERRSRX_W<'a, O> {
575    #[doc = "Framing and parity errors have no effect on receiver"]
576    #[inline(always)]
577    pub fn disable(self) -> &'a mut W {
578        self.variant(ERRSRX_A::DISABLE)
579    }
580    #[doc = "Framing and parity errors disable the receiver"]
581    #[inline(always)]
582    pub fn enable(self) -> &'a mut W {
583        self.variant(ERRSRX_A::ENABLE)
584    }
585}
586#[doc = "Field `ERRSTX` reader - Disable TX On Error"]
587pub type ERRSTX_R = crate::BitReader<ERRSTX_A>;
588#[doc = "Disable TX On Error\n\nValue on reset: 0"]
589#[derive(Clone, Copy, Debug, PartialEq, Eq)]
590pub enum ERRSTX_A {
591    #[doc = "0: Received framing and parity errors have no effect on transmitter"]
592    DISABLE = 0,
593    #[doc = "1: Received framing and parity errors disable the transmitter"]
594    ENABLE = 1,
595}
596impl From<ERRSTX_A> for bool {
597    #[inline(always)]
598    fn from(variant: ERRSTX_A) -> Self {
599        variant as u8 != 0
600    }
601}
602impl ERRSTX_R {
603    #[doc = "Get enumerated values variant"]
604    #[inline(always)]
605    pub fn variant(&self) -> ERRSTX_A {
606        match self.bits {
607            false => ERRSTX_A::DISABLE,
608            true => ERRSTX_A::ENABLE,
609        }
610    }
611    #[doc = "Checks if the value of the field is `DISABLE`"]
612    #[inline(always)]
613    pub fn is_disable(&self) -> bool {
614        *self == ERRSTX_A::DISABLE
615    }
616    #[doc = "Checks if the value of the field is `ENABLE`"]
617    #[inline(always)]
618    pub fn is_enable(&self) -> bool {
619        *self == ERRSTX_A::ENABLE
620    }
621}
622#[doc = "Field `ERRSTX` writer - Disable TX On Error"]
623pub type ERRSTX_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG0_SPEC, ERRSTX_A, O>;
624impl<'a, const O: u8> ERRSTX_W<'a, O> {
625    #[doc = "Received framing and parity errors have no effect on transmitter"]
626    #[inline(always)]
627    pub fn disable(self) -> &'a mut W {
628        self.variant(ERRSTX_A::DISABLE)
629    }
630    #[doc = "Received framing and parity errors disable the transmitter"]
631    #[inline(always)]
632    pub fn enable(self) -> &'a mut W {
633        self.variant(ERRSTX_A::ENABLE)
634    }
635}
636#[doc = "Field `MVDIS` reader - Majority Vote Disable"]
637pub type MVDIS_R = crate::BitReader<bool>;
638#[doc = "Field `MVDIS` writer - Majority Vote Disable"]
639pub type MVDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG0_SPEC, bool, O>;
640#[doc = "Field `AUTOBAUDEN` reader - AUTOBAUD detection enable"]
641pub type AUTOBAUDEN_R = crate::BitReader<bool>;
642#[doc = "Field `AUTOBAUDEN` writer - AUTOBAUD detection enable"]
643pub type AUTOBAUDEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG0_SPEC, bool, O>;
644impl R {
645    #[doc = "Bit 1 - Loopback Enable"]
646    #[inline(always)]
647    pub fn loopbk(&self) -> LOOPBK_R {
648        LOOPBK_R::new(((self.bits >> 1) & 1) != 0)
649    }
650    #[doc = "Bit 2 - Collision Check Enable"]
651    #[inline(always)]
652    pub fn ccen(&self) -> CCEN_R {
653        CCEN_R::new(((self.bits >> 2) & 1) != 0)
654    }
655    #[doc = "Bit 3 - Multi-Processor Mode"]
656    #[inline(always)]
657    pub fn mpm(&self) -> MPM_R {
658        MPM_R::new(((self.bits >> 3) & 1) != 0)
659    }
660    #[doc = "Bit 4 - Multi-Processor Address-Bit"]
661    #[inline(always)]
662    pub fn mpab(&self) -> MPAB_R {
663        MPAB_R::new(((self.bits >> 4) & 1) != 0)
664    }
665    #[doc = "Bits 5:7 - Oversampling"]
666    #[inline(always)]
667    pub fn ovs(&self) -> OVS_R {
668        OVS_R::new(((self.bits >> 5) & 7) as u8)
669    }
670    #[doc = "Bit 10 - Most Significant Bit First"]
671    #[inline(always)]
672    pub fn msbf(&self) -> MSBF_R {
673        MSBF_R::new(((self.bits >> 10) & 1) != 0)
674    }
675    #[doc = "Bit 13 - Receiver Input Invert"]
676    #[inline(always)]
677    pub fn rxinv(&self) -> RXINV_R {
678        RXINV_R::new(((self.bits >> 13) & 1) != 0)
679    }
680    #[doc = "Bit 14 - Transmitter output Invert"]
681    #[inline(always)]
682    pub fn txinv(&self) -> TXINV_R {
683        TXINV_R::new(((self.bits >> 14) & 1) != 0)
684    }
685    #[doc = "Bit 17 - Automatic TX Tristate"]
686    #[inline(always)]
687    pub fn autotri(&self) -> AUTOTRI_R {
688        AUTOTRI_R::new(((self.bits >> 17) & 1) != 0)
689    }
690    #[doc = "Bit 20 - Skip Parity Error Frames"]
691    #[inline(always)]
692    pub fn skipperrf(&self) -> SKIPPERRF_R {
693        SKIPPERRF_R::new(((self.bits >> 20) & 1) != 0)
694    }
695    #[doc = "Bit 22 - Halt DMA Read On Error"]
696    #[inline(always)]
697    pub fn errsdma(&self) -> ERRSDMA_R {
698        ERRSDMA_R::new(((self.bits >> 22) & 1) != 0)
699    }
700    #[doc = "Bit 23 - Disable RX On Error"]
701    #[inline(always)]
702    pub fn errsrx(&self) -> ERRSRX_R {
703        ERRSRX_R::new(((self.bits >> 23) & 1) != 0)
704    }
705    #[doc = "Bit 24 - Disable TX On Error"]
706    #[inline(always)]
707    pub fn errstx(&self) -> ERRSTX_R {
708        ERRSTX_R::new(((self.bits >> 24) & 1) != 0)
709    }
710    #[doc = "Bit 30 - Majority Vote Disable"]
711    #[inline(always)]
712    pub fn mvdis(&self) -> MVDIS_R {
713        MVDIS_R::new(((self.bits >> 30) & 1) != 0)
714    }
715    #[doc = "Bit 31 - AUTOBAUD detection enable"]
716    #[inline(always)]
717    pub fn autobauden(&self) -> AUTOBAUDEN_R {
718        AUTOBAUDEN_R::new(((self.bits >> 31) & 1) != 0)
719    }
720}
721impl W {
722    #[doc = "Bit 1 - Loopback Enable"]
723    #[inline(always)]
724    #[must_use]
725    pub fn loopbk(&mut self) -> LOOPBK_W<1> {
726        LOOPBK_W::new(self)
727    }
728    #[doc = "Bit 2 - Collision Check Enable"]
729    #[inline(always)]
730    #[must_use]
731    pub fn ccen(&mut self) -> CCEN_W<2> {
732        CCEN_W::new(self)
733    }
734    #[doc = "Bit 3 - Multi-Processor Mode"]
735    #[inline(always)]
736    #[must_use]
737    pub fn mpm(&mut self) -> MPM_W<3> {
738        MPM_W::new(self)
739    }
740    #[doc = "Bit 4 - Multi-Processor Address-Bit"]
741    #[inline(always)]
742    #[must_use]
743    pub fn mpab(&mut self) -> MPAB_W<4> {
744        MPAB_W::new(self)
745    }
746    #[doc = "Bits 5:7 - Oversampling"]
747    #[inline(always)]
748    #[must_use]
749    pub fn ovs(&mut self) -> OVS_W<5> {
750        OVS_W::new(self)
751    }
752    #[doc = "Bit 10 - Most Significant Bit First"]
753    #[inline(always)]
754    #[must_use]
755    pub fn msbf(&mut self) -> MSBF_W<10> {
756        MSBF_W::new(self)
757    }
758    #[doc = "Bit 13 - Receiver Input Invert"]
759    #[inline(always)]
760    #[must_use]
761    pub fn rxinv(&mut self) -> RXINV_W<13> {
762        RXINV_W::new(self)
763    }
764    #[doc = "Bit 14 - Transmitter output Invert"]
765    #[inline(always)]
766    #[must_use]
767    pub fn txinv(&mut self) -> TXINV_W<14> {
768        TXINV_W::new(self)
769    }
770    #[doc = "Bit 17 - Automatic TX Tristate"]
771    #[inline(always)]
772    #[must_use]
773    pub fn autotri(&mut self) -> AUTOTRI_W<17> {
774        AUTOTRI_W::new(self)
775    }
776    #[doc = "Bit 20 - Skip Parity Error Frames"]
777    #[inline(always)]
778    #[must_use]
779    pub fn skipperrf(&mut self) -> SKIPPERRF_W<20> {
780        SKIPPERRF_W::new(self)
781    }
782    #[doc = "Bit 22 - Halt DMA Read On Error"]
783    #[inline(always)]
784    #[must_use]
785    pub fn errsdma(&mut self) -> ERRSDMA_W<22> {
786        ERRSDMA_W::new(self)
787    }
788    #[doc = "Bit 23 - Disable RX On Error"]
789    #[inline(always)]
790    #[must_use]
791    pub fn errsrx(&mut self) -> ERRSRX_W<23> {
792        ERRSRX_W::new(self)
793    }
794    #[doc = "Bit 24 - Disable TX On Error"]
795    #[inline(always)]
796    #[must_use]
797    pub fn errstx(&mut self) -> ERRSTX_W<24> {
798        ERRSTX_W::new(self)
799    }
800    #[doc = "Bit 30 - Majority Vote Disable"]
801    #[inline(always)]
802    #[must_use]
803    pub fn mvdis(&mut self) -> MVDIS_W<30> {
804        MVDIS_W::new(self)
805    }
806    #[doc = "Bit 31 - AUTOBAUD detection enable"]
807    #[inline(always)]
808    #[must_use]
809    pub fn autobauden(&mut self) -> AUTOBAUDEN_W<31> {
810        AUTOBAUDEN_W::new(self)
811    }
812    #[doc = "Writes raw bits to the register."]
813    #[inline(always)]
814    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
815        self.0.bits(bits);
816        self
817    }
818}
819#[doc = "No Description\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 [cfg0](index.html) module"]
820pub struct CFG0_SPEC;
821impl crate::RegisterSpec for CFG0_SPEC {
822    type Ux = u32;
823}
824#[doc = "`read()` method returns [cfg0::R](R) reader structure"]
825impl crate::Readable for CFG0_SPEC {
826    type Reader = R;
827}
828#[doc = "`write(|w| ..)` method takes [cfg0::W](W) writer structure"]
829impl crate::Writable for CFG0_SPEC {
830    type Writer = W;
831    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
832    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
833}
834#[doc = "`reset()` method sets CFG0 to value 0"]
835impl crate::Resettable for CFG0_SPEC {
836    const RESET_VALUE: Self::Ux = 0;
837}