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