stm32wb_pac/pwr/
scr.rs

1#[doc = "Writer for register SCR"]
2pub type W = crate::W<u32, super::SCR>;
3#[doc = "Register SCR `reset()`'s with value 0"]
4impl crate::ResetValue for super::SCR {
5    type Type = u32;
6    #[inline(always)]
7    fn reset_value() -> Self::Type {
8        0
9    }
10}
11#[doc = "Write proxy for field `CC2HF`"]
12pub struct CC2HF_W<'a> {
13    w: &'a mut W,
14}
15impl<'a> CC2HF_W<'a> {
16    #[doc = r"Sets the field bit"]
17    #[inline(always)]
18    pub fn set_bit(self) -> &'a mut W {
19        self.bit(true)
20    }
21    #[doc = r"Clears the field bit"]
22    #[inline(always)]
23    pub fn clear_bit(self) -> &'a mut W {
24        self.bit(false)
25    }
26    #[doc = r"Writes raw bits to the field"]
27    #[inline(always)]
28    pub fn bit(self, value: bool) -> &'a mut W {
29        self.w.bits = (self.w.bits & !(0x01 << 14)) | (((value as u32) & 0x01) << 14);
30        self.w
31    }
32}
33#[doc = "Write proxy for field `C802AF`"]
34pub struct C802AF_W<'a> {
35    w: &'a mut W,
36}
37impl<'a> C802AF_W<'a> {
38    #[doc = r"Sets the field bit"]
39    #[inline(always)]
40    pub fn set_bit(self) -> &'a mut W {
41        self.bit(true)
42    }
43    #[doc = r"Clears the field bit"]
44    #[inline(always)]
45    pub fn clear_bit(self) -> &'a mut W {
46        self.bit(false)
47    }
48    #[doc = r"Writes raw bits to the field"]
49    #[inline(always)]
50    pub fn bit(self, value: bool) -> &'a mut W {
51        self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13);
52        self.w
53    }
54}
55#[doc = "Write proxy for field `CBLEAF`"]
56pub struct CBLEAF_W<'a> {
57    w: &'a mut W,
58}
59impl<'a> CBLEAF_W<'a> {
60    #[doc = r"Sets the field bit"]
61    #[inline(always)]
62    pub fn set_bit(self) -> &'a mut W {
63        self.bit(true)
64    }
65    #[doc = r"Clears the field bit"]
66    #[inline(always)]
67    pub fn clear_bit(self) -> &'a mut W {
68        self.bit(false)
69    }
70    #[doc = r"Writes raw bits to the field"]
71    #[inline(always)]
72    pub fn bit(self, value: bool) -> &'a mut W {
73        self.w.bits = (self.w.bits & !(0x01 << 12)) | (((value as u32) & 0x01) << 12);
74        self.w
75    }
76}
77#[doc = "Write proxy for field `CCRPEF`"]
78pub struct CCRPEF_W<'a> {
79    w: &'a mut W,
80}
81impl<'a> CCRPEF_W<'a> {
82    #[doc = r"Sets the field bit"]
83    #[inline(always)]
84    pub fn set_bit(self) -> &'a mut W {
85        self.bit(true)
86    }
87    #[doc = r"Clears the field bit"]
88    #[inline(always)]
89    pub fn clear_bit(self) -> &'a mut W {
90        self.bit(false)
91    }
92    #[doc = r"Writes raw bits to the field"]
93    #[inline(always)]
94    pub fn bit(self, value: bool) -> &'a mut W {
95        self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11);
96        self.w
97    }
98}
99#[doc = "Write proxy for field `C802WUF`"]
100pub struct C802WUF_W<'a> {
101    w: &'a mut W,
102}
103impl<'a> C802WUF_W<'a> {
104    #[doc = r"Sets the field bit"]
105    #[inline(always)]
106    pub fn set_bit(self) -> &'a mut W {
107        self.bit(true)
108    }
109    #[doc = r"Clears the field bit"]
110    #[inline(always)]
111    pub fn clear_bit(self) -> &'a mut W {
112        self.bit(false)
113    }
114    #[doc = r"Writes raw bits to the field"]
115    #[inline(always)]
116    pub fn bit(self, value: bool) -> &'a mut W {
117        self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10);
118        self.w
119    }
120}
121#[doc = "Write proxy for field `CBLEWUF`"]
122pub struct CBLEWUF_W<'a> {
123    w: &'a mut W,
124}
125impl<'a> CBLEWUF_W<'a> {
126    #[doc = r"Sets the field bit"]
127    #[inline(always)]
128    pub fn set_bit(self) -> &'a mut W {
129        self.bit(true)
130    }
131    #[doc = r"Clears the field bit"]
132    #[inline(always)]
133    pub fn clear_bit(self) -> &'a mut W {
134        self.bit(false)
135    }
136    #[doc = r"Writes raw bits to the field"]
137    #[inline(always)]
138    pub fn bit(self, value: bool) -> &'a mut W {
139        self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9);
140        self.w
141    }
142}
143#[doc = "Write proxy for field `CBORHF`"]
144pub struct CBORHF_W<'a> {
145    w: &'a mut W,
146}
147impl<'a> CBORHF_W<'a> {
148    #[doc = r"Sets the field bit"]
149    #[inline(always)]
150    pub fn set_bit(self) -> &'a mut W {
151        self.bit(true)
152    }
153    #[doc = r"Clears the field bit"]
154    #[inline(always)]
155    pub fn clear_bit(self) -> &'a mut W {
156        self.bit(false)
157    }
158    #[doc = r"Writes raw bits to the field"]
159    #[inline(always)]
160    pub fn bit(self, value: bool) -> &'a mut W {
161        self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8);
162        self.w
163    }
164}
165#[doc = "Write proxy for field `CSMPSFBF`"]
166pub struct CSMPSFBF_W<'a> {
167    w: &'a mut W,
168}
169impl<'a> CSMPSFBF_W<'a> {
170    #[doc = r"Sets the field bit"]
171    #[inline(always)]
172    pub fn set_bit(self) -> &'a mut W {
173        self.bit(true)
174    }
175    #[doc = r"Clears the field bit"]
176    #[inline(always)]
177    pub fn clear_bit(self) -> &'a mut W {
178        self.bit(false)
179    }
180    #[doc = r"Writes raw bits to the field"]
181    #[inline(always)]
182    pub fn bit(self, value: bool) -> &'a mut W {
183        self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7);
184        self.w
185    }
186}
187#[doc = "Write proxy for field `CWUF5`"]
188pub struct CWUF5_W<'a> {
189    w: &'a mut W,
190}
191impl<'a> CWUF5_W<'a> {
192    #[doc = r"Sets the field bit"]
193    #[inline(always)]
194    pub fn set_bit(self) -> &'a mut W {
195        self.bit(true)
196    }
197    #[doc = r"Clears the field bit"]
198    #[inline(always)]
199    pub fn clear_bit(self) -> &'a mut W {
200        self.bit(false)
201    }
202    #[doc = r"Writes raw bits to the field"]
203    #[inline(always)]
204    pub fn bit(self, value: bool) -> &'a mut W {
205        self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
206        self.w
207    }
208}
209#[doc = "Write proxy for field `CWUF4`"]
210pub struct CWUF4_W<'a> {
211    w: &'a mut W,
212}
213impl<'a> CWUF4_W<'a> {
214    #[doc = r"Sets the field bit"]
215    #[inline(always)]
216    pub fn set_bit(self) -> &'a mut W {
217        self.bit(true)
218    }
219    #[doc = r"Clears the field bit"]
220    #[inline(always)]
221    pub fn clear_bit(self) -> &'a mut W {
222        self.bit(false)
223    }
224    #[doc = r"Writes raw bits to the field"]
225    #[inline(always)]
226    pub fn bit(self, value: bool) -> &'a mut W {
227        self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
228        self.w
229    }
230}
231#[doc = "Write proxy for field `CWUF3`"]
232pub struct CWUF3_W<'a> {
233    w: &'a mut W,
234}
235impl<'a> CWUF3_W<'a> {
236    #[doc = r"Sets the field bit"]
237    #[inline(always)]
238    pub fn set_bit(self) -> &'a mut W {
239        self.bit(true)
240    }
241    #[doc = r"Clears the field bit"]
242    #[inline(always)]
243    pub fn clear_bit(self) -> &'a mut W {
244        self.bit(false)
245    }
246    #[doc = r"Writes raw bits to the field"]
247    #[inline(always)]
248    pub fn bit(self, value: bool) -> &'a mut W {
249        self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
250        self.w
251    }
252}
253#[doc = "Write proxy for field `CWUF2`"]
254pub struct CWUF2_W<'a> {
255    w: &'a mut W,
256}
257impl<'a> CWUF2_W<'a> {
258    #[doc = r"Sets the field bit"]
259    #[inline(always)]
260    pub fn set_bit(self) -> &'a mut W {
261        self.bit(true)
262    }
263    #[doc = r"Clears the field bit"]
264    #[inline(always)]
265    pub fn clear_bit(self) -> &'a mut W {
266        self.bit(false)
267    }
268    #[doc = r"Writes raw bits to the field"]
269    #[inline(always)]
270    pub fn bit(self, value: bool) -> &'a mut W {
271        self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
272        self.w
273    }
274}
275#[doc = "Write proxy for field `CWUF1`"]
276pub struct CWUF1_W<'a> {
277    w: &'a mut W,
278}
279impl<'a> CWUF1_W<'a> {
280    #[doc = r"Sets the field bit"]
281    #[inline(always)]
282    pub fn set_bit(self) -> &'a mut W {
283        self.bit(true)
284    }
285    #[doc = r"Clears the field bit"]
286    #[inline(always)]
287    pub fn clear_bit(self) -> &'a mut W {
288        self.bit(false)
289    }
290    #[doc = r"Writes raw bits to the field"]
291    #[inline(always)]
292    pub fn bit(self, value: bool) -> &'a mut W {
293        self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
294        self.w
295    }
296}
297impl W {
298    #[doc = "Bit 14 - Clear CPU2 Hold interrupt flag"]
299    #[inline(always)]
300    pub fn cc2hf(&mut self) -> CC2HF_W {
301        CC2HF_W { w: self }
302    }
303    #[doc = "Bit 13 - Clear 802.15.4 end of activity interrupt flag"]
304    #[inline(always)]
305    pub fn c802af(&mut self) -> C802AF_W {
306        C802AF_W { w: self }
307    }
308    #[doc = "Bit 12 - Clear BLE end of activity interrupt flag"]
309    #[inline(always)]
310    pub fn cbleaf(&mut self) -> CBLEAF_W {
311        CBLEAF_W { w: self }
312    }
313    #[doc = "Bit 11 - Clear critical radio phase end of activity interrupt flag"]
314    #[inline(always)]
315    pub fn ccrpef(&mut self) -> CCRPEF_W {
316        CCRPEF_W { w: self }
317    }
318    #[doc = "Bit 10 - Clear 802.15.4 wakeup interrupt flag"]
319    #[inline(always)]
320    pub fn c802wuf(&mut self) -> C802WUF_W {
321        C802WUF_W { w: self }
322    }
323    #[doc = "Bit 9 - Clear BLE wakeup interrupt flag"]
324    #[inline(always)]
325    pub fn cblewuf(&mut self) -> CBLEWUF_W {
326        CBLEWUF_W { w: self }
327    }
328    #[doc = "Bit 8 - Clear BORH interrupt flag"]
329    #[inline(always)]
330    pub fn cborhf(&mut self) -> CBORHF_W {
331        CBORHF_W { w: self }
332    }
333    #[doc = "Bit 7 - Clear SMPS Step Down converter forced in Bypass interrupt flag"]
334    #[inline(always)]
335    pub fn csmpsfbf(&mut self) -> CSMPSFBF_W {
336        CSMPSFBF_W { w: self }
337    }
338    #[doc = "Bit 4 - Clear wakeup flag 5"]
339    #[inline(always)]
340    pub fn cwuf5(&mut self) -> CWUF5_W {
341        CWUF5_W { w: self }
342    }
343    #[doc = "Bit 3 - Clear wakeup flag 4"]
344    #[inline(always)]
345    pub fn cwuf4(&mut self) -> CWUF4_W {
346        CWUF4_W { w: self }
347    }
348    #[doc = "Bit 2 - Clear wakeup flag 3"]
349    #[inline(always)]
350    pub fn cwuf3(&mut self) -> CWUF3_W {
351        CWUF3_W { w: self }
352    }
353    #[doc = "Bit 1 - Clear wakeup flag 2"]
354    #[inline(always)]
355    pub fn cwuf2(&mut self) -> CWUF2_W {
356        CWUF2_W { w: self }
357    }
358    #[doc = "Bit 0 - Clear wakeup flag 1"]
359    #[inline(always)]
360    pub fn cwuf1(&mut self) -> CWUF1_W {
361        CWUF1_W { w: self }
362    }
363}