stm32l4x2_pac/usart1/
cr1.rs

1#[doc = r" Value read from the register"]
2pub struct R {
3    bits: u32,
4}
5#[doc = r" Value to write to the register"]
6pub struct W {
7    bits: u32,
8}
9impl super::CR1 {
10    #[doc = r" Modifies the contents of the register"]
11    #[inline]
12    pub fn modify<F>(&self, f: F)
13    where
14        for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
15    {
16        let bits = self.register.get();
17        let r = R { bits: bits };
18        let mut w = W { bits: bits };
19        f(&r, &mut w);
20        self.register.set(w.bits);
21    }
22    #[doc = r" Reads the contents of the register"]
23    #[inline]
24    pub fn read(&self) -> R {
25        R {
26            bits: self.register.get(),
27        }
28    }
29    #[doc = r" Writes to the register"]
30    #[inline]
31    pub fn write<F>(&self, f: F)
32    where
33        F: FnOnce(&mut W) -> &mut W,
34    {
35        let mut w = W::reset_value();
36        f(&mut w);
37        self.register.set(w.bits);
38    }
39    #[doc = r" Writes the reset value to the register"]
40    #[inline]
41    pub fn reset(&self) {
42        self.write(|w| w)
43    }
44}
45#[doc = "Possible values of the field `M1`"]
46#[derive(Clone, Copy, Debug, PartialEq)]
47pub enum M1R {
48    #[doc = "Use M0 to set the data bits"]
49    M0,
50    #[doc = "1 start bit, 7 data bits, n stop bits"]
51    BIT7,
52}
53impl M1R {
54    #[doc = r" Returns `true` if the bit is clear (0)"]
55    #[inline]
56    pub fn bit_is_clear(&self) -> bool {
57        !self.bit()
58    }
59    #[doc = r" Returns `true` if the bit is set (1)"]
60    #[inline]
61    pub fn bit_is_set(&self) -> bool {
62        self.bit()
63    }
64    #[doc = r" Value of the field as raw bits"]
65    #[inline]
66    pub fn bit(&self) -> bool {
67        match *self {
68            M1R::M0 => false,
69            M1R::BIT7 => true,
70        }
71    }
72    #[allow(missing_docs)]
73    #[doc(hidden)]
74    #[inline]
75    pub fn _from(value: bool) -> M1R {
76        match value {
77            false => M1R::M0,
78            true => M1R::BIT7,
79        }
80    }
81    #[doc = "Checks if the value of the field is `M0`"]
82    #[inline]
83    pub fn is_m0(&self) -> bool {
84        *self == M1R::M0
85    }
86    #[doc = "Checks if the value of the field is `BIT7`"]
87    #[inline]
88    pub fn is_bit7(&self) -> bool {
89        *self == M1R::BIT7
90    }
91}
92#[doc = "Possible values of the field `EOBIE`"]
93#[derive(Clone, Copy, Debug, PartialEq)]
94pub enum EOBIER {
95    #[doc = "Interrupt is inhibited"]
96    DISABLED,
97    #[doc = "A USART interrupt is generated when the EOBF flag is set in the ISR register"]
98    ENABLED,
99}
100impl EOBIER {
101    #[doc = r" Returns `true` if the bit is clear (0)"]
102    #[inline]
103    pub fn bit_is_clear(&self) -> bool {
104        !self.bit()
105    }
106    #[doc = r" Returns `true` if the bit is set (1)"]
107    #[inline]
108    pub fn bit_is_set(&self) -> bool {
109        self.bit()
110    }
111    #[doc = r" Value of the field as raw bits"]
112    #[inline]
113    pub fn bit(&self) -> bool {
114        match *self {
115            EOBIER::DISABLED => false,
116            EOBIER::ENABLED => true,
117        }
118    }
119    #[allow(missing_docs)]
120    #[doc(hidden)]
121    #[inline]
122    pub fn _from(value: bool) -> EOBIER {
123        match value {
124            false => EOBIER::DISABLED,
125            true => EOBIER::ENABLED,
126        }
127    }
128    #[doc = "Checks if the value of the field is `DISABLED`"]
129    #[inline]
130    pub fn is_disabled(&self) -> bool {
131        *self == EOBIER::DISABLED
132    }
133    #[doc = "Checks if the value of the field is `ENABLED`"]
134    #[inline]
135    pub fn is_enabled(&self) -> bool {
136        *self == EOBIER::ENABLED
137    }
138}
139#[doc = "Possible values of the field `RTOIE`"]
140#[derive(Clone, Copy, Debug, PartialEq)]
141pub enum RTOIER {
142    #[doc = "Interrupt is inhibited"]
143    DISABLED,
144    #[doc = "An USART interrupt is generated when the RTOF bit is set in the ISR register"]
145    ENABLED,
146}
147impl RTOIER {
148    #[doc = r" Returns `true` if the bit is clear (0)"]
149    #[inline]
150    pub fn bit_is_clear(&self) -> bool {
151        !self.bit()
152    }
153    #[doc = r" Returns `true` if the bit is set (1)"]
154    #[inline]
155    pub fn bit_is_set(&self) -> bool {
156        self.bit()
157    }
158    #[doc = r" Value of the field as raw bits"]
159    #[inline]
160    pub fn bit(&self) -> bool {
161        match *self {
162            RTOIER::DISABLED => false,
163            RTOIER::ENABLED => true,
164        }
165    }
166    #[allow(missing_docs)]
167    #[doc(hidden)]
168    #[inline]
169    pub fn _from(value: bool) -> RTOIER {
170        match value {
171            false => RTOIER::DISABLED,
172            true => RTOIER::ENABLED,
173        }
174    }
175    #[doc = "Checks if the value of the field is `DISABLED`"]
176    #[inline]
177    pub fn is_disabled(&self) -> bool {
178        *self == RTOIER::DISABLED
179    }
180    #[doc = "Checks if the value of the field is `ENABLED`"]
181    #[inline]
182    pub fn is_enabled(&self) -> bool {
183        *self == RTOIER::ENABLED
184    }
185}
186#[doc = "Possible values of the field `OVER8`"]
187#[derive(Clone, Copy, Debug, PartialEq)]
188pub enum OVER8R {
189    #[doc = "Oversampling by 16"]
190    OVERSAMPLING16,
191    #[doc = "Oversampling by 8"]
192    OVERSAMPLING8,
193}
194impl OVER8R {
195    #[doc = r" Returns `true` if the bit is clear (0)"]
196    #[inline]
197    pub fn bit_is_clear(&self) -> bool {
198        !self.bit()
199    }
200    #[doc = r" Returns `true` if the bit is set (1)"]
201    #[inline]
202    pub fn bit_is_set(&self) -> bool {
203        self.bit()
204    }
205    #[doc = r" Value of the field as raw bits"]
206    #[inline]
207    pub fn bit(&self) -> bool {
208        match *self {
209            OVER8R::OVERSAMPLING16 => false,
210            OVER8R::OVERSAMPLING8 => true,
211        }
212    }
213    #[allow(missing_docs)]
214    #[doc(hidden)]
215    #[inline]
216    pub fn _from(value: bool) -> OVER8R {
217        match value {
218            false => OVER8R::OVERSAMPLING16,
219            true => OVER8R::OVERSAMPLING8,
220        }
221    }
222    #[doc = "Checks if the value of the field is `OVERSAMPLING16`"]
223    #[inline]
224    pub fn is_oversampling16(&self) -> bool {
225        *self == OVER8R::OVERSAMPLING16
226    }
227    #[doc = "Checks if the value of the field is `OVERSAMPLING8`"]
228    #[inline]
229    pub fn is_oversampling8(&self) -> bool {
230        *self == OVER8R::OVERSAMPLING8
231    }
232}
233#[doc = "Possible values of the field `CMIE`"]
234#[derive(Clone, Copy, Debug, PartialEq)]
235pub enum CMIER {
236    #[doc = "Interrupt is disabled"]
237    DISABLED,
238    #[doc = "Interrupt is generated when the CMF bit is set in the ISR register"]
239    ENABLED,
240}
241impl CMIER {
242    #[doc = r" Returns `true` if the bit is clear (0)"]
243    #[inline]
244    pub fn bit_is_clear(&self) -> bool {
245        !self.bit()
246    }
247    #[doc = r" Returns `true` if the bit is set (1)"]
248    #[inline]
249    pub fn bit_is_set(&self) -> bool {
250        self.bit()
251    }
252    #[doc = r" Value of the field as raw bits"]
253    #[inline]
254    pub fn bit(&self) -> bool {
255        match *self {
256            CMIER::DISABLED => false,
257            CMIER::ENABLED => true,
258        }
259    }
260    #[allow(missing_docs)]
261    #[doc(hidden)]
262    #[inline]
263    pub fn _from(value: bool) -> CMIER {
264        match value {
265            false => CMIER::DISABLED,
266            true => CMIER::ENABLED,
267        }
268    }
269    #[doc = "Checks if the value of the field is `DISABLED`"]
270    #[inline]
271    pub fn is_disabled(&self) -> bool {
272        *self == CMIER::DISABLED
273    }
274    #[doc = "Checks if the value of the field is `ENABLED`"]
275    #[inline]
276    pub fn is_enabled(&self) -> bool {
277        *self == CMIER::ENABLED
278    }
279}
280#[doc = "Possible values of the field `MME`"]
281#[derive(Clone, Copy, Debug, PartialEq)]
282pub enum MMER {
283    #[doc = "Receiver in active mode permanently"]
284    DISABLED,
285    #[doc = "Receiver can switch between mute mode and active mode"]
286    ENABLED,
287}
288impl MMER {
289    #[doc = r" Returns `true` if the bit is clear (0)"]
290    #[inline]
291    pub fn bit_is_clear(&self) -> bool {
292        !self.bit()
293    }
294    #[doc = r" Returns `true` if the bit is set (1)"]
295    #[inline]
296    pub fn bit_is_set(&self) -> bool {
297        self.bit()
298    }
299    #[doc = r" Value of the field as raw bits"]
300    #[inline]
301    pub fn bit(&self) -> bool {
302        match *self {
303            MMER::DISABLED => false,
304            MMER::ENABLED => true,
305        }
306    }
307    #[allow(missing_docs)]
308    #[doc(hidden)]
309    #[inline]
310    pub fn _from(value: bool) -> MMER {
311        match value {
312            false => MMER::DISABLED,
313            true => MMER::ENABLED,
314        }
315    }
316    #[doc = "Checks if the value of the field is `DISABLED`"]
317    #[inline]
318    pub fn is_disabled(&self) -> bool {
319        *self == MMER::DISABLED
320    }
321    #[doc = "Checks if the value of the field is `ENABLED`"]
322    #[inline]
323    pub fn is_enabled(&self) -> bool {
324        *self == MMER::ENABLED
325    }
326}
327#[doc = "Possible values of the field `M0`"]
328#[derive(Clone, Copy, Debug, PartialEq)]
329pub enum M0R {
330    #[doc = "1 start bit, 8 data bits, n stop bits"]
331    BIT8,
332    #[doc = "1 start bit, 9 data bits, n stop bits"]
333    BIT9,
334}
335impl M0R {
336    #[doc = r" Returns `true` if the bit is clear (0)"]
337    #[inline]
338    pub fn bit_is_clear(&self) -> bool {
339        !self.bit()
340    }
341    #[doc = r" Returns `true` if the bit is set (1)"]
342    #[inline]
343    pub fn bit_is_set(&self) -> bool {
344        self.bit()
345    }
346    #[doc = r" Value of the field as raw bits"]
347    #[inline]
348    pub fn bit(&self) -> bool {
349        match *self {
350            M0R::BIT8 => false,
351            M0R::BIT9 => true,
352        }
353    }
354    #[allow(missing_docs)]
355    #[doc(hidden)]
356    #[inline]
357    pub fn _from(value: bool) -> M0R {
358        match value {
359            false => M0R::BIT8,
360            true => M0R::BIT9,
361        }
362    }
363    #[doc = "Checks if the value of the field is `BIT8`"]
364    #[inline]
365    pub fn is_bit8(&self) -> bool {
366        *self == M0R::BIT8
367    }
368    #[doc = "Checks if the value of the field is `BIT9`"]
369    #[inline]
370    pub fn is_bit9(&self) -> bool {
371        *self == M0R::BIT9
372    }
373}
374#[doc = "Possible values of the field `WAKE`"]
375#[derive(Clone, Copy, Debug, PartialEq)]
376pub enum WAKER {
377    #[doc = "Idle line"]
378    IDLE,
379    #[doc = "Address mask"]
380    ADDRESS,
381}
382impl WAKER {
383    #[doc = r" Returns `true` if the bit is clear (0)"]
384    #[inline]
385    pub fn bit_is_clear(&self) -> bool {
386        !self.bit()
387    }
388    #[doc = r" Returns `true` if the bit is set (1)"]
389    #[inline]
390    pub fn bit_is_set(&self) -> bool {
391        self.bit()
392    }
393    #[doc = r" Value of the field as raw bits"]
394    #[inline]
395    pub fn bit(&self) -> bool {
396        match *self {
397            WAKER::IDLE => false,
398            WAKER::ADDRESS => true,
399        }
400    }
401    #[allow(missing_docs)]
402    #[doc(hidden)]
403    #[inline]
404    pub fn _from(value: bool) -> WAKER {
405        match value {
406            false => WAKER::IDLE,
407            true => WAKER::ADDRESS,
408        }
409    }
410    #[doc = "Checks if the value of the field is `IDLE`"]
411    #[inline]
412    pub fn is_idle(&self) -> bool {
413        *self == WAKER::IDLE
414    }
415    #[doc = "Checks if the value of the field is `ADDRESS`"]
416    #[inline]
417    pub fn is_address(&self) -> bool {
418        *self == WAKER::ADDRESS
419    }
420}
421#[doc = "Possible values of the field `PCE`"]
422#[derive(Clone, Copy, Debug, PartialEq)]
423pub enum PCER {
424    #[doc = "Parity control disabled"]
425    DISABLED,
426    #[doc = "Parity control enabled"]
427    ENABLED,
428}
429impl PCER {
430    #[doc = r" Returns `true` if the bit is clear (0)"]
431    #[inline]
432    pub fn bit_is_clear(&self) -> bool {
433        !self.bit()
434    }
435    #[doc = r" Returns `true` if the bit is set (1)"]
436    #[inline]
437    pub fn bit_is_set(&self) -> bool {
438        self.bit()
439    }
440    #[doc = r" Value of the field as raw bits"]
441    #[inline]
442    pub fn bit(&self) -> bool {
443        match *self {
444            PCER::DISABLED => false,
445            PCER::ENABLED => true,
446        }
447    }
448    #[allow(missing_docs)]
449    #[doc(hidden)]
450    #[inline]
451    pub fn _from(value: bool) -> PCER {
452        match value {
453            false => PCER::DISABLED,
454            true => PCER::ENABLED,
455        }
456    }
457    #[doc = "Checks if the value of the field is `DISABLED`"]
458    #[inline]
459    pub fn is_disabled(&self) -> bool {
460        *self == PCER::DISABLED
461    }
462    #[doc = "Checks if the value of the field is `ENABLED`"]
463    #[inline]
464    pub fn is_enabled(&self) -> bool {
465        *self == PCER::ENABLED
466    }
467}
468#[doc = "Possible values of the field `PS`"]
469#[derive(Clone, Copy, Debug, PartialEq)]
470pub enum PSR {
471    #[doc = "Even parity"]
472    EVEN,
473    #[doc = "Odd parity"]
474    ODD,
475}
476impl PSR {
477    #[doc = r" Returns `true` if the bit is clear (0)"]
478    #[inline]
479    pub fn bit_is_clear(&self) -> bool {
480        !self.bit()
481    }
482    #[doc = r" Returns `true` if the bit is set (1)"]
483    #[inline]
484    pub fn bit_is_set(&self) -> bool {
485        self.bit()
486    }
487    #[doc = r" Value of the field as raw bits"]
488    #[inline]
489    pub fn bit(&self) -> bool {
490        match *self {
491            PSR::EVEN => false,
492            PSR::ODD => true,
493        }
494    }
495    #[allow(missing_docs)]
496    #[doc(hidden)]
497    #[inline]
498    pub fn _from(value: bool) -> PSR {
499        match value {
500            false => PSR::EVEN,
501            true => PSR::ODD,
502        }
503    }
504    #[doc = "Checks if the value of the field is `EVEN`"]
505    #[inline]
506    pub fn is_even(&self) -> bool {
507        *self == PSR::EVEN
508    }
509    #[doc = "Checks if the value of the field is `ODD`"]
510    #[inline]
511    pub fn is_odd(&self) -> bool {
512        *self == PSR::ODD
513    }
514}
515#[doc = "Possible values of the field `PEIE`"]
516#[derive(Clone, Copy, Debug, PartialEq)]
517pub enum PEIER {
518    #[doc = "Interrupt is disabled"]
519    DISABLED,
520    #[doc = "Interrupt is generated whenever PE=1 in the ISR register"]
521    ENABLED,
522}
523impl PEIER {
524    #[doc = r" Returns `true` if the bit is clear (0)"]
525    #[inline]
526    pub fn bit_is_clear(&self) -> bool {
527        !self.bit()
528    }
529    #[doc = r" Returns `true` if the bit is set (1)"]
530    #[inline]
531    pub fn bit_is_set(&self) -> bool {
532        self.bit()
533    }
534    #[doc = r" Value of the field as raw bits"]
535    #[inline]
536    pub fn bit(&self) -> bool {
537        match *self {
538            PEIER::DISABLED => false,
539            PEIER::ENABLED => true,
540        }
541    }
542    #[allow(missing_docs)]
543    #[doc(hidden)]
544    #[inline]
545    pub fn _from(value: bool) -> PEIER {
546        match value {
547            false => PEIER::DISABLED,
548            true => PEIER::ENABLED,
549        }
550    }
551    #[doc = "Checks if the value of the field is `DISABLED`"]
552    #[inline]
553    pub fn is_disabled(&self) -> bool {
554        *self == PEIER::DISABLED
555    }
556    #[doc = "Checks if the value of the field is `ENABLED`"]
557    #[inline]
558    pub fn is_enabled(&self) -> bool {
559        *self == PEIER::ENABLED
560    }
561}
562#[doc = "Possible values of the field `TXEIE`"]
563#[derive(Clone, Copy, Debug, PartialEq)]
564pub enum TXEIER {
565    #[doc = "Interrupt is disabled"]
566    DISABLED,
567    #[doc = "Interrupt is generated whenever TXE=1 in the ISR register"]
568    ENABLED,
569}
570impl TXEIER {
571    #[doc = r" Returns `true` if the bit is clear (0)"]
572    #[inline]
573    pub fn bit_is_clear(&self) -> bool {
574        !self.bit()
575    }
576    #[doc = r" Returns `true` if the bit is set (1)"]
577    #[inline]
578    pub fn bit_is_set(&self) -> bool {
579        self.bit()
580    }
581    #[doc = r" Value of the field as raw bits"]
582    #[inline]
583    pub fn bit(&self) -> bool {
584        match *self {
585            TXEIER::DISABLED => false,
586            TXEIER::ENABLED => true,
587        }
588    }
589    #[allow(missing_docs)]
590    #[doc(hidden)]
591    #[inline]
592    pub fn _from(value: bool) -> TXEIER {
593        match value {
594            false => TXEIER::DISABLED,
595            true => TXEIER::ENABLED,
596        }
597    }
598    #[doc = "Checks if the value of the field is `DISABLED`"]
599    #[inline]
600    pub fn is_disabled(&self) -> bool {
601        *self == TXEIER::DISABLED
602    }
603    #[doc = "Checks if the value of the field is `ENABLED`"]
604    #[inline]
605    pub fn is_enabled(&self) -> bool {
606        *self == TXEIER::ENABLED
607    }
608}
609#[doc = "Possible values of the field `TCIE`"]
610#[derive(Clone, Copy, Debug, PartialEq)]
611pub enum TCIER {
612    #[doc = "Interrupt is disabled"]
613    DISABLED,
614    #[doc = "Interrupt is generated whenever TC=1 in the ISR register"]
615    ENABLED,
616}
617impl TCIER {
618    #[doc = r" Returns `true` if the bit is clear (0)"]
619    #[inline]
620    pub fn bit_is_clear(&self) -> bool {
621        !self.bit()
622    }
623    #[doc = r" Returns `true` if the bit is set (1)"]
624    #[inline]
625    pub fn bit_is_set(&self) -> bool {
626        self.bit()
627    }
628    #[doc = r" Value of the field as raw bits"]
629    #[inline]
630    pub fn bit(&self) -> bool {
631        match *self {
632            TCIER::DISABLED => false,
633            TCIER::ENABLED => true,
634        }
635    }
636    #[allow(missing_docs)]
637    #[doc(hidden)]
638    #[inline]
639    pub fn _from(value: bool) -> TCIER {
640        match value {
641            false => TCIER::DISABLED,
642            true => TCIER::ENABLED,
643        }
644    }
645    #[doc = "Checks if the value of the field is `DISABLED`"]
646    #[inline]
647    pub fn is_disabled(&self) -> bool {
648        *self == TCIER::DISABLED
649    }
650    #[doc = "Checks if the value of the field is `ENABLED`"]
651    #[inline]
652    pub fn is_enabled(&self) -> bool {
653        *self == TCIER::ENABLED
654    }
655}
656#[doc = "Possible values of the field `RXNEIE`"]
657#[derive(Clone, Copy, Debug, PartialEq)]
658pub enum RXNEIER {
659    #[doc = "Interrupt is disabled"]
660    DISABLED,
661    #[doc = "Interrupt is generated whenever ORE=1 or RXNE=1 in the ISR register"]
662    ENABLED,
663}
664impl RXNEIER {
665    #[doc = r" Returns `true` if the bit is clear (0)"]
666    #[inline]
667    pub fn bit_is_clear(&self) -> bool {
668        !self.bit()
669    }
670    #[doc = r" Returns `true` if the bit is set (1)"]
671    #[inline]
672    pub fn bit_is_set(&self) -> bool {
673        self.bit()
674    }
675    #[doc = r" Value of the field as raw bits"]
676    #[inline]
677    pub fn bit(&self) -> bool {
678        match *self {
679            RXNEIER::DISABLED => false,
680            RXNEIER::ENABLED => true,
681        }
682    }
683    #[allow(missing_docs)]
684    #[doc(hidden)]
685    #[inline]
686    pub fn _from(value: bool) -> RXNEIER {
687        match value {
688            false => RXNEIER::DISABLED,
689            true => RXNEIER::ENABLED,
690        }
691    }
692    #[doc = "Checks if the value of the field is `DISABLED`"]
693    #[inline]
694    pub fn is_disabled(&self) -> bool {
695        *self == RXNEIER::DISABLED
696    }
697    #[doc = "Checks if the value of the field is `ENABLED`"]
698    #[inline]
699    pub fn is_enabled(&self) -> bool {
700        *self == RXNEIER::ENABLED
701    }
702}
703#[doc = "Possible values of the field `IDLEIE`"]
704#[derive(Clone, Copy, Debug, PartialEq)]
705pub enum IDLEIER {
706    #[doc = "Interrupt is disabled"]
707    DISABLED,
708    #[doc = "Interrupt is generated whenever IDLE=1 in the ISR register"]
709    ENABLED,
710}
711impl IDLEIER {
712    #[doc = r" Returns `true` if the bit is clear (0)"]
713    #[inline]
714    pub fn bit_is_clear(&self) -> bool {
715        !self.bit()
716    }
717    #[doc = r" Returns `true` if the bit is set (1)"]
718    #[inline]
719    pub fn bit_is_set(&self) -> bool {
720        self.bit()
721    }
722    #[doc = r" Value of the field as raw bits"]
723    #[inline]
724    pub fn bit(&self) -> bool {
725        match *self {
726            IDLEIER::DISABLED => false,
727            IDLEIER::ENABLED => true,
728        }
729    }
730    #[allow(missing_docs)]
731    #[doc(hidden)]
732    #[inline]
733    pub fn _from(value: bool) -> IDLEIER {
734        match value {
735            false => IDLEIER::DISABLED,
736            true => IDLEIER::ENABLED,
737        }
738    }
739    #[doc = "Checks if the value of the field is `DISABLED`"]
740    #[inline]
741    pub fn is_disabled(&self) -> bool {
742        *self == IDLEIER::DISABLED
743    }
744    #[doc = "Checks if the value of the field is `ENABLED`"]
745    #[inline]
746    pub fn is_enabled(&self) -> bool {
747        *self == IDLEIER::ENABLED
748    }
749}
750#[doc = "Possible values of the field `TE`"]
751#[derive(Clone, Copy, Debug, PartialEq)]
752pub enum TER {
753    #[doc = "Transmitter is disabled"]
754    DISABLED,
755    #[doc = "Transmitter is enabled"]
756    ENABLED,
757}
758impl TER {
759    #[doc = r" Returns `true` if the bit is clear (0)"]
760    #[inline]
761    pub fn bit_is_clear(&self) -> bool {
762        !self.bit()
763    }
764    #[doc = r" Returns `true` if the bit is set (1)"]
765    #[inline]
766    pub fn bit_is_set(&self) -> bool {
767        self.bit()
768    }
769    #[doc = r" Value of the field as raw bits"]
770    #[inline]
771    pub fn bit(&self) -> bool {
772        match *self {
773            TER::DISABLED => false,
774            TER::ENABLED => true,
775        }
776    }
777    #[allow(missing_docs)]
778    #[doc(hidden)]
779    #[inline]
780    pub fn _from(value: bool) -> TER {
781        match value {
782            false => TER::DISABLED,
783            true => TER::ENABLED,
784        }
785    }
786    #[doc = "Checks if the value of the field is `DISABLED`"]
787    #[inline]
788    pub fn is_disabled(&self) -> bool {
789        *self == TER::DISABLED
790    }
791    #[doc = "Checks if the value of the field is `ENABLED`"]
792    #[inline]
793    pub fn is_enabled(&self) -> bool {
794        *self == TER::ENABLED
795    }
796}
797#[doc = "Possible values of the field `RE`"]
798#[derive(Clone, Copy, Debug, PartialEq)]
799pub enum RER {
800    #[doc = "Receiver is disabled"]
801    DISABLED,
802    #[doc = "Receiver is enabled"]
803    ENABLED,
804}
805impl RER {
806    #[doc = r" Returns `true` if the bit is clear (0)"]
807    #[inline]
808    pub fn bit_is_clear(&self) -> bool {
809        !self.bit()
810    }
811    #[doc = r" Returns `true` if the bit is set (1)"]
812    #[inline]
813    pub fn bit_is_set(&self) -> bool {
814        self.bit()
815    }
816    #[doc = r" Value of the field as raw bits"]
817    #[inline]
818    pub fn bit(&self) -> bool {
819        match *self {
820            RER::DISABLED => false,
821            RER::ENABLED => true,
822        }
823    }
824    #[allow(missing_docs)]
825    #[doc(hidden)]
826    #[inline]
827    pub fn _from(value: bool) -> RER {
828        match value {
829            false => RER::DISABLED,
830            true => RER::ENABLED,
831        }
832    }
833    #[doc = "Checks if the value of the field is `DISABLED`"]
834    #[inline]
835    pub fn is_disabled(&self) -> bool {
836        *self == RER::DISABLED
837    }
838    #[doc = "Checks if the value of the field is `ENABLED`"]
839    #[inline]
840    pub fn is_enabled(&self) -> bool {
841        *self == RER::ENABLED
842    }
843}
844#[doc = "Possible values of the field `UESM`"]
845#[derive(Clone, Copy, Debug, PartialEq)]
846pub enum UESMR {
847    #[doc = "USART not able to wake up the MCU from Stop mode"]
848    DISABLED,
849    #[doc = "USART able to wake up the MCU from Stop mode"]
850    ENABLED,
851}
852impl UESMR {
853    #[doc = r" Returns `true` if the bit is clear (0)"]
854    #[inline]
855    pub fn bit_is_clear(&self) -> bool {
856        !self.bit()
857    }
858    #[doc = r" Returns `true` if the bit is set (1)"]
859    #[inline]
860    pub fn bit_is_set(&self) -> bool {
861        self.bit()
862    }
863    #[doc = r" Value of the field as raw bits"]
864    #[inline]
865    pub fn bit(&self) -> bool {
866        match *self {
867            UESMR::DISABLED => false,
868            UESMR::ENABLED => true,
869        }
870    }
871    #[allow(missing_docs)]
872    #[doc(hidden)]
873    #[inline]
874    pub fn _from(value: bool) -> UESMR {
875        match value {
876            false => UESMR::DISABLED,
877            true => UESMR::ENABLED,
878        }
879    }
880    #[doc = "Checks if the value of the field is `DISABLED`"]
881    #[inline]
882    pub fn is_disabled(&self) -> bool {
883        *self == UESMR::DISABLED
884    }
885    #[doc = "Checks if the value of the field is `ENABLED`"]
886    #[inline]
887    pub fn is_enabled(&self) -> bool {
888        *self == UESMR::ENABLED
889    }
890}
891#[doc = "Possible values of the field `UE`"]
892#[derive(Clone, Copy, Debug, PartialEq)]
893pub enum UER {
894    #[doc = "UART is disabled"]
895    DISABLED,
896    #[doc = "UART is enabled"]
897    ENABLED,
898}
899impl UER {
900    #[doc = r" Returns `true` if the bit is clear (0)"]
901    #[inline]
902    pub fn bit_is_clear(&self) -> bool {
903        !self.bit()
904    }
905    #[doc = r" Returns `true` if the bit is set (1)"]
906    #[inline]
907    pub fn bit_is_set(&self) -> bool {
908        self.bit()
909    }
910    #[doc = r" Value of the field as raw bits"]
911    #[inline]
912    pub fn bit(&self) -> bool {
913        match *self {
914            UER::DISABLED => false,
915            UER::ENABLED => true,
916        }
917    }
918    #[allow(missing_docs)]
919    #[doc(hidden)]
920    #[inline]
921    pub fn _from(value: bool) -> UER {
922        match value {
923            false => UER::DISABLED,
924            true => UER::ENABLED,
925        }
926    }
927    #[doc = "Checks if the value of the field is `DISABLED`"]
928    #[inline]
929    pub fn is_disabled(&self) -> bool {
930        *self == UER::DISABLED
931    }
932    #[doc = "Checks if the value of the field is `ENABLED`"]
933    #[inline]
934    pub fn is_enabled(&self) -> bool {
935        *self == UER::ENABLED
936    }
937}
938#[doc = r" Value of the field"]
939pub struct DEATR {
940    bits: u8,
941}
942impl DEATR {
943    #[doc = r" Value of the field as raw bits"]
944    #[inline]
945    pub fn bits(&self) -> u8 {
946        self.bits
947    }
948}
949#[doc = r" Value of the field"]
950pub struct DEDTR {
951    bits: u8,
952}
953impl DEDTR {
954    #[doc = r" Value of the field as raw bits"]
955    #[inline]
956    pub fn bits(&self) -> u8 {
957        self.bits
958    }
959}
960#[doc = "Values that can be written to the field `M1`"]
961pub enum M1W {
962    #[doc = "Use M0 to set the data bits"]
963    M0,
964    #[doc = "1 start bit, 7 data bits, n stop bits"]
965    BIT7,
966}
967impl M1W {
968    #[allow(missing_docs)]
969    #[doc(hidden)]
970    #[inline]
971    pub fn _bits(&self) -> bool {
972        match *self {
973            M1W::M0 => false,
974            M1W::BIT7 => true,
975        }
976    }
977}
978#[doc = r" Proxy"]
979pub struct _M1W<'a> {
980    w: &'a mut W,
981}
982impl<'a> _M1W<'a> {
983    #[doc = r" Writes `variant` to the field"]
984    #[inline]
985    pub fn variant(self, variant: M1W) -> &'a mut W {
986        {
987            self.bit(variant._bits())
988        }
989    }
990    #[doc = "Use M0 to set the data bits"]
991    #[inline]
992    pub fn m0(self) -> &'a mut W {
993        self.variant(M1W::M0)
994    }
995    #[doc = "1 start bit, 7 data bits, n stop bits"]
996    #[inline]
997    pub fn bit7(self) -> &'a mut W {
998        self.variant(M1W::BIT7)
999    }
1000    #[doc = r" Sets the field bit"]
1001    pub fn set_bit(self) -> &'a mut W {
1002        self.bit(true)
1003    }
1004    #[doc = r" Clears the field bit"]
1005    pub fn clear_bit(self) -> &'a mut W {
1006        self.bit(false)
1007    }
1008    #[doc = r" Writes raw bits to the field"]
1009    #[inline]
1010    pub fn bit(self, value: bool) -> &'a mut W {
1011        const MASK: bool = true;
1012        const OFFSET: u8 = 28;
1013        self.w.bits &= !((MASK as u32) << OFFSET);
1014        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1015        self.w
1016    }
1017}
1018#[doc = "Values that can be written to the field `EOBIE`"]
1019pub enum EOBIEW {
1020    #[doc = "Interrupt is inhibited"]
1021    DISABLED,
1022    #[doc = "A USART interrupt is generated when the EOBF flag is set in the ISR register"]
1023    ENABLED,
1024}
1025impl EOBIEW {
1026    #[allow(missing_docs)]
1027    #[doc(hidden)]
1028    #[inline]
1029    pub fn _bits(&self) -> bool {
1030        match *self {
1031            EOBIEW::DISABLED => false,
1032            EOBIEW::ENABLED => true,
1033        }
1034    }
1035}
1036#[doc = r" Proxy"]
1037pub struct _EOBIEW<'a> {
1038    w: &'a mut W,
1039}
1040impl<'a> _EOBIEW<'a> {
1041    #[doc = r" Writes `variant` to the field"]
1042    #[inline]
1043    pub fn variant(self, variant: EOBIEW) -> &'a mut W {
1044        {
1045            self.bit(variant._bits())
1046        }
1047    }
1048    #[doc = "Interrupt is inhibited"]
1049    #[inline]
1050    pub fn disabled(self) -> &'a mut W {
1051        self.variant(EOBIEW::DISABLED)
1052    }
1053    #[doc = "A USART interrupt is generated when the EOBF flag is set in the ISR register"]
1054    #[inline]
1055    pub fn enabled(self) -> &'a mut W {
1056        self.variant(EOBIEW::ENABLED)
1057    }
1058    #[doc = r" Sets the field bit"]
1059    pub fn set_bit(self) -> &'a mut W {
1060        self.bit(true)
1061    }
1062    #[doc = r" Clears the field bit"]
1063    pub fn clear_bit(self) -> &'a mut W {
1064        self.bit(false)
1065    }
1066    #[doc = r" Writes raw bits to the field"]
1067    #[inline]
1068    pub fn bit(self, value: bool) -> &'a mut W {
1069        const MASK: bool = true;
1070        const OFFSET: u8 = 27;
1071        self.w.bits &= !((MASK as u32) << OFFSET);
1072        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1073        self.w
1074    }
1075}
1076#[doc = "Values that can be written to the field `RTOIE`"]
1077pub enum RTOIEW {
1078    #[doc = "Interrupt is inhibited"]
1079    DISABLED,
1080    #[doc = "An USART interrupt is generated when the RTOF bit is set in the ISR register"]
1081    ENABLED,
1082}
1083impl RTOIEW {
1084    #[allow(missing_docs)]
1085    #[doc(hidden)]
1086    #[inline]
1087    pub fn _bits(&self) -> bool {
1088        match *self {
1089            RTOIEW::DISABLED => false,
1090            RTOIEW::ENABLED => true,
1091        }
1092    }
1093}
1094#[doc = r" Proxy"]
1095pub struct _RTOIEW<'a> {
1096    w: &'a mut W,
1097}
1098impl<'a> _RTOIEW<'a> {
1099    #[doc = r" Writes `variant` to the field"]
1100    #[inline]
1101    pub fn variant(self, variant: RTOIEW) -> &'a mut W {
1102        {
1103            self.bit(variant._bits())
1104        }
1105    }
1106    #[doc = "Interrupt is inhibited"]
1107    #[inline]
1108    pub fn disabled(self) -> &'a mut W {
1109        self.variant(RTOIEW::DISABLED)
1110    }
1111    #[doc = "An USART interrupt is generated when the RTOF bit is set in the ISR register"]
1112    #[inline]
1113    pub fn enabled(self) -> &'a mut W {
1114        self.variant(RTOIEW::ENABLED)
1115    }
1116    #[doc = r" Sets the field bit"]
1117    pub fn set_bit(self) -> &'a mut W {
1118        self.bit(true)
1119    }
1120    #[doc = r" Clears the field bit"]
1121    pub fn clear_bit(self) -> &'a mut W {
1122        self.bit(false)
1123    }
1124    #[doc = r" Writes raw bits to the field"]
1125    #[inline]
1126    pub fn bit(self, value: bool) -> &'a mut W {
1127        const MASK: bool = true;
1128        const OFFSET: u8 = 26;
1129        self.w.bits &= !((MASK as u32) << OFFSET);
1130        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1131        self.w
1132    }
1133}
1134#[doc = "Values that can be written to the field `OVER8`"]
1135pub enum OVER8W {
1136    #[doc = "Oversampling by 16"]
1137    OVERSAMPLING16,
1138    #[doc = "Oversampling by 8"]
1139    OVERSAMPLING8,
1140}
1141impl OVER8W {
1142    #[allow(missing_docs)]
1143    #[doc(hidden)]
1144    #[inline]
1145    pub fn _bits(&self) -> bool {
1146        match *self {
1147            OVER8W::OVERSAMPLING16 => false,
1148            OVER8W::OVERSAMPLING8 => true,
1149        }
1150    }
1151}
1152#[doc = r" Proxy"]
1153pub struct _OVER8W<'a> {
1154    w: &'a mut W,
1155}
1156impl<'a> _OVER8W<'a> {
1157    #[doc = r" Writes `variant` to the field"]
1158    #[inline]
1159    pub fn variant(self, variant: OVER8W) -> &'a mut W {
1160        {
1161            self.bit(variant._bits())
1162        }
1163    }
1164    #[doc = "Oversampling by 16"]
1165    #[inline]
1166    pub fn oversampling16(self) -> &'a mut W {
1167        self.variant(OVER8W::OVERSAMPLING16)
1168    }
1169    #[doc = "Oversampling by 8"]
1170    #[inline]
1171    pub fn oversampling8(self) -> &'a mut W {
1172        self.variant(OVER8W::OVERSAMPLING8)
1173    }
1174    #[doc = r" Sets the field bit"]
1175    pub fn set_bit(self) -> &'a mut W {
1176        self.bit(true)
1177    }
1178    #[doc = r" Clears the field bit"]
1179    pub fn clear_bit(self) -> &'a mut W {
1180        self.bit(false)
1181    }
1182    #[doc = r" Writes raw bits to the field"]
1183    #[inline]
1184    pub fn bit(self, value: bool) -> &'a mut W {
1185        const MASK: bool = true;
1186        const OFFSET: u8 = 15;
1187        self.w.bits &= !((MASK as u32) << OFFSET);
1188        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1189        self.w
1190    }
1191}
1192#[doc = "Values that can be written to the field `CMIE`"]
1193pub enum CMIEW {
1194    #[doc = "Interrupt is disabled"]
1195    DISABLED,
1196    #[doc = "Interrupt is generated when the CMF bit is set in the ISR register"]
1197    ENABLED,
1198}
1199impl CMIEW {
1200    #[allow(missing_docs)]
1201    #[doc(hidden)]
1202    #[inline]
1203    pub fn _bits(&self) -> bool {
1204        match *self {
1205            CMIEW::DISABLED => false,
1206            CMIEW::ENABLED => true,
1207        }
1208    }
1209}
1210#[doc = r" Proxy"]
1211pub struct _CMIEW<'a> {
1212    w: &'a mut W,
1213}
1214impl<'a> _CMIEW<'a> {
1215    #[doc = r" Writes `variant` to the field"]
1216    #[inline]
1217    pub fn variant(self, variant: CMIEW) -> &'a mut W {
1218        {
1219            self.bit(variant._bits())
1220        }
1221    }
1222    #[doc = "Interrupt is disabled"]
1223    #[inline]
1224    pub fn disabled(self) -> &'a mut W {
1225        self.variant(CMIEW::DISABLED)
1226    }
1227    #[doc = "Interrupt is generated when the CMF bit is set in the ISR register"]
1228    #[inline]
1229    pub fn enabled(self) -> &'a mut W {
1230        self.variant(CMIEW::ENABLED)
1231    }
1232    #[doc = r" Sets the field bit"]
1233    pub fn set_bit(self) -> &'a mut W {
1234        self.bit(true)
1235    }
1236    #[doc = r" Clears the field bit"]
1237    pub fn clear_bit(self) -> &'a mut W {
1238        self.bit(false)
1239    }
1240    #[doc = r" Writes raw bits to the field"]
1241    #[inline]
1242    pub fn bit(self, value: bool) -> &'a mut W {
1243        const MASK: bool = true;
1244        const OFFSET: u8 = 14;
1245        self.w.bits &= !((MASK as u32) << OFFSET);
1246        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1247        self.w
1248    }
1249}
1250#[doc = "Values that can be written to the field `MME`"]
1251pub enum MMEW {
1252    #[doc = "Receiver in active mode permanently"]
1253    DISABLED,
1254    #[doc = "Receiver can switch between mute mode and active mode"]
1255    ENABLED,
1256}
1257impl MMEW {
1258    #[allow(missing_docs)]
1259    #[doc(hidden)]
1260    #[inline]
1261    pub fn _bits(&self) -> bool {
1262        match *self {
1263            MMEW::DISABLED => false,
1264            MMEW::ENABLED => true,
1265        }
1266    }
1267}
1268#[doc = r" Proxy"]
1269pub struct _MMEW<'a> {
1270    w: &'a mut W,
1271}
1272impl<'a> _MMEW<'a> {
1273    #[doc = r" Writes `variant` to the field"]
1274    #[inline]
1275    pub fn variant(self, variant: MMEW) -> &'a mut W {
1276        {
1277            self.bit(variant._bits())
1278        }
1279    }
1280    #[doc = "Receiver in active mode permanently"]
1281    #[inline]
1282    pub fn disabled(self) -> &'a mut W {
1283        self.variant(MMEW::DISABLED)
1284    }
1285    #[doc = "Receiver can switch between mute mode and active mode"]
1286    #[inline]
1287    pub fn enabled(self) -> &'a mut W {
1288        self.variant(MMEW::ENABLED)
1289    }
1290    #[doc = r" Sets the field bit"]
1291    pub fn set_bit(self) -> &'a mut W {
1292        self.bit(true)
1293    }
1294    #[doc = r" Clears the field bit"]
1295    pub fn clear_bit(self) -> &'a mut W {
1296        self.bit(false)
1297    }
1298    #[doc = r" Writes raw bits to the field"]
1299    #[inline]
1300    pub fn bit(self, value: bool) -> &'a mut W {
1301        const MASK: bool = true;
1302        const OFFSET: u8 = 13;
1303        self.w.bits &= !((MASK as u32) << OFFSET);
1304        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1305        self.w
1306    }
1307}
1308#[doc = "Values that can be written to the field `M0`"]
1309pub enum M0W {
1310    #[doc = "1 start bit, 8 data bits, n stop bits"]
1311    BIT8,
1312    #[doc = "1 start bit, 9 data bits, n stop bits"]
1313    BIT9,
1314}
1315impl M0W {
1316    #[allow(missing_docs)]
1317    #[doc(hidden)]
1318    #[inline]
1319    pub fn _bits(&self) -> bool {
1320        match *self {
1321            M0W::BIT8 => false,
1322            M0W::BIT9 => true,
1323        }
1324    }
1325}
1326#[doc = r" Proxy"]
1327pub struct _M0W<'a> {
1328    w: &'a mut W,
1329}
1330impl<'a> _M0W<'a> {
1331    #[doc = r" Writes `variant` to the field"]
1332    #[inline]
1333    pub fn variant(self, variant: M0W) -> &'a mut W {
1334        {
1335            self.bit(variant._bits())
1336        }
1337    }
1338    #[doc = "1 start bit, 8 data bits, n stop bits"]
1339    #[inline]
1340    pub fn bit8(self) -> &'a mut W {
1341        self.variant(M0W::BIT8)
1342    }
1343    #[doc = "1 start bit, 9 data bits, n stop bits"]
1344    #[inline]
1345    pub fn bit9(self) -> &'a mut W {
1346        self.variant(M0W::BIT9)
1347    }
1348    #[doc = r" Sets the field bit"]
1349    pub fn set_bit(self) -> &'a mut W {
1350        self.bit(true)
1351    }
1352    #[doc = r" Clears the field bit"]
1353    pub fn clear_bit(self) -> &'a mut W {
1354        self.bit(false)
1355    }
1356    #[doc = r" Writes raw bits to the field"]
1357    #[inline]
1358    pub fn bit(self, value: bool) -> &'a mut W {
1359        const MASK: bool = true;
1360        const OFFSET: u8 = 12;
1361        self.w.bits &= !((MASK as u32) << OFFSET);
1362        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1363        self.w
1364    }
1365}
1366#[doc = "Values that can be written to the field `WAKE`"]
1367pub enum WAKEW {
1368    #[doc = "Idle line"]
1369    IDLE,
1370    #[doc = "Address mask"]
1371    ADDRESS,
1372}
1373impl WAKEW {
1374    #[allow(missing_docs)]
1375    #[doc(hidden)]
1376    #[inline]
1377    pub fn _bits(&self) -> bool {
1378        match *self {
1379            WAKEW::IDLE => false,
1380            WAKEW::ADDRESS => true,
1381        }
1382    }
1383}
1384#[doc = r" Proxy"]
1385pub struct _WAKEW<'a> {
1386    w: &'a mut W,
1387}
1388impl<'a> _WAKEW<'a> {
1389    #[doc = r" Writes `variant` to the field"]
1390    #[inline]
1391    pub fn variant(self, variant: WAKEW) -> &'a mut W {
1392        {
1393            self.bit(variant._bits())
1394        }
1395    }
1396    #[doc = "Idle line"]
1397    #[inline]
1398    pub fn idle(self) -> &'a mut W {
1399        self.variant(WAKEW::IDLE)
1400    }
1401    #[doc = "Address mask"]
1402    #[inline]
1403    pub fn address(self) -> &'a mut W {
1404        self.variant(WAKEW::ADDRESS)
1405    }
1406    #[doc = r" Sets the field bit"]
1407    pub fn set_bit(self) -> &'a mut W {
1408        self.bit(true)
1409    }
1410    #[doc = r" Clears the field bit"]
1411    pub fn clear_bit(self) -> &'a mut W {
1412        self.bit(false)
1413    }
1414    #[doc = r" Writes raw bits to the field"]
1415    #[inline]
1416    pub fn bit(self, value: bool) -> &'a mut W {
1417        const MASK: bool = true;
1418        const OFFSET: u8 = 11;
1419        self.w.bits &= !((MASK as u32) << OFFSET);
1420        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1421        self.w
1422    }
1423}
1424#[doc = "Values that can be written to the field `PCE`"]
1425pub enum PCEW {
1426    #[doc = "Parity control disabled"]
1427    DISABLED,
1428    #[doc = "Parity control enabled"]
1429    ENABLED,
1430}
1431impl PCEW {
1432    #[allow(missing_docs)]
1433    #[doc(hidden)]
1434    #[inline]
1435    pub fn _bits(&self) -> bool {
1436        match *self {
1437            PCEW::DISABLED => false,
1438            PCEW::ENABLED => true,
1439        }
1440    }
1441}
1442#[doc = r" Proxy"]
1443pub struct _PCEW<'a> {
1444    w: &'a mut W,
1445}
1446impl<'a> _PCEW<'a> {
1447    #[doc = r" Writes `variant` to the field"]
1448    #[inline]
1449    pub fn variant(self, variant: PCEW) -> &'a mut W {
1450        {
1451            self.bit(variant._bits())
1452        }
1453    }
1454    #[doc = "Parity control disabled"]
1455    #[inline]
1456    pub fn disabled(self) -> &'a mut W {
1457        self.variant(PCEW::DISABLED)
1458    }
1459    #[doc = "Parity control enabled"]
1460    #[inline]
1461    pub fn enabled(self) -> &'a mut W {
1462        self.variant(PCEW::ENABLED)
1463    }
1464    #[doc = r" Sets the field bit"]
1465    pub fn set_bit(self) -> &'a mut W {
1466        self.bit(true)
1467    }
1468    #[doc = r" Clears the field bit"]
1469    pub fn clear_bit(self) -> &'a mut W {
1470        self.bit(false)
1471    }
1472    #[doc = r" Writes raw bits to the field"]
1473    #[inline]
1474    pub fn bit(self, value: bool) -> &'a mut W {
1475        const MASK: bool = true;
1476        const OFFSET: u8 = 10;
1477        self.w.bits &= !((MASK as u32) << OFFSET);
1478        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1479        self.w
1480    }
1481}
1482#[doc = "Values that can be written to the field `PS`"]
1483pub enum PSW {
1484    #[doc = "Even parity"]
1485    EVEN,
1486    #[doc = "Odd parity"]
1487    ODD,
1488}
1489impl PSW {
1490    #[allow(missing_docs)]
1491    #[doc(hidden)]
1492    #[inline]
1493    pub fn _bits(&self) -> bool {
1494        match *self {
1495            PSW::EVEN => false,
1496            PSW::ODD => true,
1497        }
1498    }
1499}
1500#[doc = r" Proxy"]
1501pub struct _PSW<'a> {
1502    w: &'a mut W,
1503}
1504impl<'a> _PSW<'a> {
1505    #[doc = r" Writes `variant` to the field"]
1506    #[inline]
1507    pub fn variant(self, variant: PSW) -> &'a mut W {
1508        {
1509            self.bit(variant._bits())
1510        }
1511    }
1512    #[doc = "Even parity"]
1513    #[inline]
1514    pub fn even(self) -> &'a mut W {
1515        self.variant(PSW::EVEN)
1516    }
1517    #[doc = "Odd parity"]
1518    #[inline]
1519    pub fn odd(self) -> &'a mut W {
1520        self.variant(PSW::ODD)
1521    }
1522    #[doc = r" Sets the field bit"]
1523    pub fn set_bit(self) -> &'a mut W {
1524        self.bit(true)
1525    }
1526    #[doc = r" Clears the field bit"]
1527    pub fn clear_bit(self) -> &'a mut W {
1528        self.bit(false)
1529    }
1530    #[doc = r" Writes raw bits to the field"]
1531    #[inline]
1532    pub fn bit(self, value: bool) -> &'a mut W {
1533        const MASK: bool = true;
1534        const OFFSET: u8 = 9;
1535        self.w.bits &= !((MASK as u32) << OFFSET);
1536        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1537        self.w
1538    }
1539}
1540#[doc = "Values that can be written to the field `PEIE`"]
1541pub enum PEIEW {
1542    #[doc = "Interrupt is disabled"]
1543    DISABLED,
1544    #[doc = "Interrupt is generated whenever PE=1 in the ISR register"]
1545    ENABLED,
1546}
1547impl PEIEW {
1548    #[allow(missing_docs)]
1549    #[doc(hidden)]
1550    #[inline]
1551    pub fn _bits(&self) -> bool {
1552        match *self {
1553            PEIEW::DISABLED => false,
1554            PEIEW::ENABLED => true,
1555        }
1556    }
1557}
1558#[doc = r" Proxy"]
1559pub struct _PEIEW<'a> {
1560    w: &'a mut W,
1561}
1562impl<'a> _PEIEW<'a> {
1563    #[doc = r" Writes `variant` to the field"]
1564    #[inline]
1565    pub fn variant(self, variant: PEIEW) -> &'a mut W {
1566        {
1567            self.bit(variant._bits())
1568        }
1569    }
1570    #[doc = "Interrupt is disabled"]
1571    #[inline]
1572    pub fn disabled(self) -> &'a mut W {
1573        self.variant(PEIEW::DISABLED)
1574    }
1575    #[doc = "Interrupt is generated whenever PE=1 in the ISR register"]
1576    #[inline]
1577    pub fn enabled(self) -> &'a mut W {
1578        self.variant(PEIEW::ENABLED)
1579    }
1580    #[doc = r" Sets the field bit"]
1581    pub fn set_bit(self) -> &'a mut W {
1582        self.bit(true)
1583    }
1584    #[doc = r" Clears the field bit"]
1585    pub fn clear_bit(self) -> &'a mut W {
1586        self.bit(false)
1587    }
1588    #[doc = r" Writes raw bits to the field"]
1589    #[inline]
1590    pub fn bit(self, value: bool) -> &'a mut W {
1591        const MASK: bool = true;
1592        const OFFSET: u8 = 8;
1593        self.w.bits &= !((MASK as u32) << OFFSET);
1594        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1595        self.w
1596    }
1597}
1598#[doc = "Values that can be written to the field `TXEIE`"]
1599pub enum TXEIEW {
1600    #[doc = "Interrupt is disabled"]
1601    DISABLED,
1602    #[doc = "Interrupt is generated whenever TXE=1 in the ISR register"]
1603    ENABLED,
1604}
1605impl TXEIEW {
1606    #[allow(missing_docs)]
1607    #[doc(hidden)]
1608    #[inline]
1609    pub fn _bits(&self) -> bool {
1610        match *self {
1611            TXEIEW::DISABLED => false,
1612            TXEIEW::ENABLED => true,
1613        }
1614    }
1615}
1616#[doc = r" Proxy"]
1617pub struct _TXEIEW<'a> {
1618    w: &'a mut W,
1619}
1620impl<'a> _TXEIEW<'a> {
1621    #[doc = r" Writes `variant` to the field"]
1622    #[inline]
1623    pub fn variant(self, variant: TXEIEW) -> &'a mut W {
1624        {
1625            self.bit(variant._bits())
1626        }
1627    }
1628    #[doc = "Interrupt is disabled"]
1629    #[inline]
1630    pub fn disabled(self) -> &'a mut W {
1631        self.variant(TXEIEW::DISABLED)
1632    }
1633    #[doc = "Interrupt is generated whenever TXE=1 in the ISR register"]
1634    #[inline]
1635    pub fn enabled(self) -> &'a mut W {
1636        self.variant(TXEIEW::ENABLED)
1637    }
1638    #[doc = r" Sets the field bit"]
1639    pub fn set_bit(self) -> &'a mut W {
1640        self.bit(true)
1641    }
1642    #[doc = r" Clears the field bit"]
1643    pub fn clear_bit(self) -> &'a mut W {
1644        self.bit(false)
1645    }
1646    #[doc = r" Writes raw bits to the field"]
1647    #[inline]
1648    pub fn bit(self, value: bool) -> &'a mut W {
1649        const MASK: bool = true;
1650        const OFFSET: u8 = 7;
1651        self.w.bits &= !((MASK as u32) << OFFSET);
1652        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1653        self.w
1654    }
1655}
1656#[doc = "Values that can be written to the field `TCIE`"]
1657pub enum TCIEW {
1658    #[doc = "Interrupt is disabled"]
1659    DISABLED,
1660    #[doc = "Interrupt is generated whenever TC=1 in the ISR register"]
1661    ENABLED,
1662}
1663impl TCIEW {
1664    #[allow(missing_docs)]
1665    #[doc(hidden)]
1666    #[inline]
1667    pub fn _bits(&self) -> bool {
1668        match *self {
1669            TCIEW::DISABLED => false,
1670            TCIEW::ENABLED => true,
1671        }
1672    }
1673}
1674#[doc = r" Proxy"]
1675pub struct _TCIEW<'a> {
1676    w: &'a mut W,
1677}
1678impl<'a> _TCIEW<'a> {
1679    #[doc = r" Writes `variant` to the field"]
1680    #[inline]
1681    pub fn variant(self, variant: TCIEW) -> &'a mut W {
1682        {
1683            self.bit(variant._bits())
1684        }
1685    }
1686    #[doc = "Interrupt is disabled"]
1687    #[inline]
1688    pub fn disabled(self) -> &'a mut W {
1689        self.variant(TCIEW::DISABLED)
1690    }
1691    #[doc = "Interrupt is generated whenever TC=1 in the ISR register"]
1692    #[inline]
1693    pub fn enabled(self) -> &'a mut W {
1694        self.variant(TCIEW::ENABLED)
1695    }
1696    #[doc = r" Sets the field bit"]
1697    pub fn set_bit(self) -> &'a mut W {
1698        self.bit(true)
1699    }
1700    #[doc = r" Clears the field bit"]
1701    pub fn clear_bit(self) -> &'a mut W {
1702        self.bit(false)
1703    }
1704    #[doc = r" Writes raw bits to the field"]
1705    #[inline]
1706    pub fn bit(self, value: bool) -> &'a mut W {
1707        const MASK: bool = true;
1708        const OFFSET: u8 = 6;
1709        self.w.bits &= !((MASK as u32) << OFFSET);
1710        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1711        self.w
1712    }
1713}
1714#[doc = "Values that can be written to the field `RXNEIE`"]
1715pub enum RXNEIEW {
1716    #[doc = "Interrupt is disabled"]
1717    DISABLED,
1718    #[doc = "Interrupt is generated whenever ORE=1 or RXNE=1 in the ISR register"]
1719    ENABLED,
1720}
1721impl RXNEIEW {
1722    #[allow(missing_docs)]
1723    #[doc(hidden)]
1724    #[inline]
1725    pub fn _bits(&self) -> bool {
1726        match *self {
1727            RXNEIEW::DISABLED => false,
1728            RXNEIEW::ENABLED => true,
1729        }
1730    }
1731}
1732#[doc = r" Proxy"]
1733pub struct _RXNEIEW<'a> {
1734    w: &'a mut W,
1735}
1736impl<'a> _RXNEIEW<'a> {
1737    #[doc = r" Writes `variant` to the field"]
1738    #[inline]
1739    pub fn variant(self, variant: RXNEIEW) -> &'a mut W {
1740        {
1741            self.bit(variant._bits())
1742        }
1743    }
1744    #[doc = "Interrupt is disabled"]
1745    #[inline]
1746    pub fn disabled(self) -> &'a mut W {
1747        self.variant(RXNEIEW::DISABLED)
1748    }
1749    #[doc = "Interrupt is generated whenever ORE=1 or RXNE=1 in the ISR register"]
1750    #[inline]
1751    pub fn enabled(self) -> &'a mut W {
1752        self.variant(RXNEIEW::ENABLED)
1753    }
1754    #[doc = r" Sets the field bit"]
1755    pub fn set_bit(self) -> &'a mut W {
1756        self.bit(true)
1757    }
1758    #[doc = r" Clears the field bit"]
1759    pub fn clear_bit(self) -> &'a mut W {
1760        self.bit(false)
1761    }
1762    #[doc = r" Writes raw bits to the field"]
1763    #[inline]
1764    pub fn bit(self, value: bool) -> &'a mut W {
1765        const MASK: bool = true;
1766        const OFFSET: u8 = 5;
1767        self.w.bits &= !((MASK as u32) << OFFSET);
1768        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1769        self.w
1770    }
1771}
1772#[doc = "Values that can be written to the field `IDLEIE`"]
1773pub enum IDLEIEW {
1774    #[doc = "Interrupt is disabled"]
1775    DISABLED,
1776    #[doc = "Interrupt is generated whenever IDLE=1 in the ISR register"]
1777    ENABLED,
1778}
1779impl IDLEIEW {
1780    #[allow(missing_docs)]
1781    #[doc(hidden)]
1782    #[inline]
1783    pub fn _bits(&self) -> bool {
1784        match *self {
1785            IDLEIEW::DISABLED => false,
1786            IDLEIEW::ENABLED => true,
1787        }
1788    }
1789}
1790#[doc = r" Proxy"]
1791pub struct _IDLEIEW<'a> {
1792    w: &'a mut W,
1793}
1794impl<'a> _IDLEIEW<'a> {
1795    #[doc = r" Writes `variant` to the field"]
1796    #[inline]
1797    pub fn variant(self, variant: IDLEIEW) -> &'a mut W {
1798        {
1799            self.bit(variant._bits())
1800        }
1801    }
1802    #[doc = "Interrupt is disabled"]
1803    #[inline]
1804    pub fn disabled(self) -> &'a mut W {
1805        self.variant(IDLEIEW::DISABLED)
1806    }
1807    #[doc = "Interrupt is generated whenever IDLE=1 in the ISR register"]
1808    #[inline]
1809    pub fn enabled(self) -> &'a mut W {
1810        self.variant(IDLEIEW::ENABLED)
1811    }
1812    #[doc = r" Sets the field bit"]
1813    pub fn set_bit(self) -> &'a mut W {
1814        self.bit(true)
1815    }
1816    #[doc = r" Clears the field bit"]
1817    pub fn clear_bit(self) -> &'a mut W {
1818        self.bit(false)
1819    }
1820    #[doc = r" Writes raw bits to the field"]
1821    #[inline]
1822    pub fn bit(self, value: bool) -> &'a mut W {
1823        const MASK: bool = true;
1824        const OFFSET: u8 = 4;
1825        self.w.bits &= !((MASK as u32) << OFFSET);
1826        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1827        self.w
1828    }
1829}
1830#[doc = "Values that can be written to the field `TE`"]
1831pub enum TEW {
1832    #[doc = "Transmitter is disabled"]
1833    DISABLED,
1834    #[doc = "Transmitter is enabled"]
1835    ENABLED,
1836}
1837impl TEW {
1838    #[allow(missing_docs)]
1839    #[doc(hidden)]
1840    #[inline]
1841    pub fn _bits(&self) -> bool {
1842        match *self {
1843            TEW::DISABLED => false,
1844            TEW::ENABLED => true,
1845        }
1846    }
1847}
1848#[doc = r" Proxy"]
1849pub struct _TEW<'a> {
1850    w: &'a mut W,
1851}
1852impl<'a> _TEW<'a> {
1853    #[doc = r" Writes `variant` to the field"]
1854    #[inline]
1855    pub fn variant(self, variant: TEW) -> &'a mut W {
1856        {
1857            self.bit(variant._bits())
1858        }
1859    }
1860    #[doc = "Transmitter is disabled"]
1861    #[inline]
1862    pub fn disabled(self) -> &'a mut W {
1863        self.variant(TEW::DISABLED)
1864    }
1865    #[doc = "Transmitter is enabled"]
1866    #[inline]
1867    pub fn enabled(self) -> &'a mut W {
1868        self.variant(TEW::ENABLED)
1869    }
1870    #[doc = r" Sets the field bit"]
1871    pub fn set_bit(self) -> &'a mut W {
1872        self.bit(true)
1873    }
1874    #[doc = r" Clears the field bit"]
1875    pub fn clear_bit(self) -> &'a mut W {
1876        self.bit(false)
1877    }
1878    #[doc = r" Writes raw bits to the field"]
1879    #[inline]
1880    pub fn bit(self, value: bool) -> &'a mut W {
1881        const MASK: bool = true;
1882        const OFFSET: u8 = 3;
1883        self.w.bits &= !((MASK as u32) << OFFSET);
1884        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1885        self.w
1886    }
1887}
1888#[doc = "Values that can be written to the field `RE`"]
1889pub enum REW {
1890    #[doc = "Receiver is disabled"]
1891    DISABLED,
1892    #[doc = "Receiver is enabled"]
1893    ENABLED,
1894}
1895impl REW {
1896    #[allow(missing_docs)]
1897    #[doc(hidden)]
1898    #[inline]
1899    pub fn _bits(&self) -> bool {
1900        match *self {
1901            REW::DISABLED => false,
1902            REW::ENABLED => true,
1903        }
1904    }
1905}
1906#[doc = r" Proxy"]
1907pub struct _REW<'a> {
1908    w: &'a mut W,
1909}
1910impl<'a> _REW<'a> {
1911    #[doc = r" Writes `variant` to the field"]
1912    #[inline]
1913    pub fn variant(self, variant: REW) -> &'a mut W {
1914        {
1915            self.bit(variant._bits())
1916        }
1917    }
1918    #[doc = "Receiver is disabled"]
1919    #[inline]
1920    pub fn disabled(self) -> &'a mut W {
1921        self.variant(REW::DISABLED)
1922    }
1923    #[doc = "Receiver is enabled"]
1924    #[inline]
1925    pub fn enabled(self) -> &'a mut W {
1926        self.variant(REW::ENABLED)
1927    }
1928    #[doc = r" Sets the field bit"]
1929    pub fn set_bit(self) -> &'a mut W {
1930        self.bit(true)
1931    }
1932    #[doc = r" Clears the field bit"]
1933    pub fn clear_bit(self) -> &'a mut W {
1934        self.bit(false)
1935    }
1936    #[doc = r" Writes raw bits to the field"]
1937    #[inline]
1938    pub fn bit(self, value: bool) -> &'a mut W {
1939        const MASK: bool = true;
1940        const OFFSET: u8 = 2;
1941        self.w.bits &= !((MASK as u32) << OFFSET);
1942        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1943        self.w
1944    }
1945}
1946#[doc = "Values that can be written to the field `UESM`"]
1947pub enum UESMW {
1948    #[doc = "USART not able to wake up the MCU from Stop mode"]
1949    DISABLED,
1950    #[doc = "USART able to wake up the MCU from Stop mode"]
1951    ENABLED,
1952}
1953impl UESMW {
1954    #[allow(missing_docs)]
1955    #[doc(hidden)]
1956    #[inline]
1957    pub fn _bits(&self) -> bool {
1958        match *self {
1959            UESMW::DISABLED => false,
1960            UESMW::ENABLED => true,
1961        }
1962    }
1963}
1964#[doc = r" Proxy"]
1965pub struct _UESMW<'a> {
1966    w: &'a mut W,
1967}
1968impl<'a> _UESMW<'a> {
1969    #[doc = r" Writes `variant` to the field"]
1970    #[inline]
1971    pub fn variant(self, variant: UESMW) -> &'a mut W {
1972        {
1973            self.bit(variant._bits())
1974        }
1975    }
1976    #[doc = "USART not able to wake up the MCU from Stop mode"]
1977    #[inline]
1978    pub fn disabled(self) -> &'a mut W {
1979        self.variant(UESMW::DISABLED)
1980    }
1981    #[doc = "USART able to wake up the MCU from Stop mode"]
1982    #[inline]
1983    pub fn enabled(self) -> &'a mut W {
1984        self.variant(UESMW::ENABLED)
1985    }
1986    #[doc = r" Sets the field bit"]
1987    pub fn set_bit(self) -> &'a mut W {
1988        self.bit(true)
1989    }
1990    #[doc = r" Clears the field bit"]
1991    pub fn clear_bit(self) -> &'a mut W {
1992        self.bit(false)
1993    }
1994    #[doc = r" Writes raw bits to the field"]
1995    #[inline]
1996    pub fn bit(self, value: bool) -> &'a mut W {
1997        const MASK: bool = true;
1998        const OFFSET: u8 = 1;
1999        self.w.bits &= !((MASK as u32) << OFFSET);
2000        self.w.bits |= ((value & MASK) as u32) << OFFSET;
2001        self.w
2002    }
2003}
2004#[doc = "Values that can be written to the field `UE`"]
2005pub enum UEW {
2006    #[doc = "UART is disabled"]
2007    DISABLED,
2008    #[doc = "UART is enabled"]
2009    ENABLED,
2010}
2011impl UEW {
2012    #[allow(missing_docs)]
2013    #[doc(hidden)]
2014    #[inline]
2015    pub fn _bits(&self) -> bool {
2016        match *self {
2017            UEW::DISABLED => false,
2018            UEW::ENABLED => true,
2019        }
2020    }
2021}
2022#[doc = r" Proxy"]
2023pub struct _UEW<'a> {
2024    w: &'a mut W,
2025}
2026impl<'a> _UEW<'a> {
2027    #[doc = r" Writes `variant` to the field"]
2028    #[inline]
2029    pub fn variant(self, variant: UEW) -> &'a mut W {
2030        {
2031            self.bit(variant._bits())
2032        }
2033    }
2034    #[doc = "UART is disabled"]
2035    #[inline]
2036    pub fn disabled(self) -> &'a mut W {
2037        self.variant(UEW::DISABLED)
2038    }
2039    #[doc = "UART is enabled"]
2040    #[inline]
2041    pub fn enabled(self) -> &'a mut W {
2042        self.variant(UEW::ENABLED)
2043    }
2044    #[doc = r" Sets the field bit"]
2045    pub fn set_bit(self) -> &'a mut W {
2046        self.bit(true)
2047    }
2048    #[doc = r" Clears the field bit"]
2049    pub fn clear_bit(self) -> &'a mut W {
2050        self.bit(false)
2051    }
2052    #[doc = r" Writes raw bits to the field"]
2053    #[inline]
2054    pub fn bit(self, value: bool) -> &'a mut W {
2055        const MASK: bool = true;
2056        const OFFSET: u8 = 0;
2057        self.w.bits &= !((MASK as u32) << OFFSET);
2058        self.w.bits |= ((value & MASK) as u32) << OFFSET;
2059        self.w
2060    }
2061}
2062#[doc = r" Proxy"]
2063pub struct _DEATW<'a> {
2064    w: &'a mut W,
2065}
2066impl<'a> _DEATW<'a> {
2067    #[doc = r" Writes raw bits to the field"]
2068    #[inline]
2069    pub fn bits(self, value: u8) -> &'a mut W {
2070        const MASK: u8 = 31;
2071        const OFFSET: u8 = 21;
2072        self.w.bits &= !((MASK as u32) << OFFSET);
2073        self.w.bits |= ((value & MASK) as u32) << OFFSET;
2074        self.w
2075    }
2076}
2077#[doc = r" Proxy"]
2078pub struct _DEDTW<'a> {
2079    w: &'a mut W,
2080}
2081impl<'a> _DEDTW<'a> {
2082    #[doc = r" Writes raw bits to the field"]
2083    #[inline]
2084    pub fn bits(self, value: u8) -> &'a mut W {
2085        const MASK: u8 = 31;
2086        const OFFSET: u8 = 16;
2087        self.w.bits &= !((MASK as u32) << OFFSET);
2088        self.w.bits |= ((value & MASK) as u32) << OFFSET;
2089        self.w
2090    }
2091}
2092impl R {
2093    #[doc = r" Value of the register as raw bits"]
2094    #[inline]
2095    pub fn bits(&self) -> u32 {
2096        self.bits
2097    }
2098    #[doc = "Bit 28 - Word length"]
2099    #[inline]
2100    pub fn m1(&self) -> M1R {
2101        M1R::_from({
2102            const MASK: bool = true;
2103            const OFFSET: u8 = 28;
2104            ((self.bits >> OFFSET) & MASK as u32) != 0
2105        })
2106    }
2107    #[doc = "Bit 27 - End of Block interrupt enable"]
2108    #[inline]
2109    pub fn eobie(&self) -> EOBIER {
2110        EOBIER::_from({
2111            const MASK: bool = true;
2112            const OFFSET: u8 = 27;
2113            ((self.bits >> OFFSET) & MASK as u32) != 0
2114        })
2115    }
2116    #[doc = "Bit 26 - Receiver timeout interrupt enable"]
2117    #[inline]
2118    pub fn rtoie(&self) -> RTOIER {
2119        RTOIER::_from({
2120            const MASK: bool = true;
2121            const OFFSET: u8 = 26;
2122            ((self.bits >> OFFSET) & MASK as u32) != 0
2123        })
2124    }
2125    #[doc = "Bit 15 - Oversampling mode"]
2126    #[inline]
2127    pub fn over8(&self) -> OVER8R {
2128        OVER8R::_from({
2129            const MASK: bool = true;
2130            const OFFSET: u8 = 15;
2131            ((self.bits >> OFFSET) & MASK as u32) != 0
2132        })
2133    }
2134    #[doc = "Bit 14 - Character match interrupt enable"]
2135    #[inline]
2136    pub fn cmie(&self) -> CMIER {
2137        CMIER::_from({
2138            const MASK: bool = true;
2139            const OFFSET: u8 = 14;
2140            ((self.bits >> OFFSET) & MASK as u32) != 0
2141        })
2142    }
2143    #[doc = "Bit 13 - Mute mode enable"]
2144    #[inline]
2145    pub fn mme(&self) -> MMER {
2146        MMER::_from({
2147            const MASK: bool = true;
2148            const OFFSET: u8 = 13;
2149            ((self.bits >> OFFSET) & MASK as u32) != 0
2150        })
2151    }
2152    #[doc = "Bit 12 - Word length"]
2153    #[inline]
2154    pub fn m0(&self) -> M0R {
2155        M0R::_from({
2156            const MASK: bool = true;
2157            const OFFSET: u8 = 12;
2158            ((self.bits >> OFFSET) & MASK as u32) != 0
2159        })
2160    }
2161    #[doc = "Bit 11 - Receiver wakeup method"]
2162    #[inline]
2163    pub fn wake(&self) -> WAKER {
2164        WAKER::_from({
2165            const MASK: bool = true;
2166            const OFFSET: u8 = 11;
2167            ((self.bits >> OFFSET) & MASK as u32) != 0
2168        })
2169    }
2170    #[doc = "Bit 10 - Parity control enable"]
2171    #[inline]
2172    pub fn pce(&self) -> PCER {
2173        PCER::_from({
2174            const MASK: bool = true;
2175            const OFFSET: u8 = 10;
2176            ((self.bits >> OFFSET) & MASK as u32) != 0
2177        })
2178    }
2179    #[doc = "Bit 9 - Parity selection"]
2180    #[inline]
2181    pub fn ps(&self) -> PSR {
2182        PSR::_from({
2183            const MASK: bool = true;
2184            const OFFSET: u8 = 9;
2185            ((self.bits >> OFFSET) & MASK as u32) != 0
2186        })
2187    }
2188    #[doc = "Bit 8 - PE interrupt enable"]
2189    #[inline]
2190    pub fn peie(&self) -> PEIER {
2191        PEIER::_from({
2192            const MASK: bool = true;
2193            const OFFSET: u8 = 8;
2194            ((self.bits >> OFFSET) & MASK as u32) != 0
2195        })
2196    }
2197    #[doc = "Bit 7 - interrupt enable"]
2198    #[inline]
2199    pub fn txeie(&self) -> TXEIER {
2200        TXEIER::_from({
2201            const MASK: bool = true;
2202            const OFFSET: u8 = 7;
2203            ((self.bits >> OFFSET) & MASK as u32) != 0
2204        })
2205    }
2206    #[doc = "Bit 6 - Transmission complete interrupt enable"]
2207    #[inline]
2208    pub fn tcie(&self) -> TCIER {
2209        TCIER::_from({
2210            const MASK: bool = true;
2211            const OFFSET: u8 = 6;
2212            ((self.bits >> OFFSET) & MASK as u32) != 0
2213        })
2214    }
2215    #[doc = "Bit 5 - RXNE interrupt enable"]
2216    #[inline]
2217    pub fn rxneie(&self) -> RXNEIER {
2218        RXNEIER::_from({
2219            const MASK: bool = true;
2220            const OFFSET: u8 = 5;
2221            ((self.bits >> OFFSET) & MASK as u32) != 0
2222        })
2223    }
2224    #[doc = "Bit 4 - IDLE interrupt enable"]
2225    #[inline]
2226    pub fn idleie(&self) -> IDLEIER {
2227        IDLEIER::_from({
2228            const MASK: bool = true;
2229            const OFFSET: u8 = 4;
2230            ((self.bits >> OFFSET) & MASK as u32) != 0
2231        })
2232    }
2233    #[doc = "Bit 3 - Transmitter enable"]
2234    #[inline]
2235    pub fn te(&self) -> TER {
2236        TER::_from({
2237            const MASK: bool = true;
2238            const OFFSET: u8 = 3;
2239            ((self.bits >> OFFSET) & MASK as u32) != 0
2240        })
2241    }
2242    #[doc = "Bit 2 - Receiver enable"]
2243    #[inline]
2244    pub fn re(&self) -> RER {
2245        RER::_from({
2246            const MASK: bool = true;
2247            const OFFSET: u8 = 2;
2248            ((self.bits >> OFFSET) & MASK as u32) != 0
2249        })
2250    }
2251    #[doc = "Bit 1 - USART enable in Stop mode"]
2252    #[inline]
2253    pub fn uesm(&self) -> UESMR {
2254        UESMR::_from({
2255            const MASK: bool = true;
2256            const OFFSET: u8 = 1;
2257            ((self.bits >> OFFSET) & MASK as u32) != 0
2258        })
2259    }
2260    #[doc = "Bit 0 - USART enable"]
2261    #[inline]
2262    pub fn ue(&self) -> UER {
2263        UER::_from({
2264            const MASK: bool = true;
2265            const OFFSET: u8 = 0;
2266            ((self.bits >> OFFSET) & MASK as u32) != 0
2267        })
2268    }
2269    #[doc = "Bits 21:25 - Driver Enable assertion time"]
2270    #[inline]
2271    pub fn deat(&self) -> DEATR {
2272        let bits = {
2273            const MASK: u8 = 31;
2274            const OFFSET: u8 = 21;
2275            ((self.bits >> OFFSET) & MASK as u32) as u8
2276        };
2277        DEATR { bits }
2278    }
2279    #[doc = "Bits 16:20 - Driver Enable de-assertion time"]
2280    #[inline]
2281    pub fn dedt(&self) -> DEDTR {
2282        let bits = {
2283            const MASK: u8 = 31;
2284            const OFFSET: u8 = 16;
2285            ((self.bits >> OFFSET) & MASK as u32) as u8
2286        };
2287        DEDTR { bits }
2288    }
2289}
2290impl W {
2291    #[doc = r" Reset value of the register"]
2292    #[inline]
2293    pub fn reset_value() -> W {
2294        W { bits: 0 }
2295    }
2296    #[doc = r" Writes raw bits to the register"]
2297    #[inline]
2298    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
2299        self.bits = bits;
2300        self
2301    }
2302    #[doc = "Bit 28 - Word length"]
2303    #[inline]
2304    pub fn m1(&mut self) -> _M1W {
2305        _M1W { w: self }
2306    }
2307    #[doc = "Bit 27 - End of Block interrupt enable"]
2308    #[inline]
2309    pub fn eobie(&mut self) -> _EOBIEW {
2310        _EOBIEW { w: self }
2311    }
2312    #[doc = "Bit 26 - Receiver timeout interrupt enable"]
2313    #[inline]
2314    pub fn rtoie(&mut self) -> _RTOIEW {
2315        _RTOIEW { w: self }
2316    }
2317    #[doc = "Bit 15 - Oversampling mode"]
2318    #[inline]
2319    pub fn over8(&mut self) -> _OVER8W {
2320        _OVER8W { w: self }
2321    }
2322    #[doc = "Bit 14 - Character match interrupt enable"]
2323    #[inline]
2324    pub fn cmie(&mut self) -> _CMIEW {
2325        _CMIEW { w: self }
2326    }
2327    #[doc = "Bit 13 - Mute mode enable"]
2328    #[inline]
2329    pub fn mme(&mut self) -> _MMEW {
2330        _MMEW { w: self }
2331    }
2332    #[doc = "Bit 12 - Word length"]
2333    #[inline]
2334    pub fn m0(&mut self) -> _M0W {
2335        _M0W { w: self }
2336    }
2337    #[doc = "Bit 11 - Receiver wakeup method"]
2338    #[inline]
2339    pub fn wake(&mut self) -> _WAKEW {
2340        _WAKEW { w: self }
2341    }
2342    #[doc = "Bit 10 - Parity control enable"]
2343    #[inline]
2344    pub fn pce(&mut self) -> _PCEW {
2345        _PCEW { w: self }
2346    }
2347    #[doc = "Bit 9 - Parity selection"]
2348    #[inline]
2349    pub fn ps(&mut self) -> _PSW {
2350        _PSW { w: self }
2351    }
2352    #[doc = "Bit 8 - PE interrupt enable"]
2353    #[inline]
2354    pub fn peie(&mut self) -> _PEIEW {
2355        _PEIEW { w: self }
2356    }
2357    #[doc = "Bit 7 - interrupt enable"]
2358    #[inline]
2359    pub fn txeie(&mut self) -> _TXEIEW {
2360        _TXEIEW { w: self }
2361    }
2362    #[doc = "Bit 6 - Transmission complete interrupt enable"]
2363    #[inline]
2364    pub fn tcie(&mut self) -> _TCIEW {
2365        _TCIEW { w: self }
2366    }
2367    #[doc = "Bit 5 - RXNE interrupt enable"]
2368    #[inline]
2369    pub fn rxneie(&mut self) -> _RXNEIEW {
2370        _RXNEIEW { w: self }
2371    }
2372    #[doc = "Bit 4 - IDLE interrupt enable"]
2373    #[inline]
2374    pub fn idleie(&mut self) -> _IDLEIEW {
2375        _IDLEIEW { w: self }
2376    }
2377    #[doc = "Bit 3 - Transmitter enable"]
2378    #[inline]
2379    pub fn te(&mut self) -> _TEW {
2380        _TEW { w: self }
2381    }
2382    #[doc = "Bit 2 - Receiver enable"]
2383    #[inline]
2384    pub fn re(&mut self) -> _REW {
2385        _REW { w: self }
2386    }
2387    #[doc = "Bit 1 - USART enable in Stop mode"]
2388    #[inline]
2389    pub fn uesm(&mut self) -> _UESMW {
2390        _UESMW { w: self }
2391    }
2392    #[doc = "Bit 0 - USART enable"]
2393    #[inline]
2394    pub fn ue(&mut self) -> _UEW {
2395        _UEW { w: self }
2396    }
2397    #[doc = "Bits 21:25 - Driver Enable assertion time"]
2398    #[inline]
2399    pub fn deat(&mut self) -> _DEATW {
2400        _DEATW { w: self }
2401    }
2402    #[doc = "Bits 16:20 - Driver Enable de-assertion time"]
2403    #[inline]
2404    pub fn dedt(&mut self) -> _DEDTW {
2405        _DEDTW { w: self }
2406    }
2407}