k66/llwu/
pe5.rs

1#[doc = r" Value read from the register"]
2pub struct R {
3    bits: u8,
4}
5#[doc = r" Value to write to the register"]
6pub struct W {
7    bits: u8,
8}
9impl super::PE5 {
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 = "Possible values of the field `WUPE16`"]
46#[derive(Clone, Copy, Debug, PartialEq)]
47pub enum WUPE16R {
48    #[doc = "External input pin disabled as wakeup input"]
49    _00,
50    #[doc = "External input pin enabled with rising edge detection"]
51    _01,
52    #[doc = "External input pin enabled with falling edge detection"]
53    _10,
54    #[doc = "External input pin enabled with any change detection"]
55    _11,
56}
57impl WUPE16R {
58    #[doc = r" Value of the field as raw bits"]
59    #[inline]
60    pub fn bits(&self) -> u8 {
61        match *self {
62            WUPE16R::_00 => 0,
63            WUPE16R::_01 => 1,
64            WUPE16R::_10 => 2,
65            WUPE16R::_11 => 3,
66        }
67    }
68    #[allow(missing_docs)]
69    #[doc(hidden)]
70    #[inline]
71    pub fn _from(value: u8) -> WUPE16R {
72        match value {
73            0 => WUPE16R::_00,
74            1 => WUPE16R::_01,
75            2 => WUPE16R::_10,
76            3 => WUPE16R::_11,
77            _ => unreachable!(),
78        }
79    }
80    #[doc = "Checks if the value of the field is `_00`"]
81    #[inline]
82    pub fn is_00(&self) -> bool {
83        *self == WUPE16R::_00
84    }
85    #[doc = "Checks if the value of the field is `_01`"]
86    #[inline]
87    pub fn is_01(&self) -> bool {
88        *self == WUPE16R::_01
89    }
90    #[doc = "Checks if the value of the field is `_10`"]
91    #[inline]
92    pub fn is_10(&self) -> bool {
93        *self == WUPE16R::_10
94    }
95    #[doc = "Checks if the value of the field is `_11`"]
96    #[inline]
97    pub fn is_11(&self) -> bool {
98        *self == WUPE16R::_11
99    }
100}
101#[doc = "Possible values of the field `WUPE17`"]
102#[derive(Clone, Copy, Debug, PartialEq)]
103pub enum WUPE17R {
104    #[doc = "External input pin disabled as wakeup input"]
105    _00,
106    #[doc = "External input pin enabled with rising edge detection"]
107    _01,
108    #[doc = "External input pin enabled with falling edge detection"]
109    _10,
110    #[doc = "External input pin enabled with any change detection"]
111    _11,
112}
113impl WUPE17R {
114    #[doc = r" Value of the field as raw bits"]
115    #[inline]
116    pub fn bits(&self) -> u8 {
117        match *self {
118            WUPE17R::_00 => 0,
119            WUPE17R::_01 => 1,
120            WUPE17R::_10 => 2,
121            WUPE17R::_11 => 3,
122        }
123    }
124    #[allow(missing_docs)]
125    #[doc(hidden)]
126    #[inline]
127    pub fn _from(value: u8) -> WUPE17R {
128        match value {
129            0 => WUPE17R::_00,
130            1 => WUPE17R::_01,
131            2 => WUPE17R::_10,
132            3 => WUPE17R::_11,
133            _ => unreachable!(),
134        }
135    }
136    #[doc = "Checks if the value of the field is `_00`"]
137    #[inline]
138    pub fn is_00(&self) -> bool {
139        *self == WUPE17R::_00
140    }
141    #[doc = "Checks if the value of the field is `_01`"]
142    #[inline]
143    pub fn is_01(&self) -> bool {
144        *self == WUPE17R::_01
145    }
146    #[doc = "Checks if the value of the field is `_10`"]
147    #[inline]
148    pub fn is_10(&self) -> bool {
149        *self == WUPE17R::_10
150    }
151    #[doc = "Checks if the value of the field is `_11`"]
152    #[inline]
153    pub fn is_11(&self) -> bool {
154        *self == WUPE17R::_11
155    }
156}
157#[doc = "Possible values of the field `WUPE18`"]
158#[derive(Clone, Copy, Debug, PartialEq)]
159pub enum WUPE18R {
160    #[doc = "External input pin disabled as wakeup input"]
161    _00,
162    #[doc = "External input pin enabled with rising edge detection"]
163    _01,
164    #[doc = "External input pin enabled with falling edge detection"]
165    _10,
166    #[doc = "External input pin enabled with any change detection"]
167    _11,
168}
169impl WUPE18R {
170    #[doc = r" Value of the field as raw bits"]
171    #[inline]
172    pub fn bits(&self) -> u8 {
173        match *self {
174            WUPE18R::_00 => 0,
175            WUPE18R::_01 => 1,
176            WUPE18R::_10 => 2,
177            WUPE18R::_11 => 3,
178        }
179    }
180    #[allow(missing_docs)]
181    #[doc(hidden)]
182    #[inline]
183    pub fn _from(value: u8) -> WUPE18R {
184        match value {
185            0 => WUPE18R::_00,
186            1 => WUPE18R::_01,
187            2 => WUPE18R::_10,
188            3 => WUPE18R::_11,
189            _ => unreachable!(),
190        }
191    }
192    #[doc = "Checks if the value of the field is `_00`"]
193    #[inline]
194    pub fn is_00(&self) -> bool {
195        *self == WUPE18R::_00
196    }
197    #[doc = "Checks if the value of the field is `_01`"]
198    #[inline]
199    pub fn is_01(&self) -> bool {
200        *self == WUPE18R::_01
201    }
202    #[doc = "Checks if the value of the field is `_10`"]
203    #[inline]
204    pub fn is_10(&self) -> bool {
205        *self == WUPE18R::_10
206    }
207    #[doc = "Checks if the value of the field is `_11`"]
208    #[inline]
209    pub fn is_11(&self) -> bool {
210        *self == WUPE18R::_11
211    }
212}
213#[doc = "Possible values of the field `WUPE19`"]
214#[derive(Clone, Copy, Debug, PartialEq)]
215pub enum WUPE19R {
216    #[doc = "External input pin disabled as wakeup input"]
217    _00,
218    #[doc = "External input pin enabled with rising edge detection"]
219    _01,
220    #[doc = "External input pin enabled with falling edge detection"]
221    _10,
222    #[doc = "External input pin enabled with any change detection"]
223    _11,
224}
225impl WUPE19R {
226    #[doc = r" Value of the field as raw bits"]
227    #[inline]
228    pub fn bits(&self) -> u8 {
229        match *self {
230            WUPE19R::_00 => 0,
231            WUPE19R::_01 => 1,
232            WUPE19R::_10 => 2,
233            WUPE19R::_11 => 3,
234        }
235    }
236    #[allow(missing_docs)]
237    #[doc(hidden)]
238    #[inline]
239    pub fn _from(value: u8) -> WUPE19R {
240        match value {
241            0 => WUPE19R::_00,
242            1 => WUPE19R::_01,
243            2 => WUPE19R::_10,
244            3 => WUPE19R::_11,
245            _ => unreachable!(),
246        }
247    }
248    #[doc = "Checks if the value of the field is `_00`"]
249    #[inline]
250    pub fn is_00(&self) -> bool {
251        *self == WUPE19R::_00
252    }
253    #[doc = "Checks if the value of the field is `_01`"]
254    #[inline]
255    pub fn is_01(&self) -> bool {
256        *self == WUPE19R::_01
257    }
258    #[doc = "Checks if the value of the field is `_10`"]
259    #[inline]
260    pub fn is_10(&self) -> bool {
261        *self == WUPE19R::_10
262    }
263    #[doc = "Checks if the value of the field is `_11`"]
264    #[inline]
265    pub fn is_11(&self) -> bool {
266        *self == WUPE19R::_11
267    }
268}
269#[doc = "Values that can be written to the field `WUPE16`"]
270pub enum WUPE16W {
271    #[doc = "External input pin disabled as wakeup input"]
272    _00,
273    #[doc = "External input pin enabled with rising edge detection"]
274    _01,
275    #[doc = "External input pin enabled with falling edge detection"]
276    _10,
277    #[doc = "External input pin enabled with any change detection"]
278    _11,
279}
280impl WUPE16W {
281    #[allow(missing_docs)]
282    #[doc(hidden)]
283    #[inline]
284    pub fn _bits(&self) -> u8 {
285        match *self {
286            WUPE16W::_00 => 0,
287            WUPE16W::_01 => 1,
288            WUPE16W::_10 => 2,
289            WUPE16W::_11 => 3,
290        }
291    }
292}
293#[doc = r" Proxy"]
294pub struct _WUPE16W<'a> {
295    w: &'a mut W,
296}
297impl<'a> _WUPE16W<'a> {
298    #[doc = r" Writes `variant` to the field"]
299    #[inline]
300    pub fn variant(self, variant: WUPE16W) -> &'a mut W {
301        {
302            self.bits(variant._bits())
303        }
304    }
305    #[doc = "External input pin disabled as wakeup input"]
306    #[inline]
307    pub fn _00(self) -> &'a mut W {
308        self.variant(WUPE16W::_00)
309    }
310    #[doc = "External input pin enabled with rising edge detection"]
311    #[inline]
312    pub fn _01(self) -> &'a mut W {
313        self.variant(WUPE16W::_01)
314    }
315    #[doc = "External input pin enabled with falling edge detection"]
316    #[inline]
317    pub fn _10(self) -> &'a mut W {
318        self.variant(WUPE16W::_10)
319    }
320    #[doc = "External input pin enabled with any change detection"]
321    #[inline]
322    pub fn _11(self) -> &'a mut W {
323        self.variant(WUPE16W::_11)
324    }
325    #[doc = r" Writes raw bits to the field"]
326    #[inline]
327    pub fn bits(self, value: u8) -> &'a mut W {
328        const MASK: u8 = 3;
329        const OFFSET: u8 = 0;
330        self.w.bits &= !((MASK as u8) << OFFSET);
331        self.w.bits |= ((value & MASK) as u8) << OFFSET;
332        self.w
333    }
334}
335#[doc = "Values that can be written to the field `WUPE17`"]
336pub enum WUPE17W {
337    #[doc = "External input pin disabled as wakeup input"]
338    _00,
339    #[doc = "External input pin enabled with rising edge detection"]
340    _01,
341    #[doc = "External input pin enabled with falling edge detection"]
342    _10,
343    #[doc = "External input pin enabled with any change detection"]
344    _11,
345}
346impl WUPE17W {
347    #[allow(missing_docs)]
348    #[doc(hidden)]
349    #[inline]
350    pub fn _bits(&self) -> u8 {
351        match *self {
352            WUPE17W::_00 => 0,
353            WUPE17W::_01 => 1,
354            WUPE17W::_10 => 2,
355            WUPE17W::_11 => 3,
356        }
357    }
358}
359#[doc = r" Proxy"]
360pub struct _WUPE17W<'a> {
361    w: &'a mut W,
362}
363impl<'a> _WUPE17W<'a> {
364    #[doc = r" Writes `variant` to the field"]
365    #[inline]
366    pub fn variant(self, variant: WUPE17W) -> &'a mut W {
367        {
368            self.bits(variant._bits())
369        }
370    }
371    #[doc = "External input pin disabled as wakeup input"]
372    #[inline]
373    pub fn _00(self) -> &'a mut W {
374        self.variant(WUPE17W::_00)
375    }
376    #[doc = "External input pin enabled with rising edge detection"]
377    #[inline]
378    pub fn _01(self) -> &'a mut W {
379        self.variant(WUPE17W::_01)
380    }
381    #[doc = "External input pin enabled with falling edge detection"]
382    #[inline]
383    pub fn _10(self) -> &'a mut W {
384        self.variant(WUPE17W::_10)
385    }
386    #[doc = "External input pin enabled with any change detection"]
387    #[inline]
388    pub fn _11(self) -> &'a mut W {
389        self.variant(WUPE17W::_11)
390    }
391    #[doc = r" Writes raw bits to the field"]
392    #[inline]
393    pub fn bits(self, value: u8) -> &'a mut W {
394        const MASK: u8 = 3;
395        const OFFSET: u8 = 2;
396        self.w.bits &= !((MASK as u8) << OFFSET);
397        self.w.bits |= ((value & MASK) as u8) << OFFSET;
398        self.w
399    }
400}
401#[doc = "Values that can be written to the field `WUPE18`"]
402pub enum WUPE18W {
403    #[doc = "External input pin disabled as wakeup input"]
404    _00,
405    #[doc = "External input pin enabled with rising edge detection"]
406    _01,
407    #[doc = "External input pin enabled with falling edge detection"]
408    _10,
409    #[doc = "External input pin enabled with any change detection"]
410    _11,
411}
412impl WUPE18W {
413    #[allow(missing_docs)]
414    #[doc(hidden)]
415    #[inline]
416    pub fn _bits(&self) -> u8 {
417        match *self {
418            WUPE18W::_00 => 0,
419            WUPE18W::_01 => 1,
420            WUPE18W::_10 => 2,
421            WUPE18W::_11 => 3,
422        }
423    }
424}
425#[doc = r" Proxy"]
426pub struct _WUPE18W<'a> {
427    w: &'a mut W,
428}
429impl<'a> _WUPE18W<'a> {
430    #[doc = r" Writes `variant` to the field"]
431    #[inline]
432    pub fn variant(self, variant: WUPE18W) -> &'a mut W {
433        {
434            self.bits(variant._bits())
435        }
436    }
437    #[doc = "External input pin disabled as wakeup input"]
438    #[inline]
439    pub fn _00(self) -> &'a mut W {
440        self.variant(WUPE18W::_00)
441    }
442    #[doc = "External input pin enabled with rising edge detection"]
443    #[inline]
444    pub fn _01(self) -> &'a mut W {
445        self.variant(WUPE18W::_01)
446    }
447    #[doc = "External input pin enabled with falling edge detection"]
448    #[inline]
449    pub fn _10(self) -> &'a mut W {
450        self.variant(WUPE18W::_10)
451    }
452    #[doc = "External input pin enabled with any change detection"]
453    #[inline]
454    pub fn _11(self) -> &'a mut W {
455        self.variant(WUPE18W::_11)
456    }
457    #[doc = r" Writes raw bits to the field"]
458    #[inline]
459    pub fn bits(self, value: u8) -> &'a mut W {
460        const MASK: u8 = 3;
461        const OFFSET: u8 = 4;
462        self.w.bits &= !((MASK as u8) << OFFSET);
463        self.w.bits |= ((value & MASK) as u8) << OFFSET;
464        self.w
465    }
466}
467#[doc = "Values that can be written to the field `WUPE19`"]
468pub enum WUPE19W {
469    #[doc = "External input pin disabled as wakeup input"]
470    _00,
471    #[doc = "External input pin enabled with rising edge detection"]
472    _01,
473    #[doc = "External input pin enabled with falling edge detection"]
474    _10,
475    #[doc = "External input pin enabled with any change detection"]
476    _11,
477}
478impl WUPE19W {
479    #[allow(missing_docs)]
480    #[doc(hidden)]
481    #[inline]
482    pub fn _bits(&self) -> u8 {
483        match *self {
484            WUPE19W::_00 => 0,
485            WUPE19W::_01 => 1,
486            WUPE19W::_10 => 2,
487            WUPE19W::_11 => 3,
488        }
489    }
490}
491#[doc = r" Proxy"]
492pub struct _WUPE19W<'a> {
493    w: &'a mut W,
494}
495impl<'a> _WUPE19W<'a> {
496    #[doc = r" Writes `variant` to the field"]
497    #[inline]
498    pub fn variant(self, variant: WUPE19W) -> &'a mut W {
499        {
500            self.bits(variant._bits())
501        }
502    }
503    #[doc = "External input pin disabled as wakeup input"]
504    #[inline]
505    pub fn _00(self) -> &'a mut W {
506        self.variant(WUPE19W::_00)
507    }
508    #[doc = "External input pin enabled with rising edge detection"]
509    #[inline]
510    pub fn _01(self) -> &'a mut W {
511        self.variant(WUPE19W::_01)
512    }
513    #[doc = "External input pin enabled with falling edge detection"]
514    #[inline]
515    pub fn _10(self) -> &'a mut W {
516        self.variant(WUPE19W::_10)
517    }
518    #[doc = "External input pin enabled with any change detection"]
519    #[inline]
520    pub fn _11(self) -> &'a mut W {
521        self.variant(WUPE19W::_11)
522    }
523    #[doc = r" Writes raw bits to the field"]
524    #[inline]
525    pub fn bits(self, value: u8) -> &'a mut W {
526        const MASK: u8 = 3;
527        const OFFSET: u8 = 6;
528        self.w.bits &= !((MASK as u8) << OFFSET);
529        self.w.bits |= ((value & MASK) as u8) << OFFSET;
530        self.w
531    }
532}
533impl R {
534    #[doc = r" Value of the register as raw bits"]
535    #[inline]
536    pub fn bits(&self) -> u8 {
537        self.bits
538    }
539    #[doc = "Bits 0:1 - Wakeup Pin Enable For LLWU_P16"]
540    #[inline]
541    pub fn wupe16(&self) -> WUPE16R {
542        WUPE16R::_from({
543            const MASK: u8 = 3;
544            const OFFSET: u8 = 0;
545            ((self.bits >> OFFSET) & MASK as u8) as u8
546        })
547    }
548    #[doc = "Bits 2:3 - Wakeup Pin Enable For LLWU_P17"]
549    #[inline]
550    pub fn wupe17(&self) -> WUPE17R {
551        WUPE17R::_from({
552            const MASK: u8 = 3;
553            const OFFSET: u8 = 2;
554            ((self.bits >> OFFSET) & MASK as u8) as u8
555        })
556    }
557    #[doc = "Bits 4:5 - Wakeup Pin Enable For LLWU_P18"]
558    #[inline]
559    pub fn wupe18(&self) -> WUPE18R {
560        WUPE18R::_from({
561            const MASK: u8 = 3;
562            const OFFSET: u8 = 4;
563            ((self.bits >> OFFSET) & MASK as u8) as u8
564        })
565    }
566    #[doc = "Bits 6:7 - Wakeup Pin Enable For LLWU_P19"]
567    #[inline]
568    pub fn wupe19(&self) -> WUPE19R {
569        WUPE19R::_from({
570            const MASK: u8 = 3;
571            const OFFSET: u8 = 6;
572            ((self.bits >> OFFSET) & MASK as u8) as u8
573        })
574    }
575}
576impl W {
577    #[doc = r" Reset value of the register"]
578    #[inline]
579    pub fn reset_value() -> W {
580        W { bits: 0 }
581    }
582    #[doc = r" Writes raw bits to the register"]
583    #[inline]
584    pub unsafe fn bits(&mut self, bits: u8) -> &mut Self {
585        self.bits = bits;
586        self
587    }
588    #[doc = "Bits 0:1 - Wakeup Pin Enable For LLWU_P16"]
589    #[inline]
590    pub fn wupe16(&mut self) -> _WUPE16W {
591        _WUPE16W { w: self }
592    }
593    #[doc = "Bits 2:3 - Wakeup Pin Enable For LLWU_P17"]
594    #[inline]
595    pub fn wupe17(&mut self) -> _WUPE17W {
596        _WUPE17W { w: self }
597    }
598    #[doc = "Bits 4:5 - Wakeup Pin Enable For LLWU_P18"]
599    #[inline]
600    pub fn wupe18(&mut self) -> _WUPE18W {
601        _WUPE18W { w: self }
602    }
603    #[doc = "Bits 6:7 - Wakeup Pin Enable For LLWU_P19"]
604    #[inline]
605    pub fn wupe19(&mut self) -> _WUPE19W {
606        _WUPE19W { w: self }
607    }
608}