stm32l4x2_pac/lpuart1/
rqr.rs

1#[doc = r" Value to write to the register"]
2pub struct W {
3    bits: u32,
4}
5impl super::RQR {
6    #[doc = r" Writes to the register"]
7    #[inline]
8    pub fn write<F>(&self, f: F)
9    where
10        F: FnOnce(&mut W) -> &mut W,
11    {
12        let mut w = W::reset_value();
13        f(&mut w);
14        self.register.set(w.bits);
15    }
16}
17#[doc = "Values that can be written to the field `RXFRQ`"]
18pub enum RXFRQW {
19    #[doc = "clears the RXNE flag. This allows to discard the received data without reading it, and avoid an overrun condition"]
20    DISCARD,
21}
22impl RXFRQW {
23    #[allow(missing_docs)]
24    #[doc(hidden)]
25    #[inline]
26    pub fn _bits(&self) -> bool {
27        match *self {
28            RXFRQW::DISCARD => true,
29        }
30    }
31}
32#[doc = r" Proxy"]
33pub struct _RXFRQW<'a> {
34    w: &'a mut W,
35}
36impl<'a> _RXFRQW<'a> {
37    #[doc = r" Writes `variant` to the field"]
38    #[inline]
39    pub fn variant(self, variant: RXFRQW) -> &'a mut W {
40        {
41            self.bit(variant._bits())
42        }
43    }
44    #[doc = "clears the RXNE flag. This allows to discard the received data without reading it, and avoid an overrun condition"]
45    #[inline]
46    pub fn discard(self) -> &'a mut W {
47        self.variant(RXFRQW::DISCARD)
48    }
49    #[doc = r" Sets the field bit"]
50    pub fn set_bit(self) -> &'a mut W {
51        self.bit(true)
52    }
53    #[doc = r" Clears the field bit"]
54    pub fn clear_bit(self) -> &'a mut W {
55        self.bit(false)
56    }
57    #[doc = r" Writes raw bits to the field"]
58    #[inline]
59    pub fn bit(self, value: bool) -> &'a mut W {
60        const MASK: bool = true;
61        const OFFSET: u8 = 3;
62        self.w.bits &= !((MASK as u32) << OFFSET);
63        self.w.bits |= ((value & MASK) as u32) << OFFSET;
64        self.w
65    }
66}
67#[doc = "Values that can be written to the field `MMRQ`"]
68pub enum MMRQW {
69    #[doc = "Puts the USART in mute mode and sets the RWU flag"]
70    MUTE,
71}
72impl MMRQW {
73    #[allow(missing_docs)]
74    #[doc(hidden)]
75    #[inline]
76    pub fn _bits(&self) -> bool {
77        match *self {
78            MMRQW::MUTE => true,
79        }
80    }
81}
82#[doc = r" Proxy"]
83pub struct _MMRQW<'a> {
84    w: &'a mut W,
85}
86impl<'a> _MMRQW<'a> {
87    #[doc = r" Writes `variant` to the field"]
88    #[inline]
89    pub fn variant(self, variant: MMRQW) -> &'a mut W {
90        {
91            self.bit(variant._bits())
92        }
93    }
94    #[doc = "Puts the USART in mute mode and sets the RWU flag"]
95    #[inline]
96    pub fn mute(self) -> &'a mut W {
97        self.variant(MMRQW::MUTE)
98    }
99    #[doc = r" Sets the field bit"]
100    pub fn set_bit(self) -> &'a mut W {
101        self.bit(true)
102    }
103    #[doc = r" Clears the field bit"]
104    pub fn clear_bit(self) -> &'a mut W {
105        self.bit(false)
106    }
107    #[doc = r" Writes raw bits to the field"]
108    #[inline]
109    pub fn bit(self, value: bool) -> &'a mut W {
110        const MASK: bool = true;
111        const OFFSET: u8 = 2;
112        self.w.bits &= !((MASK as u32) << OFFSET);
113        self.w.bits |= ((value & MASK) as u32) << OFFSET;
114        self.w
115    }
116}
117#[doc = "Values that can be written to the field `SBKRQ`"]
118pub enum SBKRQW {
119    #[doc = "sets the SBKF flag and request to send a BREAK on the line, as soon as the transmit machine is available"]
120    BREAK,
121}
122impl SBKRQW {
123    #[allow(missing_docs)]
124    #[doc(hidden)]
125    #[inline]
126    pub fn _bits(&self) -> bool {
127        match *self {
128            SBKRQW::BREAK => true,
129        }
130    }
131}
132#[doc = r" Proxy"]
133pub struct _SBKRQW<'a> {
134    w: &'a mut W,
135}
136impl<'a> _SBKRQW<'a> {
137    #[doc = r" Writes `variant` to the field"]
138    #[inline]
139    pub fn variant(self, variant: SBKRQW) -> &'a mut W {
140        {
141            self.bit(variant._bits())
142        }
143    }
144    #[doc = "sets the SBKF flag and request to send a BREAK on the line, as soon as the transmit machine is available"]
145    #[inline]
146    pub fn break_(self) -> &'a mut W {
147        self.variant(SBKRQW::BREAK)
148    }
149    #[doc = r" Sets the field bit"]
150    pub fn set_bit(self) -> &'a mut W {
151        self.bit(true)
152    }
153    #[doc = r" Clears the field bit"]
154    pub fn clear_bit(self) -> &'a mut W {
155        self.bit(false)
156    }
157    #[doc = r" Writes raw bits to the field"]
158    #[inline]
159    pub fn bit(self, value: bool) -> &'a mut W {
160        const MASK: bool = true;
161        const OFFSET: u8 = 1;
162        self.w.bits &= !((MASK as u32) << OFFSET);
163        self.w.bits |= ((value & MASK) as u32) << OFFSET;
164        self.w
165    }
166}
167impl W {
168    #[doc = r" Reset value of the register"]
169    #[inline]
170    pub fn reset_value() -> W {
171        W { bits: 0 }
172    }
173    #[doc = r" Writes raw bits to the register"]
174    #[inline]
175    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
176        self.bits = bits;
177        self
178    }
179    #[doc = "Bit 3 - Receive data flush request"]
180    #[inline]
181    pub fn rxfrq(&mut self) -> _RXFRQW {
182        _RXFRQW { w: self }
183    }
184    #[doc = "Bit 2 - Mute mode request"]
185    #[inline]
186    pub fn mmrq(&mut self) -> _MMRQW {
187        _MMRQW { w: self }
188    }
189    #[doc = "Bit 1 - Send break request"]
190    #[inline]
191    pub fn sbkrq(&mut self) -> _SBKRQW {
192        _SBKRQW { w: self }
193    }
194}