stm32l4x2_pac/exti/
emr2.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::EMR2 {
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 MR32R {
47    bits: bool,
48}
49impl MR32R {
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 MR33R {
68    bits: bool,
69}
70impl MR33R {
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 MR34R {
89    bits: bool,
90}
91impl MR34R {
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 MR35R {
110    bits: bool,
111}
112impl MR35R {
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 MR36R {
131    bits: bool,
132}
133impl MR36R {
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" Value of the field"]
151pub struct MR37R {
152    bits: bool,
153}
154impl MR37R {
155    #[doc = r" Value of the field as raw bits"]
156    #[inline]
157    pub fn bit(&self) -> bool {
158        self.bits
159    }
160    #[doc = r" Returns `true` if the bit is clear (0)"]
161    #[inline]
162    pub fn bit_is_clear(&self) -> bool {
163        !self.bit()
164    }
165    #[doc = r" Returns `true` if the bit is set (1)"]
166    #[inline]
167    pub fn bit_is_set(&self) -> bool {
168        self.bit()
169    }
170}
171#[doc = r" Value of the field"]
172pub struct MR38R {
173    bits: bool,
174}
175impl MR38R {
176    #[doc = r" Value of the field as raw bits"]
177    #[inline]
178    pub fn bit(&self) -> bool {
179        self.bits
180    }
181    #[doc = r" Returns `true` if the bit is clear (0)"]
182    #[inline]
183    pub fn bit_is_clear(&self) -> bool {
184        !self.bit()
185    }
186    #[doc = r" Returns `true` if the bit is set (1)"]
187    #[inline]
188    pub fn bit_is_set(&self) -> bool {
189        self.bit()
190    }
191}
192#[doc = r" Value of the field"]
193pub struct MR39R {
194    bits: bool,
195}
196impl MR39R {
197    #[doc = r" Value of the field as raw bits"]
198    #[inline]
199    pub fn bit(&self) -> bool {
200        self.bits
201    }
202    #[doc = r" Returns `true` if the bit is clear (0)"]
203    #[inline]
204    pub fn bit_is_clear(&self) -> bool {
205        !self.bit()
206    }
207    #[doc = r" Returns `true` if the bit is set (1)"]
208    #[inline]
209    pub fn bit_is_set(&self) -> bool {
210        self.bit()
211    }
212}
213#[doc = r" Proxy"]
214pub struct _MR32W<'a> {
215    w: &'a mut W,
216}
217impl<'a> _MR32W<'a> {
218    #[doc = r" Sets the field bit"]
219    pub fn set_bit(self) -> &'a mut W {
220        self.bit(true)
221    }
222    #[doc = r" Clears the field bit"]
223    pub fn clear_bit(self) -> &'a mut W {
224        self.bit(false)
225    }
226    #[doc = r" Writes raw bits to the field"]
227    #[inline]
228    pub fn bit(self, value: bool) -> &'a mut W {
229        const MASK: bool = true;
230        const OFFSET: u8 = 0;
231        self.w.bits &= !((MASK as u32) << OFFSET);
232        self.w.bits |= ((value & MASK) as u32) << OFFSET;
233        self.w
234    }
235}
236#[doc = r" Proxy"]
237pub struct _MR33W<'a> {
238    w: &'a mut W,
239}
240impl<'a> _MR33W<'a> {
241    #[doc = r" Sets the field bit"]
242    pub fn set_bit(self) -> &'a mut W {
243        self.bit(true)
244    }
245    #[doc = r" Clears the field bit"]
246    pub fn clear_bit(self) -> &'a mut W {
247        self.bit(false)
248    }
249    #[doc = r" Writes raw bits to the field"]
250    #[inline]
251    pub fn bit(self, value: bool) -> &'a mut W {
252        const MASK: bool = true;
253        const OFFSET: u8 = 1;
254        self.w.bits &= !((MASK as u32) << OFFSET);
255        self.w.bits |= ((value & MASK) as u32) << OFFSET;
256        self.w
257    }
258}
259#[doc = r" Proxy"]
260pub struct _MR34W<'a> {
261    w: &'a mut W,
262}
263impl<'a> _MR34W<'a> {
264    #[doc = r" Sets the field bit"]
265    pub fn set_bit(self) -> &'a mut W {
266        self.bit(true)
267    }
268    #[doc = r" Clears the field bit"]
269    pub fn clear_bit(self) -> &'a mut W {
270        self.bit(false)
271    }
272    #[doc = r" Writes raw bits to the field"]
273    #[inline]
274    pub fn bit(self, value: bool) -> &'a mut W {
275        const MASK: bool = true;
276        const OFFSET: u8 = 2;
277        self.w.bits &= !((MASK as u32) << OFFSET);
278        self.w.bits |= ((value & MASK) as u32) << OFFSET;
279        self.w
280    }
281}
282#[doc = r" Proxy"]
283pub struct _MR35W<'a> {
284    w: &'a mut W,
285}
286impl<'a> _MR35W<'a> {
287    #[doc = r" Sets the field bit"]
288    pub fn set_bit(self) -> &'a mut W {
289        self.bit(true)
290    }
291    #[doc = r" Clears the field bit"]
292    pub fn clear_bit(self) -> &'a mut W {
293        self.bit(false)
294    }
295    #[doc = r" Writes raw bits to the field"]
296    #[inline]
297    pub fn bit(self, value: bool) -> &'a mut W {
298        const MASK: bool = true;
299        const OFFSET: u8 = 3;
300        self.w.bits &= !((MASK as u32) << OFFSET);
301        self.w.bits |= ((value & MASK) as u32) << OFFSET;
302        self.w
303    }
304}
305#[doc = r" Proxy"]
306pub struct _MR36W<'a> {
307    w: &'a mut W,
308}
309impl<'a> _MR36W<'a> {
310    #[doc = r" Sets the field bit"]
311    pub fn set_bit(self) -> &'a mut W {
312        self.bit(true)
313    }
314    #[doc = r" Clears the field bit"]
315    pub fn clear_bit(self) -> &'a mut W {
316        self.bit(false)
317    }
318    #[doc = r" Writes raw bits to the field"]
319    #[inline]
320    pub fn bit(self, value: bool) -> &'a mut W {
321        const MASK: bool = true;
322        const OFFSET: u8 = 4;
323        self.w.bits &= !((MASK as u32) << OFFSET);
324        self.w.bits |= ((value & MASK) as u32) << OFFSET;
325        self.w
326    }
327}
328#[doc = r" Proxy"]
329pub struct _MR37W<'a> {
330    w: &'a mut W,
331}
332impl<'a> _MR37W<'a> {
333    #[doc = r" Sets the field bit"]
334    pub fn set_bit(self) -> &'a mut W {
335        self.bit(true)
336    }
337    #[doc = r" Clears the field bit"]
338    pub fn clear_bit(self) -> &'a mut W {
339        self.bit(false)
340    }
341    #[doc = r" Writes raw bits to the field"]
342    #[inline]
343    pub fn bit(self, value: bool) -> &'a mut W {
344        const MASK: bool = true;
345        const OFFSET: u8 = 5;
346        self.w.bits &= !((MASK as u32) << OFFSET);
347        self.w.bits |= ((value & MASK) as u32) << OFFSET;
348        self.w
349    }
350}
351#[doc = r" Proxy"]
352pub struct _MR38W<'a> {
353    w: &'a mut W,
354}
355impl<'a> _MR38W<'a> {
356    #[doc = r" Sets the field bit"]
357    pub fn set_bit(self) -> &'a mut W {
358        self.bit(true)
359    }
360    #[doc = r" Clears the field bit"]
361    pub fn clear_bit(self) -> &'a mut W {
362        self.bit(false)
363    }
364    #[doc = r" Writes raw bits to the field"]
365    #[inline]
366    pub fn bit(self, value: bool) -> &'a mut W {
367        const MASK: bool = true;
368        const OFFSET: u8 = 6;
369        self.w.bits &= !((MASK as u32) << OFFSET);
370        self.w.bits |= ((value & MASK) as u32) << OFFSET;
371        self.w
372    }
373}
374#[doc = r" Proxy"]
375pub struct _MR39W<'a> {
376    w: &'a mut W,
377}
378impl<'a> _MR39W<'a> {
379    #[doc = r" Sets the field bit"]
380    pub fn set_bit(self) -> &'a mut W {
381        self.bit(true)
382    }
383    #[doc = r" Clears the field bit"]
384    pub fn clear_bit(self) -> &'a mut W {
385        self.bit(false)
386    }
387    #[doc = r" Writes raw bits to the field"]
388    #[inline]
389    pub fn bit(self, value: bool) -> &'a mut W {
390        const MASK: bool = true;
391        const OFFSET: u8 = 7;
392        self.w.bits &= !((MASK as u32) << OFFSET);
393        self.w.bits |= ((value & MASK) as u32) << OFFSET;
394        self.w
395    }
396}
397impl R {
398    #[doc = r" Value of the register as raw bits"]
399    #[inline]
400    pub fn bits(&self) -> u32 {
401        self.bits
402    }
403    #[doc = "Bit 0 - Event mask on external/internal line 32"]
404    #[inline]
405    pub fn mr32(&self) -> MR32R {
406        let bits = {
407            const MASK: bool = true;
408            const OFFSET: u8 = 0;
409            ((self.bits >> OFFSET) & MASK as u32) != 0
410        };
411        MR32R { bits }
412    }
413    #[doc = "Bit 1 - Event mask on external/internal line 33"]
414    #[inline]
415    pub fn mr33(&self) -> MR33R {
416        let bits = {
417            const MASK: bool = true;
418            const OFFSET: u8 = 1;
419            ((self.bits >> OFFSET) & MASK as u32) != 0
420        };
421        MR33R { bits }
422    }
423    #[doc = "Bit 2 - Event mask on external/internal line 34"]
424    #[inline]
425    pub fn mr34(&self) -> MR34R {
426        let bits = {
427            const MASK: bool = true;
428            const OFFSET: u8 = 2;
429            ((self.bits >> OFFSET) & MASK as u32) != 0
430        };
431        MR34R { bits }
432    }
433    #[doc = "Bit 3 - Event mask on external/internal line 35"]
434    #[inline]
435    pub fn mr35(&self) -> MR35R {
436        let bits = {
437            const MASK: bool = true;
438            const OFFSET: u8 = 3;
439            ((self.bits >> OFFSET) & MASK as u32) != 0
440        };
441        MR35R { bits }
442    }
443    #[doc = "Bit 4 - Event mask on external/internal line 36"]
444    #[inline]
445    pub fn mr36(&self) -> MR36R {
446        let bits = {
447            const MASK: bool = true;
448            const OFFSET: u8 = 4;
449            ((self.bits >> OFFSET) & MASK as u32) != 0
450        };
451        MR36R { bits }
452    }
453    #[doc = "Bit 5 - Event mask on external/internal line 37"]
454    #[inline]
455    pub fn mr37(&self) -> MR37R {
456        let bits = {
457            const MASK: bool = true;
458            const OFFSET: u8 = 5;
459            ((self.bits >> OFFSET) & MASK as u32) != 0
460        };
461        MR37R { bits }
462    }
463    #[doc = "Bit 6 - Event mask on external/internal line 38"]
464    #[inline]
465    pub fn mr38(&self) -> MR38R {
466        let bits = {
467            const MASK: bool = true;
468            const OFFSET: u8 = 6;
469            ((self.bits >> OFFSET) & MASK as u32) != 0
470        };
471        MR38R { bits }
472    }
473    #[doc = "Bit 7 - Event mask on external/internal line 39"]
474    #[inline]
475    pub fn mr39(&self) -> MR39R {
476        let bits = {
477            const MASK: bool = true;
478            const OFFSET: u8 = 7;
479            ((self.bits >> OFFSET) & MASK as u32) != 0
480        };
481        MR39R { bits }
482    }
483}
484impl W {
485    #[doc = r" Reset value of the register"]
486    #[inline]
487    pub fn reset_value() -> W {
488        W { bits: 0 }
489    }
490    #[doc = r" Writes raw bits to the register"]
491    #[inline]
492    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
493        self.bits = bits;
494        self
495    }
496    #[doc = "Bit 0 - Event mask on external/internal line 32"]
497    #[inline]
498    pub fn mr32(&mut self) -> _MR32W {
499        _MR32W { w: self }
500    }
501    #[doc = "Bit 1 - Event mask on external/internal line 33"]
502    #[inline]
503    pub fn mr33(&mut self) -> _MR33W {
504        _MR33W { w: self }
505    }
506    #[doc = "Bit 2 - Event mask on external/internal line 34"]
507    #[inline]
508    pub fn mr34(&mut self) -> _MR34W {
509        _MR34W { w: self }
510    }
511    #[doc = "Bit 3 - Event mask on external/internal line 35"]
512    #[inline]
513    pub fn mr35(&mut self) -> _MR35W {
514        _MR35W { w: self }
515    }
516    #[doc = "Bit 4 - Event mask on external/internal line 36"]
517    #[inline]
518    pub fn mr36(&mut self) -> _MR36W {
519        _MR36W { w: self }
520    }
521    #[doc = "Bit 5 - Event mask on external/internal line 37"]
522    #[inline]
523    pub fn mr37(&mut self) -> _MR37W {
524        _MR37W { w: self }
525    }
526    #[doc = "Bit 6 - Event mask on external/internal line 38"]
527    #[inline]
528    pub fn mr38(&mut self) -> _MR38W {
529        _MR38W { w: self }
530    }
531    #[doc = "Bit 7 - Event mask on external/internal line 39"]
532    #[inline]
533    pub fn mr39(&mut self) -> _MR39W {
534        _MR39W { w: self }
535    }
536}