stm32l4x2_pac/scb_actrl/
actrl.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::ACTRL {
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 = r" Value of the field"]
46pub struct DISMCYCINTR {
47    bits: bool,
48}
49impl DISMCYCINTR {
50    #[doc = r" Value of the field as raw bits"]
51    #[inline]
52    pub fn bit(&self) -> bool {
53        self.bits
54    }
55    #[doc = r" Returns `true` if the bit is clear (0)"]
56    #[inline]
57    pub fn bit_is_clear(&self) -> bool {
58        !self.bit()
59    }
60    #[doc = r" Returns `true` if the bit is set (1)"]
61    #[inline]
62    pub fn bit_is_set(&self) -> bool {
63        self.bit()
64    }
65}
66#[doc = r" Value of the field"]
67pub struct DISDEFWBUFR {
68    bits: bool,
69}
70impl DISDEFWBUFR {
71    #[doc = r" Value of the field as raw bits"]
72    #[inline]
73    pub fn bit(&self) -> bool {
74        self.bits
75    }
76    #[doc = r" Returns `true` if the bit is clear (0)"]
77    #[inline]
78    pub fn bit_is_clear(&self) -> bool {
79        !self.bit()
80    }
81    #[doc = r" Returns `true` if the bit is set (1)"]
82    #[inline]
83    pub fn bit_is_set(&self) -> bool {
84        self.bit()
85    }
86}
87#[doc = r" Value of the field"]
88pub struct DISFOLDR {
89    bits: bool,
90}
91impl DISFOLDR {
92    #[doc = r" Value of the field as raw bits"]
93    #[inline]
94    pub fn bit(&self) -> bool {
95        self.bits
96    }
97    #[doc = r" Returns `true` if the bit is clear (0)"]
98    #[inline]
99    pub fn bit_is_clear(&self) -> bool {
100        !self.bit()
101    }
102    #[doc = r" Returns `true` if the bit is set (1)"]
103    #[inline]
104    pub fn bit_is_set(&self) -> bool {
105        self.bit()
106    }
107}
108#[doc = r" Value of the field"]
109pub struct DISFPCAR {
110    bits: bool,
111}
112impl DISFPCAR {
113    #[doc = r" Value of the field as raw bits"]
114    #[inline]
115    pub fn bit(&self) -> bool {
116        self.bits
117    }
118    #[doc = r" Returns `true` if the bit is clear (0)"]
119    #[inline]
120    pub fn bit_is_clear(&self) -> bool {
121        !self.bit()
122    }
123    #[doc = r" Returns `true` if the bit is set (1)"]
124    #[inline]
125    pub fn bit_is_set(&self) -> bool {
126        self.bit()
127    }
128}
129#[doc = r" Value of the field"]
130pub struct DISOOFPR {
131    bits: bool,
132}
133impl DISOOFPR {
134    #[doc = r" Value of the field as raw bits"]
135    #[inline]
136    pub fn bit(&self) -> bool {
137        self.bits
138    }
139    #[doc = r" Returns `true` if the bit is clear (0)"]
140    #[inline]
141    pub fn bit_is_clear(&self) -> bool {
142        !self.bit()
143    }
144    #[doc = r" Returns `true` if the bit is set (1)"]
145    #[inline]
146    pub fn bit_is_set(&self) -> bool {
147        self.bit()
148    }
149}
150#[doc = r" Proxy"]
151pub struct _DISMCYCINTW<'a> {
152    w: &'a mut W,
153}
154impl<'a> _DISMCYCINTW<'a> {
155    #[doc = r" Sets the field bit"]
156    pub fn set_bit(self) -> &'a mut W {
157        self.bit(true)
158    }
159    #[doc = r" Clears the field bit"]
160    pub fn clear_bit(self) -> &'a mut W {
161        self.bit(false)
162    }
163    #[doc = r" Writes raw bits to the field"]
164    #[inline]
165    pub fn bit(self, value: bool) -> &'a mut W {
166        const MASK: bool = true;
167        const OFFSET: u8 = 0;
168        self.w.bits &= !((MASK as u32) << OFFSET);
169        self.w.bits |= ((value & MASK) as u32) << OFFSET;
170        self.w
171    }
172}
173#[doc = r" Proxy"]
174pub struct _DISDEFWBUFW<'a> {
175    w: &'a mut W,
176}
177impl<'a> _DISDEFWBUFW<'a> {
178    #[doc = r" Sets the field bit"]
179    pub fn set_bit(self) -> &'a mut W {
180        self.bit(true)
181    }
182    #[doc = r" Clears the field bit"]
183    pub fn clear_bit(self) -> &'a mut W {
184        self.bit(false)
185    }
186    #[doc = r" Writes raw bits to the field"]
187    #[inline]
188    pub fn bit(self, value: bool) -> &'a mut W {
189        const MASK: bool = true;
190        const OFFSET: u8 = 1;
191        self.w.bits &= !((MASK as u32) << OFFSET);
192        self.w.bits |= ((value & MASK) as u32) << OFFSET;
193        self.w
194    }
195}
196#[doc = r" Proxy"]
197pub struct _DISFOLDW<'a> {
198    w: &'a mut W,
199}
200impl<'a> _DISFOLDW<'a> {
201    #[doc = r" Sets the field bit"]
202    pub fn set_bit(self) -> &'a mut W {
203        self.bit(true)
204    }
205    #[doc = r" Clears the field bit"]
206    pub fn clear_bit(self) -> &'a mut W {
207        self.bit(false)
208    }
209    #[doc = r" Writes raw bits to the field"]
210    #[inline]
211    pub fn bit(self, value: bool) -> &'a mut W {
212        const MASK: bool = true;
213        const OFFSET: u8 = 2;
214        self.w.bits &= !((MASK as u32) << OFFSET);
215        self.w.bits |= ((value & MASK) as u32) << OFFSET;
216        self.w
217    }
218}
219#[doc = r" Proxy"]
220pub struct _DISFPCAW<'a> {
221    w: &'a mut W,
222}
223impl<'a> _DISFPCAW<'a> {
224    #[doc = r" Sets the field bit"]
225    pub fn set_bit(self) -> &'a mut W {
226        self.bit(true)
227    }
228    #[doc = r" Clears the field bit"]
229    pub fn clear_bit(self) -> &'a mut W {
230        self.bit(false)
231    }
232    #[doc = r" Writes raw bits to the field"]
233    #[inline]
234    pub fn bit(self, value: bool) -> &'a mut W {
235        const MASK: bool = true;
236        const OFFSET: u8 = 8;
237        self.w.bits &= !((MASK as u32) << OFFSET);
238        self.w.bits |= ((value & MASK) as u32) << OFFSET;
239        self.w
240    }
241}
242#[doc = r" Proxy"]
243pub struct _DISOOFPW<'a> {
244    w: &'a mut W,
245}
246impl<'a> _DISOOFPW<'a> {
247    #[doc = r" Sets the field bit"]
248    pub fn set_bit(self) -> &'a mut W {
249        self.bit(true)
250    }
251    #[doc = r" Clears the field bit"]
252    pub fn clear_bit(self) -> &'a mut W {
253        self.bit(false)
254    }
255    #[doc = r" Writes raw bits to the field"]
256    #[inline]
257    pub fn bit(self, value: bool) -> &'a mut W {
258        const MASK: bool = true;
259        const OFFSET: u8 = 9;
260        self.w.bits &= !((MASK as u32) << OFFSET);
261        self.w.bits |= ((value & MASK) as u32) << OFFSET;
262        self.w
263    }
264}
265impl R {
266    #[doc = r" Value of the register as raw bits"]
267    #[inline]
268    pub fn bits(&self) -> u32 {
269        self.bits
270    }
271    #[doc = "Bit 0 - DISMCYCINT"]
272    #[inline]
273    pub fn dismcycint(&self) -> DISMCYCINTR {
274        let bits = {
275            const MASK: bool = true;
276            const OFFSET: u8 = 0;
277            ((self.bits >> OFFSET) & MASK as u32) != 0
278        };
279        DISMCYCINTR { bits }
280    }
281    #[doc = "Bit 1 - DISDEFWBUF"]
282    #[inline]
283    pub fn disdefwbuf(&self) -> DISDEFWBUFR {
284        let bits = {
285            const MASK: bool = true;
286            const OFFSET: u8 = 1;
287            ((self.bits >> OFFSET) & MASK as u32) != 0
288        };
289        DISDEFWBUFR { bits }
290    }
291    #[doc = "Bit 2 - DISFOLD"]
292    #[inline]
293    pub fn disfold(&self) -> DISFOLDR {
294        let bits = {
295            const MASK: bool = true;
296            const OFFSET: u8 = 2;
297            ((self.bits >> OFFSET) & MASK as u32) != 0
298        };
299        DISFOLDR { bits }
300    }
301    #[doc = "Bit 8 - DISFPCA"]
302    #[inline]
303    pub fn disfpca(&self) -> DISFPCAR {
304        let bits = {
305            const MASK: bool = true;
306            const OFFSET: u8 = 8;
307            ((self.bits >> OFFSET) & MASK as u32) != 0
308        };
309        DISFPCAR { bits }
310    }
311    #[doc = "Bit 9 - DISOOFP"]
312    #[inline]
313    pub fn disoofp(&self) -> DISOOFPR {
314        let bits = {
315            const MASK: bool = true;
316            const OFFSET: u8 = 9;
317            ((self.bits >> OFFSET) & MASK as u32) != 0
318        };
319        DISOOFPR { bits }
320    }
321}
322impl W {
323    #[doc = r" Reset value of the register"]
324    #[inline]
325    pub fn reset_value() -> W {
326        W { bits: 0 }
327    }
328    #[doc = r" Writes raw bits to the register"]
329    #[inline]
330    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
331        self.bits = bits;
332        self
333    }
334    #[doc = "Bit 0 - DISMCYCINT"]
335    #[inline]
336    pub fn dismcycint(&mut self) -> _DISMCYCINTW {
337        _DISMCYCINTW { w: self }
338    }
339    #[doc = "Bit 1 - DISDEFWBUF"]
340    #[inline]
341    pub fn disdefwbuf(&mut self) -> _DISDEFWBUFW {
342        _DISDEFWBUFW { w: self }
343    }
344    #[doc = "Bit 2 - DISFOLD"]
345    #[inline]
346    pub fn disfold(&mut self) -> _DISFOLDW {
347        _DISFOLDW { w: self }
348    }
349    #[doc = "Bit 8 - DISFPCA"]
350    #[inline]
351    pub fn disfpca(&mut self) -> _DISFPCAW {
352        _DISFPCAW { w: self }
353    }
354    #[doc = "Bit 9 - DISOOFP"]
355    #[inline]
356    pub fn disoofp(&mut self) -> _DISOOFPW {
357        _DISOOFPW { w: self }
358    }
359}