stm32wb_pac/gpioa/
pupdr.rs

1#[doc = "Reader of register PUPDR"]
2pub type R = crate::R<u32, super::PUPDR>;
3#[doc = "Writer for register PUPDR"]
4pub type W = crate::W<u32, super::PUPDR>;
5#[doc = "Register PUPDR `reset()`'s with value 0x6400_0000"]
6impl crate::ResetValue for super::PUPDR {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0x6400_0000
11    }
12}
13#[doc = "Reader of field `PUPDR15`"]
14pub type PUPDR15_R = crate::R<u8, u8>;
15#[doc = "Write proxy for field `PUPDR15`"]
16pub struct PUPDR15_W<'a> {
17    w: &'a mut W,
18}
19impl<'a> PUPDR15_W<'a> {
20    #[doc = r"Writes raw bits to the field"]
21    #[inline(always)]
22    pub unsafe fn bits(self, value: u8) -> &'a mut W {
23        self.w.bits = (self.w.bits & !(0x03 << 30)) | (((value as u32) & 0x03) << 30);
24        self.w
25    }
26}
27#[doc = "Reader of field `PUPDR14`"]
28pub type PUPDR14_R = crate::R<u8, u8>;
29#[doc = "Write proxy for field `PUPDR14`"]
30pub struct PUPDR14_W<'a> {
31    w: &'a mut W,
32}
33impl<'a> PUPDR14_W<'a> {
34    #[doc = r"Writes raw bits to the field"]
35    #[inline(always)]
36    pub unsafe fn bits(self, value: u8) -> &'a mut W {
37        self.w.bits = (self.w.bits & !(0x03 << 28)) | (((value as u32) & 0x03) << 28);
38        self.w
39    }
40}
41#[doc = "Reader of field `PUPDR13`"]
42pub type PUPDR13_R = crate::R<u8, u8>;
43#[doc = "Write proxy for field `PUPDR13`"]
44pub struct PUPDR13_W<'a> {
45    w: &'a mut W,
46}
47impl<'a> PUPDR13_W<'a> {
48    #[doc = r"Writes raw bits to the field"]
49    #[inline(always)]
50    pub unsafe fn bits(self, value: u8) -> &'a mut W {
51        self.w.bits = (self.w.bits & !(0x03 << 26)) | (((value as u32) & 0x03) << 26);
52        self.w
53    }
54}
55#[doc = "Reader of field `PUPDR12`"]
56pub type PUPDR12_R = crate::R<u8, u8>;
57#[doc = "Write proxy for field `PUPDR12`"]
58pub struct PUPDR12_W<'a> {
59    w: &'a mut W,
60}
61impl<'a> PUPDR12_W<'a> {
62    #[doc = r"Writes raw bits to the field"]
63    #[inline(always)]
64    pub unsafe fn bits(self, value: u8) -> &'a mut W {
65        self.w.bits = (self.w.bits & !(0x03 << 24)) | (((value as u32) & 0x03) << 24);
66        self.w
67    }
68}
69#[doc = "Reader of field `PUPDR11`"]
70pub type PUPDR11_R = crate::R<u8, u8>;
71#[doc = "Write proxy for field `PUPDR11`"]
72pub struct PUPDR11_W<'a> {
73    w: &'a mut W,
74}
75impl<'a> PUPDR11_W<'a> {
76    #[doc = r"Writes raw bits to the field"]
77    #[inline(always)]
78    pub unsafe fn bits(self, value: u8) -> &'a mut W {
79        self.w.bits = (self.w.bits & !(0x03 << 22)) | (((value as u32) & 0x03) << 22);
80        self.w
81    }
82}
83#[doc = "Reader of field `PUPDR10`"]
84pub type PUPDR10_R = crate::R<u8, u8>;
85#[doc = "Write proxy for field `PUPDR10`"]
86pub struct PUPDR10_W<'a> {
87    w: &'a mut W,
88}
89impl<'a> PUPDR10_W<'a> {
90    #[doc = r"Writes raw bits to the field"]
91    #[inline(always)]
92    pub unsafe fn bits(self, value: u8) -> &'a mut W {
93        self.w.bits = (self.w.bits & !(0x03 << 20)) | (((value as u32) & 0x03) << 20);
94        self.w
95    }
96}
97#[doc = "Reader of field `PUPDR9`"]
98pub type PUPDR9_R = crate::R<u8, u8>;
99#[doc = "Write proxy for field `PUPDR9`"]
100pub struct PUPDR9_W<'a> {
101    w: &'a mut W,
102}
103impl<'a> PUPDR9_W<'a> {
104    #[doc = r"Writes raw bits to the field"]
105    #[inline(always)]
106    pub unsafe fn bits(self, value: u8) -> &'a mut W {
107        self.w.bits = (self.w.bits & !(0x03 << 18)) | (((value as u32) & 0x03) << 18);
108        self.w
109    }
110}
111#[doc = "Reader of field `PUPDR8`"]
112pub type PUPDR8_R = crate::R<u8, u8>;
113#[doc = "Write proxy for field `PUPDR8`"]
114pub struct PUPDR8_W<'a> {
115    w: &'a mut W,
116}
117impl<'a> PUPDR8_W<'a> {
118    #[doc = r"Writes raw bits to the field"]
119    #[inline(always)]
120    pub unsafe fn bits(self, value: u8) -> &'a mut W {
121        self.w.bits = (self.w.bits & !(0x03 << 16)) | (((value as u32) & 0x03) << 16);
122        self.w
123    }
124}
125#[doc = "Reader of field `PUPDR7`"]
126pub type PUPDR7_R = crate::R<u8, u8>;
127#[doc = "Write proxy for field `PUPDR7`"]
128pub struct PUPDR7_W<'a> {
129    w: &'a mut W,
130}
131impl<'a> PUPDR7_W<'a> {
132    #[doc = r"Writes raw bits to the field"]
133    #[inline(always)]
134    pub unsafe fn bits(self, value: u8) -> &'a mut W {
135        self.w.bits = (self.w.bits & !(0x03 << 14)) | (((value as u32) & 0x03) << 14);
136        self.w
137    }
138}
139#[doc = "Reader of field `PUPDR6`"]
140pub type PUPDR6_R = crate::R<u8, u8>;
141#[doc = "Write proxy for field `PUPDR6`"]
142pub struct PUPDR6_W<'a> {
143    w: &'a mut W,
144}
145impl<'a> PUPDR6_W<'a> {
146    #[doc = r"Writes raw bits to the field"]
147    #[inline(always)]
148    pub unsafe fn bits(self, value: u8) -> &'a mut W {
149        self.w.bits = (self.w.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12);
150        self.w
151    }
152}
153#[doc = "Reader of field `PUPDR5`"]
154pub type PUPDR5_R = crate::R<u8, u8>;
155#[doc = "Write proxy for field `PUPDR5`"]
156pub struct PUPDR5_W<'a> {
157    w: &'a mut W,
158}
159impl<'a> PUPDR5_W<'a> {
160    #[doc = r"Writes raw bits to the field"]
161    #[inline(always)]
162    pub unsafe fn bits(self, value: u8) -> &'a mut W {
163        self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10);
164        self.w
165    }
166}
167#[doc = "Reader of field `PUPDR4`"]
168pub type PUPDR4_R = crate::R<u8, u8>;
169#[doc = "Write proxy for field `PUPDR4`"]
170pub struct PUPDR4_W<'a> {
171    w: &'a mut W,
172}
173impl<'a> PUPDR4_W<'a> {
174    #[doc = r"Writes raw bits to the field"]
175    #[inline(always)]
176    pub unsafe fn bits(self, value: u8) -> &'a mut W {
177        self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8);
178        self.w
179    }
180}
181#[doc = "Reader of field `PUPDR3`"]
182pub type PUPDR3_R = crate::R<u8, u8>;
183#[doc = "Write proxy for field `PUPDR3`"]
184pub struct PUPDR3_W<'a> {
185    w: &'a mut W,
186}
187impl<'a> PUPDR3_W<'a> {
188    #[doc = r"Writes raw bits to the field"]
189    #[inline(always)]
190    pub unsafe fn bits(self, value: u8) -> &'a mut W {
191        self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6);
192        self.w
193    }
194}
195#[doc = "Reader of field `PUPDR2`"]
196pub type PUPDR2_R = crate::R<u8, u8>;
197#[doc = "Write proxy for field `PUPDR2`"]
198pub struct PUPDR2_W<'a> {
199    w: &'a mut W,
200}
201impl<'a> PUPDR2_W<'a> {
202    #[doc = r"Writes raw bits to the field"]
203    #[inline(always)]
204    pub unsafe fn bits(self, value: u8) -> &'a mut W {
205        self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4);
206        self.w
207    }
208}
209#[doc = "Reader of field `PUPDR1`"]
210pub type PUPDR1_R = crate::R<u8, u8>;
211#[doc = "Write proxy for field `PUPDR1`"]
212pub struct PUPDR1_W<'a> {
213    w: &'a mut W,
214}
215impl<'a> PUPDR1_W<'a> {
216    #[doc = r"Writes raw bits to the field"]
217    #[inline(always)]
218    pub unsafe fn bits(self, value: u8) -> &'a mut W {
219        self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2);
220        self.w
221    }
222}
223#[doc = "Reader of field `PUPDR0`"]
224pub type PUPDR0_R = crate::R<u8, u8>;
225#[doc = "Write proxy for field `PUPDR0`"]
226pub struct PUPDR0_W<'a> {
227    w: &'a mut W,
228}
229impl<'a> PUPDR0_W<'a> {
230    #[doc = r"Writes raw bits to the field"]
231    #[inline(always)]
232    pub unsafe fn bits(self, value: u8) -> &'a mut W {
233        self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03);
234        self.w
235    }
236}
237impl R {
238    #[doc = "Bits 30:31 - Port x configuration bits (y = 0..15)"]
239    #[inline(always)]
240    pub fn pupdr15(&self) -> PUPDR15_R {
241        PUPDR15_R::new(((self.bits >> 30) & 0x03) as u8)
242    }
243    #[doc = "Bits 28:29 - Port x configuration bits (y = 0..15)"]
244    #[inline(always)]
245    pub fn pupdr14(&self) -> PUPDR14_R {
246        PUPDR14_R::new(((self.bits >> 28) & 0x03) as u8)
247    }
248    #[doc = "Bits 26:27 - Port x configuration bits (y = 0..15)"]
249    #[inline(always)]
250    pub fn pupdr13(&self) -> PUPDR13_R {
251        PUPDR13_R::new(((self.bits >> 26) & 0x03) as u8)
252    }
253    #[doc = "Bits 24:25 - Port x configuration bits (y = 0..15)"]
254    #[inline(always)]
255    pub fn pupdr12(&self) -> PUPDR12_R {
256        PUPDR12_R::new(((self.bits >> 24) & 0x03) as u8)
257    }
258    #[doc = "Bits 22:23 - Port x configuration bits (y = 0..15)"]
259    #[inline(always)]
260    pub fn pupdr11(&self) -> PUPDR11_R {
261        PUPDR11_R::new(((self.bits >> 22) & 0x03) as u8)
262    }
263    #[doc = "Bits 20:21 - Port x configuration bits (y = 0..15)"]
264    #[inline(always)]
265    pub fn pupdr10(&self) -> PUPDR10_R {
266        PUPDR10_R::new(((self.bits >> 20) & 0x03) as u8)
267    }
268    #[doc = "Bits 18:19 - Port x configuration bits (y = 0..15)"]
269    #[inline(always)]
270    pub fn pupdr9(&self) -> PUPDR9_R {
271        PUPDR9_R::new(((self.bits >> 18) & 0x03) as u8)
272    }
273    #[doc = "Bits 16:17 - Port x configuration bits (y = 0..15)"]
274    #[inline(always)]
275    pub fn pupdr8(&self) -> PUPDR8_R {
276        PUPDR8_R::new(((self.bits >> 16) & 0x03) as u8)
277    }
278    #[doc = "Bits 14:15 - Port x configuration bits (y = 0..15)"]
279    #[inline(always)]
280    pub fn pupdr7(&self) -> PUPDR7_R {
281        PUPDR7_R::new(((self.bits >> 14) & 0x03) as u8)
282    }
283    #[doc = "Bits 12:13 - Port x configuration bits (y = 0..15)"]
284    #[inline(always)]
285    pub fn pupdr6(&self) -> PUPDR6_R {
286        PUPDR6_R::new(((self.bits >> 12) & 0x03) as u8)
287    }
288    #[doc = "Bits 10:11 - Port x configuration bits (y = 0..15)"]
289    #[inline(always)]
290    pub fn pupdr5(&self) -> PUPDR5_R {
291        PUPDR5_R::new(((self.bits >> 10) & 0x03) as u8)
292    }
293    #[doc = "Bits 8:9 - Port x configuration bits (y = 0..15)"]
294    #[inline(always)]
295    pub fn pupdr4(&self) -> PUPDR4_R {
296        PUPDR4_R::new(((self.bits >> 8) & 0x03) as u8)
297    }
298    #[doc = "Bits 6:7 - Port x configuration bits (y = 0..15)"]
299    #[inline(always)]
300    pub fn pupdr3(&self) -> PUPDR3_R {
301        PUPDR3_R::new(((self.bits >> 6) & 0x03) as u8)
302    }
303    #[doc = "Bits 4:5 - Port x configuration bits (y = 0..15)"]
304    #[inline(always)]
305    pub fn pupdr2(&self) -> PUPDR2_R {
306        PUPDR2_R::new(((self.bits >> 4) & 0x03) as u8)
307    }
308    #[doc = "Bits 2:3 - Port x configuration bits (y = 0..15)"]
309    #[inline(always)]
310    pub fn pupdr1(&self) -> PUPDR1_R {
311        PUPDR1_R::new(((self.bits >> 2) & 0x03) as u8)
312    }
313    #[doc = "Bits 0:1 - Port x configuration bits (y = 0..15)"]
314    #[inline(always)]
315    pub fn pupdr0(&self) -> PUPDR0_R {
316        PUPDR0_R::new((self.bits & 0x03) as u8)
317    }
318}
319impl W {
320    #[doc = "Bits 30:31 - Port x configuration bits (y = 0..15)"]
321    #[inline(always)]
322    pub fn pupdr15(&mut self) -> PUPDR15_W {
323        PUPDR15_W { w: self }
324    }
325    #[doc = "Bits 28:29 - Port x configuration bits (y = 0..15)"]
326    #[inline(always)]
327    pub fn pupdr14(&mut self) -> PUPDR14_W {
328        PUPDR14_W { w: self }
329    }
330    #[doc = "Bits 26:27 - Port x configuration bits (y = 0..15)"]
331    #[inline(always)]
332    pub fn pupdr13(&mut self) -> PUPDR13_W {
333        PUPDR13_W { w: self }
334    }
335    #[doc = "Bits 24:25 - Port x configuration bits (y = 0..15)"]
336    #[inline(always)]
337    pub fn pupdr12(&mut self) -> PUPDR12_W {
338        PUPDR12_W { w: self }
339    }
340    #[doc = "Bits 22:23 - Port x configuration bits (y = 0..15)"]
341    #[inline(always)]
342    pub fn pupdr11(&mut self) -> PUPDR11_W {
343        PUPDR11_W { w: self }
344    }
345    #[doc = "Bits 20:21 - Port x configuration bits (y = 0..15)"]
346    #[inline(always)]
347    pub fn pupdr10(&mut self) -> PUPDR10_W {
348        PUPDR10_W { w: self }
349    }
350    #[doc = "Bits 18:19 - Port x configuration bits (y = 0..15)"]
351    #[inline(always)]
352    pub fn pupdr9(&mut self) -> PUPDR9_W {
353        PUPDR9_W { w: self }
354    }
355    #[doc = "Bits 16:17 - Port x configuration bits (y = 0..15)"]
356    #[inline(always)]
357    pub fn pupdr8(&mut self) -> PUPDR8_W {
358        PUPDR8_W { w: self }
359    }
360    #[doc = "Bits 14:15 - Port x configuration bits (y = 0..15)"]
361    #[inline(always)]
362    pub fn pupdr7(&mut self) -> PUPDR7_W {
363        PUPDR7_W { w: self }
364    }
365    #[doc = "Bits 12:13 - Port x configuration bits (y = 0..15)"]
366    #[inline(always)]
367    pub fn pupdr6(&mut self) -> PUPDR6_W {
368        PUPDR6_W { w: self }
369    }
370    #[doc = "Bits 10:11 - Port x configuration bits (y = 0..15)"]
371    #[inline(always)]
372    pub fn pupdr5(&mut self) -> PUPDR5_W {
373        PUPDR5_W { w: self }
374    }
375    #[doc = "Bits 8:9 - Port x configuration bits (y = 0..15)"]
376    #[inline(always)]
377    pub fn pupdr4(&mut self) -> PUPDR4_W {
378        PUPDR4_W { w: self }
379    }
380    #[doc = "Bits 6:7 - Port x configuration bits (y = 0..15)"]
381    #[inline(always)]
382    pub fn pupdr3(&mut self) -> PUPDR3_W {
383        PUPDR3_W { w: self }
384    }
385    #[doc = "Bits 4:5 - Port x configuration bits (y = 0..15)"]
386    #[inline(always)]
387    pub fn pupdr2(&mut self) -> PUPDR2_W {
388        PUPDR2_W { w: self }
389    }
390    #[doc = "Bits 2:3 - Port x configuration bits (y = 0..15)"]
391    #[inline(always)]
392    pub fn pupdr1(&mut self) -> PUPDR1_W {
393        PUPDR1_W { w: self }
394    }
395    #[doc = "Bits 0:1 - Port x configuration bits (y = 0..15)"]
396    #[inline(always)]
397    pub fn pupdr0(&mut self) -> PUPDR0_W {
398        PUPDR0_W { w: self }
399    }
400}