py32f0/py32f003/usart1/
cr1.rs

1///Register `CR1` reader
2pub struct R(crate::R<CR1_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CR1_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CR1_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CR1_SPEC>) -> Self {
13        R(reader)
14    }
15}
16///Register `CR1` writer
17pub struct W(crate::W<CR1_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CR1_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<CR1_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CR1_SPEC>) -> Self {
34        W(writer)
35    }
36}
37///Field `SBK` reader - Send break
38pub type SBK_R = crate::BitReader<SBK_A>;
39/**Send break
40
41Value on reset: 0*/
42#[derive(Clone, Copy, Debug, PartialEq, Eq)]
43pub enum SBK_A {
44    ///0: No break character is transmitted
45    NoBreak = 0,
46    ///1: Break character transmitted
47    Break = 1,
48}
49impl From<SBK_A> for bool {
50    #[inline(always)]
51    fn from(variant: SBK_A) -> Self {
52        variant as u8 != 0
53    }
54}
55impl SBK_R {
56    ///Get enumerated values variant
57    #[inline(always)]
58    pub fn variant(&self) -> SBK_A {
59        match self.bits {
60            false => SBK_A::NoBreak,
61            true => SBK_A::Break,
62        }
63    }
64    ///Checks if the value of the field is `NoBreak`
65    #[inline(always)]
66    pub fn is_no_break(&self) -> bool {
67        *self == SBK_A::NoBreak
68    }
69    ///Checks if the value of the field is `Break`
70    #[inline(always)]
71    pub fn is_break(&self) -> bool {
72        *self == SBK_A::Break
73    }
74}
75///Field `SBK` writer - Send break
76pub type SBK_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, SBK_A, O>;
77impl<'a, const O: u8> SBK_W<'a, O> {
78    ///No break character is transmitted
79    #[inline(always)]
80    pub fn no_break(self) -> &'a mut W {
81        self.variant(SBK_A::NoBreak)
82    }
83    ///Break character transmitted
84    #[inline(always)]
85    pub fn break_(self) -> &'a mut W {
86        self.variant(SBK_A::Break)
87    }
88}
89///Field `RWU` reader - Receiver wakeup
90pub type RWU_R = crate::BitReader<RWU_A>;
91/**Receiver wakeup
92
93Value on reset: 0*/
94#[derive(Clone, Copy, Debug, PartialEq, Eq)]
95pub enum RWU_A {
96    ///0: Receiver in active mode
97    Active = 0,
98    ///1: Receiver in mute mode
99    Mute = 1,
100}
101impl From<RWU_A> for bool {
102    #[inline(always)]
103    fn from(variant: RWU_A) -> Self {
104        variant as u8 != 0
105    }
106}
107impl RWU_R {
108    ///Get enumerated values variant
109    #[inline(always)]
110    pub fn variant(&self) -> RWU_A {
111        match self.bits {
112            false => RWU_A::Active,
113            true => RWU_A::Mute,
114        }
115    }
116    ///Checks if the value of the field is `Active`
117    #[inline(always)]
118    pub fn is_active(&self) -> bool {
119        *self == RWU_A::Active
120    }
121    ///Checks if the value of the field is `Mute`
122    #[inline(always)]
123    pub fn is_mute(&self) -> bool {
124        *self == RWU_A::Mute
125    }
126}
127///Field `RWU` writer - Receiver wakeup
128pub type RWU_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, RWU_A, O>;
129impl<'a, const O: u8> RWU_W<'a, O> {
130    ///Receiver in active mode
131    #[inline(always)]
132    pub fn active(self) -> &'a mut W {
133        self.variant(RWU_A::Active)
134    }
135    ///Receiver in mute mode
136    #[inline(always)]
137    pub fn mute(self) -> &'a mut W {
138        self.variant(RWU_A::Mute)
139    }
140}
141///Field `RE` reader - Receiver enable
142pub type RE_R = crate::BitReader<RE_A>;
143/**Receiver enable
144
145Value on reset: 0*/
146#[derive(Clone, Copy, Debug, PartialEq, Eq)]
147pub enum RE_A {
148    ///0: Receiver disabled
149    Disabled = 0,
150    ///1: Receiver enabled
151    Enabled = 1,
152}
153impl From<RE_A> for bool {
154    #[inline(always)]
155    fn from(variant: RE_A) -> Self {
156        variant as u8 != 0
157    }
158}
159impl RE_R {
160    ///Get enumerated values variant
161    #[inline(always)]
162    pub fn variant(&self) -> RE_A {
163        match self.bits {
164            false => RE_A::Disabled,
165            true => RE_A::Enabled,
166        }
167    }
168    ///Checks if the value of the field is `Disabled`
169    #[inline(always)]
170    pub fn is_disabled(&self) -> bool {
171        *self == RE_A::Disabled
172    }
173    ///Checks if the value of the field is `Enabled`
174    #[inline(always)]
175    pub fn is_enabled(&self) -> bool {
176        *self == RE_A::Enabled
177    }
178}
179///Field `RE` writer - Receiver enable
180pub type RE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, RE_A, O>;
181impl<'a, const O: u8> RE_W<'a, O> {
182    ///Receiver disabled
183    #[inline(always)]
184    pub fn disabled(self) -> &'a mut W {
185        self.variant(RE_A::Disabled)
186    }
187    ///Receiver enabled
188    #[inline(always)]
189    pub fn enabled(self) -> &'a mut W {
190        self.variant(RE_A::Enabled)
191    }
192}
193///Field `TE` reader - Transmitter enable
194pub type TE_R = crate::BitReader<TE_A>;
195/**Transmitter enable
196
197Value on reset: 0*/
198#[derive(Clone, Copy, Debug, PartialEq, Eq)]
199pub enum TE_A {
200    ///0: Transmitter disabled
201    Disabled = 0,
202    ///1: Transmitter enabled
203    Enabled = 1,
204}
205impl From<TE_A> for bool {
206    #[inline(always)]
207    fn from(variant: TE_A) -> Self {
208        variant as u8 != 0
209    }
210}
211impl TE_R {
212    ///Get enumerated values variant
213    #[inline(always)]
214    pub fn variant(&self) -> TE_A {
215        match self.bits {
216            false => TE_A::Disabled,
217            true => TE_A::Enabled,
218        }
219    }
220    ///Checks if the value of the field is `Disabled`
221    #[inline(always)]
222    pub fn is_disabled(&self) -> bool {
223        *self == TE_A::Disabled
224    }
225    ///Checks if the value of the field is `Enabled`
226    #[inline(always)]
227    pub fn is_enabled(&self) -> bool {
228        *self == TE_A::Enabled
229    }
230}
231///Field `TE` writer - Transmitter enable
232pub type TE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, TE_A, O>;
233impl<'a, const O: u8> TE_W<'a, O> {
234    ///Transmitter disabled
235    #[inline(always)]
236    pub fn disabled(self) -> &'a mut W {
237        self.variant(TE_A::Disabled)
238    }
239    ///Transmitter enabled
240    #[inline(always)]
241    pub fn enabled(self) -> &'a mut W {
242        self.variant(TE_A::Enabled)
243    }
244}
245///Field `IDLEIE` reader - IDLE interrupt enable
246pub type IDLEIE_R = crate::BitReader<IDLEIE_A>;
247/**IDLE interrupt enable
248
249Value on reset: 0*/
250#[derive(Clone, Copy, Debug, PartialEq, Eq)]
251pub enum IDLEIE_A {
252    ///0: IDLE interrupt disabled
253    Disabled = 0,
254    ///1: IDLE interrupt enabled
255    Enabled = 1,
256}
257impl From<IDLEIE_A> for bool {
258    #[inline(always)]
259    fn from(variant: IDLEIE_A) -> Self {
260        variant as u8 != 0
261    }
262}
263impl IDLEIE_R {
264    ///Get enumerated values variant
265    #[inline(always)]
266    pub fn variant(&self) -> IDLEIE_A {
267        match self.bits {
268            false => IDLEIE_A::Disabled,
269            true => IDLEIE_A::Enabled,
270        }
271    }
272    ///Checks if the value of the field is `Disabled`
273    #[inline(always)]
274    pub fn is_disabled(&self) -> bool {
275        *self == IDLEIE_A::Disabled
276    }
277    ///Checks if the value of the field is `Enabled`
278    #[inline(always)]
279    pub fn is_enabled(&self) -> bool {
280        *self == IDLEIE_A::Enabled
281    }
282}
283///Field `IDLEIE` writer - IDLE interrupt enable
284pub type IDLEIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, IDLEIE_A, O>;
285impl<'a, const O: u8> IDLEIE_W<'a, O> {
286    ///IDLE interrupt disabled
287    #[inline(always)]
288    pub fn disabled(self) -> &'a mut W {
289        self.variant(IDLEIE_A::Disabled)
290    }
291    ///IDLE interrupt enabled
292    #[inline(always)]
293    pub fn enabled(self) -> &'a mut W {
294        self.variant(IDLEIE_A::Enabled)
295    }
296}
297///Field `RXNEIE` reader - RXNE interrupt enable
298pub type RXNEIE_R = crate::BitReader<RXNEIE_A>;
299/**RXNE interrupt enable
300
301Value on reset: 0*/
302#[derive(Clone, Copy, Debug, PartialEq, Eq)]
303pub enum RXNEIE_A {
304    ///0: RXNE interrupt disabled
305    Disabled = 0,
306    ///1: RXNE interrupt enabled
307    Enabled = 1,
308}
309impl From<RXNEIE_A> for bool {
310    #[inline(always)]
311    fn from(variant: RXNEIE_A) -> Self {
312        variant as u8 != 0
313    }
314}
315impl RXNEIE_R {
316    ///Get enumerated values variant
317    #[inline(always)]
318    pub fn variant(&self) -> RXNEIE_A {
319        match self.bits {
320            false => RXNEIE_A::Disabled,
321            true => RXNEIE_A::Enabled,
322        }
323    }
324    ///Checks if the value of the field is `Disabled`
325    #[inline(always)]
326    pub fn is_disabled(&self) -> bool {
327        *self == RXNEIE_A::Disabled
328    }
329    ///Checks if the value of the field is `Enabled`
330    #[inline(always)]
331    pub fn is_enabled(&self) -> bool {
332        *self == RXNEIE_A::Enabled
333    }
334}
335///Field `RXNEIE` writer - RXNE interrupt enable
336pub type RXNEIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, RXNEIE_A, O>;
337impl<'a, const O: u8> RXNEIE_W<'a, O> {
338    ///RXNE interrupt disabled
339    #[inline(always)]
340    pub fn disabled(self) -> &'a mut W {
341        self.variant(RXNEIE_A::Disabled)
342    }
343    ///RXNE interrupt enabled
344    #[inline(always)]
345    pub fn enabled(self) -> &'a mut W {
346        self.variant(RXNEIE_A::Enabled)
347    }
348}
349///Field `TCIE` reader - Transmission complete interrupt enable
350pub type TCIE_R = crate::BitReader<TCIE_A>;
351/**Transmission complete interrupt enable
352
353Value on reset: 0*/
354#[derive(Clone, Copy, Debug, PartialEq, Eq)]
355pub enum TCIE_A {
356    ///0: TC interrupt disabled
357    Disabled = 0,
358    ///1: TC interrupt enabled
359    Enabled = 1,
360}
361impl From<TCIE_A> for bool {
362    #[inline(always)]
363    fn from(variant: TCIE_A) -> Self {
364        variant as u8 != 0
365    }
366}
367impl TCIE_R {
368    ///Get enumerated values variant
369    #[inline(always)]
370    pub fn variant(&self) -> TCIE_A {
371        match self.bits {
372            false => TCIE_A::Disabled,
373            true => TCIE_A::Enabled,
374        }
375    }
376    ///Checks if the value of the field is `Disabled`
377    #[inline(always)]
378    pub fn is_disabled(&self) -> bool {
379        *self == TCIE_A::Disabled
380    }
381    ///Checks if the value of the field is `Enabled`
382    #[inline(always)]
383    pub fn is_enabled(&self) -> bool {
384        *self == TCIE_A::Enabled
385    }
386}
387///Field `TCIE` writer - Transmission complete interrupt enable
388pub type TCIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, TCIE_A, O>;
389impl<'a, const O: u8> TCIE_W<'a, O> {
390    ///TC interrupt disabled
391    #[inline(always)]
392    pub fn disabled(self) -> &'a mut W {
393        self.variant(TCIE_A::Disabled)
394    }
395    ///TC interrupt enabled
396    #[inline(always)]
397    pub fn enabled(self) -> &'a mut W {
398        self.variant(TCIE_A::Enabled)
399    }
400}
401///Field `TXEIE` reader - TXE interrupt enable
402pub type TXEIE_R = crate::BitReader<TXEIE_A>;
403/**TXE interrupt enable
404
405Value on reset: 0*/
406#[derive(Clone, Copy, Debug, PartialEq, Eq)]
407pub enum TXEIE_A {
408    ///0: TXE interrupt disabled
409    Disabled = 0,
410    ///1: TXE interrupt enabled
411    Enabled = 1,
412}
413impl From<TXEIE_A> for bool {
414    #[inline(always)]
415    fn from(variant: TXEIE_A) -> Self {
416        variant as u8 != 0
417    }
418}
419impl TXEIE_R {
420    ///Get enumerated values variant
421    #[inline(always)]
422    pub fn variant(&self) -> TXEIE_A {
423        match self.bits {
424            false => TXEIE_A::Disabled,
425            true => TXEIE_A::Enabled,
426        }
427    }
428    ///Checks if the value of the field is `Disabled`
429    #[inline(always)]
430    pub fn is_disabled(&self) -> bool {
431        *self == TXEIE_A::Disabled
432    }
433    ///Checks if the value of the field is `Enabled`
434    #[inline(always)]
435    pub fn is_enabled(&self) -> bool {
436        *self == TXEIE_A::Enabled
437    }
438}
439///Field `TXEIE` writer - TXE interrupt enable
440pub type TXEIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, TXEIE_A, O>;
441impl<'a, const O: u8> TXEIE_W<'a, O> {
442    ///TXE interrupt disabled
443    #[inline(always)]
444    pub fn disabled(self) -> &'a mut W {
445        self.variant(TXEIE_A::Disabled)
446    }
447    ///TXE interrupt enabled
448    #[inline(always)]
449    pub fn enabled(self) -> &'a mut W {
450        self.variant(TXEIE_A::Enabled)
451    }
452}
453///Field `PEIE` reader - PE interrupt enable
454pub type PEIE_R = crate::BitReader<PEIE_A>;
455/**PE interrupt enable
456
457Value on reset: 0*/
458#[derive(Clone, Copy, Debug, PartialEq, Eq)]
459pub enum PEIE_A {
460    ///0: PE interrupt disabled
461    Disabled = 0,
462    ///1: PE interrupt enabled
463    Enabled = 1,
464}
465impl From<PEIE_A> for bool {
466    #[inline(always)]
467    fn from(variant: PEIE_A) -> Self {
468        variant as u8 != 0
469    }
470}
471impl PEIE_R {
472    ///Get enumerated values variant
473    #[inline(always)]
474    pub fn variant(&self) -> PEIE_A {
475        match self.bits {
476            false => PEIE_A::Disabled,
477            true => PEIE_A::Enabled,
478        }
479    }
480    ///Checks if the value of the field is `Disabled`
481    #[inline(always)]
482    pub fn is_disabled(&self) -> bool {
483        *self == PEIE_A::Disabled
484    }
485    ///Checks if the value of the field is `Enabled`
486    #[inline(always)]
487    pub fn is_enabled(&self) -> bool {
488        *self == PEIE_A::Enabled
489    }
490}
491///Field `PEIE` writer - PE interrupt enable
492pub type PEIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, PEIE_A, O>;
493impl<'a, const O: u8> PEIE_W<'a, O> {
494    ///PE interrupt disabled
495    #[inline(always)]
496    pub fn disabled(self) -> &'a mut W {
497        self.variant(PEIE_A::Disabled)
498    }
499    ///PE interrupt enabled
500    #[inline(always)]
501    pub fn enabled(self) -> &'a mut W {
502        self.variant(PEIE_A::Enabled)
503    }
504}
505///Field `PS` reader - Parity selection
506pub type PS_R = crate::BitReader<PS_A>;
507/**Parity selection
508
509Value on reset: 0*/
510#[derive(Clone, Copy, Debug, PartialEq, Eq)]
511pub enum PS_A {
512    ///0: Even parity
513    Even = 0,
514    ///1: Odd parity
515    Odd = 1,
516}
517impl From<PS_A> for bool {
518    #[inline(always)]
519    fn from(variant: PS_A) -> Self {
520        variant as u8 != 0
521    }
522}
523impl PS_R {
524    ///Get enumerated values variant
525    #[inline(always)]
526    pub fn variant(&self) -> PS_A {
527        match self.bits {
528            false => PS_A::Even,
529            true => PS_A::Odd,
530        }
531    }
532    ///Checks if the value of the field is `Even`
533    #[inline(always)]
534    pub fn is_even(&self) -> bool {
535        *self == PS_A::Even
536    }
537    ///Checks if the value of the field is `Odd`
538    #[inline(always)]
539    pub fn is_odd(&self) -> bool {
540        *self == PS_A::Odd
541    }
542}
543///Field `PS` writer - Parity selection
544pub type PS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, PS_A, O>;
545impl<'a, const O: u8> PS_W<'a, O> {
546    ///Even parity
547    #[inline(always)]
548    pub fn even(self) -> &'a mut W {
549        self.variant(PS_A::Even)
550    }
551    ///Odd parity
552    #[inline(always)]
553    pub fn odd(self) -> &'a mut W {
554        self.variant(PS_A::Odd)
555    }
556}
557///Field `PCE` reader - Parity control enable
558pub type PCE_R = crate::BitReader<PCE_A>;
559/**Parity control enable
560
561Value on reset: 0*/
562#[derive(Clone, Copy, Debug, PartialEq, Eq)]
563pub enum PCE_A {
564    ///0: Parity control disabled
565    Disabled = 0,
566    ///1: Parity control enabled
567    Enabled = 1,
568}
569impl From<PCE_A> for bool {
570    #[inline(always)]
571    fn from(variant: PCE_A) -> Self {
572        variant as u8 != 0
573    }
574}
575impl PCE_R {
576    ///Get enumerated values variant
577    #[inline(always)]
578    pub fn variant(&self) -> PCE_A {
579        match self.bits {
580            false => PCE_A::Disabled,
581            true => PCE_A::Enabled,
582        }
583    }
584    ///Checks if the value of the field is `Disabled`
585    #[inline(always)]
586    pub fn is_disabled(&self) -> bool {
587        *self == PCE_A::Disabled
588    }
589    ///Checks if the value of the field is `Enabled`
590    #[inline(always)]
591    pub fn is_enabled(&self) -> bool {
592        *self == PCE_A::Enabled
593    }
594}
595///Field `PCE` writer - Parity control enable
596pub type PCE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, PCE_A, O>;
597impl<'a, const O: u8> PCE_W<'a, O> {
598    ///Parity control disabled
599    #[inline(always)]
600    pub fn disabled(self) -> &'a mut W {
601        self.variant(PCE_A::Disabled)
602    }
603    ///Parity control enabled
604    #[inline(always)]
605    pub fn enabled(self) -> &'a mut W {
606        self.variant(PCE_A::Enabled)
607    }
608}
609///Field `WAKE` reader - Wakeup method
610pub type WAKE_R = crate::BitReader<WAKE_A>;
611/**Wakeup method
612
613Value on reset: 0*/
614#[derive(Clone, Copy, Debug, PartialEq, Eq)]
615pub enum WAKE_A {
616    ///0: USART wakeup on idle line
617    IdleLine = 0,
618    ///1: USART wakeup on address mark
619    AddressMark = 1,
620}
621impl From<WAKE_A> for bool {
622    #[inline(always)]
623    fn from(variant: WAKE_A) -> Self {
624        variant as u8 != 0
625    }
626}
627impl WAKE_R {
628    ///Get enumerated values variant
629    #[inline(always)]
630    pub fn variant(&self) -> WAKE_A {
631        match self.bits {
632            false => WAKE_A::IdleLine,
633            true => WAKE_A::AddressMark,
634        }
635    }
636    ///Checks if the value of the field is `IdleLine`
637    #[inline(always)]
638    pub fn is_idle_line(&self) -> bool {
639        *self == WAKE_A::IdleLine
640    }
641    ///Checks if the value of the field is `AddressMark`
642    #[inline(always)]
643    pub fn is_address_mark(&self) -> bool {
644        *self == WAKE_A::AddressMark
645    }
646}
647///Field `WAKE` writer - Wakeup method
648pub type WAKE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, WAKE_A, O>;
649impl<'a, const O: u8> WAKE_W<'a, O> {
650    ///USART wakeup on idle line
651    #[inline(always)]
652    pub fn idle_line(self) -> &'a mut W {
653        self.variant(WAKE_A::IdleLine)
654    }
655    ///USART wakeup on address mark
656    #[inline(always)]
657    pub fn address_mark(self) -> &'a mut W {
658        self.variant(WAKE_A::AddressMark)
659    }
660}
661///Field `M` reader - Word length
662pub type M_R = crate::BitReader<M_A>;
663/**Word length
664
665Value on reset: 0*/
666#[derive(Clone, Copy, Debug, PartialEq, Eq)]
667pub enum M_A {
668    ///0: 8 data bits
669    M8 = 0,
670    ///1: 9 data bits
671    M9 = 1,
672}
673impl From<M_A> for bool {
674    #[inline(always)]
675    fn from(variant: M_A) -> Self {
676        variant as u8 != 0
677    }
678}
679impl M_R {
680    ///Get enumerated values variant
681    #[inline(always)]
682    pub fn variant(&self) -> M_A {
683        match self.bits {
684            false => M_A::M8,
685            true => M_A::M9,
686        }
687    }
688    ///Checks if the value of the field is `M8`
689    #[inline(always)]
690    pub fn is_m8(&self) -> bool {
691        *self == M_A::M8
692    }
693    ///Checks if the value of the field is `M9`
694    #[inline(always)]
695    pub fn is_m9(&self) -> bool {
696        *self == M_A::M9
697    }
698}
699///Field `M` writer - Word length
700pub type M_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, M_A, O>;
701impl<'a, const O: u8> M_W<'a, O> {
702    ///8 data bits
703    #[inline(always)]
704    pub fn m8(self) -> &'a mut W {
705        self.variant(M_A::M8)
706    }
707    ///9 data bits
708    #[inline(always)]
709    pub fn m9(self) -> &'a mut W {
710        self.variant(M_A::M9)
711    }
712}
713///Field `UE` reader - USART enable
714pub type UE_R = crate::BitReader<UE_A>;
715/**USART enable
716
717Value on reset: 0*/
718#[derive(Clone, Copy, Debug, PartialEq, Eq)]
719pub enum UE_A {
720    ///0: USART prescaler and outputs disabled
721    Disabled = 0,
722    ///1: USART enabled
723    Enabled = 1,
724}
725impl From<UE_A> for bool {
726    #[inline(always)]
727    fn from(variant: UE_A) -> Self {
728        variant as u8 != 0
729    }
730}
731impl UE_R {
732    ///Get enumerated values variant
733    #[inline(always)]
734    pub fn variant(&self) -> UE_A {
735        match self.bits {
736            false => UE_A::Disabled,
737            true => UE_A::Enabled,
738        }
739    }
740    ///Checks if the value of the field is `Disabled`
741    #[inline(always)]
742    pub fn is_disabled(&self) -> bool {
743        *self == UE_A::Disabled
744    }
745    ///Checks if the value of the field is `Enabled`
746    #[inline(always)]
747    pub fn is_enabled(&self) -> bool {
748        *self == UE_A::Enabled
749    }
750}
751///Field `UE` writer - USART enable
752pub type UE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, UE_A, O>;
753impl<'a, const O: u8> UE_W<'a, O> {
754    ///USART prescaler and outputs disabled
755    #[inline(always)]
756    pub fn disabled(self) -> &'a mut W {
757        self.variant(UE_A::Disabled)
758    }
759    ///USART enabled
760    #[inline(always)]
761    pub fn enabled(self) -> &'a mut W {
762        self.variant(UE_A::Enabled)
763    }
764}
765impl R {
766    ///Bit 0 - Send break
767    #[inline(always)]
768    pub fn sbk(&self) -> SBK_R {
769        SBK_R::new((self.bits & 1) != 0)
770    }
771    ///Bit 1 - Receiver wakeup
772    #[inline(always)]
773    pub fn rwu(&self) -> RWU_R {
774        RWU_R::new(((self.bits >> 1) & 1) != 0)
775    }
776    ///Bit 2 - Receiver enable
777    #[inline(always)]
778    pub fn re(&self) -> RE_R {
779        RE_R::new(((self.bits >> 2) & 1) != 0)
780    }
781    ///Bit 3 - Transmitter enable
782    #[inline(always)]
783    pub fn te(&self) -> TE_R {
784        TE_R::new(((self.bits >> 3) & 1) != 0)
785    }
786    ///Bit 4 - IDLE interrupt enable
787    #[inline(always)]
788    pub fn idleie(&self) -> IDLEIE_R {
789        IDLEIE_R::new(((self.bits >> 4) & 1) != 0)
790    }
791    ///Bit 5 - RXNE interrupt enable
792    #[inline(always)]
793    pub fn rxneie(&self) -> RXNEIE_R {
794        RXNEIE_R::new(((self.bits >> 5) & 1) != 0)
795    }
796    ///Bit 6 - Transmission complete interrupt enable
797    #[inline(always)]
798    pub fn tcie(&self) -> TCIE_R {
799        TCIE_R::new(((self.bits >> 6) & 1) != 0)
800    }
801    ///Bit 7 - TXE interrupt enable
802    #[inline(always)]
803    pub fn txeie(&self) -> TXEIE_R {
804        TXEIE_R::new(((self.bits >> 7) & 1) != 0)
805    }
806    ///Bit 8 - PE interrupt enable
807    #[inline(always)]
808    pub fn peie(&self) -> PEIE_R {
809        PEIE_R::new(((self.bits >> 8) & 1) != 0)
810    }
811    ///Bit 9 - Parity selection
812    #[inline(always)]
813    pub fn ps(&self) -> PS_R {
814        PS_R::new(((self.bits >> 9) & 1) != 0)
815    }
816    ///Bit 10 - Parity control enable
817    #[inline(always)]
818    pub fn pce(&self) -> PCE_R {
819        PCE_R::new(((self.bits >> 10) & 1) != 0)
820    }
821    ///Bit 11 - Wakeup method
822    #[inline(always)]
823    pub fn wake(&self) -> WAKE_R {
824        WAKE_R::new(((self.bits >> 11) & 1) != 0)
825    }
826    ///Bit 12 - Word length
827    #[inline(always)]
828    pub fn m(&self) -> M_R {
829        M_R::new(((self.bits >> 12) & 1) != 0)
830    }
831    ///Bit 13 - USART enable
832    #[inline(always)]
833    pub fn ue(&self) -> UE_R {
834        UE_R::new(((self.bits >> 13) & 1) != 0)
835    }
836}
837impl W {
838    ///Bit 0 - Send break
839    #[inline(always)]
840    #[must_use]
841    pub fn sbk(&mut self) -> SBK_W<0> {
842        SBK_W::new(self)
843    }
844    ///Bit 1 - Receiver wakeup
845    #[inline(always)]
846    #[must_use]
847    pub fn rwu(&mut self) -> RWU_W<1> {
848        RWU_W::new(self)
849    }
850    ///Bit 2 - Receiver enable
851    #[inline(always)]
852    #[must_use]
853    pub fn re(&mut self) -> RE_W<2> {
854        RE_W::new(self)
855    }
856    ///Bit 3 - Transmitter enable
857    #[inline(always)]
858    #[must_use]
859    pub fn te(&mut self) -> TE_W<3> {
860        TE_W::new(self)
861    }
862    ///Bit 4 - IDLE interrupt enable
863    #[inline(always)]
864    #[must_use]
865    pub fn idleie(&mut self) -> IDLEIE_W<4> {
866        IDLEIE_W::new(self)
867    }
868    ///Bit 5 - RXNE interrupt enable
869    #[inline(always)]
870    #[must_use]
871    pub fn rxneie(&mut self) -> RXNEIE_W<5> {
872        RXNEIE_W::new(self)
873    }
874    ///Bit 6 - Transmission complete interrupt enable
875    #[inline(always)]
876    #[must_use]
877    pub fn tcie(&mut self) -> TCIE_W<6> {
878        TCIE_W::new(self)
879    }
880    ///Bit 7 - TXE interrupt enable
881    #[inline(always)]
882    #[must_use]
883    pub fn txeie(&mut self) -> TXEIE_W<7> {
884        TXEIE_W::new(self)
885    }
886    ///Bit 8 - PE interrupt enable
887    #[inline(always)]
888    #[must_use]
889    pub fn peie(&mut self) -> PEIE_W<8> {
890        PEIE_W::new(self)
891    }
892    ///Bit 9 - Parity selection
893    #[inline(always)]
894    #[must_use]
895    pub fn ps(&mut self) -> PS_W<9> {
896        PS_W::new(self)
897    }
898    ///Bit 10 - Parity control enable
899    #[inline(always)]
900    #[must_use]
901    pub fn pce(&mut self) -> PCE_W<10> {
902        PCE_W::new(self)
903    }
904    ///Bit 11 - Wakeup method
905    #[inline(always)]
906    #[must_use]
907    pub fn wake(&mut self) -> WAKE_W<11> {
908        WAKE_W::new(self)
909    }
910    ///Bit 12 - Word length
911    #[inline(always)]
912    #[must_use]
913    pub fn m(&mut self) -> M_W<12> {
914        M_W::new(self)
915    }
916    ///Bit 13 - USART enable
917    #[inline(always)]
918    #[must_use]
919    pub fn ue(&mut self) -> UE_W<13> {
920        UE_W::new(self)
921    }
922    ///Writes raw bits to the register.
923    #[inline(always)]
924    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
925        self.0.bits(bits);
926        self
927    }
928}
929/**Control register 1
930
931This register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).
932
933For information about available fields see [cr1](index.html) module*/
934pub struct CR1_SPEC;
935impl crate::RegisterSpec for CR1_SPEC {
936    type Ux = u32;
937}
938///`read()` method returns [cr1::R](R) reader structure
939impl crate::Readable for CR1_SPEC {
940    type Reader = R;
941}
942///`write(|w| ..)` method takes [cr1::W](W) writer structure
943impl crate::Writable for CR1_SPEC {
944    type Writer = W;
945    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
946    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
947}
948///`reset()` method sets CR1 to value 0
949impl crate::Resettable for CR1_SPEC {
950    const RESET_VALUE: Self::Ux = 0;
951}