1#[doc = "Register `PIO2_11` reader"]
2pub struct R(crate::R<PIO2_11_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<PIO2_11_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<PIO2_11_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<PIO2_11_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `PIO2_11` writer"]
17pub struct W(crate::W<PIO2_11_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<PIO2_11_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<PIO2_11_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<PIO2_11_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `FSEL` reader - Function Selector (Digital Function)"]
38pub type FSEL_R = crate::FieldReader<u8, FSEL_A>;
39#[doc = "Function Selector (Digital Function)\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41#[repr(u8)]
42pub enum FSEL_A {
43 #[doc = "0: Function 0"]
44 FSEL_0 = 0,
45 #[doc = "1: Function 1"]
46 FSEL_1 = 1,
47 #[doc = "2: Function 2"]
48 FSEL_2 = 2,
49 #[doc = "3: Function 3"]
50 FSEL_3 = 3,
51 #[doc = "4: Function 4"]
52 FSEL_4 = 4,
53 #[doc = "5: Function 5"]
54 FSEL_5 = 5,
55 #[doc = "6: Function 6"]
56 FSEL_6 = 6,
57 #[doc = "7: Function 7"]
58 FSEL_7 = 7,
59 #[doc = "8: Function 8"]
60 FSEL_8 = 8,
61 #[doc = "9: Function 9"]
62 FSEL_9 = 9,
63 #[doc = "10: Function 10"]
64 FSEL_10 = 10,
65 #[doc = "11: Function 11"]
66 FSEL_11 = 11,
67 #[doc = "12: Function 12"]
68 FSEL_12 = 12,
69 #[doc = "13: Function 13"]
70 FSEL_13 = 13,
71 #[doc = "14: Function 14"]
72 FSEL_14 = 14,
73 #[doc = "15: Function 15"]
74 FSEL_15 = 15,
75}
76impl From<FSEL_A> for u8 {
77 #[inline(always)]
78 fn from(variant: FSEL_A) -> Self {
79 variant as _
80 }
81}
82impl FSEL_R {
83 #[doc = "Get enumerated values variant"]
84 #[inline(always)]
85 pub fn variant(&self) -> FSEL_A {
86 match self.bits {
87 0 => FSEL_A::FSEL_0,
88 1 => FSEL_A::FSEL_1,
89 2 => FSEL_A::FSEL_2,
90 3 => FSEL_A::FSEL_3,
91 4 => FSEL_A::FSEL_4,
92 5 => FSEL_A::FSEL_5,
93 6 => FSEL_A::FSEL_6,
94 7 => FSEL_A::FSEL_7,
95 8 => FSEL_A::FSEL_8,
96 9 => FSEL_A::FSEL_9,
97 10 => FSEL_A::FSEL_10,
98 11 => FSEL_A::FSEL_11,
99 12 => FSEL_A::FSEL_12,
100 13 => FSEL_A::FSEL_13,
101 14 => FSEL_A::FSEL_14,
102 15 => FSEL_A::FSEL_15,
103 _ => unreachable!(),
104 }
105 }
106 #[doc = "Checks if the value of the field is `FSEL_0`"]
107 #[inline(always)]
108 pub fn is_fsel_0(&self) -> bool {
109 *self == FSEL_A::FSEL_0
110 }
111 #[doc = "Checks if the value of the field is `FSEL_1`"]
112 #[inline(always)]
113 pub fn is_fsel_1(&self) -> bool {
114 *self == FSEL_A::FSEL_1
115 }
116 #[doc = "Checks if the value of the field is `FSEL_2`"]
117 #[inline(always)]
118 pub fn is_fsel_2(&self) -> bool {
119 *self == FSEL_A::FSEL_2
120 }
121 #[doc = "Checks if the value of the field is `FSEL_3`"]
122 #[inline(always)]
123 pub fn is_fsel_3(&self) -> bool {
124 *self == FSEL_A::FSEL_3
125 }
126 #[doc = "Checks if the value of the field is `FSEL_4`"]
127 #[inline(always)]
128 pub fn is_fsel_4(&self) -> bool {
129 *self == FSEL_A::FSEL_4
130 }
131 #[doc = "Checks if the value of the field is `FSEL_5`"]
132 #[inline(always)]
133 pub fn is_fsel_5(&self) -> bool {
134 *self == FSEL_A::FSEL_5
135 }
136 #[doc = "Checks if the value of the field is `FSEL_6`"]
137 #[inline(always)]
138 pub fn is_fsel_6(&self) -> bool {
139 *self == FSEL_A::FSEL_6
140 }
141 #[doc = "Checks if the value of the field is `FSEL_7`"]
142 #[inline(always)]
143 pub fn is_fsel_7(&self) -> bool {
144 *self == FSEL_A::FSEL_7
145 }
146 #[doc = "Checks if the value of the field is `FSEL_8`"]
147 #[inline(always)]
148 pub fn is_fsel_8(&self) -> bool {
149 *self == FSEL_A::FSEL_8
150 }
151 #[doc = "Checks if the value of the field is `FSEL_9`"]
152 #[inline(always)]
153 pub fn is_fsel_9(&self) -> bool {
154 *self == FSEL_A::FSEL_9
155 }
156 #[doc = "Checks if the value of the field is `FSEL_10`"]
157 #[inline(always)]
158 pub fn is_fsel_10(&self) -> bool {
159 *self == FSEL_A::FSEL_10
160 }
161 #[doc = "Checks if the value of the field is `FSEL_11`"]
162 #[inline(always)]
163 pub fn is_fsel_11(&self) -> bool {
164 *self == FSEL_A::FSEL_11
165 }
166 #[doc = "Checks if the value of the field is `FSEL_12`"]
167 #[inline(always)]
168 pub fn is_fsel_12(&self) -> bool {
169 *self == FSEL_A::FSEL_12
170 }
171 #[doc = "Checks if the value of the field is `FSEL_13`"]
172 #[inline(always)]
173 pub fn is_fsel_13(&self) -> bool {
174 *self == FSEL_A::FSEL_13
175 }
176 #[doc = "Checks if the value of the field is `FSEL_14`"]
177 #[inline(always)]
178 pub fn is_fsel_14(&self) -> bool {
179 *self == FSEL_A::FSEL_14
180 }
181 #[doc = "Checks if the value of the field is `FSEL_15`"]
182 #[inline(always)]
183 pub fn is_fsel_15(&self) -> bool {
184 *self == FSEL_A::FSEL_15
185 }
186}
187#[doc = "Field `FSEL` writer - Function Selector (Digital Function)"]
188pub type FSEL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, PIO2_11_SPEC, u8, FSEL_A, 4, O>;
189impl<'a, const O: u8> FSEL_W<'a, O> {
190 #[doc = "Function 0"]
191 #[inline(always)]
192 pub fn fsel_0(self) -> &'a mut W {
193 self.variant(FSEL_A::FSEL_0)
194 }
195 #[doc = "Function 1"]
196 #[inline(always)]
197 pub fn fsel_1(self) -> &'a mut W {
198 self.variant(FSEL_A::FSEL_1)
199 }
200 #[doc = "Function 2"]
201 #[inline(always)]
202 pub fn fsel_2(self) -> &'a mut W {
203 self.variant(FSEL_A::FSEL_2)
204 }
205 #[doc = "Function 3"]
206 #[inline(always)]
207 pub fn fsel_3(self) -> &'a mut W {
208 self.variant(FSEL_A::FSEL_3)
209 }
210 #[doc = "Function 4"]
211 #[inline(always)]
212 pub fn fsel_4(self) -> &'a mut W {
213 self.variant(FSEL_A::FSEL_4)
214 }
215 #[doc = "Function 5"]
216 #[inline(always)]
217 pub fn fsel_5(self) -> &'a mut W {
218 self.variant(FSEL_A::FSEL_5)
219 }
220 #[doc = "Function 6"]
221 #[inline(always)]
222 pub fn fsel_6(self) -> &'a mut W {
223 self.variant(FSEL_A::FSEL_6)
224 }
225 #[doc = "Function 7"]
226 #[inline(always)]
227 pub fn fsel_7(self) -> &'a mut W {
228 self.variant(FSEL_A::FSEL_7)
229 }
230 #[doc = "Function 8"]
231 #[inline(always)]
232 pub fn fsel_8(self) -> &'a mut W {
233 self.variant(FSEL_A::FSEL_8)
234 }
235 #[doc = "Function 9"]
236 #[inline(always)]
237 pub fn fsel_9(self) -> &'a mut W {
238 self.variant(FSEL_A::FSEL_9)
239 }
240 #[doc = "Function 10"]
241 #[inline(always)]
242 pub fn fsel_10(self) -> &'a mut W {
243 self.variant(FSEL_A::FSEL_10)
244 }
245 #[doc = "Function 11"]
246 #[inline(always)]
247 pub fn fsel_11(self) -> &'a mut W {
248 self.variant(FSEL_A::FSEL_11)
249 }
250 #[doc = "Function 12"]
251 #[inline(always)]
252 pub fn fsel_12(self) -> &'a mut W {
253 self.variant(FSEL_A::FSEL_12)
254 }
255 #[doc = "Function 13"]
256 #[inline(always)]
257 pub fn fsel_13(self) -> &'a mut W {
258 self.variant(FSEL_A::FSEL_13)
259 }
260 #[doc = "Function 14"]
261 #[inline(always)]
262 pub fn fsel_14(self) -> &'a mut W {
263 self.variant(FSEL_A::FSEL_14)
264 }
265 #[doc = "Function 15"]
266 #[inline(always)]
267 pub fn fsel_15(self) -> &'a mut W {
268 self.variant(FSEL_A::FSEL_15)
269 }
270}
271#[doc = "Field `PUPDENA` reader - Pullup / Pulldown Enable"]
272pub type PUPDENA_R = crate::BitReader<PUPDENA_A>;
273#[doc = "Pullup / Pulldown Enable\n\nValue on reset: 0"]
274#[derive(Clone, Copy, Debug, PartialEq, Eq)]
275pub enum PUPDENA_A {
276 #[doc = "0: Disable"]
277 PUPDENA_0 = 0,
278 #[doc = "1: Enable"]
279 PUPDENA_1 = 1,
280}
281impl From<PUPDENA_A> for bool {
282 #[inline(always)]
283 fn from(variant: PUPDENA_A) -> Self {
284 variant as u8 != 0
285 }
286}
287impl PUPDENA_R {
288 #[doc = "Get enumerated values variant"]
289 #[inline(always)]
290 pub fn variant(&self) -> PUPDENA_A {
291 match self.bits {
292 false => PUPDENA_A::PUPDENA_0,
293 true => PUPDENA_A::PUPDENA_1,
294 }
295 }
296 #[doc = "Checks if the value of the field is `PUPDENA_0`"]
297 #[inline(always)]
298 pub fn is_pupdena_0(&self) -> bool {
299 *self == PUPDENA_A::PUPDENA_0
300 }
301 #[doc = "Checks if the value of the field is `PUPDENA_1`"]
302 #[inline(always)]
303 pub fn is_pupdena_1(&self) -> bool {
304 *self == PUPDENA_A::PUPDENA_1
305 }
306}
307#[doc = "Field `PUPDENA` writer - Pullup / Pulldown Enable"]
308pub type PUPDENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, PIO2_11_SPEC, PUPDENA_A, O>;
309impl<'a, const O: u8> PUPDENA_W<'a, O> {
310 #[doc = "Disable"]
311 #[inline(always)]
312 pub fn pupdena_0(self) -> &'a mut W {
313 self.variant(PUPDENA_A::PUPDENA_0)
314 }
315 #[doc = "Enable"]
316 #[inline(always)]
317 pub fn pupdena_1(self) -> &'a mut W {
318 self.variant(PUPDENA_A::PUPDENA_1)
319 }
320}
321#[doc = "Field `PUPDSEL` reader - Pullup or Pulldown Selector"]
322pub type PUPDSEL_R = crate::BitReader<PUPDSEL_A>;
323#[doc = "Pullup or Pulldown Selector\n\nValue on reset: 0"]
324#[derive(Clone, Copy, Debug, PartialEq, Eq)]
325pub enum PUPDSEL_A {
326 #[doc = "0: Pull-down"]
327 PUPDSEL_0 = 0,
328 #[doc = "1: Pull-up"]
329 PUPDSEL_1 = 1,
330}
331impl From<PUPDSEL_A> for bool {
332 #[inline(always)]
333 fn from(variant: PUPDSEL_A) -> Self {
334 variant as u8 != 0
335 }
336}
337impl PUPDSEL_R {
338 #[doc = "Get enumerated values variant"]
339 #[inline(always)]
340 pub fn variant(&self) -> PUPDSEL_A {
341 match self.bits {
342 false => PUPDSEL_A::PUPDSEL_0,
343 true => PUPDSEL_A::PUPDSEL_1,
344 }
345 }
346 #[doc = "Checks if the value of the field is `PUPDSEL_0`"]
347 #[inline(always)]
348 pub fn is_pupdsel_0(&self) -> bool {
349 *self == PUPDSEL_A::PUPDSEL_0
350 }
351 #[doc = "Checks if the value of the field is `PUPDSEL_1`"]
352 #[inline(always)]
353 pub fn is_pupdsel_1(&self) -> bool {
354 *self == PUPDSEL_A::PUPDSEL_1
355 }
356}
357#[doc = "Field `PUPDSEL` writer - Pullup or Pulldown Selector"]
358pub type PUPDSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PIO2_11_SPEC, PUPDSEL_A, O>;
359impl<'a, const O: u8> PUPDSEL_W<'a, O> {
360 #[doc = "Pull-down"]
361 #[inline(always)]
362 pub fn pupdsel_0(self) -> &'a mut W {
363 self.variant(PUPDSEL_A::PUPDSEL_0)
364 }
365 #[doc = "Pull-up"]
366 #[inline(always)]
367 pub fn pupdsel_1(self) -> &'a mut W {
368 self.variant(PUPDSEL_A::PUPDSEL_1)
369 }
370}
371#[doc = "Field `IBENA` reader - Input Buffer Enable"]
372pub type IBENA_R = crate::BitReader<IBENA_A>;
373#[doc = "Input Buffer Enable\n\nValue on reset: 0"]
374#[derive(Clone, Copy, Debug, PartialEq, Eq)]
375pub enum IBENA_A {
376 #[doc = "0: Input buffer disabled"]
377 IBENA_0 = 0,
378 #[doc = "1: Input buffer enabled"]
379 IBENA_1 = 1,
380}
381impl From<IBENA_A> for bool {
382 #[inline(always)]
383 fn from(variant: IBENA_A) -> Self {
384 variant as u8 != 0
385 }
386}
387impl IBENA_R {
388 #[doc = "Get enumerated values variant"]
389 #[inline(always)]
390 pub fn variant(&self) -> IBENA_A {
391 match self.bits {
392 false => IBENA_A::IBENA_0,
393 true => IBENA_A::IBENA_1,
394 }
395 }
396 #[doc = "Checks if the value of the field is `IBENA_0`"]
397 #[inline(always)]
398 pub fn is_ibena_0(&self) -> bool {
399 *self == IBENA_A::IBENA_0
400 }
401 #[doc = "Checks if the value of the field is `IBENA_1`"]
402 #[inline(always)]
403 pub fn is_ibena_1(&self) -> bool {
404 *self == IBENA_A::IBENA_1
405 }
406}
407#[doc = "Field `IBENA` writer - Input Buffer Enable"]
408pub type IBENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, PIO2_11_SPEC, IBENA_A, O>;
409impl<'a, const O: u8> IBENA_W<'a, O> {
410 #[doc = "Input buffer disabled"]
411 #[inline(always)]
412 pub fn ibena_0(self) -> &'a mut W {
413 self.variant(IBENA_A::IBENA_0)
414 }
415 #[doc = "Input buffer enabled"]
416 #[inline(always)]
417 pub fn ibena_1(self) -> &'a mut W {
418 self.variant(IBENA_A::IBENA_1)
419 }
420}
421#[doc = "Field `SLEWRATE` reader - Slew Rate Control"]
422pub type SLEWRATE_R = crate::BitReader<SLEWRATE_A>;
423#[doc = "Slew Rate Control\n\nValue on reset: 0"]
424#[derive(Clone, Copy, Debug, PartialEq, Eq)]
425pub enum SLEWRATE_A {
426 #[doc = "0: Standard mode, output slew rate is not controlled."]
427 SLEWRATE_0 = 0,
428 #[doc = "1: Slow mode, output slew rate control is enabled, limiting the output rate change and maximum toggle frequency. See device datasheet for details."]
429 SLEWRATE_1 = 1,
430}
431impl From<SLEWRATE_A> for bool {
432 #[inline(always)]
433 fn from(variant: SLEWRATE_A) -> Self {
434 variant as u8 != 0
435 }
436}
437impl SLEWRATE_R {
438 #[doc = "Get enumerated values variant"]
439 #[inline(always)]
440 pub fn variant(&self) -> SLEWRATE_A {
441 match self.bits {
442 false => SLEWRATE_A::SLEWRATE_0,
443 true => SLEWRATE_A::SLEWRATE_1,
444 }
445 }
446 #[doc = "Checks if the value of the field is `SLEWRATE_0`"]
447 #[inline(always)]
448 pub fn is_slewrate_0(&self) -> bool {
449 *self == SLEWRATE_A::SLEWRATE_0
450 }
451 #[doc = "Checks if the value of the field is `SLEWRATE_1`"]
452 #[inline(always)]
453 pub fn is_slewrate_1(&self) -> bool {
454 *self == SLEWRATE_A::SLEWRATE_1
455 }
456}
457#[doc = "Field `SLEWRATE` writer - Slew Rate Control"]
458pub type SLEWRATE_W<'a, const O: u8> = crate::BitWriter<'a, u32, PIO2_11_SPEC, SLEWRATE_A, O>;
459impl<'a, const O: u8> SLEWRATE_W<'a, O> {
460 #[doc = "Standard mode, output slew rate is not controlled."]
461 #[inline(always)]
462 pub fn slewrate_0(self) -> &'a mut W {
463 self.variant(SLEWRATE_A::SLEWRATE_0)
464 }
465 #[doc = "Slow mode, output slew rate control is enabled, limiting the output rate change and maximum toggle frequency. See device datasheet for details."]
466 #[inline(always)]
467 pub fn slewrate_1(self) -> &'a mut W {
468 self.variant(SLEWRATE_A::SLEWRATE_1)
469 }
470}
471#[doc = "Field `FULLDRIVE` reader - Drive Selector"]
472pub type FULLDRIVE_R = crate::BitReader<FULLDRIVE_A>;
473#[doc = "Drive Selector\n\nValue on reset: 0"]
474#[derive(Clone, Copy, Debug, PartialEq, Eq)]
475pub enum FULLDRIVE_A {
476 #[doc = "0: Normal output drive"]
477 FULLDRIVE_0 = 0,
478 #[doc = "1: Full output drive, twice the drive of normal mode."]
479 FULLDRIVE_1 = 1,
480}
481impl From<FULLDRIVE_A> for bool {
482 #[inline(always)]
483 fn from(variant: FULLDRIVE_A) -> Self {
484 variant as u8 != 0
485 }
486}
487impl FULLDRIVE_R {
488 #[doc = "Get enumerated values variant"]
489 #[inline(always)]
490 pub fn variant(&self) -> FULLDRIVE_A {
491 match self.bits {
492 false => FULLDRIVE_A::FULLDRIVE_0,
493 true => FULLDRIVE_A::FULLDRIVE_1,
494 }
495 }
496 #[doc = "Checks if the value of the field is `FULLDRIVE_0`"]
497 #[inline(always)]
498 pub fn is_fulldrive_0(&self) -> bool {
499 *self == FULLDRIVE_A::FULLDRIVE_0
500 }
501 #[doc = "Checks if the value of the field is `FULLDRIVE_1`"]
502 #[inline(always)]
503 pub fn is_fulldrive_1(&self) -> bool {
504 *self == FULLDRIVE_A::FULLDRIVE_1
505 }
506}
507#[doc = "Field `FULLDRIVE` writer - Drive Selector"]
508pub type FULLDRIVE_W<'a, const O: u8> = crate::BitWriter<'a, u32, PIO2_11_SPEC, FULLDRIVE_A, O>;
509impl<'a, const O: u8> FULLDRIVE_W<'a, O> {
510 #[doc = "Normal output drive"]
511 #[inline(always)]
512 pub fn fulldrive_0(self) -> &'a mut W {
513 self.variant(FULLDRIVE_A::FULLDRIVE_0)
514 }
515 #[doc = "Full output drive, twice the drive of normal mode."]
516 #[inline(always)]
517 pub fn fulldrive_1(self) -> &'a mut W {
518 self.variant(FULLDRIVE_A::FULLDRIVE_1)
519 }
520}
521#[doc = "Field `AMENA` reader - Analog Mux Enable"]
522pub type AMENA_R = crate::BitReader<AMENA_A>;
523#[doc = "Analog Mux Enable\n\nValue on reset: 0"]
524#[derive(Clone, Copy, Debug, PartialEq, Eq)]
525pub enum AMENA_A {
526 #[doc = "0: Analog multiplexor disabled, required for digital pin function"]
527 AMENA_0 = 0,
528 #[doc = "1: Analog multiplexor enabled, required for analog pin function"]
529 AMENA_1 = 1,
530}
531impl From<AMENA_A> for bool {
532 #[inline(always)]
533 fn from(variant: AMENA_A) -> Self {
534 variant as u8 != 0
535 }
536}
537impl AMENA_R {
538 #[doc = "Get enumerated values variant"]
539 #[inline(always)]
540 pub fn variant(&self) -> AMENA_A {
541 match self.bits {
542 false => AMENA_A::AMENA_0,
543 true => AMENA_A::AMENA_1,
544 }
545 }
546 #[doc = "Checks if the value of the field is `AMENA_0`"]
547 #[inline(always)]
548 pub fn is_amena_0(&self) -> bool {
549 *self == AMENA_A::AMENA_0
550 }
551 #[doc = "Checks if the value of the field is `AMENA_1`"]
552 #[inline(always)]
553 pub fn is_amena_1(&self) -> bool {
554 *self == AMENA_A::AMENA_1
555 }
556}
557#[doc = "Field `AMENA` writer - Analog Mux Enable"]
558pub type AMENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, PIO2_11_SPEC, AMENA_A, O>;
559impl<'a, const O: u8> AMENA_W<'a, O> {
560 #[doc = "Analog multiplexor disabled, required for digital pin function"]
561 #[inline(always)]
562 pub fn amena_0(self) -> &'a mut W {
563 self.variant(AMENA_A::AMENA_0)
564 }
565 #[doc = "Analog multiplexor enabled, required for analog pin function"]
566 #[inline(always)]
567 pub fn amena_1(self) -> &'a mut W {
568 self.variant(AMENA_A::AMENA_1)
569 }
570}
571#[doc = "Field `ODENA` reader - Open-drain mode enable"]
572pub type ODENA_R = crate::BitReader<ODENA_A>;
573#[doc = "Open-drain mode enable\n\nValue on reset: 0"]
574#[derive(Clone, Copy, Debug, PartialEq, Eq)]
575pub enum ODENA_A {
576 #[doc = "0: Normal push-pull output"]
577 ODENA_0 = 0,
578 #[doc = "1: Pseudo open-drain output (high drive disabled)"]
579 ODENA_1 = 1,
580}
581impl From<ODENA_A> for bool {
582 #[inline(always)]
583 fn from(variant: ODENA_A) -> Self {
584 variant as u8 != 0
585 }
586}
587impl ODENA_R {
588 #[doc = "Get enumerated values variant"]
589 #[inline(always)]
590 pub fn variant(&self) -> ODENA_A {
591 match self.bits {
592 false => ODENA_A::ODENA_0,
593 true => ODENA_A::ODENA_1,
594 }
595 }
596 #[doc = "Checks if the value of the field is `ODENA_0`"]
597 #[inline(always)]
598 pub fn is_odena_0(&self) -> bool {
599 *self == ODENA_A::ODENA_0
600 }
601 #[doc = "Checks if the value of the field is `ODENA_1`"]
602 #[inline(always)]
603 pub fn is_odena_1(&self) -> bool {
604 *self == ODENA_A::ODENA_1
605 }
606}
607#[doc = "Field `ODENA` writer - Open-drain mode enable"]
608pub type ODENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, PIO2_11_SPEC, ODENA_A, O>;
609impl<'a, const O: u8> ODENA_W<'a, O> {
610 #[doc = "Normal push-pull output"]
611 #[inline(always)]
612 pub fn odena_0(self) -> &'a mut W {
613 self.variant(ODENA_A::ODENA_0)
614 }
615 #[doc = "Pseudo open-drain output (high drive disabled)"]
616 #[inline(always)]
617 pub fn odena_1(self) -> &'a mut W {
618 self.variant(ODENA_A::ODENA_1)
619 }
620}
621#[doc = "Field `IIENA` reader - Input Invert Enable"]
622pub type IIENA_R = crate::BitReader<IIENA_A>;
623#[doc = "Input Invert Enable\n\nValue on reset: 0"]
624#[derive(Clone, Copy, Debug, PartialEq, Eq)]
625pub enum IIENA_A {
626 #[doc = "0: Disabled, Input function is not inverted"]
627 IIENA_0 = 0,
628 #[doc = "1: Enabled, Input is function inverted"]
629 IIENA_1 = 1,
630}
631impl From<IIENA_A> for bool {
632 #[inline(always)]
633 fn from(variant: IIENA_A) -> Self {
634 variant as u8 != 0
635 }
636}
637impl IIENA_R {
638 #[doc = "Get enumerated values variant"]
639 #[inline(always)]
640 pub fn variant(&self) -> IIENA_A {
641 match self.bits {
642 false => IIENA_A::IIENA_0,
643 true => IIENA_A::IIENA_1,
644 }
645 }
646 #[doc = "Checks if the value of the field is `IIENA_0`"]
647 #[inline(always)]
648 pub fn is_iiena_0(&self) -> bool {
649 *self == IIENA_A::IIENA_0
650 }
651 #[doc = "Checks if the value of the field is `IIENA_1`"]
652 #[inline(always)]
653 pub fn is_iiena_1(&self) -> bool {
654 *self == IIENA_A::IIENA_1
655 }
656}
657#[doc = "Field `IIENA` writer - Input Invert Enable"]
658pub type IIENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, PIO2_11_SPEC, IIENA_A, O>;
659impl<'a, const O: u8> IIENA_W<'a, O> {
660 #[doc = "Disabled, Input function is not inverted"]
661 #[inline(always)]
662 pub fn iiena_0(self) -> &'a mut W {
663 self.variant(IIENA_A::IIENA_0)
664 }
665 #[doc = "Enabled, Input is function inverted"]
666 #[inline(always)]
667 pub fn iiena_1(self) -> &'a mut W {
668 self.variant(IIENA_A::IIENA_1)
669 }
670}
671impl R {
672 #[doc = "Bits 0:3 - Function Selector (Digital Function)"]
673 #[inline(always)]
674 pub fn fsel(&self) -> FSEL_R {
675 FSEL_R::new((self.bits & 0x0f) as u8)
676 }
677 #[doc = "Bit 4 - Pullup / Pulldown Enable"]
678 #[inline(always)]
679 pub fn pupdena(&self) -> PUPDENA_R {
680 PUPDENA_R::new(((self.bits >> 4) & 1) != 0)
681 }
682 #[doc = "Bit 5 - Pullup or Pulldown Selector"]
683 #[inline(always)]
684 pub fn pupdsel(&self) -> PUPDSEL_R {
685 PUPDSEL_R::new(((self.bits >> 5) & 1) != 0)
686 }
687 #[doc = "Bit 6 - Input Buffer Enable"]
688 #[inline(always)]
689 pub fn ibena(&self) -> IBENA_R {
690 IBENA_R::new(((self.bits >> 6) & 1) != 0)
691 }
692 #[doc = "Bit 7 - Slew Rate Control"]
693 #[inline(always)]
694 pub fn slewrate(&self) -> SLEWRATE_R {
695 SLEWRATE_R::new(((self.bits >> 7) & 1) != 0)
696 }
697 #[doc = "Bit 8 - Drive Selector"]
698 #[inline(always)]
699 pub fn fulldrive(&self) -> FULLDRIVE_R {
700 FULLDRIVE_R::new(((self.bits >> 8) & 1) != 0)
701 }
702 #[doc = "Bit 9 - Analog Mux Enable"]
703 #[inline(always)]
704 pub fn amena(&self) -> AMENA_R {
705 AMENA_R::new(((self.bits >> 9) & 1) != 0)
706 }
707 #[doc = "Bit 10 - Open-drain mode enable"]
708 #[inline(always)]
709 pub fn odena(&self) -> ODENA_R {
710 ODENA_R::new(((self.bits >> 10) & 1) != 0)
711 }
712 #[doc = "Bit 11 - Input Invert Enable"]
713 #[inline(always)]
714 pub fn iiena(&self) -> IIENA_R {
715 IIENA_R::new(((self.bits >> 11) & 1) != 0)
716 }
717}
718impl W {
719 #[doc = "Bits 0:3 - Function Selector (Digital Function)"]
720 #[inline(always)]
721 #[must_use]
722 pub fn fsel(&mut self) -> FSEL_W<0> {
723 FSEL_W::new(self)
724 }
725 #[doc = "Bit 4 - Pullup / Pulldown Enable"]
726 #[inline(always)]
727 #[must_use]
728 pub fn pupdena(&mut self) -> PUPDENA_W<4> {
729 PUPDENA_W::new(self)
730 }
731 #[doc = "Bit 5 - Pullup or Pulldown Selector"]
732 #[inline(always)]
733 #[must_use]
734 pub fn pupdsel(&mut self) -> PUPDSEL_W<5> {
735 PUPDSEL_W::new(self)
736 }
737 #[doc = "Bit 6 - Input Buffer Enable"]
738 #[inline(always)]
739 #[must_use]
740 pub fn ibena(&mut self) -> IBENA_W<6> {
741 IBENA_W::new(self)
742 }
743 #[doc = "Bit 7 - Slew Rate Control"]
744 #[inline(always)]
745 #[must_use]
746 pub fn slewrate(&mut self) -> SLEWRATE_W<7> {
747 SLEWRATE_W::new(self)
748 }
749 #[doc = "Bit 8 - Drive Selector"]
750 #[inline(always)]
751 #[must_use]
752 pub fn fulldrive(&mut self) -> FULLDRIVE_W<8> {
753 FULLDRIVE_W::new(self)
754 }
755 #[doc = "Bit 9 - Analog Mux Enable"]
756 #[inline(always)]
757 #[must_use]
758 pub fn amena(&mut self) -> AMENA_W<9> {
759 AMENA_W::new(self)
760 }
761 #[doc = "Bit 10 - Open-drain mode enable"]
762 #[inline(always)]
763 #[must_use]
764 pub fn odena(&mut self) -> ODENA_W<10> {
765 ODENA_W::new(self)
766 }
767 #[doc = "Bit 11 - Input Invert Enable"]
768 #[inline(always)]
769 #[must_use]
770 pub fn iiena(&mut self) -> IIENA_W<11> {
771 IIENA_W::new(self)
772 }
773 #[doc = "Writes raw bits to the register."]
774 #[inline(always)]
775 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
776 self.0.bits(bits);
777 self
778 }
779}
780#[doc = "IOPCTL configuration\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pio2_11](index.html) module"]
781pub struct PIO2_11_SPEC;
782impl crate::RegisterSpec for PIO2_11_SPEC {
783 type Ux = u32;
784}
785#[doc = "`read()` method returns [pio2_11::R](R) reader structure"]
786impl crate::Readable for PIO2_11_SPEC {
787 type Reader = R;
788}
789#[doc = "`write(|w| ..)` method takes [pio2_11::W](W) writer structure"]
790impl crate::Writable for PIO2_11_SPEC {
791 type Writer = W;
792 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
793 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
794}
795#[doc = "`reset()` method sets PIO2_11 to value 0"]
796impl crate::Resettable for PIO2_11_SPEC {
797 const RESET_VALUE: Self::Ux = 0;
798}