stm32l4x2_pac/gpiob/
pupdr.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::PUPDR {
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 `PUPDR15`"]
46#[derive(Clone, Copy, Debug, PartialEq)]
47pub enum PUPDR15R {
48    #[doc = "No pull-up, pull-down"]
49    FLOATING,
50    #[doc = "Pull-up"]
51    PULLUP,
52    #[doc = "Pull-down"]
53    PULLDOWN,
54    #[doc = r" Reserved"]
55    _Reserved(u8),
56}
57impl PUPDR15R {
58    #[doc = r" Value of the field as raw bits"]
59    #[inline]
60    pub fn bits(&self) -> u8 {
61        match *self {
62            PUPDR15R::FLOATING => 0,
63            PUPDR15R::PULLUP => 1,
64            PUPDR15R::PULLDOWN => 2,
65            PUPDR15R::_Reserved(bits) => bits,
66        }
67    }
68    #[allow(missing_docs)]
69    #[doc(hidden)]
70    #[inline]
71    pub fn _from(value: u8) -> PUPDR15R {
72        match value {
73            0 => PUPDR15R::FLOATING,
74            1 => PUPDR15R::PULLUP,
75            2 => PUPDR15R::PULLDOWN,
76            i => PUPDR15R::_Reserved(i),
77        }
78    }
79    #[doc = "Checks if the value of the field is `FLOATING`"]
80    #[inline]
81    pub fn is_floating(&self) -> bool {
82        *self == PUPDR15R::FLOATING
83    }
84    #[doc = "Checks if the value of the field is `PULLUP`"]
85    #[inline]
86    pub fn is_pull_up(&self) -> bool {
87        *self == PUPDR15R::PULLUP
88    }
89    #[doc = "Checks if the value of the field is `PULLDOWN`"]
90    #[inline]
91    pub fn is_pull_down(&self) -> bool {
92        *self == PUPDR15R::PULLDOWN
93    }
94}
95#[doc = "Possible values of the field `PUPDR14`"]
96pub type PUPDR14R = PUPDR15R;
97#[doc = "Possible values of the field `PUPDR13`"]
98pub type PUPDR13R = PUPDR15R;
99#[doc = "Possible values of the field `PUPDR12`"]
100pub type PUPDR12R = PUPDR15R;
101#[doc = "Possible values of the field `PUPDR11`"]
102pub type PUPDR11R = PUPDR15R;
103#[doc = "Possible values of the field `PUPDR10`"]
104pub type PUPDR10R = PUPDR15R;
105#[doc = "Possible values of the field `PUPDR9`"]
106pub type PUPDR9R = PUPDR15R;
107#[doc = "Possible values of the field `PUPDR8`"]
108pub type PUPDR8R = PUPDR15R;
109#[doc = "Possible values of the field `PUPDR7`"]
110pub type PUPDR7R = PUPDR15R;
111#[doc = "Possible values of the field `PUPDR6`"]
112pub type PUPDR6R = PUPDR15R;
113#[doc = "Possible values of the field `PUPDR5`"]
114pub type PUPDR5R = PUPDR15R;
115#[doc = "Possible values of the field `PUPDR4`"]
116pub type PUPDR4R = PUPDR15R;
117#[doc = "Possible values of the field `PUPDR3`"]
118pub type PUPDR3R = PUPDR15R;
119#[doc = "Possible values of the field `PUPDR2`"]
120pub type PUPDR2R = PUPDR15R;
121#[doc = "Possible values of the field `PUPDR1`"]
122pub type PUPDR1R = PUPDR15R;
123#[doc = "Possible values of the field `PUPDR0`"]
124pub type PUPDR0R = PUPDR15R;
125#[doc = "Values that can be written to the field `PUPDR15`"]
126pub enum PUPDR15W {
127    #[doc = "No pull-up, pull-down"]
128    FLOATING,
129    #[doc = "Pull-up"]
130    PULLUP,
131    #[doc = "Pull-down"]
132    PULLDOWN,
133}
134impl PUPDR15W {
135    #[allow(missing_docs)]
136    #[doc(hidden)]
137    #[inline]
138    pub fn _bits(&self) -> u8 {
139        match *self {
140            PUPDR15W::FLOATING => 0,
141            PUPDR15W::PULLUP => 1,
142            PUPDR15W::PULLDOWN => 2,
143        }
144    }
145}
146#[doc = r" Proxy"]
147pub struct _PUPDR15W<'a> {
148    w: &'a mut W,
149}
150impl<'a> _PUPDR15W<'a> {
151    #[doc = r" Writes `variant` to the field"]
152    #[inline]
153    pub fn variant(self, variant: PUPDR15W) -> &'a mut W {
154        unsafe { self.bits(variant._bits()) }
155    }
156    #[doc = "No pull-up, pull-down"]
157    #[inline]
158    pub fn floating(self) -> &'a mut W {
159        self.variant(PUPDR15W::FLOATING)
160    }
161    #[doc = "Pull-up"]
162    #[inline]
163    pub fn pull_up(self) -> &'a mut W {
164        self.variant(PUPDR15W::PULLUP)
165    }
166    #[doc = "Pull-down"]
167    #[inline]
168    pub fn pull_down(self) -> &'a mut W {
169        self.variant(PUPDR15W::PULLDOWN)
170    }
171    #[doc = r" Writes raw bits to the field"]
172    #[inline]
173    pub unsafe fn bits(self, value: u8) -> &'a mut W {
174        const MASK: u8 = 3;
175        const OFFSET: u8 = 30;
176        self.w.bits &= !((MASK as u32) << OFFSET);
177        self.w.bits |= ((value & MASK) as u32) << OFFSET;
178        self.w
179    }
180}
181#[doc = "Values that can be written to the field `PUPDR14`"]
182pub type PUPDR14W = PUPDR15W;
183#[doc = r" Proxy"]
184pub struct _PUPDR14W<'a> {
185    w: &'a mut W,
186}
187impl<'a> _PUPDR14W<'a> {
188    #[doc = r" Writes `variant` to the field"]
189    #[inline]
190    pub fn variant(self, variant: PUPDR14W) -> &'a mut W {
191        unsafe { self.bits(variant._bits()) }
192    }
193    #[doc = "No pull-up, pull-down"]
194    #[inline]
195    pub fn floating(self) -> &'a mut W {
196        self.variant(PUPDR15W::FLOATING)
197    }
198    #[doc = "Pull-up"]
199    #[inline]
200    pub fn pull_up(self) -> &'a mut W {
201        self.variant(PUPDR15W::PULLUP)
202    }
203    #[doc = "Pull-down"]
204    #[inline]
205    pub fn pull_down(self) -> &'a mut W {
206        self.variant(PUPDR15W::PULLDOWN)
207    }
208    #[doc = r" Writes raw bits to the field"]
209    #[inline]
210    pub unsafe fn bits(self, value: u8) -> &'a mut W {
211        const MASK: u8 = 3;
212        const OFFSET: u8 = 28;
213        self.w.bits &= !((MASK as u32) << OFFSET);
214        self.w.bits |= ((value & MASK) as u32) << OFFSET;
215        self.w
216    }
217}
218#[doc = "Values that can be written to the field `PUPDR13`"]
219pub type PUPDR13W = PUPDR15W;
220#[doc = r" Proxy"]
221pub struct _PUPDR13W<'a> {
222    w: &'a mut W,
223}
224impl<'a> _PUPDR13W<'a> {
225    #[doc = r" Writes `variant` to the field"]
226    #[inline]
227    pub fn variant(self, variant: PUPDR13W) -> &'a mut W {
228        unsafe { self.bits(variant._bits()) }
229    }
230    #[doc = "No pull-up, pull-down"]
231    #[inline]
232    pub fn floating(self) -> &'a mut W {
233        self.variant(PUPDR15W::FLOATING)
234    }
235    #[doc = "Pull-up"]
236    #[inline]
237    pub fn pull_up(self) -> &'a mut W {
238        self.variant(PUPDR15W::PULLUP)
239    }
240    #[doc = "Pull-down"]
241    #[inline]
242    pub fn pull_down(self) -> &'a mut W {
243        self.variant(PUPDR15W::PULLDOWN)
244    }
245    #[doc = r" Writes raw bits to the field"]
246    #[inline]
247    pub unsafe fn bits(self, value: u8) -> &'a mut W {
248        const MASK: u8 = 3;
249        const OFFSET: u8 = 26;
250        self.w.bits &= !((MASK as u32) << OFFSET);
251        self.w.bits |= ((value & MASK) as u32) << OFFSET;
252        self.w
253    }
254}
255#[doc = "Values that can be written to the field `PUPDR12`"]
256pub type PUPDR12W = PUPDR15W;
257#[doc = r" Proxy"]
258pub struct _PUPDR12W<'a> {
259    w: &'a mut W,
260}
261impl<'a> _PUPDR12W<'a> {
262    #[doc = r" Writes `variant` to the field"]
263    #[inline]
264    pub fn variant(self, variant: PUPDR12W) -> &'a mut W {
265        unsafe { self.bits(variant._bits()) }
266    }
267    #[doc = "No pull-up, pull-down"]
268    #[inline]
269    pub fn floating(self) -> &'a mut W {
270        self.variant(PUPDR15W::FLOATING)
271    }
272    #[doc = "Pull-up"]
273    #[inline]
274    pub fn pull_up(self) -> &'a mut W {
275        self.variant(PUPDR15W::PULLUP)
276    }
277    #[doc = "Pull-down"]
278    #[inline]
279    pub fn pull_down(self) -> &'a mut W {
280        self.variant(PUPDR15W::PULLDOWN)
281    }
282    #[doc = r" Writes raw bits to the field"]
283    #[inline]
284    pub unsafe fn bits(self, value: u8) -> &'a mut W {
285        const MASK: u8 = 3;
286        const OFFSET: u8 = 24;
287        self.w.bits &= !((MASK as u32) << OFFSET);
288        self.w.bits |= ((value & MASK) as u32) << OFFSET;
289        self.w
290    }
291}
292#[doc = "Values that can be written to the field `PUPDR11`"]
293pub type PUPDR11W = PUPDR15W;
294#[doc = r" Proxy"]
295pub struct _PUPDR11W<'a> {
296    w: &'a mut W,
297}
298impl<'a> _PUPDR11W<'a> {
299    #[doc = r" Writes `variant` to the field"]
300    #[inline]
301    pub fn variant(self, variant: PUPDR11W) -> &'a mut W {
302        unsafe { self.bits(variant._bits()) }
303    }
304    #[doc = "No pull-up, pull-down"]
305    #[inline]
306    pub fn floating(self) -> &'a mut W {
307        self.variant(PUPDR15W::FLOATING)
308    }
309    #[doc = "Pull-up"]
310    #[inline]
311    pub fn pull_up(self) -> &'a mut W {
312        self.variant(PUPDR15W::PULLUP)
313    }
314    #[doc = "Pull-down"]
315    #[inline]
316    pub fn pull_down(self) -> &'a mut W {
317        self.variant(PUPDR15W::PULLDOWN)
318    }
319    #[doc = r" Writes raw bits to the field"]
320    #[inline]
321    pub unsafe fn bits(self, value: u8) -> &'a mut W {
322        const MASK: u8 = 3;
323        const OFFSET: u8 = 22;
324        self.w.bits &= !((MASK as u32) << OFFSET);
325        self.w.bits |= ((value & MASK) as u32) << OFFSET;
326        self.w
327    }
328}
329#[doc = "Values that can be written to the field `PUPDR10`"]
330pub type PUPDR10W = PUPDR15W;
331#[doc = r" Proxy"]
332pub struct _PUPDR10W<'a> {
333    w: &'a mut W,
334}
335impl<'a> _PUPDR10W<'a> {
336    #[doc = r" Writes `variant` to the field"]
337    #[inline]
338    pub fn variant(self, variant: PUPDR10W) -> &'a mut W {
339        unsafe { self.bits(variant._bits()) }
340    }
341    #[doc = "No pull-up, pull-down"]
342    #[inline]
343    pub fn floating(self) -> &'a mut W {
344        self.variant(PUPDR15W::FLOATING)
345    }
346    #[doc = "Pull-up"]
347    #[inline]
348    pub fn pull_up(self) -> &'a mut W {
349        self.variant(PUPDR15W::PULLUP)
350    }
351    #[doc = "Pull-down"]
352    #[inline]
353    pub fn pull_down(self) -> &'a mut W {
354        self.variant(PUPDR15W::PULLDOWN)
355    }
356    #[doc = r" Writes raw bits to the field"]
357    #[inline]
358    pub unsafe fn bits(self, value: u8) -> &'a mut W {
359        const MASK: u8 = 3;
360        const OFFSET: u8 = 20;
361        self.w.bits &= !((MASK as u32) << OFFSET);
362        self.w.bits |= ((value & MASK) as u32) << OFFSET;
363        self.w
364    }
365}
366#[doc = "Values that can be written to the field `PUPDR9`"]
367pub type PUPDR9W = PUPDR15W;
368#[doc = r" Proxy"]
369pub struct _PUPDR9W<'a> {
370    w: &'a mut W,
371}
372impl<'a> _PUPDR9W<'a> {
373    #[doc = r" Writes `variant` to the field"]
374    #[inline]
375    pub fn variant(self, variant: PUPDR9W) -> &'a mut W {
376        unsafe { self.bits(variant._bits()) }
377    }
378    #[doc = "No pull-up, pull-down"]
379    #[inline]
380    pub fn floating(self) -> &'a mut W {
381        self.variant(PUPDR15W::FLOATING)
382    }
383    #[doc = "Pull-up"]
384    #[inline]
385    pub fn pull_up(self) -> &'a mut W {
386        self.variant(PUPDR15W::PULLUP)
387    }
388    #[doc = "Pull-down"]
389    #[inline]
390    pub fn pull_down(self) -> &'a mut W {
391        self.variant(PUPDR15W::PULLDOWN)
392    }
393    #[doc = r" Writes raw bits to the field"]
394    #[inline]
395    pub unsafe fn bits(self, value: u8) -> &'a mut W {
396        const MASK: u8 = 3;
397        const OFFSET: u8 = 18;
398        self.w.bits &= !((MASK as u32) << OFFSET);
399        self.w.bits |= ((value & MASK) as u32) << OFFSET;
400        self.w
401    }
402}
403#[doc = "Values that can be written to the field `PUPDR8`"]
404pub type PUPDR8W = PUPDR15W;
405#[doc = r" Proxy"]
406pub struct _PUPDR8W<'a> {
407    w: &'a mut W,
408}
409impl<'a> _PUPDR8W<'a> {
410    #[doc = r" Writes `variant` to the field"]
411    #[inline]
412    pub fn variant(self, variant: PUPDR8W) -> &'a mut W {
413        unsafe { self.bits(variant._bits()) }
414    }
415    #[doc = "No pull-up, pull-down"]
416    #[inline]
417    pub fn floating(self) -> &'a mut W {
418        self.variant(PUPDR15W::FLOATING)
419    }
420    #[doc = "Pull-up"]
421    #[inline]
422    pub fn pull_up(self) -> &'a mut W {
423        self.variant(PUPDR15W::PULLUP)
424    }
425    #[doc = "Pull-down"]
426    #[inline]
427    pub fn pull_down(self) -> &'a mut W {
428        self.variant(PUPDR15W::PULLDOWN)
429    }
430    #[doc = r" Writes raw bits to the field"]
431    #[inline]
432    pub unsafe fn bits(self, value: u8) -> &'a mut W {
433        const MASK: u8 = 3;
434        const OFFSET: u8 = 16;
435        self.w.bits &= !((MASK as u32) << OFFSET);
436        self.w.bits |= ((value & MASK) as u32) << OFFSET;
437        self.w
438    }
439}
440#[doc = "Values that can be written to the field `PUPDR7`"]
441pub type PUPDR7W = PUPDR15W;
442#[doc = r" Proxy"]
443pub struct _PUPDR7W<'a> {
444    w: &'a mut W,
445}
446impl<'a> _PUPDR7W<'a> {
447    #[doc = r" Writes `variant` to the field"]
448    #[inline]
449    pub fn variant(self, variant: PUPDR7W) -> &'a mut W {
450        unsafe { self.bits(variant._bits()) }
451    }
452    #[doc = "No pull-up, pull-down"]
453    #[inline]
454    pub fn floating(self) -> &'a mut W {
455        self.variant(PUPDR15W::FLOATING)
456    }
457    #[doc = "Pull-up"]
458    #[inline]
459    pub fn pull_up(self) -> &'a mut W {
460        self.variant(PUPDR15W::PULLUP)
461    }
462    #[doc = "Pull-down"]
463    #[inline]
464    pub fn pull_down(self) -> &'a mut W {
465        self.variant(PUPDR15W::PULLDOWN)
466    }
467    #[doc = r" Writes raw bits to the field"]
468    #[inline]
469    pub unsafe fn bits(self, value: u8) -> &'a mut W {
470        const MASK: u8 = 3;
471        const OFFSET: u8 = 14;
472        self.w.bits &= !((MASK as u32) << OFFSET);
473        self.w.bits |= ((value & MASK) as u32) << OFFSET;
474        self.w
475    }
476}
477#[doc = "Values that can be written to the field `PUPDR6`"]
478pub type PUPDR6W = PUPDR15W;
479#[doc = r" Proxy"]
480pub struct _PUPDR6W<'a> {
481    w: &'a mut W,
482}
483impl<'a> _PUPDR6W<'a> {
484    #[doc = r" Writes `variant` to the field"]
485    #[inline]
486    pub fn variant(self, variant: PUPDR6W) -> &'a mut W {
487        unsafe { self.bits(variant._bits()) }
488    }
489    #[doc = "No pull-up, pull-down"]
490    #[inline]
491    pub fn floating(self) -> &'a mut W {
492        self.variant(PUPDR15W::FLOATING)
493    }
494    #[doc = "Pull-up"]
495    #[inline]
496    pub fn pull_up(self) -> &'a mut W {
497        self.variant(PUPDR15W::PULLUP)
498    }
499    #[doc = "Pull-down"]
500    #[inline]
501    pub fn pull_down(self) -> &'a mut W {
502        self.variant(PUPDR15W::PULLDOWN)
503    }
504    #[doc = r" Writes raw bits to the field"]
505    #[inline]
506    pub unsafe fn bits(self, value: u8) -> &'a mut W {
507        const MASK: u8 = 3;
508        const OFFSET: u8 = 12;
509        self.w.bits &= !((MASK as u32) << OFFSET);
510        self.w.bits |= ((value & MASK) as u32) << OFFSET;
511        self.w
512    }
513}
514#[doc = "Values that can be written to the field `PUPDR5`"]
515pub type PUPDR5W = PUPDR15W;
516#[doc = r" Proxy"]
517pub struct _PUPDR5W<'a> {
518    w: &'a mut W,
519}
520impl<'a> _PUPDR5W<'a> {
521    #[doc = r" Writes `variant` to the field"]
522    #[inline]
523    pub fn variant(self, variant: PUPDR5W) -> &'a mut W {
524        unsafe { self.bits(variant._bits()) }
525    }
526    #[doc = "No pull-up, pull-down"]
527    #[inline]
528    pub fn floating(self) -> &'a mut W {
529        self.variant(PUPDR15W::FLOATING)
530    }
531    #[doc = "Pull-up"]
532    #[inline]
533    pub fn pull_up(self) -> &'a mut W {
534        self.variant(PUPDR15W::PULLUP)
535    }
536    #[doc = "Pull-down"]
537    #[inline]
538    pub fn pull_down(self) -> &'a mut W {
539        self.variant(PUPDR15W::PULLDOWN)
540    }
541    #[doc = r" Writes raw bits to the field"]
542    #[inline]
543    pub unsafe fn bits(self, value: u8) -> &'a mut W {
544        const MASK: u8 = 3;
545        const OFFSET: u8 = 10;
546        self.w.bits &= !((MASK as u32) << OFFSET);
547        self.w.bits |= ((value & MASK) as u32) << OFFSET;
548        self.w
549    }
550}
551#[doc = "Values that can be written to the field `PUPDR4`"]
552pub type PUPDR4W = PUPDR15W;
553#[doc = r" Proxy"]
554pub struct _PUPDR4W<'a> {
555    w: &'a mut W,
556}
557impl<'a> _PUPDR4W<'a> {
558    #[doc = r" Writes `variant` to the field"]
559    #[inline]
560    pub fn variant(self, variant: PUPDR4W) -> &'a mut W {
561        unsafe { self.bits(variant._bits()) }
562    }
563    #[doc = "No pull-up, pull-down"]
564    #[inline]
565    pub fn floating(self) -> &'a mut W {
566        self.variant(PUPDR15W::FLOATING)
567    }
568    #[doc = "Pull-up"]
569    #[inline]
570    pub fn pull_up(self) -> &'a mut W {
571        self.variant(PUPDR15W::PULLUP)
572    }
573    #[doc = "Pull-down"]
574    #[inline]
575    pub fn pull_down(self) -> &'a mut W {
576        self.variant(PUPDR15W::PULLDOWN)
577    }
578    #[doc = r" Writes raw bits to the field"]
579    #[inline]
580    pub unsafe fn bits(self, value: u8) -> &'a mut W {
581        const MASK: u8 = 3;
582        const OFFSET: u8 = 8;
583        self.w.bits &= !((MASK as u32) << OFFSET);
584        self.w.bits |= ((value & MASK) as u32) << OFFSET;
585        self.w
586    }
587}
588#[doc = "Values that can be written to the field `PUPDR3`"]
589pub type PUPDR3W = PUPDR15W;
590#[doc = r" Proxy"]
591pub struct _PUPDR3W<'a> {
592    w: &'a mut W,
593}
594impl<'a> _PUPDR3W<'a> {
595    #[doc = r" Writes `variant` to the field"]
596    #[inline]
597    pub fn variant(self, variant: PUPDR3W) -> &'a mut W {
598        unsafe { self.bits(variant._bits()) }
599    }
600    #[doc = "No pull-up, pull-down"]
601    #[inline]
602    pub fn floating(self) -> &'a mut W {
603        self.variant(PUPDR15W::FLOATING)
604    }
605    #[doc = "Pull-up"]
606    #[inline]
607    pub fn pull_up(self) -> &'a mut W {
608        self.variant(PUPDR15W::PULLUP)
609    }
610    #[doc = "Pull-down"]
611    #[inline]
612    pub fn pull_down(self) -> &'a mut W {
613        self.variant(PUPDR15W::PULLDOWN)
614    }
615    #[doc = r" Writes raw bits to the field"]
616    #[inline]
617    pub unsafe fn bits(self, value: u8) -> &'a mut W {
618        const MASK: u8 = 3;
619        const OFFSET: u8 = 6;
620        self.w.bits &= !((MASK as u32) << OFFSET);
621        self.w.bits |= ((value & MASK) as u32) << OFFSET;
622        self.w
623    }
624}
625#[doc = "Values that can be written to the field `PUPDR2`"]
626pub type PUPDR2W = PUPDR15W;
627#[doc = r" Proxy"]
628pub struct _PUPDR2W<'a> {
629    w: &'a mut W,
630}
631impl<'a> _PUPDR2W<'a> {
632    #[doc = r" Writes `variant` to the field"]
633    #[inline]
634    pub fn variant(self, variant: PUPDR2W) -> &'a mut W {
635        unsafe { self.bits(variant._bits()) }
636    }
637    #[doc = "No pull-up, pull-down"]
638    #[inline]
639    pub fn floating(self) -> &'a mut W {
640        self.variant(PUPDR15W::FLOATING)
641    }
642    #[doc = "Pull-up"]
643    #[inline]
644    pub fn pull_up(self) -> &'a mut W {
645        self.variant(PUPDR15W::PULLUP)
646    }
647    #[doc = "Pull-down"]
648    #[inline]
649    pub fn pull_down(self) -> &'a mut W {
650        self.variant(PUPDR15W::PULLDOWN)
651    }
652    #[doc = r" Writes raw bits to the field"]
653    #[inline]
654    pub unsafe fn bits(self, value: u8) -> &'a mut W {
655        const MASK: u8 = 3;
656        const OFFSET: u8 = 4;
657        self.w.bits &= !((MASK as u32) << OFFSET);
658        self.w.bits |= ((value & MASK) as u32) << OFFSET;
659        self.w
660    }
661}
662#[doc = "Values that can be written to the field `PUPDR1`"]
663pub type PUPDR1W = PUPDR15W;
664#[doc = r" Proxy"]
665pub struct _PUPDR1W<'a> {
666    w: &'a mut W,
667}
668impl<'a> _PUPDR1W<'a> {
669    #[doc = r" Writes `variant` to the field"]
670    #[inline]
671    pub fn variant(self, variant: PUPDR1W) -> &'a mut W {
672        unsafe { self.bits(variant._bits()) }
673    }
674    #[doc = "No pull-up, pull-down"]
675    #[inline]
676    pub fn floating(self) -> &'a mut W {
677        self.variant(PUPDR15W::FLOATING)
678    }
679    #[doc = "Pull-up"]
680    #[inline]
681    pub fn pull_up(self) -> &'a mut W {
682        self.variant(PUPDR15W::PULLUP)
683    }
684    #[doc = "Pull-down"]
685    #[inline]
686    pub fn pull_down(self) -> &'a mut W {
687        self.variant(PUPDR15W::PULLDOWN)
688    }
689    #[doc = r" Writes raw bits to the field"]
690    #[inline]
691    pub unsafe fn bits(self, value: u8) -> &'a mut W {
692        const MASK: u8 = 3;
693        const OFFSET: u8 = 2;
694        self.w.bits &= !((MASK as u32) << OFFSET);
695        self.w.bits |= ((value & MASK) as u32) << OFFSET;
696        self.w
697    }
698}
699#[doc = "Values that can be written to the field `PUPDR0`"]
700pub type PUPDR0W = PUPDR15W;
701#[doc = r" Proxy"]
702pub struct _PUPDR0W<'a> {
703    w: &'a mut W,
704}
705impl<'a> _PUPDR0W<'a> {
706    #[doc = r" Writes `variant` to the field"]
707    #[inline]
708    pub fn variant(self, variant: PUPDR0W) -> &'a mut W {
709        unsafe { self.bits(variant._bits()) }
710    }
711    #[doc = "No pull-up, pull-down"]
712    #[inline]
713    pub fn floating(self) -> &'a mut W {
714        self.variant(PUPDR15W::FLOATING)
715    }
716    #[doc = "Pull-up"]
717    #[inline]
718    pub fn pull_up(self) -> &'a mut W {
719        self.variant(PUPDR15W::PULLUP)
720    }
721    #[doc = "Pull-down"]
722    #[inline]
723    pub fn pull_down(self) -> &'a mut W {
724        self.variant(PUPDR15W::PULLDOWN)
725    }
726    #[doc = r" Writes raw bits to the field"]
727    #[inline]
728    pub unsafe fn bits(self, value: u8) -> &'a mut W {
729        const MASK: u8 = 3;
730        const OFFSET: u8 = 0;
731        self.w.bits &= !((MASK as u32) << OFFSET);
732        self.w.bits |= ((value & MASK) as u32) << OFFSET;
733        self.w
734    }
735}
736impl R {
737    #[doc = r" Value of the register as raw bits"]
738    #[inline]
739    pub fn bits(&self) -> u32 {
740        self.bits
741    }
742    #[doc = "Bits 30:31 - Port x configuration bits (y = 0..15)"]
743    #[inline]
744    pub fn pupdr15(&self) -> PUPDR15R {
745        PUPDR15R::_from({
746            const MASK: u8 = 3;
747            const OFFSET: u8 = 30;
748            ((self.bits >> OFFSET) & MASK as u32) as u8
749        })
750    }
751    #[doc = "Bits 28:29 - Port x configuration bits (y = 0..15)"]
752    #[inline]
753    pub fn pupdr14(&self) -> PUPDR14R {
754        PUPDR14R::_from({
755            const MASK: u8 = 3;
756            const OFFSET: u8 = 28;
757            ((self.bits >> OFFSET) & MASK as u32) as u8
758        })
759    }
760    #[doc = "Bits 26:27 - Port x configuration bits (y = 0..15)"]
761    #[inline]
762    pub fn pupdr13(&self) -> PUPDR13R {
763        PUPDR13R::_from({
764            const MASK: u8 = 3;
765            const OFFSET: u8 = 26;
766            ((self.bits >> OFFSET) & MASK as u32) as u8
767        })
768    }
769    #[doc = "Bits 24:25 - Port x configuration bits (y = 0..15)"]
770    #[inline]
771    pub fn pupdr12(&self) -> PUPDR12R {
772        PUPDR12R::_from({
773            const MASK: u8 = 3;
774            const OFFSET: u8 = 24;
775            ((self.bits >> OFFSET) & MASK as u32) as u8
776        })
777    }
778    #[doc = "Bits 22:23 - Port x configuration bits (y = 0..15)"]
779    #[inline]
780    pub fn pupdr11(&self) -> PUPDR11R {
781        PUPDR11R::_from({
782            const MASK: u8 = 3;
783            const OFFSET: u8 = 22;
784            ((self.bits >> OFFSET) & MASK as u32) as u8
785        })
786    }
787    #[doc = "Bits 20:21 - Port x configuration bits (y = 0..15)"]
788    #[inline]
789    pub fn pupdr10(&self) -> PUPDR10R {
790        PUPDR10R::_from({
791            const MASK: u8 = 3;
792            const OFFSET: u8 = 20;
793            ((self.bits >> OFFSET) & MASK as u32) as u8
794        })
795    }
796    #[doc = "Bits 18:19 - Port x configuration bits (y = 0..15)"]
797    #[inline]
798    pub fn pupdr9(&self) -> PUPDR9R {
799        PUPDR9R::_from({
800            const MASK: u8 = 3;
801            const OFFSET: u8 = 18;
802            ((self.bits >> OFFSET) & MASK as u32) as u8
803        })
804    }
805    #[doc = "Bits 16:17 - Port x configuration bits (y = 0..15)"]
806    #[inline]
807    pub fn pupdr8(&self) -> PUPDR8R {
808        PUPDR8R::_from({
809            const MASK: u8 = 3;
810            const OFFSET: u8 = 16;
811            ((self.bits >> OFFSET) & MASK as u32) as u8
812        })
813    }
814    #[doc = "Bits 14:15 - Port x configuration bits (y = 0..15)"]
815    #[inline]
816    pub fn pupdr7(&self) -> PUPDR7R {
817        PUPDR7R::_from({
818            const MASK: u8 = 3;
819            const OFFSET: u8 = 14;
820            ((self.bits >> OFFSET) & MASK as u32) as u8
821        })
822    }
823    #[doc = "Bits 12:13 - Port x configuration bits (y = 0..15)"]
824    #[inline]
825    pub fn pupdr6(&self) -> PUPDR6R {
826        PUPDR6R::_from({
827            const MASK: u8 = 3;
828            const OFFSET: u8 = 12;
829            ((self.bits >> OFFSET) & MASK as u32) as u8
830        })
831    }
832    #[doc = "Bits 10:11 - Port x configuration bits (y = 0..15)"]
833    #[inline]
834    pub fn pupdr5(&self) -> PUPDR5R {
835        PUPDR5R::_from({
836            const MASK: u8 = 3;
837            const OFFSET: u8 = 10;
838            ((self.bits >> OFFSET) & MASK as u32) as u8
839        })
840    }
841    #[doc = "Bits 8:9 - Port x configuration bits (y = 0..15)"]
842    #[inline]
843    pub fn pupdr4(&self) -> PUPDR4R {
844        PUPDR4R::_from({
845            const MASK: u8 = 3;
846            const OFFSET: u8 = 8;
847            ((self.bits >> OFFSET) & MASK as u32) as u8
848        })
849    }
850    #[doc = "Bits 6:7 - Port x configuration bits (y = 0..15)"]
851    #[inline]
852    pub fn pupdr3(&self) -> PUPDR3R {
853        PUPDR3R::_from({
854            const MASK: u8 = 3;
855            const OFFSET: u8 = 6;
856            ((self.bits >> OFFSET) & MASK as u32) as u8
857        })
858    }
859    #[doc = "Bits 4:5 - Port x configuration bits (y = 0..15)"]
860    #[inline]
861    pub fn pupdr2(&self) -> PUPDR2R {
862        PUPDR2R::_from({
863            const MASK: u8 = 3;
864            const OFFSET: u8 = 4;
865            ((self.bits >> OFFSET) & MASK as u32) as u8
866        })
867    }
868    #[doc = "Bits 2:3 - Port x configuration bits (y = 0..15)"]
869    #[inline]
870    pub fn pupdr1(&self) -> PUPDR1R {
871        PUPDR1R::_from({
872            const MASK: u8 = 3;
873            const OFFSET: u8 = 2;
874            ((self.bits >> OFFSET) & MASK as u32) as u8
875        })
876    }
877    #[doc = "Bits 0:1 - Port x configuration bits (y = 0..15)"]
878    #[inline]
879    pub fn pupdr0(&self) -> PUPDR0R {
880        PUPDR0R::_from({
881            const MASK: u8 = 3;
882            const OFFSET: u8 = 0;
883            ((self.bits >> OFFSET) & MASK as u32) as u8
884        })
885    }
886}
887impl W {
888    #[doc = r" Reset value of the register"]
889    #[inline]
890    pub fn reset_value() -> W {
891        W { bits: 256 }
892    }
893    #[doc = r" Writes raw bits to the register"]
894    #[inline]
895    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
896        self.bits = bits;
897        self
898    }
899    #[doc = "Bits 30:31 - Port x configuration bits (y = 0..15)"]
900    #[inline]
901    pub fn pupdr15(&mut self) -> _PUPDR15W {
902        _PUPDR15W { w: self }
903    }
904    #[doc = "Bits 28:29 - Port x configuration bits (y = 0..15)"]
905    #[inline]
906    pub fn pupdr14(&mut self) -> _PUPDR14W {
907        _PUPDR14W { w: self }
908    }
909    #[doc = "Bits 26:27 - Port x configuration bits (y = 0..15)"]
910    #[inline]
911    pub fn pupdr13(&mut self) -> _PUPDR13W {
912        _PUPDR13W { w: self }
913    }
914    #[doc = "Bits 24:25 - Port x configuration bits (y = 0..15)"]
915    #[inline]
916    pub fn pupdr12(&mut self) -> _PUPDR12W {
917        _PUPDR12W { w: self }
918    }
919    #[doc = "Bits 22:23 - Port x configuration bits (y = 0..15)"]
920    #[inline]
921    pub fn pupdr11(&mut self) -> _PUPDR11W {
922        _PUPDR11W { w: self }
923    }
924    #[doc = "Bits 20:21 - Port x configuration bits (y = 0..15)"]
925    #[inline]
926    pub fn pupdr10(&mut self) -> _PUPDR10W {
927        _PUPDR10W { w: self }
928    }
929    #[doc = "Bits 18:19 - Port x configuration bits (y = 0..15)"]
930    #[inline]
931    pub fn pupdr9(&mut self) -> _PUPDR9W {
932        _PUPDR9W { w: self }
933    }
934    #[doc = "Bits 16:17 - Port x configuration bits (y = 0..15)"]
935    #[inline]
936    pub fn pupdr8(&mut self) -> _PUPDR8W {
937        _PUPDR8W { w: self }
938    }
939    #[doc = "Bits 14:15 - Port x configuration bits (y = 0..15)"]
940    #[inline]
941    pub fn pupdr7(&mut self) -> _PUPDR7W {
942        _PUPDR7W { w: self }
943    }
944    #[doc = "Bits 12:13 - Port x configuration bits (y = 0..15)"]
945    #[inline]
946    pub fn pupdr6(&mut self) -> _PUPDR6W {
947        _PUPDR6W { w: self }
948    }
949    #[doc = "Bits 10:11 - Port x configuration bits (y = 0..15)"]
950    #[inline]
951    pub fn pupdr5(&mut self) -> _PUPDR5W {
952        _PUPDR5W { w: self }
953    }
954    #[doc = "Bits 8:9 - Port x configuration bits (y = 0..15)"]
955    #[inline]
956    pub fn pupdr4(&mut self) -> _PUPDR4W {
957        _PUPDR4W { w: self }
958    }
959    #[doc = "Bits 6:7 - Port x configuration bits (y = 0..15)"]
960    #[inline]
961    pub fn pupdr3(&mut self) -> _PUPDR3W {
962        _PUPDR3W { w: self }
963    }
964    #[doc = "Bits 4:5 - Port x configuration bits (y = 0..15)"]
965    #[inline]
966    pub fn pupdr2(&mut self) -> _PUPDR2W {
967        _PUPDR2W { w: self }
968    }
969    #[doc = "Bits 2:3 - Port x configuration bits (y = 0..15)"]
970    #[inline]
971    pub fn pupdr1(&mut self) -> _PUPDR1W {
972        _PUPDR1W { w: self }
973    }
974    #[doc = "Bits 0:1 - Port x configuration bits (y = 0..15)"]
975    #[inline]
976    pub fn pupdr0(&mut self) -> _PUPDR0W {
977        _PUPDR0W { w: self }
978    }
979}