bl61x_pac/uart/
receive_config.rs

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