py32f0/py32f030/gpioa/
afrh.rs1pub struct R(crate::R<AFRH_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<AFRH_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<AFRH_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<AFRH_SPEC>) -> Self {
13 R(reader)
14 }
15}
16pub struct W(crate::W<AFRH_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<AFRH_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<AFRH_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<AFRH_SPEC>) -> Self {
34 W(writer)
35 }
36}
37pub type AFSEL8_R = crate::FieldReader<u8, AFSEL8_A>;
39#[derive(Clone, Copy, Debug, PartialEq, Eq)]
43#[repr(u8)]
44pub enum AFSEL8_A {
45 Af0 = 0,
47 Af1 = 1,
49 Af2 = 2,
51 Af3 = 3,
53 Af4 = 4,
55 Af5 = 5,
57 Af6 = 6,
59 Af7 = 7,
61 Af8 = 8,
63 Af9 = 9,
65 Af10 = 10,
67 Af11 = 11,
69 Af12 = 12,
71 Af13 = 13,
73 Af14 = 14,
75 Af15 = 15,
77}
78impl From<AFSEL8_A> for u8 {
79 #[inline(always)]
80 fn from(variant: AFSEL8_A) -> Self {
81 variant as _
82 }
83}
84impl AFSEL8_R {
85 #[inline(always)]
87 pub fn variant(&self) -> AFSEL8_A {
88 match self.bits {
89 0 => AFSEL8_A::Af0,
90 1 => AFSEL8_A::Af1,
91 2 => AFSEL8_A::Af2,
92 3 => AFSEL8_A::Af3,
93 4 => AFSEL8_A::Af4,
94 5 => AFSEL8_A::Af5,
95 6 => AFSEL8_A::Af6,
96 7 => AFSEL8_A::Af7,
97 8 => AFSEL8_A::Af8,
98 9 => AFSEL8_A::Af9,
99 10 => AFSEL8_A::Af10,
100 11 => AFSEL8_A::Af11,
101 12 => AFSEL8_A::Af12,
102 13 => AFSEL8_A::Af13,
103 14 => AFSEL8_A::Af14,
104 15 => AFSEL8_A::Af15,
105 _ => unreachable!(),
106 }
107 }
108 #[inline(always)]
110 pub fn is_af0(&self) -> bool {
111 *self == AFSEL8_A::Af0
112 }
113 #[inline(always)]
115 pub fn is_af1(&self) -> bool {
116 *self == AFSEL8_A::Af1
117 }
118 #[inline(always)]
120 pub fn is_af2(&self) -> bool {
121 *self == AFSEL8_A::Af2
122 }
123 #[inline(always)]
125 pub fn is_af3(&self) -> bool {
126 *self == AFSEL8_A::Af3
127 }
128 #[inline(always)]
130 pub fn is_af4(&self) -> bool {
131 *self == AFSEL8_A::Af4
132 }
133 #[inline(always)]
135 pub fn is_af5(&self) -> bool {
136 *self == AFSEL8_A::Af5
137 }
138 #[inline(always)]
140 pub fn is_af6(&self) -> bool {
141 *self == AFSEL8_A::Af6
142 }
143 #[inline(always)]
145 pub fn is_af7(&self) -> bool {
146 *self == AFSEL8_A::Af7
147 }
148 #[inline(always)]
150 pub fn is_af8(&self) -> bool {
151 *self == AFSEL8_A::Af8
152 }
153 #[inline(always)]
155 pub fn is_af9(&self) -> bool {
156 *self == AFSEL8_A::Af9
157 }
158 #[inline(always)]
160 pub fn is_af10(&self) -> bool {
161 *self == AFSEL8_A::Af10
162 }
163 #[inline(always)]
165 pub fn is_af11(&self) -> bool {
166 *self == AFSEL8_A::Af11
167 }
168 #[inline(always)]
170 pub fn is_af12(&self) -> bool {
171 *self == AFSEL8_A::Af12
172 }
173 #[inline(always)]
175 pub fn is_af13(&self) -> bool {
176 *self == AFSEL8_A::Af13
177 }
178 #[inline(always)]
180 pub fn is_af14(&self) -> bool {
181 *self == AFSEL8_A::Af14
182 }
183 #[inline(always)]
185 pub fn is_af15(&self) -> bool {
186 *self == AFSEL8_A::Af15
187 }
188}
189pub type AFSEL8_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, AFRH_SPEC, u8, AFSEL8_A, 4, O>;
191impl<'a, const O: u8> AFSEL8_W<'a, O> {
192 #[inline(always)]
194 pub fn af0(self) -> &'a mut W {
195 self.variant(AFSEL8_A::Af0)
196 }
197 #[inline(always)]
199 pub fn af1(self) -> &'a mut W {
200 self.variant(AFSEL8_A::Af1)
201 }
202 #[inline(always)]
204 pub fn af2(self) -> &'a mut W {
205 self.variant(AFSEL8_A::Af2)
206 }
207 #[inline(always)]
209 pub fn af3(self) -> &'a mut W {
210 self.variant(AFSEL8_A::Af3)
211 }
212 #[inline(always)]
214 pub fn af4(self) -> &'a mut W {
215 self.variant(AFSEL8_A::Af4)
216 }
217 #[inline(always)]
219 pub fn af5(self) -> &'a mut W {
220 self.variant(AFSEL8_A::Af5)
221 }
222 #[inline(always)]
224 pub fn af6(self) -> &'a mut W {
225 self.variant(AFSEL8_A::Af6)
226 }
227 #[inline(always)]
229 pub fn af7(self) -> &'a mut W {
230 self.variant(AFSEL8_A::Af7)
231 }
232 #[inline(always)]
234 pub fn af8(self) -> &'a mut W {
235 self.variant(AFSEL8_A::Af8)
236 }
237 #[inline(always)]
239 pub fn af9(self) -> &'a mut W {
240 self.variant(AFSEL8_A::Af9)
241 }
242 #[inline(always)]
244 pub fn af10(self) -> &'a mut W {
245 self.variant(AFSEL8_A::Af10)
246 }
247 #[inline(always)]
249 pub fn af11(self) -> &'a mut W {
250 self.variant(AFSEL8_A::Af11)
251 }
252 #[inline(always)]
254 pub fn af12(self) -> &'a mut W {
255 self.variant(AFSEL8_A::Af12)
256 }
257 #[inline(always)]
259 pub fn af13(self) -> &'a mut W {
260 self.variant(AFSEL8_A::Af13)
261 }
262 #[inline(always)]
264 pub fn af14(self) -> &'a mut W {
265 self.variant(AFSEL8_A::Af14)
266 }
267 #[inline(always)]
269 pub fn af15(self) -> &'a mut W {
270 self.variant(AFSEL8_A::Af15)
271 }
272}
273pub use AFSEL8_R as AFSEL9_R;
275pub use AFSEL8_R as AFSEL10_R;
277pub use AFSEL8_R as AFSEL11_R;
279pub use AFSEL8_R as AFSEL12_R;
281pub use AFSEL8_R as AFSEL13_R;
283pub use AFSEL8_R as AFSEL14_R;
285pub use AFSEL8_R as AFSEL15_R;
287pub use AFSEL8_W as AFSEL9_W;
289pub use AFSEL8_W as AFSEL10_W;
291pub use AFSEL8_W as AFSEL11_W;
293pub use AFSEL8_W as AFSEL12_W;
295pub use AFSEL8_W as AFSEL13_W;
297pub use AFSEL8_W as AFSEL14_W;
299pub use AFSEL8_W as AFSEL15_W;
301impl R {
302 #[inline(always)]
304 pub fn afsel8(&self) -> AFSEL8_R {
305 AFSEL8_R::new((self.bits & 0x0f) as u8)
306 }
307 #[inline(always)]
309 pub fn afsel9(&self) -> AFSEL9_R {
310 AFSEL9_R::new(((self.bits >> 4) & 0x0f) as u8)
311 }
312 #[inline(always)]
314 pub fn afsel10(&self) -> AFSEL10_R {
315 AFSEL10_R::new(((self.bits >> 8) & 0x0f) as u8)
316 }
317 #[inline(always)]
319 pub fn afsel11(&self) -> AFSEL11_R {
320 AFSEL11_R::new(((self.bits >> 12) & 0x0f) as u8)
321 }
322 #[inline(always)]
324 pub fn afsel12(&self) -> AFSEL12_R {
325 AFSEL12_R::new(((self.bits >> 16) & 0x0f) as u8)
326 }
327 #[inline(always)]
329 pub fn afsel13(&self) -> AFSEL13_R {
330 AFSEL13_R::new(((self.bits >> 20) & 0x0f) as u8)
331 }
332 #[inline(always)]
334 pub fn afsel14(&self) -> AFSEL14_R {
335 AFSEL14_R::new(((self.bits >> 24) & 0x0f) as u8)
336 }
337 #[inline(always)]
339 pub fn afsel15(&self) -> AFSEL15_R {
340 AFSEL15_R::new(((self.bits >> 28) & 0x0f) as u8)
341 }
342}
343impl W {
344 #[inline(always)]
346 #[must_use]
347 pub fn afsel8(&mut self) -> AFSEL8_W<0> {
348 AFSEL8_W::new(self)
349 }
350 #[inline(always)]
352 #[must_use]
353 pub fn afsel9(&mut self) -> AFSEL9_W<4> {
354 AFSEL9_W::new(self)
355 }
356 #[inline(always)]
358 #[must_use]
359 pub fn afsel10(&mut self) -> AFSEL10_W<8> {
360 AFSEL10_W::new(self)
361 }
362 #[inline(always)]
364 #[must_use]
365 pub fn afsel11(&mut self) -> AFSEL11_W<12> {
366 AFSEL11_W::new(self)
367 }
368 #[inline(always)]
370 #[must_use]
371 pub fn afsel12(&mut self) -> AFSEL12_W<16> {
372 AFSEL12_W::new(self)
373 }
374 #[inline(always)]
376 #[must_use]
377 pub fn afsel13(&mut self) -> AFSEL13_W<20> {
378 AFSEL13_W::new(self)
379 }
380 #[inline(always)]
382 #[must_use]
383 pub fn afsel14(&mut self) -> AFSEL14_W<24> {
384 AFSEL14_W::new(self)
385 }
386 #[inline(always)]
388 #[must_use]
389 pub fn afsel15(&mut self) -> AFSEL15_W<28> {
390 AFSEL15_W::new(self)
391 }
392 #[inline(always)]
394 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
395 self.0.bits(bits);
396 self
397 }
398}
399pub struct AFRH_SPEC;
405impl crate::RegisterSpec for AFRH_SPEC {
406 type Ux = u32;
407}
408impl crate::Readable for AFRH_SPEC {
410 type Reader = R;
411}
412impl crate::Writable for AFRH_SPEC {
414 type Writer = W;
415 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
416 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
417}
418impl crate::Resettable for AFRH_SPEC {
420 const RESET_VALUE: Self::Ux = 0;
421}