stm32l4x2_pac/rcc/
cicr.rs

1#[doc = r" Value to write to the register"]
2pub struct W {
3    bits: u32,
4}
5impl super::CICR {
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 = r" Proxy"]
18pub struct _LSECSSCW<'a> {
19    w: &'a mut W,
20}
21impl<'a> _LSECSSCW<'a> {
22    #[doc = r" Sets the field bit"]
23    pub fn set_bit(self) -> &'a mut W {
24        self.bit(true)
25    }
26    #[doc = r" Clears the field bit"]
27    pub fn clear_bit(self) -> &'a mut W {
28        self.bit(false)
29    }
30    #[doc = r" Writes raw bits to the field"]
31    #[inline]
32    pub fn bit(self, value: bool) -> &'a mut W {
33        const MASK: bool = true;
34        const OFFSET: u8 = 9;
35        self.w.bits &= !((MASK as u32) << OFFSET);
36        self.w.bits |= ((value & MASK) as u32) << OFFSET;
37        self.w
38    }
39}
40#[doc = r" Proxy"]
41pub struct _CSSCW<'a> {
42    w: &'a mut W,
43}
44impl<'a> _CSSCW<'a> {
45    #[doc = r" Sets the field bit"]
46    pub fn set_bit(self) -> &'a mut W {
47        self.bit(true)
48    }
49    #[doc = r" Clears the field bit"]
50    pub fn clear_bit(self) -> &'a mut W {
51        self.bit(false)
52    }
53    #[doc = r" Writes raw bits to the field"]
54    #[inline]
55    pub fn bit(self, value: bool) -> &'a mut W {
56        const MASK: bool = true;
57        const OFFSET: u8 = 8;
58        self.w.bits &= !((MASK as u32) << OFFSET);
59        self.w.bits |= ((value & MASK) as u32) << OFFSET;
60        self.w
61    }
62}
63#[doc = r" Proxy"]
64pub struct _PLLSAI1RDYCW<'a> {
65    w: &'a mut W,
66}
67impl<'a> _PLLSAI1RDYCW<'a> {
68    #[doc = r" Sets the field bit"]
69    pub fn set_bit(self) -> &'a mut W {
70        self.bit(true)
71    }
72    #[doc = r" Clears the field bit"]
73    pub fn clear_bit(self) -> &'a mut W {
74        self.bit(false)
75    }
76    #[doc = r" Writes raw bits to the field"]
77    #[inline]
78    pub fn bit(self, value: bool) -> &'a mut W {
79        const MASK: bool = true;
80        const OFFSET: u8 = 6;
81        self.w.bits &= !((MASK as u32) << OFFSET);
82        self.w.bits |= ((value & MASK) as u32) << OFFSET;
83        self.w
84    }
85}
86#[doc = r" Proxy"]
87pub struct _PLLRDYCW<'a> {
88    w: &'a mut W,
89}
90impl<'a> _PLLRDYCW<'a> {
91    #[doc = r" Sets the field bit"]
92    pub fn set_bit(self) -> &'a mut W {
93        self.bit(true)
94    }
95    #[doc = r" Clears the field bit"]
96    pub fn clear_bit(self) -> &'a mut W {
97        self.bit(false)
98    }
99    #[doc = r" Writes raw bits to the field"]
100    #[inline]
101    pub fn bit(self, value: bool) -> &'a mut W {
102        const MASK: bool = true;
103        const OFFSET: u8 = 5;
104        self.w.bits &= !((MASK as u32) << OFFSET);
105        self.w.bits |= ((value & MASK) as u32) << OFFSET;
106        self.w
107    }
108}
109#[doc = r" Proxy"]
110pub struct _HSERDYCW<'a> {
111    w: &'a mut W,
112}
113impl<'a> _HSERDYCW<'a> {
114    #[doc = r" Sets the field bit"]
115    pub fn set_bit(self) -> &'a mut W {
116        self.bit(true)
117    }
118    #[doc = r" Clears the field bit"]
119    pub fn clear_bit(self) -> &'a mut W {
120        self.bit(false)
121    }
122    #[doc = r" Writes raw bits to the field"]
123    #[inline]
124    pub fn bit(self, value: bool) -> &'a mut W {
125        const MASK: bool = true;
126        const OFFSET: u8 = 4;
127        self.w.bits &= !((MASK as u32) << OFFSET);
128        self.w.bits |= ((value & MASK) as u32) << OFFSET;
129        self.w
130    }
131}
132#[doc = r" Proxy"]
133pub struct _HSIRDYCW<'a> {
134    w: &'a mut W,
135}
136impl<'a> _HSIRDYCW<'a> {
137    #[doc = r" Sets the field bit"]
138    pub fn set_bit(self) -> &'a mut W {
139        self.bit(true)
140    }
141    #[doc = r" Clears the field bit"]
142    pub fn clear_bit(self) -> &'a mut W {
143        self.bit(false)
144    }
145    #[doc = r" Writes raw bits to the field"]
146    #[inline]
147    pub fn bit(self, value: bool) -> &'a mut W {
148        const MASK: bool = true;
149        const OFFSET: u8 = 3;
150        self.w.bits &= !((MASK as u32) << OFFSET);
151        self.w.bits |= ((value & MASK) as u32) << OFFSET;
152        self.w
153    }
154}
155#[doc = r" Proxy"]
156pub struct _MSIRDYCW<'a> {
157    w: &'a mut W,
158}
159impl<'a> _MSIRDYCW<'a> {
160    #[doc = r" Sets the field bit"]
161    pub fn set_bit(self) -> &'a mut W {
162        self.bit(true)
163    }
164    #[doc = r" Clears the field bit"]
165    pub fn clear_bit(self) -> &'a mut W {
166        self.bit(false)
167    }
168    #[doc = r" Writes raw bits to the field"]
169    #[inline]
170    pub fn bit(self, value: bool) -> &'a mut W {
171        const MASK: bool = true;
172        const OFFSET: u8 = 2;
173        self.w.bits &= !((MASK as u32) << OFFSET);
174        self.w.bits |= ((value & MASK) as u32) << OFFSET;
175        self.w
176    }
177}
178#[doc = r" Proxy"]
179pub struct _LSERDYCW<'a> {
180    w: &'a mut W,
181}
182impl<'a> _LSERDYCW<'a> {
183    #[doc = r" Sets the field bit"]
184    pub fn set_bit(self) -> &'a mut W {
185        self.bit(true)
186    }
187    #[doc = r" Clears the field bit"]
188    pub fn clear_bit(self) -> &'a mut W {
189        self.bit(false)
190    }
191    #[doc = r" Writes raw bits to the field"]
192    #[inline]
193    pub fn bit(self, value: bool) -> &'a mut W {
194        const MASK: bool = true;
195        const OFFSET: u8 = 1;
196        self.w.bits &= !((MASK as u32) << OFFSET);
197        self.w.bits |= ((value & MASK) as u32) << OFFSET;
198        self.w
199    }
200}
201#[doc = r" Proxy"]
202pub struct _LSIRDYCW<'a> {
203    w: &'a mut W,
204}
205impl<'a> _LSIRDYCW<'a> {
206    #[doc = r" Sets the field bit"]
207    pub fn set_bit(self) -> &'a mut W {
208        self.bit(true)
209    }
210    #[doc = r" Clears the field bit"]
211    pub fn clear_bit(self) -> &'a mut W {
212        self.bit(false)
213    }
214    #[doc = r" Writes raw bits to the field"]
215    #[inline]
216    pub fn bit(self, value: bool) -> &'a mut W {
217        const MASK: bool = true;
218        const OFFSET: u8 = 0;
219        self.w.bits &= !((MASK as u32) << OFFSET);
220        self.w.bits |= ((value & MASK) as u32) << OFFSET;
221        self.w
222    }
223}
224#[doc = r" Proxy"]
225pub struct _HSI48RDYCW<'a> {
226    w: &'a mut W,
227}
228impl<'a> _HSI48RDYCW<'a> {
229    #[doc = r" Sets the field bit"]
230    pub fn set_bit(self) -> &'a mut W {
231        self.bit(true)
232    }
233    #[doc = r" Clears the field bit"]
234    pub fn clear_bit(self) -> &'a mut W {
235        self.bit(false)
236    }
237    #[doc = r" Writes raw bits to the field"]
238    #[inline]
239    pub fn bit(self, value: bool) -> &'a mut W {
240        const MASK: bool = true;
241        const OFFSET: u8 = 10;
242        self.w.bits &= !((MASK as u32) << OFFSET);
243        self.w.bits |= ((value & MASK) as u32) << OFFSET;
244        self.w
245    }
246}
247impl W {
248    #[doc = r" Reset value of the register"]
249    #[inline]
250    pub fn reset_value() -> W {
251        W { bits: 0 }
252    }
253    #[doc = r" Writes raw bits to the register"]
254    #[inline]
255    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
256        self.bits = bits;
257        self
258    }
259    #[doc = "Bit 9 - LSE Clock security system interrupt clear"]
260    #[inline]
261    pub fn lsecssc(&mut self) -> _LSECSSCW {
262        _LSECSSCW { w: self }
263    }
264    #[doc = "Bit 8 - Clock security system interrupt clear"]
265    #[inline]
266    pub fn cssc(&mut self) -> _CSSCW {
267        _CSSCW { w: self }
268    }
269    #[doc = "Bit 6 - PLLSAI1 ready interrupt clear"]
270    #[inline]
271    pub fn pllsai1rdyc(&mut self) -> _PLLSAI1RDYCW {
272        _PLLSAI1RDYCW { w: self }
273    }
274    #[doc = "Bit 5 - PLL ready interrupt clear"]
275    #[inline]
276    pub fn pllrdyc(&mut self) -> _PLLRDYCW {
277        _PLLRDYCW { w: self }
278    }
279    #[doc = "Bit 4 - HSE ready interrupt clear"]
280    #[inline]
281    pub fn hserdyc(&mut self) -> _HSERDYCW {
282        _HSERDYCW { w: self }
283    }
284    #[doc = "Bit 3 - HSI ready interrupt clear"]
285    #[inline]
286    pub fn hsirdyc(&mut self) -> _HSIRDYCW {
287        _HSIRDYCW { w: self }
288    }
289    #[doc = "Bit 2 - MSI ready interrupt clear"]
290    #[inline]
291    pub fn msirdyc(&mut self) -> _MSIRDYCW {
292        _MSIRDYCW { w: self }
293    }
294    #[doc = "Bit 1 - LSE ready interrupt clear"]
295    #[inline]
296    pub fn lserdyc(&mut self) -> _LSERDYCW {
297        _LSERDYCW { w: self }
298    }
299    #[doc = "Bit 0 - LSI ready interrupt clear"]
300    #[inline]
301    pub fn lsirdyc(&mut self) -> _LSIRDYCW {
302        _LSIRDYCW { w: self }
303    }
304    #[doc = "Bit 10 - HSI48 oscillator ready interrupt clear"]
305    #[inline]
306    pub fn hsi48rdyc(&mut self) -> _HSI48RDYCW {
307        _HSI48RDYCW { w: self }
308    }
309}