bl808_pac/uart/
receive_config.rs

1#[doc = "Register `receive_config` reader"]
2pub struct R(crate::R<RECEIVE_CONFIG_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<RECEIVE_CONFIG_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<RECEIVE_CONFIG_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<RECEIVE_CONFIG_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `receive_config` writer"]
17pub struct W(crate::W<RECEIVE_CONFIG_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<RECEIVE_CONFIG_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<RECEIVE_CONFIG_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<RECEIVE_CONFIG_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `function` reader - Enable receive function"]
38pub type FUNCTION_R = crate::BitReader<FUNCTION_A>;
39#[doc = "Enable receive function\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum FUNCTION_A {
42    #[doc = "1: Enable UART receive function signal"]
43    ENABLE = 1,
44    #[doc = "0: Disable UART receive function signal"]
45    DISABLE = 0,
46}
47impl From<FUNCTION_A> for bool {
48    #[inline(always)]
49    fn from(variant: FUNCTION_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl FUNCTION_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> FUNCTION_A {
57        match self.bits {
58            true => FUNCTION_A::ENABLE,
59            false => FUNCTION_A::DISABLE,
60        }
61    }
62    #[doc = "Checks if the value of the field is `ENABLE`"]
63    #[inline(always)]
64    pub fn is_enable(&self) -> bool {
65        *self == FUNCTION_A::ENABLE
66    }
67    #[doc = "Checks if the value of the field is `DISABLE`"]
68    #[inline(always)]
69    pub fn is_disable(&self) -> bool {
70        *self == FUNCTION_A::DISABLE
71    }
72}
73#[doc = "Field `function` writer - Enable receive function"]
74pub type FUNCTION_W<'a, const O: u8> =
75    crate::BitWriter<'a, u32, RECEIVE_CONFIG_SPEC, FUNCTION_A, O>;
76impl<'a, const O: u8> FUNCTION_W<'a, O> {
77    #[doc = "Enable UART receive function signal"]
78    #[inline(always)]
79    pub fn enable(self) -> &'a mut W {
80        self.variant(FUNCTION_A::ENABLE)
81    }
82    #[doc = "Disable UART receive function signal"]
83    #[inline(always)]
84    pub fn disable(self) -> &'a mut W {
85        self.variant(FUNCTION_A::DISABLE)
86    }
87}
88#[doc = "Field `auto_baudrate` reader - Enable receive auto baudrate detection"]
89pub type AUTO_BAUDRATE_R = crate::BitReader<AUTO_BAUDRATE_A>;
90#[doc = "Enable receive auto baudrate detection\n\nValue on reset: 0"]
91#[derive(Clone, Copy, Debug, PartialEq, Eq)]
92pub enum AUTO_BAUDRATE_A {
93    #[doc = "1: Enable auto baudrate upon receive"]
94    ENABLE = 1,
95    #[doc = "0: Disable auto baudrate upon receive"]
96    DISABLE = 0,
97}
98impl From<AUTO_BAUDRATE_A> for bool {
99    #[inline(always)]
100    fn from(variant: AUTO_BAUDRATE_A) -> Self {
101        variant as u8 != 0
102    }
103}
104impl AUTO_BAUDRATE_R {
105    #[doc = "Get enumerated values variant"]
106    #[inline(always)]
107    pub fn variant(&self) -> AUTO_BAUDRATE_A {
108        match self.bits {
109            true => AUTO_BAUDRATE_A::ENABLE,
110            false => AUTO_BAUDRATE_A::DISABLE,
111        }
112    }
113    #[doc = "Checks if the value of the field is `ENABLE`"]
114    #[inline(always)]
115    pub fn is_enable(&self) -> bool {
116        *self == AUTO_BAUDRATE_A::ENABLE
117    }
118    #[doc = "Checks if the value of the field is `DISABLE`"]
119    #[inline(always)]
120    pub fn is_disable(&self) -> bool {
121        *self == AUTO_BAUDRATE_A::DISABLE
122    }
123}
124#[doc = "Field `auto_baudrate` writer - Enable receive auto baudrate detection"]
125pub type AUTO_BAUDRATE_W<'a, const O: u8> =
126    crate::BitWriter<'a, u32, RECEIVE_CONFIG_SPEC, AUTO_BAUDRATE_A, O>;
127impl<'a, const O: u8> AUTO_BAUDRATE_W<'a, O> {
128    #[doc = "Enable auto baudrate upon receive"]
129    #[inline(always)]
130    pub fn enable(self) -> &'a mut W {
131        self.variant(AUTO_BAUDRATE_A::ENABLE)
132    }
133    #[doc = "Disable auto baudrate upon receive"]
134    #[inline(always)]
135    pub fn disable(self) -> &'a mut W {
136        self.variant(AUTO_BAUDRATE_A::DISABLE)
137    }
138}
139#[doc = "Field `lin_receive` reader - Local Interconnect Network protocol enable"]
140pub type LIN_RECEIVE_R = crate::BitReader<LIN_RECEIVE_A>;
141#[doc = "Local Interconnect Network protocol enable\n\nValue on reset: 0"]
142#[derive(Clone, Copy, Debug, PartialEq, Eq)]
143pub enum LIN_RECEIVE_A {
144    #[doc = "1: Enable Local Interconnect Network protocol"]
145    ENABLE = 1,
146    #[doc = "0: Disable Local Interconnect Network protocol"]
147    DISABLE = 0,
148}
149impl From<LIN_RECEIVE_A> for bool {
150    #[inline(always)]
151    fn from(variant: LIN_RECEIVE_A) -> Self {
152        variant as u8 != 0
153    }
154}
155impl LIN_RECEIVE_R {
156    #[doc = "Get enumerated values variant"]
157    #[inline(always)]
158    pub fn variant(&self) -> LIN_RECEIVE_A {
159        match self.bits {
160            true => LIN_RECEIVE_A::ENABLE,
161            false => LIN_RECEIVE_A::DISABLE,
162        }
163    }
164    #[doc = "Checks if the value of the field is `ENABLE`"]
165    #[inline(always)]
166    pub fn is_enable(&self) -> bool {
167        *self == LIN_RECEIVE_A::ENABLE
168    }
169    #[doc = "Checks if the value of the field is `DISABLE`"]
170    #[inline(always)]
171    pub fn is_disable(&self) -> bool {
172        *self == LIN_RECEIVE_A::DISABLE
173    }
174}
175#[doc = "Field `lin_receive` writer - Local Interconnect Network protocol enable"]
176pub type LIN_RECEIVE_W<'a, const O: u8> =
177    crate::BitWriter<'a, u32, RECEIVE_CONFIG_SPEC, LIN_RECEIVE_A, O>;
178impl<'a, const O: u8> LIN_RECEIVE_W<'a, O> {
179    #[doc = "Enable Local Interconnect Network protocol"]
180    #[inline(always)]
181    pub fn enable(self) -> &'a mut W {
182        self.variant(LIN_RECEIVE_A::ENABLE)
183    }
184    #[doc = "Disable Local Interconnect Network protocol"]
185    #[inline(always)]
186    pub fn disable(self) -> &'a mut W {
187        self.variant(LIN_RECEIVE_A::DISABLE)
188    }
189}
190#[doc = "Field `parity_enable` reader - Enable receive parity check"]
191pub type PARITY_ENABLE_R = crate::BitReader<PARITY_ENABLE_A>;
192#[doc = "Enable receive parity check\n\nValue on reset: 0"]
193#[derive(Clone, Copy, Debug, PartialEq, Eq)]
194pub enum PARITY_ENABLE_A {
195    #[doc = "1: Enable receive parity check"]
196    ENABLE = 1,
197    #[doc = "0: Disable receive parity check"]
198    DISABLE = 0,
199}
200impl From<PARITY_ENABLE_A> for bool {
201    #[inline(always)]
202    fn from(variant: PARITY_ENABLE_A) -> Self {
203        variant as u8 != 0
204    }
205}
206impl PARITY_ENABLE_R {
207    #[doc = "Get enumerated values variant"]
208    #[inline(always)]
209    pub fn variant(&self) -> PARITY_ENABLE_A {
210        match self.bits {
211            true => PARITY_ENABLE_A::ENABLE,
212            false => PARITY_ENABLE_A::DISABLE,
213        }
214    }
215    #[doc = "Checks if the value of the field is `ENABLE`"]
216    #[inline(always)]
217    pub fn is_enable(&self) -> bool {
218        *self == PARITY_ENABLE_A::ENABLE
219    }
220    #[doc = "Checks if the value of the field is `DISABLE`"]
221    #[inline(always)]
222    pub fn is_disable(&self) -> bool {
223        *self == PARITY_ENABLE_A::DISABLE
224    }
225}
226#[doc = "Field `parity_enable` writer - Enable receive parity check"]
227pub type PARITY_ENABLE_W<'a, const O: u8> =
228    crate::BitWriter<'a, u32, RECEIVE_CONFIG_SPEC, PARITY_ENABLE_A, O>;
229impl<'a, const O: u8> PARITY_ENABLE_W<'a, O> {
230    #[doc = "Enable receive parity check"]
231    #[inline(always)]
232    pub fn enable(self) -> &'a mut W {
233        self.variant(PARITY_ENABLE_A::ENABLE)
234    }
235    #[doc = "Disable receive parity check"]
236    #[inline(always)]
237    pub fn disable(self) -> &'a mut W {
238        self.variant(PARITY_ENABLE_A::DISABLE)
239    }
240}
241#[doc = "Field `parity_mode` reader - Select receive parity mode if enabled"]
242pub type PARITY_MODE_R = crate::BitReader<PARITY_MODE_A>;
243#[doc = "Select receive parity mode if enabled\n\nValue on reset: 0"]
244#[derive(Clone, Copy, Debug, PartialEq, Eq)]
245pub enum PARITY_MODE_A {
246    #[doc = "1: Odd parity if `parity_enable` is set"]
247    ODD = 1,
248    #[doc = "0: Even parity if `parity_enable` is set"]
249    EVEN = 0,
250}
251impl From<PARITY_MODE_A> for bool {
252    #[inline(always)]
253    fn from(variant: PARITY_MODE_A) -> Self {
254        variant as u8 != 0
255    }
256}
257impl PARITY_MODE_R {
258    #[doc = "Get enumerated values variant"]
259    #[inline(always)]
260    pub fn variant(&self) -> PARITY_MODE_A {
261        match self.bits {
262            true => PARITY_MODE_A::ODD,
263            false => PARITY_MODE_A::EVEN,
264        }
265    }
266    #[doc = "Checks if the value of the field is `ODD`"]
267    #[inline(always)]
268    pub fn is_odd(&self) -> bool {
269        *self == PARITY_MODE_A::ODD
270    }
271    #[doc = "Checks if the value of the field is `EVEN`"]
272    #[inline(always)]
273    pub fn is_even(&self) -> bool {
274        *self == PARITY_MODE_A::EVEN
275    }
276}
277#[doc = "Field `parity_mode` writer - Select receive parity mode if enabled"]
278pub type PARITY_MODE_W<'a, const O: u8> =
279    crate::BitWriter<'a, u32, RECEIVE_CONFIG_SPEC, PARITY_MODE_A, O>;
280impl<'a, const O: u8> PARITY_MODE_W<'a, O> {
281    #[doc = "Odd parity if `parity_enable` is set"]
282    #[inline(always)]
283    pub fn odd(self) -> &'a mut W {
284        self.variant(PARITY_MODE_A::ODD)
285    }
286    #[doc = "Even parity if `parity_enable` is set"]
287    #[inline(always)]
288    pub fn even(self) -> &'a mut W {
289        self.variant(PARITY_MODE_A::EVEN)
290    }
291}
292#[doc = "Field `ir_receive` reader - Enable IR receive mode"]
293pub type IR_RECEIVE_R = crate::BitReader<IR_RECEIVE_A>;
294#[doc = "Enable IR receive mode\n\nValue on reset: 0"]
295#[derive(Clone, Copy, Debug, PartialEq, Eq)]
296pub enum IR_RECEIVE_A {
297    #[doc = "1: Enable IR receive mode"]
298    ENABLE = 1,
299    #[doc = "0: Disable IR receive mode"]
300    DISABLE = 0,
301}
302impl From<IR_RECEIVE_A> for bool {
303    #[inline(always)]
304    fn from(variant: IR_RECEIVE_A) -> Self {
305        variant as u8 != 0
306    }
307}
308impl IR_RECEIVE_R {
309    #[doc = "Get enumerated values variant"]
310    #[inline(always)]
311    pub fn variant(&self) -> IR_RECEIVE_A {
312        match self.bits {
313            true => IR_RECEIVE_A::ENABLE,
314            false => IR_RECEIVE_A::DISABLE,
315        }
316    }
317    #[doc = "Checks if the value of the field is `ENABLE`"]
318    #[inline(always)]
319    pub fn is_enable(&self) -> bool {
320        *self == IR_RECEIVE_A::ENABLE
321    }
322    #[doc = "Checks if the value of the field is `DISABLE`"]
323    #[inline(always)]
324    pub fn is_disable(&self) -> bool {
325        *self == IR_RECEIVE_A::DISABLE
326    }
327}
328#[doc = "Field `ir_receive` writer - Enable IR receive mode"]
329pub type IR_RECEIVE_W<'a, const O: u8> =
330    crate::BitWriter<'a, u32, RECEIVE_CONFIG_SPEC, IR_RECEIVE_A, O>;
331impl<'a, const O: u8> IR_RECEIVE_W<'a, O> {
332    #[doc = "Enable IR receive mode"]
333    #[inline(always)]
334    pub fn enable(self) -> &'a mut W {
335        self.variant(IR_RECEIVE_A::ENABLE)
336    }
337    #[doc = "Disable IR receive mode"]
338    #[inline(always)]
339    pub fn disable(self) -> &'a mut W {
340        self.variant(IR_RECEIVE_A::DISABLE)
341    }
342}
343#[doc = "Field `ir_inverse` reader - Inverse receive signal output in IR mode"]
344pub type IR_INVERSE_R = crate::BitReader<IR_INVERSE_A>;
345#[doc = "Inverse receive signal output in IR mode\n\nValue on reset: 0"]
346#[derive(Clone, Copy, Debug, PartialEq, Eq)]
347pub enum IR_INVERSE_A {
348    #[doc = "1: Inverse receive input in IR mode"]
349    INVERSE = 1,
350    #[doc = "0: Don't inverse receive input in IR mode"]
351    NO_INVERSE = 0,
352}
353impl From<IR_INVERSE_A> for bool {
354    #[inline(always)]
355    fn from(variant: IR_INVERSE_A) -> Self {
356        variant as u8 != 0
357    }
358}
359impl IR_INVERSE_R {
360    #[doc = "Get enumerated values variant"]
361    #[inline(always)]
362    pub fn variant(&self) -> IR_INVERSE_A {
363        match self.bits {
364            true => IR_INVERSE_A::INVERSE,
365            false => IR_INVERSE_A::NO_INVERSE,
366        }
367    }
368    #[doc = "Checks if the value of the field is `INVERSE`"]
369    #[inline(always)]
370    pub fn is_inverse(&self) -> bool {
371        *self == IR_INVERSE_A::INVERSE
372    }
373    #[doc = "Checks if the value of the field is `NO_INVERSE`"]
374    #[inline(always)]
375    pub fn is_no_inverse(&self) -> bool {
376        *self == IR_INVERSE_A::NO_INVERSE
377    }
378}
379#[doc = "Field `ir_inverse` writer - Inverse receive signal output in IR mode"]
380pub type IR_INVERSE_W<'a, const O: u8> =
381    crate::BitWriter<'a, u32, RECEIVE_CONFIG_SPEC, IR_INVERSE_A, O>;
382impl<'a, const O: u8> IR_INVERSE_W<'a, O> {
383    #[doc = "Inverse receive input in IR mode"]
384    #[inline(always)]
385    pub fn inverse(self) -> &'a mut W {
386        self.variant(IR_INVERSE_A::INVERSE)
387    }
388    #[doc = "Don't inverse receive input in IR mode"]
389    #[inline(always)]
390    pub fn no_inverse(self) -> &'a mut W {
391        self.variant(IR_INVERSE_A::NO_INVERSE)
392    }
393}
394#[doc = "Field `word_length` reader - Bit count for each receive data word"]
395pub type WORD_LENGTH_R = crate::FieldReader<u8, WORD_LENGTH_A>;
396#[doc = "Bit count for each receive data word\n\nValue on reset: 7"]
397#[derive(Clone, Copy, Debug, PartialEq, Eq)]
398#[repr(u8)]
399pub enum WORD_LENGTH_A {
400    #[doc = "4: Each word includes 5 bits"]
401    FIVE = 4,
402    #[doc = "5: Each word includes 6 bits"]
403    SIX = 5,
404    #[doc = "6: Each word includes 7 bits"]
405    SEVEN = 6,
406    #[doc = "7: Each word includes 8 bits"]
407    EIGHT = 7,
408}
409impl From<WORD_LENGTH_A> for u8 {
410    #[inline(always)]
411    fn from(variant: WORD_LENGTH_A) -> Self {
412        variant as _
413    }
414}
415impl WORD_LENGTH_R {
416    #[doc = "Get enumerated values variant"]
417    #[inline(always)]
418    pub fn variant(&self) -> Option<WORD_LENGTH_A> {
419        match self.bits {
420            4 => Some(WORD_LENGTH_A::FIVE),
421            5 => Some(WORD_LENGTH_A::SIX),
422            6 => Some(WORD_LENGTH_A::SEVEN),
423            7 => Some(WORD_LENGTH_A::EIGHT),
424            _ => None,
425        }
426    }
427    #[doc = "Checks if the value of the field is `FIVE`"]
428    #[inline(always)]
429    pub fn is_five(&self) -> bool {
430        *self == WORD_LENGTH_A::FIVE
431    }
432    #[doc = "Checks if the value of the field is `SIX`"]
433    #[inline(always)]
434    pub fn is_six(&self) -> bool {
435        *self == WORD_LENGTH_A::SIX
436    }
437    #[doc = "Checks if the value of the field is `SEVEN`"]
438    #[inline(always)]
439    pub fn is_seven(&self) -> bool {
440        *self == WORD_LENGTH_A::SEVEN
441    }
442    #[doc = "Checks if the value of the field is `EIGHT`"]
443    #[inline(always)]
444    pub fn is_eight(&self) -> bool {
445        *self == WORD_LENGTH_A::EIGHT
446    }
447}
448#[doc = "Field `word_length` writer - Bit count for each receive data word"]
449pub type WORD_LENGTH_W<'a, const O: u8> =
450    crate::FieldWriter<'a, u32, RECEIVE_CONFIG_SPEC, u8, WORD_LENGTH_A, 3, O>;
451impl<'a, const O: u8> WORD_LENGTH_W<'a, O> {
452    #[doc = "Each word includes 5 bits"]
453    #[inline(always)]
454    pub fn five(self) -> &'a mut W {
455        self.variant(WORD_LENGTH_A::FIVE)
456    }
457    #[doc = "Each word includes 6 bits"]
458    #[inline(always)]
459    pub fn six(self) -> &'a mut W {
460        self.variant(WORD_LENGTH_A::SIX)
461    }
462    #[doc = "Each word includes 7 bits"]
463    #[inline(always)]
464    pub fn seven(self) -> &'a mut W {
465        self.variant(WORD_LENGTH_A::SEVEN)
466    }
467    #[doc = "Each word includes 8 bits"]
468    #[inline(always)]
469    pub fn eight(self) -> &'a mut W {
470        self.variant(WORD_LENGTH_A::EIGHT)
471    }
472}
473#[doc = "Field `deglitch_enable` reader - Enable receive de-glitch function"]
474pub type DEGLITCH_ENABLE_R = crate::BitReader<DEGLITCH_ENABLE_A>;
475#[doc = "Enable receive de-glitch function\n\nValue on reset: 0"]
476#[derive(Clone, Copy, Debug, PartialEq, Eq)]
477pub enum DEGLITCH_ENABLE_A {
478    #[doc = "1: Enable de-glitch function upon receive"]
479    ENABLE = 1,
480    #[doc = "0: Disable de-glitch function upon receive"]
481    DISABLE = 0,
482}
483impl From<DEGLITCH_ENABLE_A> for bool {
484    #[inline(always)]
485    fn from(variant: DEGLITCH_ENABLE_A) -> Self {
486        variant as u8 != 0
487    }
488}
489impl DEGLITCH_ENABLE_R {
490    #[doc = "Get enumerated values variant"]
491    #[inline(always)]
492    pub fn variant(&self) -> DEGLITCH_ENABLE_A {
493        match self.bits {
494            true => DEGLITCH_ENABLE_A::ENABLE,
495            false => DEGLITCH_ENABLE_A::DISABLE,
496        }
497    }
498    #[doc = "Checks if the value of the field is `ENABLE`"]
499    #[inline(always)]
500    pub fn is_enable(&self) -> bool {
501        *self == DEGLITCH_ENABLE_A::ENABLE
502    }
503    #[doc = "Checks if the value of the field is `DISABLE`"]
504    #[inline(always)]
505    pub fn is_disable(&self) -> bool {
506        *self == DEGLITCH_ENABLE_A::DISABLE
507    }
508}
509#[doc = "Field `deglitch_enable` writer - Enable receive de-glitch function"]
510pub type DEGLITCH_ENABLE_W<'a, const O: u8> =
511    crate::BitWriter<'a, u32, RECEIVE_CONFIG_SPEC, DEGLITCH_ENABLE_A, O>;
512impl<'a, const O: u8> DEGLITCH_ENABLE_W<'a, O> {
513    #[doc = "Enable de-glitch function upon receive"]
514    #[inline(always)]
515    pub fn enable(self) -> &'a mut W {
516        self.variant(DEGLITCH_ENABLE_A::ENABLE)
517    }
518    #[doc = "Disable de-glitch function upon receive"]
519    #[inline(always)]
520    pub fn disable(self) -> &'a mut W {
521        self.variant(DEGLITCH_ENABLE_A::DISABLE)
522    }
523}
524#[doc = "Field `deglitch_cycle` reader - De-glitch function cycle count"]
525pub type DEGLITCH_CYCLE_R = crate::FieldReader<u8, u8>;
526#[doc = "Field `deglitch_cycle` writer - De-glitch function cycle count"]
527pub type DEGLITCH_CYCLE_W<'a, const O: u8> =
528    crate::FieldWriter<'a, u32, RECEIVE_CONFIG_SPEC, u8, u8, 4, O>;
529#[doc = "Field `transfer_length` reader - Length of words per UART receive transfer"]
530pub type TRANSFER_LENGTH_R = crate::FieldReader<u16, u16>;
531#[doc = "Field `transfer_length` writer - Length of words per UART receive transfer"]
532pub type TRANSFER_LENGTH_W<'a, const O: u8> =
533    crate::FieldWriter<'a, u32, RECEIVE_CONFIG_SPEC, u16, u16, 16, O>;
534impl R {
535    #[doc = "Bit 0 - Enable receive function"]
536    #[inline(always)]
537    pub fn function(&self) -> FUNCTION_R {
538        FUNCTION_R::new((self.bits & 1) != 0)
539    }
540    #[doc = "Bit 1 - Enable receive auto baudrate detection"]
541    #[inline(always)]
542    pub fn auto_baudrate(&self) -> AUTO_BAUDRATE_R {
543        AUTO_BAUDRATE_R::new(((self.bits >> 1) & 1) != 0)
544    }
545    #[doc = "Bit 3 - Local Interconnect Network protocol enable"]
546    #[inline(always)]
547    pub fn lin_receive(&self) -> LIN_RECEIVE_R {
548        LIN_RECEIVE_R::new(((self.bits >> 3) & 1) != 0)
549    }
550    #[doc = "Bit 4 - Enable receive parity check"]
551    #[inline(always)]
552    pub fn parity_enable(&self) -> PARITY_ENABLE_R {
553        PARITY_ENABLE_R::new(((self.bits >> 4) & 1) != 0)
554    }
555    #[doc = "Bit 5 - Select receive parity mode if enabled"]
556    #[inline(always)]
557    pub fn parity_mode(&self) -> PARITY_MODE_R {
558        PARITY_MODE_R::new(((self.bits >> 5) & 1) != 0)
559    }
560    #[doc = "Bit 6 - Enable IR receive mode"]
561    #[inline(always)]
562    pub fn ir_receive(&self) -> IR_RECEIVE_R {
563        IR_RECEIVE_R::new(((self.bits >> 6) & 1) != 0)
564    }
565    #[doc = "Bit 7 - Inverse receive signal output in IR mode"]
566    #[inline(always)]
567    pub fn ir_inverse(&self) -> IR_INVERSE_R {
568        IR_INVERSE_R::new(((self.bits >> 7) & 1) != 0)
569    }
570    #[doc = "Bits 8:10 - Bit count for each receive data word"]
571    #[inline(always)]
572    pub fn word_length(&self) -> WORD_LENGTH_R {
573        WORD_LENGTH_R::new(((self.bits >> 8) & 7) as u8)
574    }
575    #[doc = "Bit 11 - Enable receive de-glitch function"]
576    #[inline(always)]
577    pub fn deglitch_enable(&self) -> DEGLITCH_ENABLE_R {
578        DEGLITCH_ENABLE_R::new(((self.bits >> 11) & 1) != 0)
579    }
580    #[doc = "Bits 12:15 - De-glitch function cycle count"]
581    #[inline(always)]
582    pub fn deglitch_cycle(&self) -> DEGLITCH_CYCLE_R {
583        DEGLITCH_CYCLE_R::new(((self.bits >> 12) & 0x0f) as u8)
584    }
585    #[doc = "Bits 16:31 - Length of words per UART receive transfer"]
586    #[inline(always)]
587    pub fn transfer_length(&self) -> TRANSFER_LENGTH_R {
588        TRANSFER_LENGTH_R::new(((self.bits >> 16) & 0xffff) as u16)
589    }
590}
591impl W {
592    #[doc = "Bit 0 - Enable receive function"]
593    #[inline(always)]
594    pub fn function(&mut self) -> FUNCTION_W<0> {
595        FUNCTION_W::new(self)
596    }
597    #[doc = "Bit 1 - Enable receive auto baudrate detection"]
598    #[inline(always)]
599    pub fn auto_baudrate(&mut self) -> AUTO_BAUDRATE_W<1> {
600        AUTO_BAUDRATE_W::new(self)
601    }
602    #[doc = "Bit 3 - Local Interconnect Network protocol enable"]
603    #[inline(always)]
604    pub fn lin_receive(&mut self) -> LIN_RECEIVE_W<3> {
605        LIN_RECEIVE_W::new(self)
606    }
607    #[doc = "Bit 4 - Enable receive parity check"]
608    #[inline(always)]
609    pub fn parity_enable(&mut self) -> PARITY_ENABLE_W<4> {
610        PARITY_ENABLE_W::new(self)
611    }
612    #[doc = "Bit 5 - Select receive parity mode if enabled"]
613    #[inline(always)]
614    pub fn parity_mode(&mut self) -> PARITY_MODE_W<5> {
615        PARITY_MODE_W::new(self)
616    }
617    #[doc = "Bit 6 - Enable IR receive mode"]
618    #[inline(always)]
619    pub fn ir_receive(&mut self) -> IR_RECEIVE_W<6> {
620        IR_RECEIVE_W::new(self)
621    }
622    #[doc = "Bit 7 - Inverse receive signal output in IR mode"]
623    #[inline(always)]
624    pub fn ir_inverse(&mut self) -> IR_INVERSE_W<7> {
625        IR_INVERSE_W::new(self)
626    }
627    #[doc = "Bits 8:10 - Bit count for each receive data word"]
628    #[inline(always)]
629    pub fn word_length(&mut self) -> WORD_LENGTH_W<8> {
630        WORD_LENGTH_W::new(self)
631    }
632    #[doc = "Bit 11 - Enable receive de-glitch function"]
633    #[inline(always)]
634    pub fn deglitch_enable(&mut self) -> DEGLITCH_ENABLE_W<11> {
635        DEGLITCH_ENABLE_W::new(self)
636    }
637    #[doc = "Bits 12:15 - De-glitch function cycle count"]
638    #[inline(always)]
639    pub fn deglitch_cycle(&mut self) -> DEGLITCH_CYCLE_W<12> {
640        DEGLITCH_CYCLE_W::new(self)
641    }
642    #[doc = "Bits 16:31 - Length of words per UART receive transfer"]
643    #[inline(always)]
644    pub fn transfer_length(&mut self) -> TRANSFER_LENGTH_W<16> {
645        TRANSFER_LENGTH_W::new(self)
646    }
647    #[doc = "Writes raw bits to the register."]
648    #[inline(always)]
649    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
650        self.0.bits(bits);
651        self
652    }
653}
654#[doc = "Receive configuration 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 [receive_config](index.html) module"]
655pub struct RECEIVE_CONFIG_SPEC;
656impl crate::RegisterSpec for RECEIVE_CONFIG_SPEC {
657    type Ux = u32;
658}
659#[doc = "`read()` method returns [receive_config::R](R) reader structure"]
660impl crate::Readable for RECEIVE_CONFIG_SPEC {
661    type Reader = R;
662}
663#[doc = "`write(|w| ..)` method takes [receive_config::W](W) writer structure"]
664impl crate::Writable for RECEIVE_CONFIG_SPEC {
665    type Writer = W;
666}
667#[doc = "`reset()` method sets receive_config to value 0x0700"]
668impl crate::Resettable for RECEIVE_CONFIG_SPEC {
669    #[inline(always)]
670    fn reset_value() -> Self::Ux {
671        0x0700
672    }
673}