stm32l4x2_pac/lpuart1/
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 `CMIE`"]
93#[derive(Clone, Copy, Debug, PartialEq)]
94pub enum CMIER {
95    #[doc = "Interrupt is disabled"]
96    DISABLED,
97    #[doc = "Interrupt is generated when the CMF bit is set in the ISR register"]
98    ENABLED,
99}
100impl CMIER {
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            CMIER::DISABLED => false,
116            CMIER::ENABLED => true,
117        }
118    }
119    #[allow(missing_docs)]
120    #[doc(hidden)]
121    #[inline]
122    pub fn _from(value: bool) -> CMIER {
123        match value {
124            false => CMIER::DISABLED,
125            true => CMIER::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 == CMIER::DISABLED
132    }
133    #[doc = "Checks if the value of the field is `ENABLED`"]
134    #[inline]
135    pub fn is_enabled(&self) -> bool {
136        *self == CMIER::ENABLED
137    }
138}
139#[doc = "Possible values of the field `MME`"]
140#[derive(Clone, Copy, Debug, PartialEq)]
141pub enum MMER {
142    #[doc = "Receiver in active mode permanently"]
143    DISABLED,
144    #[doc = "Receiver can switch between mute mode and active mode"]
145    ENABLED,
146}
147impl MMER {
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            MMER::DISABLED => false,
163            MMER::ENABLED => true,
164        }
165    }
166    #[allow(missing_docs)]
167    #[doc(hidden)]
168    #[inline]
169    pub fn _from(value: bool) -> MMER {
170        match value {
171            false => MMER::DISABLED,
172            true => MMER::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 == MMER::DISABLED
179    }
180    #[doc = "Checks if the value of the field is `ENABLED`"]
181    #[inline]
182    pub fn is_enabled(&self) -> bool {
183        *self == MMER::ENABLED
184    }
185}
186#[doc = "Possible values of the field `M0`"]
187#[derive(Clone, Copy, Debug, PartialEq)]
188pub enum M0R {
189    #[doc = "1 start bit, 8 data bits, n stop bits"]
190    BIT8,
191    #[doc = "1 start bit, 9 data bits, n stop bits"]
192    BIT9,
193}
194impl M0R {
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            M0R::BIT8 => false,
210            M0R::BIT9 => true,
211        }
212    }
213    #[allow(missing_docs)]
214    #[doc(hidden)]
215    #[inline]
216    pub fn _from(value: bool) -> M0R {
217        match value {
218            false => M0R::BIT8,
219            true => M0R::BIT9,
220        }
221    }
222    #[doc = "Checks if the value of the field is `BIT8`"]
223    #[inline]
224    pub fn is_bit8(&self) -> bool {
225        *self == M0R::BIT8
226    }
227    #[doc = "Checks if the value of the field is `BIT9`"]
228    #[inline]
229    pub fn is_bit9(&self) -> bool {
230        *self == M0R::BIT9
231    }
232}
233#[doc = "Possible values of the field `WAKE`"]
234#[derive(Clone, Copy, Debug, PartialEq)]
235pub enum WAKER {
236    #[doc = "Idle line"]
237    IDLE,
238    #[doc = "Address mask"]
239    ADDRESS,
240}
241impl WAKER {
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            WAKER::IDLE => false,
257            WAKER::ADDRESS => true,
258        }
259    }
260    #[allow(missing_docs)]
261    #[doc(hidden)]
262    #[inline]
263    pub fn _from(value: bool) -> WAKER {
264        match value {
265            false => WAKER::IDLE,
266            true => WAKER::ADDRESS,
267        }
268    }
269    #[doc = "Checks if the value of the field is `IDLE`"]
270    #[inline]
271    pub fn is_idle(&self) -> bool {
272        *self == WAKER::IDLE
273    }
274    #[doc = "Checks if the value of the field is `ADDRESS`"]
275    #[inline]
276    pub fn is_address(&self) -> bool {
277        *self == WAKER::ADDRESS
278    }
279}
280#[doc = "Possible values of the field `PCE`"]
281#[derive(Clone, Copy, Debug, PartialEq)]
282pub enum PCER {
283    #[doc = "Parity control disabled"]
284    DISABLED,
285    #[doc = "Parity control enabled"]
286    ENABLED,
287}
288impl PCER {
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            PCER::DISABLED => false,
304            PCER::ENABLED => true,
305        }
306    }
307    #[allow(missing_docs)]
308    #[doc(hidden)]
309    #[inline]
310    pub fn _from(value: bool) -> PCER {
311        match value {
312            false => PCER::DISABLED,
313            true => PCER::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 == PCER::DISABLED
320    }
321    #[doc = "Checks if the value of the field is `ENABLED`"]
322    #[inline]
323    pub fn is_enabled(&self) -> bool {
324        *self == PCER::ENABLED
325    }
326}
327#[doc = "Possible values of the field `PS`"]
328#[derive(Clone, Copy, Debug, PartialEq)]
329pub enum PSR {
330    #[doc = "Even parity"]
331    EVEN,
332    #[doc = "Odd parity"]
333    ODD,
334}
335impl PSR {
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            PSR::EVEN => false,
351            PSR::ODD => true,
352        }
353    }
354    #[allow(missing_docs)]
355    #[doc(hidden)]
356    #[inline]
357    pub fn _from(value: bool) -> PSR {
358        match value {
359            false => PSR::EVEN,
360            true => PSR::ODD,
361        }
362    }
363    #[doc = "Checks if the value of the field is `EVEN`"]
364    #[inline]
365    pub fn is_even(&self) -> bool {
366        *self == PSR::EVEN
367    }
368    #[doc = "Checks if the value of the field is `ODD`"]
369    #[inline]
370    pub fn is_odd(&self) -> bool {
371        *self == PSR::ODD
372    }
373}
374#[doc = "Possible values of the field `PEIE`"]
375#[derive(Clone, Copy, Debug, PartialEq)]
376pub enum PEIER {
377    #[doc = "Interrupt is disabled"]
378    DISABLED,
379    #[doc = "Interrupt is generated whenever PE=1 in the ISR register"]
380    ENABLED,
381}
382impl PEIER {
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            PEIER::DISABLED => false,
398            PEIER::ENABLED => true,
399        }
400    }
401    #[allow(missing_docs)]
402    #[doc(hidden)]
403    #[inline]
404    pub fn _from(value: bool) -> PEIER {
405        match value {
406            false => PEIER::DISABLED,
407            true => PEIER::ENABLED,
408        }
409    }
410    #[doc = "Checks if the value of the field is `DISABLED`"]
411    #[inline]
412    pub fn is_disabled(&self) -> bool {
413        *self == PEIER::DISABLED
414    }
415    #[doc = "Checks if the value of the field is `ENABLED`"]
416    #[inline]
417    pub fn is_enabled(&self) -> bool {
418        *self == PEIER::ENABLED
419    }
420}
421#[doc = "Possible values of the field `TXEIE`"]
422#[derive(Clone, Copy, Debug, PartialEq)]
423pub enum TXEIER {
424    #[doc = "Interrupt is disabled"]
425    DISABLED,
426    #[doc = "Interrupt is generated whenever TXE=1 in the ISR register"]
427    ENABLED,
428}
429impl TXEIER {
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            TXEIER::DISABLED => false,
445            TXEIER::ENABLED => true,
446        }
447    }
448    #[allow(missing_docs)]
449    #[doc(hidden)]
450    #[inline]
451    pub fn _from(value: bool) -> TXEIER {
452        match value {
453            false => TXEIER::DISABLED,
454            true => TXEIER::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 == TXEIER::DISABLED
461    }
462    #[doc = "Checks if the value of the field is `ENABLED`"]
463    #[inline]
464    pub fn is_enabled(&self) -> bool {
465        *self == TXEIER::ENABLED
466    }
467}
468#[doc = "Possible values of the field `TCIE`"]
469#[derive(Clone, Copy, Debug, PartialEq)]
470pub enum TCIER {
471    #[doc = "Interrupt is disabled"]
472    DISABLED,
473    #[doc = "Interrupt is generated whenever TC=1 in the ISR register"]
474    ENABLED,
475}
476impl TCIER {
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            TCIER::DISABLED => false,
492            TCIER::ENABLED => true,
493        }
494    }
495    #[allow(missing_docs)]
496    #[doc(hidden)]
497    #[inline]
498    pub fn _from(value: bool) -> TCIER {
499        match value {
500            false => TCIER::DISABLED,
501            true => TCIER::ENABLED,
502        }
503    }
504    #[doc = "Checks if the value of the field is `DISABLED`"]
505    #[inline]
506    pub fn is_disabled(&self) -> bool {
507        *self == TCIER::DISABLED
508    }
509    #[doc = "Checks if the value of the field is `ENABLED`"]
510    #[inline]
511    pub fn is_enabled(&self) -> bool {
512        *self == TCIER::ENABLED
513    }
514}
515#[doc = "Possible values of the field `RXNEIE`"]
516#[derive(Clone, Copy, Debug, PartialEq)]
517pub enum RXNEIER {
518    #[doc = "Interrupt is disabled"]
519    DISABLED,
520    #[doc = "Interrupt is generated whenever ORE=1 or RXNE=1 in the ISR register"]
521    ENABLED,
522}
523impl RXNEIER {
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            RXNEIER::DISABLED => false,
539            RXNEIER::ENABLED => true,
540        }
541    }
542    #[allow(missing_docs)]
543    #[doc(hidden)]
544    #[inline]
545    pub fn _from(value: bool) -> RXNEIER {
546        match value {
547            false => RXNEIER::DISABLED,
548            true => RXNEIER::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 == RXNEIER::DISABLED
555    }
556    #[doc = "Checks if the value of the field is `ENABLED`"]
557    #[inline]
558    pub fn is_enabled(&self) -> bool {
559        *self == RXNEIER::ENABLED
560    }
561}
562#[doc = "Possible values of the field `IDLEIE`"]
563#[derive(Clone, Copy, Debug, PartialEq)]
564pub enum IDLEIER {
565    #[doc = "Interrupt is disabled"]
566    DISABLED,
567    #[doc = "Interrupt is generated whenever IDLE=1 in the ISR register"]
568    ENABLED,
569}
570impl IDLEIER {
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            IDLEIER::DISABLED => false,
586            IDLEIER::ENABLED => true,
587        }
588    }
589    #[allow(missing_docs)]
590    #[doc(hidden)]
591    #[inline]
592    pub fn _from(value: bool) -> IDLEIER {
593        match value {
594            false => IDLEIER::DISABLED,
595            true => IDLEIER::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 == IDLEIER::DISABLED
602    }
603    #[doc = "Checks if the value of the field is `ENABLED`"]
604    #[inline]
605    pub fn is_enabled(&self) -> bool {
606        *self == IDLEIER::ENABLED
607    }
608}
609#[doc = "Possible values of the field `TE`"]
610#[derive(Clone, Copy, Debug, PartialEq)]
611pub enum TER {
612    #[doc = "Transmitter is disabled"]
613    DISABLED,
614    #[doc = "Transmitter is enabled"]
615    ENABLED,
616}
617impl TER {
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            TER::DISABLED => false,
633            TER::ENABLED => true,
634        }
635    }
636    #[allow(missing_docs)]
637    #[doc(hidden)]
638    #[inline]
639    pub fn _from(value: bool) -> TER {
640        match value {
641            false => TER::DISABLED,
642            true => TER::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 == TER::DISABLED
649    }
650    #[doc = "Checks if the value of the field is `ENABLED`"]
651    #[inline]
652    pub fn is_enabled(&self) -> bool {
653        *self == TER::ENABLED
654    }
655}
656#[doc = "Possible values of the field `RE`"]
657#[derive(Clone, Copy, Debug, PartialEq)]
658pub enum RER {
659    #[doc = "Receiver is disabled"]
660    DISABLED,
661    #[doc = "Receiver is enabled"]
662    ENABLED,
663}
664impl RER {
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            RER::DISABLED => false,
680            RER::ENABLED => true,
681        }
682    }
683    #[allow(missing_docs)]
684    #[doc(hidden)]
685    #[inline]
686    pub fn _from(value: bool) -> RER {
687        match value {
688            false => RER::DISABLED,
689            true => RER::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 == RER::DISABLED
696    }
697    #[doc = "Checks if the value of the field is `ENABLED`"]
698    #[inline]
699    pub fn is_enabled(&self) -> bool {
700        *self == RER::ENABLED
701    }
702}
703#[doc = "Possible values of the field `UESM`"]
704#[derive(Clone, Copy, Debug, PartialEq)]
705pub enum UESMR {
706    #[doc = "USART not able to wake up the MCU from Stop mode"]
707    DISABLED,
708    #[doc = "USART able to wake up the MCU from Stop mode"]
709    ENABLED,
710}
711impl UESMR {
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            UESMR::DISABLED => false,
727            UESMR::ENABLED => true,
728        }
729    }
730    #[allow(missing_docs)]
731    #[doc(hidden)]
732    #[inline]
733    pub fn _from(value: bool) -> UESMR {
734        match value {
735            false => UESMR::DISABLED,
736            true => UESMR::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 == UESMR::DISABLED
743    }
744    #[doc = "Checks if the value of the field is `ENABLED`"]
745    #[inline]
746    pub fn is_enabled(&self) -> bool {
747        *self == UESMR::ENABLED
748    }
749}
750#[doc = "Possible values of the field `UE`"]
751#[derive(Clone, Copy, Debug, PartialEq)]
752pub enum UER {
753    #[doc = "UART is disabled"]
754    DISABLED,
755    #[doc = "UART is enabled"]
756    ENABLED,
757}
758impl UER {
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            UER::DISABLED => false,
774            UER::ENABLED => true,
775        }
776    }
777    #[allow(missing_docs)]
778    #[doc(hidden)]
779    #[inline]
780    pub fn _from(value: bool) -> UER {
781        match value {
782            false => UER::DISABLED,
783            true => UER::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 == UER::DISABLED
790    }
791    #[doc = "Checks if the value of the field is `ENABLED`"]
792    #[inline]
793    pub fn is_enabled(&self) -> bool {
794        *self == UER::ENABLED
795    }
796}
797#[doc = r" Value of the field"]
798pub struct DEATR {
799    bits: u8,
800}
801impl DEATR {
802    #[doc = r" Value of the field as raw bits"]
803    #[inline]
804    pub fn bits(&self) -> u8 {
805        self.bits
806    }
807}
808#[doc = r" Value of the field"]
809pub struct DEDTR {
810    bits: u8,
811}
812impl DEDTR {
813    #[doc = r" Value of the field as raw bits"]
814    #[inline]
815    pub fn bits(&self) -> u8 {
816        self.bits
817    }
818}
819#[doc = "Values that can be written to the field `M1`"]
820pub enum M1W {
821    #[doc = "Use M0 to set the data bits"]
822    M0,
823    #[doc = "1 start bit, 7 data bits, n stop bits"]
824    BIT7,
825}
826impl M1W {
827    #[allow(missing_docs)]
828    #[doc(hidden)]
829    #[inline]
830    pub fn _bits(&self) -> bool {
831        match *self {
832            M1W::M0 => false,
833            M1W::BIT7 => true,
834        }
835    }
836}
837#[doc = r" Proxy"]
838pub struct _M1W<'a> {
839    w: &'a mut W,
840}
841impl<'a> _M1W<'a> {
842    #[doc = r" Writes `variant` to the field"]
843    #[inline]
844    pub fn variant(self, variant: M1W) -> &'a mut W {
845        {
846            self.bit(variant._bits())
847        }
848    }
849    #[doc = "Use M0 to set the data bits"]
850    #[inline]
851    pub fn m0(self) -> &'a mut W {
852        self.variant(M1W::M0)
853    }
854    #[doc = "1 start bit, 7 data bits, n stop bits"]
855    #[inline]
856    pub fn bit7(self) -> &'a mut W {
857        self.variant(M1W::BIT7)
858    }
859    #[doc = r" Sets the field bit"]
860    pub fn set_bit(self) -> &'a mut W {
861        self.bit(true)
862    }
863    #[doc = r" Clears the field bit"]
864    pub fn clear_bit(self) -> &'a mut W {
865        self.bit(false)
866    }
867    #[doc = r" Writes raw bits to the field"]
868    #[inline]
869    pub fn bit(self, value: bool) -> &'a mut W {
870        const MASK: bool = true;
871        const OFFSET: u8 = 28;
872        self.w.bits &= !((MASK as u32) << OFFSET);
873        self.w.bits |= ((value & MASK) as u32) << OFFSET;
874        self.w
875    }
876}
877#[doc = "Values that can be written to the field `CMIE`"]
878pub enum CMIEW {
879    #[doc = "Interrupt is disabled"]
880    DISABLED,
881    #[doc = "Interrupt is generated when the CMF bit is set in the ISR register"]
882    ENABLED,
883}
884impl CMIEW {
885    #[allow(missing_docs)]
886    #[doc(hidden)]
887    #[inline]
888    pub fn _bits(&self) -> bool {
889        match *self {
890            CMIEW::DISABLED => false,
891            CMIEW::ENABLED => true,
892        }
893    }
894}
895#[doc = r" Proxy"]
896pub struct _CMIEW<'a> {
897    w: &'a mut W,
898}
899impl<'a> _CMIEW<'a> {
900    #[doc = r" Writes `variant` to the field"]
901    #[inline]
902    pub fn variant(self, variant: CMIEW) -> &'a mut W {
903        {
904            self.bit(variant._bits())
905        }
906    }
907    #[doc = "Interrupt is disabled"]
908    #[inline]
909    pub fn disabled(self) -> &'a mut W {
910        self.variant(CMIEW::DISABLED)
911    }
912    #[doc = "Interrupt is generated when the CMF bit is set in the ISR register"]
913    #[inline]
914    pub fn enabled(self) -> &'a mut W {
915        self.variant(CMIEW::ENABLED)
916    }
917    #[doc = r" Sets the field bit"]
918    pub fn set_bit(self) -> &'a mut W {
919        self.bit(true)
920    }
921    #[doc = r" Clears the field bit"]
922    pub fn clear_bit(self) -> &'a mut W {
923        self.bit(false)
924    }
925    #[doc = r" Writes raw bits to the field"]
926    #[inline]
927    pub fn bit(self, value: bool) -> &'a mut W {
928        const MASK: bool = true;
929        const OFFSET: u8 = 14;
930        self.w.bits &= !((MASK as u32) << OFFSET);
931        self.w.bits |= ((value & MASK) as u32) << OFFSET;
932        self.w
933    }
934}
935#[doc = "Values that can be written to the field `MME`"]
936pub enum MMEW {
937    #[doc = "Receiver in active mode permanently"]
938    DISABLED,
939    #[doc = "Receiver can switch between mute mode and active mode"]
940    ENABLED,
941}
942impl MMEW {
943    #[allow(missing_docs)]
944    #[doc(hidden)]
945    #[inline]
946    pub fn _bits(&self) -> bool {
947        match *self {
948            MMEW::DISABLED => false,
949            MMEW::ENABLED => true,
950        }
951    }
952}
953#[doc = r" Proxy"]
954pub struct _MMEW<'a> {
955    w: &'a mut W,
956}
957impl<'a> _MMEW<'a> {
958    #[doc = r" Writes `variant` to the field"]
959    #[inline]
960    pub fn variant(self, variant: MMEW) -> &'a mut W {
961        {
962            self.bit(variant._bits())
963        }
964    }
965    #[doc = "Receiver in active mode permanently"]
966    #[inline]
967    pub fn disabled(self) -> &'a mut W {
968        self.variant(MMEW::DISABLED)
969    }
970    #[doc = "Receiver can switch between mute mode and active mode"]
971    #[inline]
972    pub fn enabled(self) -> &'a mut W {
973        self.variant(MMEW::ENABLED)
974    }
975    #[doc = r" Sets the field bit"]
976    pub fn set_bit(self) -> &'a mut W {
977        self.bit(true)
978    }
979    #[doc = r" Clears the field bit"]
980    pub fn clear_bit(self) -> &'a mut W {
981        self.bit(false)
982    }
983    #[doc = r" Writes raw bits to the field"]
984    #[inline]
985    pub fn bit(self, value: bool) -> &'a mut W {
986        const MASK: bool = true;
987        const OFFSET: u8 = 13;
988        self.w.bits &= !((MASK as u32) << OFFSET);
989        self.w.bits |= ((value & MASK) as u32) << OFFSET;
990        self.w
991    }
992}
993#[doc = "Values that can be written to the field `M0`"]
994pub enum M0W {
995    #[doc = "1 start bit, 8 data bits, n stop bits"]
996    BIT8,
997    #[doc = "1 start bit, 9 data bits, n stop bits"]
998    BIT9,
999}
1000impl M0W {
1001    #[allow(missing_docs)]
1002    #[doc(hidden)]
1003    #[inline]
1004    pub fn _bits(&self) -> bool {
1005        match *self {
1006            M0W::BIT8 => false,
1007            M0W::BIT9 => true,
1008        }
1009    }
1010}
1011#[doc = r" Proxy"]
1012pub struct _M0W<'a> {
1013    w: &'a mut W,
1014}
1015impl<'a> _M0W<'a> {
1016    #[doc = r" Writes `variant` to the field"]
1017    #[inline]
1018    pub fn variant(self, variant: M0W) -> &'a mut W {
1019        {
1020            self.bit(variant._bits())
1021        }
1022    }
1023    #[doc = "1 start bit, 8 data bits, n stop bits"]
1024    #[inline]
1025    pub fn bit8(self) -> &'a mut W {
1026        self.variant(M0W::BIT8)
1027    }
1028    #[doc = "1 start bit, 9 data bits, n stop bits"]
1029    #[inline]
1030    pub fn bit9(self) -> &'a mut W {
1031        self.variant(M0W::BIT9)
1032    }
1033    #[doc = r" Sets the field bit"]
1034    pub fn set_bit(self) -> &'a mut W {
1035        self.bit(true)
1036    }
1037    #[doc = r" Clears the field bit"]
1038    pub fn clear_bit(self) -> &'a mut W {
1039        self.bit(false)
1040    }
1041    #[doc = r" Writes raw bits to the field"]
1042    #[inline]
1043    pub fn bit(self, value: bool) -> &'a mut W {
1044        const MASK: bool = true;
1045        const OFFSET: u8 = 12;
1046        self.w.bits &= !((MASK as u32) << OFFSET);
1047        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1048        self.w
1049    }
1050}
1051#[doc = "Values that can be written to the field `WAKE`"]
1052pub enum WAKEW {
1053    #[doc = "Idle line"]
1054    IDLE,
1055    #[doc = "Address mask"]
1056    ADDRESS,
1057}
1058impl WAKEW {
1059    #[allow(missing_docs)]
1060    #[doc(hidden)]
1061    #[inline]
1062    pub fn _bits(&self) -> bool {
1063        match *self {
1064            WAKEW::IDLE => false,
1065            WAKEW::ADDRESS => true,
1066        }
1067    }
1068}
1069#[doc = r" Proxy"]
1070pub struct _WAKEW<'a> {
1071    w: &'a mut W,
1072}
1073impl<'a> _WAKEW<'a> {
1074    #[doc = r" Writes `variant` to the field"]
1075    #[inline]
1076    pub fn variant(self, variant: WAKEW) -> &'a mut W {
1077        {
1078            self.bit(variant._bits())
1079        }
1080    }
1081    #[doc = "Idle line"]
1082    #[inline]
1083    pub fn idle(self) -> &'a mut W {
1084        self.variant(WAKEW::IDLE)
1085    }
1086    #[doc = "Address mask"]
1087    #[inline]
1088    pub fn address(self) -> &'a mut W {
1089        self.variant(WAKEW::ADDRESS)
1090    }
1091    #[doc = r" Sets the field bit"]
1092    pub fn set_bit(self) -> &'a mut W {
1093        self.bit(true)
1094    }
1095    #[doc = r" Clears the field bit"]
1096    pub fn clear_bit(self) -> &'a mut W {
1097        self.bit(false)
1098    }
1099    #[doc = r" Writes raw bits to the field"]
1100    #[inline]
1101    pub fn bit(self, value: bool) -> &'a mut W {
1102        const MASK: bool = true;
1103        const OFFSET: u8 = 11;
1104        self.w.bits &= !((MASK as u32) << OFFSET);
1105        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1106        self.w
1107    }
1108}
1109#[doc = "Values that can be written to the field `PCE`"]
1110pub enum PCEW {
1111    #[doc = "Parity control disabled"]
1112    DISABLED,
1113    #[doc = "Parity control enabled"]
1114    ENABLED,
1115}
1116impl PCEW {
1117    #[allow(missing_docs)]
1118    #[doc(hidden)]
1119    #[inline]
1120    pub fn _bits(&self) -> bool {
1121        match *self {
1122            PCEW::DISABLED => false,
1123            PCEW::ENABLED => true,
1124        }
1125    }
1126}
1127#[doc = r" Proxy"]
1128pub struct _PCEW<'a> {
1129    w: &'a mut W,
1130}
1131impl<'a> _PCEW<'a> {
1132    #[doc = r" Writes `variant` to the field"]
1133    #[inline]
1134    pub fn variant(self, variant: PCEW) -> &'a mut W {
1135        {
1136            self.bit(variant._bits())
1137        }
1138    }
1139    #[doc = "Parity control disabled"]
1140    #[inline]
1141    pub fn disabled(self) -> &'a mut W {
1142        self.variant(PCEW::DISABLED)
1143    }
1144    #[doc = "Parity control enabled"]
1145    #[inline]
1146    pub fn enabled(self) -> &'a mut W {
1147        self.variant(PCEW::ENABLED)
1148    }
1149    #[doc = r" Sets the field bit"]
1150    pub fn set_bit(self) -> &'a mut W {
1151        self.bit(true)
1152    }
1153    #[doc = r" Clears the field bit"]
1154    pub fn clear_bit(self) -> &'a mut W {
1155        self.bit(false)
1156    }
1157    #[doc = r" Writes raw bits to the field"]
1158    #[inline]
1159    pub fn bit(self, value: bool) -> &'a mut W {
1160        const MASK: bool = true;
1161        const OFFSET: u8 = 10;
1162        self.w.bits &= !((MASK as u32) << OFFSET);
1163        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1164        self.w
1165    }
1166}
1167#[doc = "Values that can be written to the field `PS`"]
1168pub enum PSW {
1169    #[doc = "Even parity"]
1170    EVEN,
1171    #[doc = "Odd parity"]
1172    ODD,
1173}
1174impl PSW {
1175    #[allow(missing_docs)]
1176    #[doc(hidden)]
1177    #[inline]
1178    pub fn _bits(&self) -> bool {
1179        match *self {
1180            PSW::EVEN => false,
1181            PSW::ODD => true,
1182        }
1183    }
1184}
1185#[doc = r" Proxy"]
1186pub struct _PSW<'a> {
1187    w: &'a mut W,
1188}
1189impl<'a> _PSW<'a> {
1190    #[doc = r" Writes `variant` to the field"]
1191    #[inline]
1192    pub fn variant(self, variant: PSW) -> &'a mut W {
1193        {
1194            self.bit(variant._bits())
1195        }
1196    }
1197    #[doc = "Even parity"]
1198    #[inline]
1199    pub fn even(self) -> &'a mut W {
1200        self.variant(PSW::EVEN)
1201    }
1202    #[doc = "Odd parity"]
1203    #[inline]
1204    pub fn odd(self) -> &'a mut W {
1205        self.variant(PSW::ODD)
1206    }
1207    #[doc = r" Sets the field bit"]
1208    pub fn set_bit(self) -> &'a mut W {
1209        self.bit(true)
1210    }
1211    #[doc = r" Clears the field bit"]
1212    pub fn clear_bit(self) -> &'a mut W {
1213        self.bit(false)
1214    }
1215    #[doc = r" Writes raw bits to the field"]
1216    #[inline]
1217    pub fn bit(self, value: bool) -> &'a mut W {
1218        const MASK: bool = true;
1219        const OFFSET: u8 = 9;
1220        self.w.bits &= !((MASK as u32) << OFFSET);
1221        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1222        self.w
1223    }
1224}
1225#[doc = "Values that can be written to the field `PEIE`"]
1226pub enum PEIEW {
1227    #[doc = "Interrupt is disabled"]
1228    DISABLED,
1229    #[doc = "Interrupt is generated whenever PE=1 in the ISR register"]
1230    ENABLED,
1231}
1232impl PEIEW {
1233    #[allow(missing_docs)]
1234    #[doc(hidden)]
1235    #[inline]
1236    pub fn _bits(&self) -> bool {
1237        match *self {
1238            PEIEW::DISABLED => false,
1239            PEIEW::ENABLED => true,
1240        }
1241    }
1242}
1243#[doc = r" Proxy"]
1244pub struct _PEIEW<'a> {
1245    w: &'a mut W,
1246}
1247impl<'a> _PEIEW<'a> {
1248    #[doc = r" Writes `variant` to the field"]
1249    #[inline]
1250    pub fn variant(self, variant: PEIEW) -> &'a mut W {
1251        {
1252            self.bit(variant._bits())
1253        }
1254    }
1255    #[doc = "Interrupt is disabled"]
1256    #[inline]
1257    pub fn disabled(self) -> &'a mut W {
1258        self.variant(PEIEW::DISABLED)
1259    }
1260    #[doc = "Interrupt is generated whenever PE=1 in the ISR register"]
1261    #[inline]
1262    pub fn enabled(self) -> &'a mut W {
1263        self.variant(PEIEW::ENABLED)
1264    }
1265    #[doc = r" Sets the field bit"]
1266    pub fn set_bit(self) -> &'a mut W {
1267        self.bit(true)
1268    }
1269    #[doc = r" Clears the field bit"]
1270    pub fn clear_bit(self) -> &'a mut W {
1271        self.bit(false)
1272    }
1273    #[doc = r" Writes raw bits to the field"]
1274    #[inline]
1275    pub fn bit(self, value: bool) -> &'a mut W {
1276        const MASK: bool = true;
1277        const OFFSET: u8 = 8;
1278        self.w.bits &= !((MASK as u32) << OFFSET);
1279        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1280        self.w
1281    }
1282}
1283#[doc = "Values that can be written to the field `TXEIE`"]
1284pub enum TXEIEW {
1285    #[doc = "Interrupt is disabled"]
1286    DISABLED,
1287    #[doc = "Interrupt is generated whenever TXE=1 in the ISR register"]
1288    ENABLED,
1289}
1290impl TXEIEW {
1291    #[allow(missing_docs)]
1292    #[doc(hidden)]
1293    #[inline]
1294    pub fn _bits(&self) -> bool {
1295        match *self {
1296            TXEIEW::DISABLED => false,
1297            TXEIEW::ENABLED => true,
1298        }
1299    }
1300}
1301#[doc = r" Proxy"]
1302pub struct _TXEIEW<'a> {
1303    w: &'a mut W,
1304}
1305impl<'a> _TXEIEW<'a> {
1306    #[doc = r" Writes `variant` to the field"]
1307    #[inline]
1308    pub fn variant(self, variant: TXEIEW) -> &'a mut W {
1309        {
1310            self.bit(variant._bits())
1311        }
1312    }
1313    #[doc = "Interrupt is disabled"]
1314    #[inline]
1315    pub fn disabled(self) -> &'a mut W {
1316        self.variant(TXEIEW::DISABLED)
1317    }
1318    #[doc = "Interrupt is generated whenever TXE=1 in the ISR register"]
1319    #[inline]
1320    pub fn enabled(self) -> &'a mut W {
1321        self.variant(TXEIEW::ENABLED)
1322    }
1323    #[doc = r" Sets the field bit"]
1324    pub fn set_bit(self) -> &'a mut W {
1325        self.bit(true)
1326    }
1327    #[doc = r" Clears the field bit"]
1328    pub fn clear_bit(self) -> &'a mut W {
1329        self.bit(false)
1330    }
1331    #[doc = r" Writes raw bits to the field"]
1332    #[inline]
1333    pub fn bit(self, value: bool) -> &'a mut W {
1334        const MASK: bool = true;
1335        const OFFSET: u8 = 7;
1336        self.w.bits &= !((MASK as u32) << OFFSET);
1337        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1338        self.w
1339    }
1340}
1341#[doc = "Values that can be written to the field `TCIE`"]
1342pub enum TCIEW {
1343    #[doc = "Interrupt is disabled"]
1344    DISABLED,
1345    #[doc = "Interrupt is generated whenever TC=1 in the ISR register"]
1346    ENABLED,
1347}
1348impl TCIEW {
1349    #[allow(missing_docs)]
1350    #[doc(hidden)]
1351    #[inline]
1352    pub fn _bits(&self) -> bool {
1353        match *self {
1354            TCIEW::DISABLED => false,
1355            TCIEW::ENABLED => true,
1356        }
1357    }
1358}
1359#[doc = r" Proxy"]
1360pub struct _TCIEW<'a> {
1361    w: &'a mut W,
1362}
1363impl<'a> _TCIEW<'a> {
1364    #[doc = r" Writes `variant` to the field"]
1365    #[inline]
1366    pub fn variant(self, variant: TCIEW) -> &'a mut W {
1367        {
1368            self.bit(variant._bits())
1369        }
1370    }
1371    #[doc = "Interrupt is disabled"]
1372    #[inline]
1373    pub fn disabled(self) -> &'a mut W {
1374        self.variant(TCIEW::DISABLED)
1375    }
1376    #[doc = "Interrupt is generated whenever TC=1 in the ISR register"]
1377    #[inline]
1378    pub fn enabled(self) -> &'a mut W {
1379        self.variant(TCIEW::ENABLED)
1380    }
1381    #[doc = r" Sets the field bit"]
1382    pub fn set_bit(self) -> &'a mut W {
1383        self.bit(true)
1384    }
1385    #[doc = r" Clears the field bit"]
1386    pub fn clear_bit(self) -> &'a mut W {
1387        self.bit(false)
1388    }
1389    #[doc = r" Writes raw bits to the field"]
1390    #[inline]
1391    pub fn bit(self, value: bool) -> &'a mut W {
1392        const MASK: bool = true;
1393        const OFFSET: u8 = 6;
1394        self.w.bits &= !((MASK as u32) << OFFSET);
1395        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1396        self.w
1397    }
1398}
1399#[doc = "Values that can be written to the field `RXNEIE`"]
1400pub enum RXNEIEW {
1401    #[doc = "Interrupt is disabled"]
1402    DISABLED,
1403    #[doc = "Interrupt is generated whenever ORE=1 or RXNE=1 in the ISR register"]
1404    ENABLED,
1405}
1406impl RXNEIEW {
1407    #[allow(missing_docs)]
1408    #[doc(hidden)]
1409    #[inline]
1410    pub fn _bits(&self) -> bool {
1411        match *self {
1412            RXNEIEW::DISABLED => false,
1413            RXNEIEW::ENABLED => true,
1414        }
1415    }
1416}
1417#[doc = r" Proxy"]
1418pub struct _RXNEIEW<'a> {
1419    w: &'a mut W,
1420}
1421impl<'a> _RXNEIEW<'a> {
1422    #[doc = r" Writes `variant` to the field"]
1423    #[inline]
1424    pub fn variant(self, variant: RXNEIEW) -> &'a mut W {
1425        {
1426            self.bit(variant._bits())
1427        }
1428    }
1429    #[doc = "Interrupt is disabled"]
1430    #[inline]
1431    pub fn disabled(self) -> &'a mut W {
1432        self.variant(RXNEIEW::DISABLED)
1433    }
1434    #[doc = "Interrupt is generated whenever ORE=1 or RXNE=1 in the ISR register"]
1435    #[inline]
1436    pub fn enabled(self) -> &'a mut W {
1437        self.variant(RXNEIEW::ENABLED)
1438    }
1439    #[doc = r" Sets the field bit"]
1440    pub fn set_bit(self) -> &'a mut W {
1441        self.bit(true)
1442    }
1443    #[doc = r" Clears the field bit"]
1444    pub fn clear_bit(self) -> &'a mut W {
1445        self.bit(false)
1446    }
1447    #[doc = r" Writes raw bits to the field"]
1448    #[inline]
1449    pub fn bit(self, value: bool) -> &'a mut W {
1450        const MASK: bool = true;
1451        const OFFSET: u8 = 5;
1452        self.w.bits &= !((MASK as u32) << OFFSET);
1453        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1454        self.w
1455    }
1456}
1457#[doc = "Values that can be written to the field `IDLEIE`"]
1458pub enum IDLEIEW {
1459    #[doc = "Interrupt is disabled"]
1460    DISABLED,
1461    #[doc = "Interrupt is generated whenever IDLE=1 in the ISR register"]
1462    ENABLED,
1463}
1464impl IDLEIEW {
1465    #[allow(missing_docs)]
1466    #[doc(hidden)]
1467    #[inline]
1468    pub fn _bits(&self) -> bool {
1469        match *self {
1470            IDLEIEW::DISABLED => false,
1471            IDLEIEW::ENABLED => true,
1472        }
1473    }
1474}
1475#[doc = r" Proxy"]
1476pub struct _IDLEIEW<'a> {
1477    w: &'a mut W,
1478}
1479impl<'a> _IDLEIEW<'a> {
1480    #[doc = r" Writes `variant` to the field"]
1481    #[inline]
1482    pub fn variant(self, variant: IDLEIEW) -> &'a mut W {
1483        {
1484            self.bit(variant._bits())
1485        }
1486    }
1487    #[doc = "Interrupt is disabled"]
1488    #[inline]
1489    pub fn disabled(self) -> &'a mut W {
1490        self.variant(IDLEIEW::DISABLED)
1491    }
1492    #[doc = "Interrupt is generated whenever IDLE=1 in the ISR register"]
1493    #[inline]
1494    pub fn enabled(self) -> &'a mut W {
1495        self.variant(IDLEIEW::ENABLED)
1496    }
1497    #[doc = r" Sets the field bit"]
1498    pub fn set_bit(self) -> &'a mut W {
1499        self.bit(true)
1500    }
1501    #[doc = r" Clears the field bit"]
1502    pub fn clear_bit(self) -> &'a mut W {
1503        self.bit(false)
1504    }
1505    #[doc = r" Writes raw bits to the field"]
1506    #[inline]
1507    pub fn bit(self, value: bool) -> &'a mut W {
1508        const MASK: bool = true;
1509        const OFFSET: u8 = 4;
1510        self.w.bits &= !((MASK as u32) << OFFSET);
1511        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1512        self.w
1513    }
1514}
1515#[doc = "Values that can be written to the field `TE`"]
1516pub enum TEW {
1517    #[doc = "Transmitter is disabled"]
1518    DISABLED,
1519    #[doc = "Transmitter is enabled"]
1520    ENABLED,
1521}
1522impl TEW {
1523    #[allow(missing_docs)]
1524    #[doc(hidden)]
1525    #[inline]
1526    pub fn _bits(&self) -> bool {
1527        match *self {
1528            TEW::DISABLED => false,
1529            TEW::ENABLED => true,
1530        }
1531    }
1532}
1533#[doc = r" Proxy"]
1534pub struct _TEW<'a> {
1535    w: &'a mut W,
1536}
1537impl<'a> _TEW<'a> {
1538    #[doc = r" Writes `variant` to the field"]
1539    #[inline]
1540    pub fn variant(self, variant: TEW) -> &'a mut W {
1541        {
1542            self.bit(variant._bits())
1543        }
1544    }
1545    #[doc = "Transmitter is disabled"]
1546    #[inline]
1547    pub fn disabled(self) -> &'a mut W {
1548        self.variant(TEW::DISABLED)
1549    }
1550    #[doc = "Transmitter is enabled"]
1551    #[inline]
1552    pub fn enabled(self) -> &'a mut W {
1553        self.variant(TEW::ENABLED)
1554    }
1555    #[doc = r" Sets the field bit"]
1556    pub fn set_bit(self) -> &'a mut W {
1557        self.bit(true)
1558    }
1559    #[doc = r" Clears the field bit"]
1560    pub fn clear_bit(self) -> &'a mut W {
1561        self.bit(false)
1562    }
1563    #[doc = r" Writes raw bits to the field"]
1564    #[inline]
1565    pub fn bit(self, value: bool) -> &'a mut W {
1566        const MASK: bool = true;
1567        const OFFSET: u8 = 3;
1568        self.w.bits &= !((MASK as u32) << OFFSET);
1569        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1570        self.w
1571    }
1572}
1573#[doc = "Values that can be written to the field `RE`"]
1574pub enum REW {
1575    #[doc = "Receiver is disabled"]
1576    DISABLED,
1577    #[doc = "Receiver is enabled"]
1578    ENABLED,
1579}
1580impl REW {
1581    #[allow(missing_docs)]
1582    #[doc(hidden)]
1583    #[inline]
1584    pub fn _bits(&self) -> bool {
1585        match *self {
1586            REW::DISABLED => false,
1587            REW::ENABLED => true,
1588        }
1589    }
1590}
1591#[doc = r" Proxy"]
1592pub struct _REW<'a> {
1593    w: &'a mut W,
1594}
1595impl<'a> _REW<'a> {
1596    #[doc = r" Writes `variant` to the field"]
1597    #[inline]
1598    pub fn variant(self, variant: REW) -> &'a mut W {
1599        {
1600            self.bit(variant._bits())
1601        }
1602    }
1603    #[doc = "Receiver is disabled"]
1604    #[inline]
1605    pub fn disabled(self) -> &'a mut W {
1606        self.variant(REW::DISABLED)
1607    }
1608    #[doc = "Receiver is enabled"]
1609    #[inline]
1610    pub fn enabled(self) -> &'a mut W {
1611        self.variant(REW::ENABLED)
1612    }
1613    #[doc = r" Sets the field bit"]
1614    pub fn set_bit(self) -> &'a mut W {
1615        self.bit(true)
1616    }
1617    #[doc = r" Clears the field bit"]
1618    pub fn clear_bit(self) -> &'a mut W {
1619        self.bit(false)
1620    }
1621    #[doc = r" Writes raw bits to the field"]
1622    #[inline]
1623    pub fn bit(self, value: bool) -> &'a mut W {
1624        const MASK: bool = true;
1625        const OFFSET: u8 = 2;
1626        self.w.bits &= !((MASK as u32) << OFFSET);
1627        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1628        self.w
1629    }
1630}
1631#[doc = "Values that can be written to the field `UESM`"]
1632pub enum UESMW {
1633    #[doc = "USART not able to wake up the MCU from Stop mode"]
1634    DISABLED,
1635    #[doc = "USART able to wake up the MCU from Stop mode"]
1636    ENABLED,
1637}
1638impl UESMW {
1639    #[allow(missing_docs)]
1640    #[doc(hidden)]
1641    #[inline]
1642    pub fn _bits(&self) -> bool {
1643        match *self {
1644            UESMW::DISABLED => false,
1645            UESMW::ENABLED => true,
1646        }
1647    }
1648}
1649#[doc = r" Proxy"]
1650pub struct _UESMW<'a> {
1651    w: &'a mut W,
1652}
1653impl<'a> _UESMW<'a> {
1654    #[doc = r" Writes `variant` to the field"]
1655    #[inline]
1656    pub fn variant(self, variant: UESMW) -> &'a mut W {
1657        {
1658            self.bit(variant._bits())
1659        }
1660    }
1661    #[doc = "USART not able to wake up the MCU from Stop mode"]
1662    #[inline]
1663    pub fn disabled(self) -> &'a mut W {
1664        self.variant(UESMW::DISABLED)
1665    }
1666    #[doc = "USART able to wake up the MCU from Stop mode"]
1667    #[inline]
1668    pub fn enabled(self) -> &'a mut W {
1669        self.variant(UESMW::ENABLED)
1670    }
1671    #[doc = r" Sets the field bit"]
1672    pub fn set_bit(self) -> &'a mut W {
1673        self.bit(true)
1674    }
1675    #[doc = r" Clears the field bit"]
1676    pub fn clear_bit(self) -> &'a mut W {
1677        self.bit(false)
1678    }
1679    #[doc = r" Writes raw bits to the field"]
1680    #[inline]
1681    pub fn bit(self, value: bool) -> &'a mut W {
1682        const MASK: bool = true;
1683        const OFFSET: u8 = 1;
1684        self.w.bits &= !((MASK as u32) << OFFSET);
1685        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1686        self.w
1687    }
1688}
1689#[doc = "Values that can be written to the field `UE`"]
1690pub enum UEW {
1691    #[doc = "UART is disabled"]
1692    DISABLED,
1693    #[doc = "UART is enabled"]
1694    ENABLED,
1695}
1696impl UEW {
1697    #[allow(missing_docs)]
1698    #[doc(hidden)]
1699    #[inline]
1700    pub fn _bits(&self) -> bool {
1701        match *self {
1702            UEW::DISABLED => false,
1703            UEW::ENABLED => true,
1704        }
1705    }
1706}
1707#[doc = r" Proxy"]
1708pub struct _UEW<'a> {
1709    w: &'a mut W,
1710}
1711impl<'a> _UEW<'a> {
1712    #[doc = r" Writes `variant` to the field"]
1713    #[inline]
1714    pub fn variant(self, variant: UEW) -> &'a mut W {
1715        {
1716            self.bit(variant._bits())
1717        }
1718    }
1719    #[doc = "UART is disabled"]
1720    #[inline]
1721    pub fn disabled(self) -> &'a mut W {
1722        self.variant(UEW::DISABLED)
1723    }
1724    #[doc = "UART is enabled"]
1725    #[inline]
1726    pub fn enabled(self) -> &'a mut W {
1727        self.variant(UEW::ENABLED)
1728    }
1729    #[doc = r" Sets the field bit"]
1730    pub fn set_bit(self) -> &'a mut W {
1731        self.bit(true)
1732    }
1733    #[doc = r" Clears the field bit"]
1734    pub fn clear_bit(self) -> &'a mut W {
1735        self.bit(false)
1736    }
1737    #[doc = r" Writes raw bits to the field"]
1738    #[inline]
1739    pub fn bit(self, value: bool) -> &'a mut W {
1740        const MASK: bool = true;
1741        const OFFSET: u8 = 0;
1742        self.w.bits &= !((MASK as u32) << OFFSET);
1743        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1744        self.w
1745    }
1746}
1747#[doc = r" Proxy"]
1748pub struct _DEATW<'a> {
1749    w: &'a mut W,
1750}
1751impl<'a> _DEATW<'a> {
1752    #[doc = r" Writes raw bits to the field"]
1753    #[inline]
1754    pub fn bits(self, value: u8) -> &'a mut W {
1755        const MASK: u8 = 31;
1756        const OFFSET: u8 = 21;
1757        self.w.bits &= !((MASK as u32) << OFFSET);
1758        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1759        self.w
1760    }
1761}
1762#[doc = r" Proxy"]
1763pub struct _DEDTW<'a> {
1764    w: &'a mut W,
1765}
1766impl<'a> _DEDTW<'a> {
1767    #[doc = r" Writes raw bits to the field"]
1768    #[inline]
1769    pub fn bits(self, value: u8) -> &'a mut W {
1770        const MASK: u8 = 31;
1771        const OFFSET: u8 = 16;
1772        self.w.bits &= !((MASK as u32) << OFFSET);
1773        self.w.bits |= ((value & MASK) as u32) << OFFSET;
1774        self.w
1775    }
1776}
1777impl R {
1778    #[doc = r" Value of the register as raw bits"]
1779    #[inline]
1780    pub fn bits(&self) -> u32 {
1781        self.bits
1782    }
1783    #[doc = "Bit 28 - Word length"]
1784    #[inline]
1785    pub fn m1(&self) -> M1R {
1786        M1R::_from({
1787            const MASK: bool = true;
1788            const OFFSET: u8 = 28;
1789            ((self.bits >> OFFSET) & MASK as u32) != 0
1790        })
1791    }
1792    #[doc = "Bit 14 - Character match interrupt enable"]
1793    #[inline]
1794    pub fn cmie(&self) -> CMIER {
1795        CMIER::_from({
1796            const MASK: bool = true;
1797            const OFFSET: u8 = 14;
1798            ((self.bits >> OFFSET) & MASK as u32) != 0
1799        })
1800    }
1801    #[doc = "Bit 13 - Mute mode enable"]
1802    #[inline]
1803    pub fn mme(&self) -> MMER {
1804        MMER::_from({
1805            const MASK: bool = true;
1806            const OFFSET: u8 = 13;
1807            ((self.bits >> OFFSET) & MASK as u32) != 0
1808        })
1809    }
1810    #[doc = "Bit 12 - Word length"]
1811    #[inline]
1812    pub fn m0(&self) -> M0R {
1813        M0R::_from({
1814            const MASK: bool = true;
1815            const OFFSET: u8 = 12;
1816            ((self.bits >> OFFSET) & MASK as u32) != 0
1817        })
1818    }
1819    #[doc = "Bit 11 - Receiver wakeup method"]
1820    #[inline]
1821    pub fn wake(&self) -> WAKER {
1822        WAKER::_from({
1823            const MASK: bool = true;
1824            const OFFSET: u8 = 11;
1825            ((self.bits >> OFFSET) & MASK as u32) != 0
1826        })
1827    }
1828    #[doc = "Bit 10 - Parity control enable"]
1829    #[inline]
1830    pub fn pce(&self) -> PCER {
1831        PCER::_from({
1832            const MASK: bool = true;
1833            const OFFSET: u8 = 10;
1834            ((self.bits >> OFFSET) & MASK as u32) != 0
1835        })
1836    }
1837    #[doc = "Bit 9 - Parity selection"]
1838    #[inline]
1839    pub fn ps(&self) -> PSR {
1840        PSR::_from({
1841            const MASK: bool = true;
1842            const OFFSET: u8 = 9;
1843            ((self.bits >> OFFSET) & MASK as u32) != 0
1844        })
1845    }
1846    #[doc = "Bit 8 - PE interrupt enable"]
1847    #[inline]
1848    pub fn peie(&self) -> PEIER {
1849        PEIER::_from({
1850            const MASK: bool = true;
1851            const OFFSET: u8 = 8;
1852            ((self.bits >> OFFSET) & MASK as u32) != 0
1853        })
1854    }
1855    #[doc = "Bit 7 - interrupt enable"]
1856    #[inline]
1857    pub fn txeie(&self) -> TXEIER {
1858        TXEIER::_from({
1859            const MASK: bool = true;
1860            const OFFSET: u8 = 7;
1861            ((self.bits >> OFFSET) & MASK as u32) != 0
1862        })
1863    }
1864    #[doc = "Bit 6 - Transmission complete interrupt enable"]
1865    #[inline]
1866    pub fn tcie(&self) -> TCIER {
1867        TCIER::_from({
1868            const MASK: bool = true;
1869            const OFFSET: u8 = 6;
1870            ((self.bits >> OFFSET) & MASK as u32) != 0
1871        })
1872    }
1873    #[doc = "Bit 5 - RXNE interrupt enable"]
1874    #[inline]
1875    pub fn rxneie(&self) -> RXNEIER {
1876        RXNEIER::_from({
1877            const MASK: bool = true;
1878            const OFFSET: u8 = 5;
1879            ((self.bits >> OFFSET) & MASK as u32) != 0
1880        })
1881    }
1882    #[doc = "Bit 4 - IDLE interrupt enable"]
1883    #[inline]
1884    pub fn idleie(&self) -> IDLEIER {
1885        IDLEIER::_from({
1886            const MASK: bool = true;
1887            const OFFSET: u8 = 4;
1888            ((self.bits >> OFFSET) & MASK as u32) != 0
1889        })
1890    }
1891    #[doc = "Bit 3 - Transmitter enable"]
1892    #[inline]
1893    pub fn te(&self) -> TER {
1894        TER::_from({
1895            const MASK: bool = true;
1896            const OFFSET: u8 = 3;
1897            ((self.bits >> OFFSET) & MASK as u32) != 0
1898        })
1899    }
1900    #[doc = "Bit 2 - Receiver enable"]
1901    #[inline]
1902    pub fn re(&self) -> RER {
1903        RER::_from({
1904            const MASK: bool = true;
1905            const OFFSET: u8 = 2;
1906            ((self.bits >> OFFSET) & MASK as u32) != 0
1907        })
1908    }
1909    #[doc = "Bit 1 - USART enable in Stop mode"]
1910    #[inline]
1911    pub fn uesm(&self) -> UESMR {
1912        UESMR::_from({
1913            const MASK: bool = true;
1914            const OFFSET: u8 = 1;
1915            ((self.bits >> OFFSET) & MASK as u32) != 0
1916        })
1917    }
1918    #[doc = "Bit 0 - USART enable"]
1919    #[inline]
1920    pub fn ue(&self) -> UER {
1921        UER::_from({
1922            const MASK: bool = true;
1923            const OFFSET: u8 = 0;
1924            ((self.bits >> OFFSET) & MASK as u32) != 0
1925        })
1926    }
1927    #[doc = "Bits 21:25 - Driver Enable assertion time"]
1928    #[inline]
1929    pub fn deat(&self) -> DEATR {
1930        let bits = {
1931            const MASK: u8 = 31;
1932            const OFFSET: u8 = 21;
1933            ((self.bits >> OFFSET) & MASK as u32) as u8
1934        };
1935        DEATR { bits }
1936    }
1937    #[doc = "Bits 16:20 - Driver Enable de-assertion time"]
1938    #[inline]
1939    pub fn dedt(&self) -> DEDTR {
1940        let bits = {
1941            const MASK: u8 = 31;
1942            const OFFSET: u8 = 16;
1943            ((self.bits >> OFFSET) & MASK as u32) as u8
1944        };
1945        DEDTR { bits }
1946    }
1947}
1948impl W {
1949    #[doc = r" Reset value of the register"]
1950    #[inline]
1951    pub fn reset_value() -> W {
1952        W { bits: 0 }
1953    }
1954    #[doc = r" Writes raw bits to the register"]
1955    #[inline]
1956    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
1957        self.bits = bits;
1958        self
1959    }
1960    #[doc = "Bit 28 - Word length"]
1961    #[inline]
1962    pub fn m1(&mut self) -> _M1W {
1963        _M1W { w: self }
1964    }
1965    #[doc = "Bit 14 - Character match interrupt enable"]
1966    #[inline]
1967    pub fn cmie(&mut self) -> _CMIEW {
1968        _CMIEW { w: self }
1969    }
1970    #[doc = "Bit 13 - Mute mode enable"]
1971    #[inline]
1972    pub fn mme(&mut self) -> _MMEW {
1973        _MMEW { w: self }
1974    }
1975    #[doc = "Bit 12 - Word length"]
1976    #[inline]
1977    pub fn m0(&mut self) -> _M0W {
1978        _M0W { w: self }
1979    }
1980    #[doc = "Bit 11 - Receiver wakeup method"]
1981    #[inline]
1982    pub fn wake(&mut self) -> _WAKEW {
1983        _WAKEW { w: self }
1984    }
1985    #[doc = "Bit 10 - Parity control enable"]
1986    #[inline]
1987    pub fn pce(&mut self) -> _PCEW {
1988        _PCEW { w: self }
1989    }
1990    #[doc = "Bit 9 - Parity selection"]
1991    #[inline]
1992    pub fn ps(&mut self) -> _PSW {
1993        _PSW { w: self }
1994    }
1995    #[doc = "Bit 8 - PE interrupt enable"]
1996    #[inline]
1997    pub fn peie(&mut self) -> _PEIEW {
1998        _PEIEW { w: self }
1999    }
2000    #[doc = "Bit 7 - interrupt enable"]
2001    #[inline]
2002    pub fn txeie(&mut self) -> _TXEIEW {
2003        _TXEIEW { w: self }
2004    }
2005    #[doc = "Bit 6 - Transmission complete interrupt enable"]
2006    #[inline]
2007    pub fn tcie(&mut self) -> _TCIEW {
2008        _TCIEW { w: self }
2009    }
2010    #[doc = "Bit 5 - RXNE interrupt enable"]
2011    #[inline]
2012    pub fn rxneie(&mut self) -> _RXNEIEW {
2013        _RXNEIEW { w: self }
2014    }
2015    #[doc = "Bit 4 - IDLE interrupt enable"]
2016    #[inline]
2017    pub fn idleie(&mut self) -> _IDLEIEW {
2018        _IDLEIEW { w: self }
2019    }
2020    #[doc = "Bit 3 - Transmitter enable"]
2021    #[inline]
2022    pub fn te(&mut self) -> _TEW {
2023        _TEW { w: self }
2024    }
2025    #[doc = "Bit 2 - Receiver enable"]
2026    #[inline]
2027    pub fn re(&mut self) -> _REW {
2028        _REW { w: self }
2029    }
2030    #[doc = "Bit 1 - USART enable in Stop mode"]
2031    #[inline]
2032    pub fn uesm(&mut self) -> _UESMW {
2033        _UESMW { w: self }
2034    }
2035    #[doc = "Bit 0 - USART enable"]
2036    #[inline]
2037    pub fn ue(&mut self) -> _UEW {
2038        _UEW { w: self }
2039    }
2040    #[doc = "Bits 21:25 - Driver Enable assertion time"]
2041    #[inline]
2042    pub fn deat(&mut self) -> _DEATW {
2043        _DEATW { w: self }
2044    }
2045    #[doc = "Bits 16:20 - Driver Enable de-assertion time"]
2046    #[inline]
2047    pub fn dedt(&mut self) -> _DEDTW {
2048        _DEDTW { w: self }
2049    }
2050}