mimxrt685s_pac/iopctl/
pio0_21.rs

1#[doc = "Register `PIO0_21` reader"]
2pub type R = crate::R<Pio0_21Spec>;
3#[doc = "Register `PIO0_21` writer"]
4pub type W = crate::W<Pio0_21Spec>;
5#[doc = "Function Selector. . .(FSELs Sources can be found in the next several pages.)\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8#[repr(u8)]
9pub enum Fsel {
10    #[doc = "0: Function 0."]
11    Function0 = 0,
12    #[doc = "1: Function 1."]
13    Function1 = 1,
14    #[doc = "2: Function 2."]
15    Function2 = 2,
16    #[doc = "3: Function 3."]
17    Function3 = 3,
18    #[doc = "4: Function 4."]
19    Function4 = 4,
20    #[doc = "5: Function 5."]
21    Function5 = 5,
22    #[doc = "6: Function 6."]
23    Function6 = 6,
24    #[doc = "7: Function 7."]
25    Function7 = 7,
26    #[doc = "8: Function 8."]
27    Function8 = 8,
28    #[doc = "9: Function 9."]
29    Function9 = 9,
30    #[doc = "10: Function 10."]
31    Function10 = 10,
32    #[doc = "11: Function 11."]
33    Function11 = 11,
34    #[doc = "12: Function 12."]
35    Function12 = 12,
36    #[doc = "13: Function 13."]
37    Function13 = 13,
38    #[doc = "14: Function 14."]
39    Function14 = 14,
40    #[doc = "15: Function 15."]
41    Function15 = 15,
42}
43impl From<Fsel> for u8 {
44    #[inline(always)]
45    fn from(variant: Fsel) -> Self {
46        variant as _
47    }
48}
49impl crate::FieldSpec for Fsel {
50    type Ux = u8;
51}
52impl crate::IsEnum for Fsel {}
53#[doc = "Field `FSEL` reader - Function Selector. . .(FSELs Sources can be found in the next several pages.)"]
54pub type FselR = crate::FieldReader<Fsel>;
55impl FselR {
56    #[doc = "Get enumerated values variant"]
57    #[inline(always)]
58    pub const fn variant(&self) -> Fsel {
59        match self.bits {
60            0 => Fsel::Function0,
61            1 => Fsel::Function1,
62            2 => Fsel::Function2,
63            3 => Fsel::Function3,
64            4 => Fsel::Function4,
65            5 => Fsel::Function5,
66            6 => Fsel::Function6,
67            7 => Fsel::Function7,
68            8 => Fsel::Function8,
69            9 => Fsel::Function9,
70            10 => Fsel::Function10,
71            11 => Fsel::Function11,
72            12 => Fsel::Function12,
73            13 => Fsel::Function13,
74            14 => Fsel::Function14,
75            15 => Fsel::Function15,
76            _ => unreachable!(),
77        }
78    }
79    #[doc = "Function 0."]
80    #[inline(always)]
81    pub fn is_function_0(&self) -> bool {
82        *self == Fsel::Function0
83    }
84    #[doc = "Function 1."]
85    #[inline(always)]
86    pub fn is_function_1(&self) -> bool {
87        *self == Fsel::Function1
88    }
89    #[doc = "Function 2."]
90    #[inline(always)]
91    pub fn is_function_2(&self) -> bool {
92        *self == Fsel::Function2
93    }
94    #[doc = "Function 3."]
95    #[inline(always)]
96    pub fn is_function_3(&self) -> bool {
97        *self == Fsel::Function3
98    }
99    #[doc = "Function 4."]
100    #[inline(always)]
101    pub fn is_function_4(&self) -> bool {
102        *self == Fsel::Function4
103    }
104    #[doc = "Function 5."]
105    #[inline(always)]
106    pub fn is_function_5(&self) -> bool {
107        *self == Fsel::Function5
108    }
109    #[doc = "Function 6."]
110    #[inline(always)]
111    pub fn is_function_6(&self) -> bool {
112        *self == Fsel::Function6
113    }
114    #[doc = "Function 7."]
115    #[inline(always)]
116    pub fn is_function_7(&self) -> bool {
117        *self == Fsel::Function7
118    }
119    #[doc = "Function 8."]
120    #[inline(always)]
121    pub fn is_function_8(&self) -> bool {
122        *self == Fsel::Function8
123    }
124    #[doc = "Function 9."]
125    #[inline(always)]
126    pub fn is_function_9(&self) -> bool {
127        *self == Fsel::Function9
128    }
129    #[doc = "Function 10."]
130    #[inline(always)]
131    pub fn is_function_10(&self) -> bool {
132        *self == Fsel::Function10
133    }
134    #[doc = "Function 11."]
135    #[inline(always)]
136    pub fn is_function_11(&self) -> bool {
137        *self == Fsel::Function11
138    }
139    #[doc = "Function 12."]
140    #[inline(always)]
141    pub fn is_function_12(&self) -> bool {
142        *self == Fsel::Function12
143    }
144    #[doc = "Function 13."]
145    #[inline(always)]
146    pub fn is_function_13(&self) -> bool {
147        *self == Fsel::Function13
148    }
149    #[doc = "Function 14."]
150    #[inline(always)]
151    pub fn is_function_14(&self) -> bool {
152        *self == Fsel::Function14
153    }
154    #[doc = "Function 15."]
155    #[inline(always)]
156    pub fn is_function_15(&self) -> bool {
157        *self == Fsel::Function15
158    }
159}
160#[doc = "Field `FSEL` writer - Function Selector. . .(FSELs Sources can be found in the next several pages.)"]
161pub type FselW<'a, REG> = crate::FieldWriter<'a, REG, 4, Fsel, crate::Safe>;
162impl<'a, REG> FselW<'a, REG>
163where
164    REG: crate::Writable + crate::RegisterSpec,
165    REG::Ux: From<u8>,
166{
167    #[doc = "Function 0."]
168    #[inline(always)]
169    pub fn function_0(self) -> &'a mut crate::W<REG> {
170        self.variant(Fsel::Function0)
171    }
172    #[doc = "Function 1."]
173    #[inline(always)]
174    pub fn function_1(self) -> &'a mut crate::W<REG> {
175        self.variant(Fsel::Function1)
176    }
177    #[doc = "Function 2."]
178    #[inline(always)]
179    pub fn function_2(self) -> &'a mut crate::W<REG> {
180        self.variant(Fsel::Function2)
181    }
182    #[doc = "Function 3."]
183    #[inline(always)]
184    pub fn function_3(self) -> &'a mut crate::W<REG> {
185        self.variant(Fsel::Function3)
186    }
187    #[doc = "Function 4."]
188    #[inline(always)]
189    pub fn function_4(self) -> &'a mut crate::W<REG> {
190        self.variant(Fsel::Function4)
191    }
192    #[doc = "Function 5."]
193    #[inline(always)]
194    pub fn function_5(self) -> &'a mut crate::W<REG> {
195        self.variant(Fsel::Function5)
196    }
197    #[doc = "Function 6."]
198    #[inline(always)]
199    pub fn function_6(self) -> &'a mut crate::W<REG> {
200        self.variant(Fsel::Function6)
201    }
202    #[doc = "Function 7."]
203    #[inline(always)]
204    pub fn function_7(self) -> &'a mut crate::W<REG> {
205        self.variant(Fsel::Function7)
206    }
207    #[doc = "Function 8."]
208    #[inline(always)]
209    pub fn function_8(self) -> &'a mut crate::W<REG> {
210        self.variant(Fsel::Function8)
211    }
212    #[doc = "Function 9."]
213    #[inline(always)]
214    pub fn function_9(self) -> &'a mut crate::W<REG> {
215        self.variant(Fsel::Function9)
216    }
217    #[doc = "Function 10."]
218    #[inline(always)]
219    pub fn function_10(self) -> &'a mut crate::W<REG> {
220        self.variant(Fsel::Function10)
221    }
222    #[doc = "Function 11."]
223    #[inline(always)]
224    pub fn function_11(self) -> &'a mut crate::W<REG> {
225        self.variant(Fsel::Function11)
226    }
227    #[doc = "Function 12."]
228    #[inline(always)]
229    pub fn function_12(self) -> &'a mut crate::W<REG> {
230        self.variant(Fsel::Function12)
231    }
232    #[doc = "Function 13."]
233    #[inline(always)]
234    pub fn function_13(self) -> &'a mut crate::W<REG> {
235        self.variant(Fsel::Function13)
236    }
237    #[doc = "Function 14."]
238    #[inline(always)]
239    pub fn function_14(self) -> &'a mut crate::W<REG> {
240        self.variant(Fsel::Function14)
241    }
242    #[doc = "Function 15."]
243    #[inline(always)]
244    pub fn function_15(self) -> &'a mut crate::W<REG> {
245        self.variant(Fsel::Function15)
246    }
247}
248#[doc = "Pullup / Pulldown Enable. . .\n\nValue on reset: 0"]
249#[cfg_attr(feature = "defmt", derive(defmt::Format))]
250#[derive(Clone, Copy, Debug, PartialEq, Eq)]
251pub enum Pupdena {
252    #[doc = "0: Disable."]
253    Disabled = 0,
254    #[doc = "1: Enable."]
255    Enabled = 1,
256}
257impl From<Pupdena> for bool {
258    #[inline(always)]
259    fn from(variant: Pupdena) -> Self {
260        variant as u8 != 0
261    }
262}
263#[doc = "Field `PUPDENA` reader - Pullup / Pulldown Enable. . ."]
264pub type PupdenaR = crate::BitReader<Pupdena>;
265impl PupdenaR {
266    #[doc = "Get enumerated values variant"]
267    #[inline(always)]
268    pub const fn variant(&self) -> Pupdena {
269        match self.bits {
270            false => Pupdena::Disabled,
271            true => Pupdena::Enabled,
272        }
273    }
274    #[doc = "Disable."]
275    #[inline(always)]
276    pub fn is_disabled(&self) -> bool {
277        *self == Pupdena::Disabled
278    }
279    #[doc = "Enable."]
280    #[inline(always)]
281    pub fn is_enabled(&self) -> bool {
282        *self == Pupdena::Enabled
283    }
284}
285#[doc = "Field `PUPDENA` writer - Pullup / Pulldown Enable. . ."]
286pub type PupdenaW<'a, REG> = crate::BitWriter<'a, REG, Pupdena>;
287impl<'a, REG> PupdenaW<'a, REG>
288where
289    REG: crate::Writable + crate::RegisterSpec,
290{
291    #[doc = "Disable."]
292    #[inline(always)]
293    pub fn disabled(self) -> &'a mut crate::W<REG> {
294        self.variant(Pupdena::Disabled)
295    }
296    #[doc = "Enable."]
297    #[inline(always)]
298    pub fn enabled(self) -> &'a mut crate::W<REG> {
299        self.variant(Pupdena::Enabled)
300    }
301}
302#[doc = "Pullup or Pulldown Selector. . .\n\nValue on reset: 0"]
303#[cfg_attr(feature = "defmt", derive(defmt::Format))]
304#[derive(Clone, Copy, Debug, PartialEq, Eq)]
305pub enum Pupdsel {
306    #[doc = "0: Pull-down."]
307    PullDown = 0,
308    #[doc = "1: Pull-up."]
309    PullUp = 1,
310}
311impl From<Pupdsel> for bool {
312    #[inline(always)]
313    fn from(variant: Pupdsel) -> Self {
314        variant as u8 != 0
315    }
316}
317#[doc = "Field `PUPDSEL` reader - Pullup or Pulldown Selector. . ."]
318pub type PupdselR = crate::BitReader<Pupdsel>;
319impl PupdselR {
320    #[doc = "Get enumerated values variant"]
321    #[inline(always)]
322    pub const fn variant(&self) -> Pupdsel {
323        match self.bits {
324            false => Pupdsel::PullDown,
325            true => Pupdsel::PullUp,
326        }
327    }
328    #[doc = "Pull-down."]
329    #[inline(always)]
330    pub fn is_pull_down(&self) -> bool {
331        *self == Pupdsel::PullDown
332    }
333    #[doc = "Pull-up."]
334    #[inline(always)]
335    pub fn is_pull_up(&self) -> bool {
336        *self == Pupdsel::PullUp
337    }
338}
339#[doc = "Field `PUPDSEL` writer - Pullup or Pulldown Selector. . ."]
340pub type PupdselW<'a, REG> = crate::BitWriter<'a, REG, Pupdsel>;
341impl<'a, REG> PupdselW<'a, REG>
342where
343    REG: crate::Writable + crate::RegisterSpec,
344{
345    #[doc = "Pull-down."]
346    #[inline(always)]
347    pub fn pull_down(self) -> &'a mut crate::W<REG> {
348        self.variant(Pupdsel::PullDown)
349    }
350    #[doc = "Pull-up."]
351    #[inline(always)]
352    pub fn pull_up(self) -> &'a mut crate::W<REG> {
353        self.variant(Pupdsel::PullUp)
354    }
355}
356#[doc = "Input Buffer Enable. .\n\nValue on reset: 0"]
357#[cfg_attr(feature = "defmt", derive(defmt::Format))]
358#[derive(Clone, Copy, Debug, PartialEq, Eq)]
359pub enum Ibena {
360    #[doc = "0: Disable."]
361    Disabled = 0,
362    #[doc = "1: Enable."]
363    Enabled = 1,
364}
365impl From<Ibena> for bool {
366    #[inline(always)]
367    fn from(variant: Ibena) -> Self {
368        variant as u8 != 0
369    }
370}
371#[doc = "Field `IBENA` reader - Input Buffer Enable. ."]
372pub type IbenaR = crate::BitReader<Ibena>;
373impl IbenaR {
374    #[doc = "Get enumerated values variant"]
375    #[inline(always)]
376    pub const fn variant(&self) -> Ibena {
377        match self.bits {
378            false => Ibena::Disabled,
379            true => Ibena::Enabled,
380        }
381    }
382    #[doc = "Disable."]
383    #[inline(always)]
384    pub fn is_disabled(&self) -> bool {
385        *self == Ibena::Disabled
386    }
387    #[doc = "Enable."]
388    #[inline(always)]
389    pub fn is_enabled(&self) -> bool {
390        *self == Ibena::Enabled
391    }
392}
393#[doc = "Field `IBENA` writer - Input Buffer Enable. ."]
394pub type IbenaW<'a, REG> = crate::BitWriter<'a, REG, Ibena>;
395impl<'a, REG> IbenaW<'a, REG>
396where
397    REG: crate::Writable + crate::RegisterSpec,
398{
399    #[doc = "Disable."]
400    #[inline(always)]
401    pub fn disabled(self) -> &'a mut crate::W<REG> {
402        self.variant(Ibena::Disabled)
403    }
404    #[doc = "Enable."]
405    #[inline(always)]
406    pub fn enabled(self) -> &'a mut crate::W<REG> {
407        self.variant(Ibena::Enabled)
408    }
409}
410#[doc = "Slew Rate Control. . .\n\nValue on reset: 0"]
411#[cfg_attr(feature = "defmt", derive(defmt::Format))]
412#[derive(Clone, Copy, Debug, PartialEq, Eq)]
413pub enum Slewrate {
414    #[doc = "0: Slew Rate is Normal."]
415    Normal = 0,
416    #[doc = "1: Slew Rate Slow."]
417    Slow = 1,
418}
419impl From<Slewrate> for bool {
420    #[inline(always)]
421    fn from(variant: Slewrate) -> Self {
422        variant as u8 != 0
423    }
424}
425#[doc = "Field `SLEWRATE` reader - Slew Rate Control. . ."]
426pub type SlewrateR = crate::BitReader<Slewrate>;
427impl SlewrateR {
428    #[doc = "Get enumerated values variant"]
429    #[inline(always)]
430    pub const fn variant(&self) -> Slewrate {
431        match self.bits {
432            false => Slewrate::Normal,
433            true => Slewrate::Slow,
434        }
435    }
436    #[doc = "Slew Rate is Normal."]
437    #[inline(always)]
438    pub fn is_normal(&self) -> bool {
439        *self == Slewrate::Normal
440    }
441    #[doc = "Slew Rate Slow."]
442    #[inline(always)]
443    pub fn is_slow(&self) -> bool {
444        *self == Slewrate::Slow
445    }
446}
447#[doc = "Field `SLEWRATE` writer - Slew Rate Control. . ."]
448pub type SlewrateW<'a, REG> = crate::BitWriter<'a, REG, Slewrate>;
449impl<'a, REG> SlewrateW<'a, REG>
450where
451    REG: crate::Writable + crate::RegisterSpec,
452{
453    #[doc = "Slew Rate is Normal."]
454    #[inline(always)]
455    pub fn normal(self) -> &'a mut crate::W<REG> {
456        self.variant(Slewrate::Normal)
457    }
458    #[doc = "Slew Rate Slow."]
459    #[inline(always)]
460    pub fn slow(self) -> &'a mut crate::W<REG> {
461        self.variant(Slewrate::Slow)
462    }
463}
464#[doc = "Drive Selector. . .\n\nValue on reset: 0"]
465#[cfg_attr(feature = "defmt", derive(defmt::Format))]
466#[derive(Clone, Copy, Debug, PartialEq, Eq)]
467pub enum Fulldrive {
468    #[doc = "0: Normal Drive."]
469    NormalDrive = 0,
470    #[doc = "1: Full Drive."]
471    FullDrive = 1,
472}
473impl From<Fulldrive> for bool {
474    #[inline(always)]
475    fn from(variant: Fulldrive) -> Self {
476        variant as u8 != 0
477    }
478}
479#[doc = "Field `FULLDRIVE` reader - Drive Selector. . ."]
480pub type FulldriveR = crate::BitReader<Fulldrive>;
481impl FulldriveR {
482    #[doc = "Get enumerated values variant"]
483    #[inline(always)]
484    pub const fn variant(&self) -> Fulldrive {
485        match self.bits {
486            false => Fulldrive::NormalDrive,
487            true => Fulldrive::FullDrive,
488        }
489    }
490    #[doc = "Normal Drive."]
491    #[inline(always)]
492    pub fn is_normal_drive(&self) -> bool {
493        *self == Fulldrive::NormalDrive
494    }
495    #[doc = "Full Drive."]
496    #[inline(always)]
497    pub fn is_full_drive(&self) -> bool {
498        *self == Fulldrive::FullDrive
499    }
500}
501#[doc = "Field `FULLDRIVE` writer - Drive Selector. . ."]
502pub type FulldriveW<'a, REG> = crate::BitWriter<'a, REG, Fulldrive>;
503impl<'a, REG> FulldriveW<'a, REG>
504where
505    REG: crate::Writable + crate::RegisterSpec,
506{
507    #[doc = "Normal Drive."]
508    #[inline(always)]
509    pub fn normal_drive(self) -> &'a mut crate::W<REG> {
510        self.variant(Fulldrive::NormalDrive)
511    }
512    #[doc = "Full Drive."]
513    #[inline(always)]
514    pub fn full_drive(self) -> &'a mut crate::W<REG> {
515        self.variant(Fulldrive::FullDrive)
516    }
517}
518#[doc = "Analog Mux Enable. . .\n\nValue on reset: 0"]
519#[cfg_attr(feature = "defmt", derive(defmt::Format))]
520#[derive(Clone, Copy, Debug, PartialEq, Eq)]
521pub enum Amena {
522    #[doc = "0: Disable."]
523    Disabled = 0,
524    #[doc = "1: Enable."]
525    Enabled = 1,
526}
527impl From<Amena> for bool {
528    #[inline(always)]
529    fn from(variant: Amena) -> Self {
530        variant as u8 != 0
531    }
532}
533#[doc = "Field `AMENA` reader - Analog Mux Enable. . ."]
534pub type AmenaR = crate::BitReader<Amena>;
535impl AmenaR {
536    #[doc = "Get enumerated values variant"]
537    #[inline(always)]
538    pub const fn variant(&self) -> Amena {
539        match self.bits {
540            false => Amena::Disabled,
541            true => Amena::Enabled,
542        }
543    }
544    #[doc = "Disable."]
545    #[inline(always)]
546    pub fn is_disabled(&self) -> bool {
547        *self == Amena::Disabled
548    }
549    #[doc = "Enable."]
550    #[inline(always)]
551    pub fn is_enabled(&self) -> bool {
552        *self == Amena::Enabled
553    }
554}
555#[doc = "Field `AMENA` writer - Analog Mux Enable. . ."]
556pub type AmenaW<'a, REG> = crate::BitWriter<'a, REG, Amena>;
557impl<'a, REG> AmenaW<'a, REG>
558where
559    REG: crate::Writable + crate::RegisterSpec,
560{
561    #[doc = "Disable."]
562    #[inline(always)]
563    pub fn disabled(self) -> &'a mut crate::W<REG> {
564        self.variant(Amena::Disabled)
565    }
566    #[doc = "Enable."]
567    #[inline(always)]
568    pub fn enabled(self) -> &'a mut crate::W<REG> {
569        self.variant(Amena::Enabled)
570    }
571}
572#[doc = "Pseudo Output Drain Enable. . .\n\nValue on reset: 0"]
573#[cfg_attr(feature = "defmt", derive(defmt::Format))]
574#[derive(Clone, Copy, Debug, PartialEq, Eq)]
575pub enum Odena {
576    #[doc = "0: Disable."]
577    Disabled = 0,
578    #[doc = "1: Enable."]
579    Enabled = 1,
580}
581impl From<Odena> for bool {
582    #[inline(always)]
583    fn from(variant: Odena) -> Self {
584        variant as u8 != 0
585    }
586}
587#[doc = "Field `ODENA` reader - Pseudo Output Drain Enable. . ."]
588pub type OdenaR = crate::BitReader<Odena>;
589impl OdenaR {
590    #[doc = "Get enumerated values variant"]
591    #[inline(always)]
592    pub const fn variant(&self) -> Odena {
593        match self.bits {
594            false => Odena::Disabled,
595            true => Odena::Enabled,
596        }
597    }
598    #[doc = "Disable."]
599    #[inline(always)]
600    pub fn is_disabled(&self) -> bool {
601        *self == Odena::Disabled
602    }
603    #[doc = "Enable."]
604    #[inline(always)]
605    pub fn is_enabled(&self) -> bool {
606        *self == Odena::Enabled
607    }
608}
609#[doc = "Field `ODENA` writer - Pseudo Output Drain Enable. . ."]
610pub type OdenaW<'a, REG> = crate::BitWriter<'a, REG, Odena>;
611impl<'a, REG> OdenaW<'a, REG>
612where
613    REG: crate::Writable + crate::RegisterSpec,
614{
615    #[doc = "Disable."]
616    #[inline(always)]
617    pub fn disabled(self) -> &'a mut crate::W<REG> {
618        self.variant(Odena::Disabled)
619    }
620    #[doc = "Enable."]
621    #[inline(always)]
622    pub fn enabled(self) -> &'a mut crate::W<REG> {
623        self.variant(Odena::Enabled)
624    }
625}
626#[doc = "Input Invert Enable. . .\n\nValue on reset: 0"]
627#[cfg_attr(feature = "defmt", derive(defmt::Format))]
628#[derive(Clone, Copy, Debug, PartialEq, Eq)]
629pub enum Iiena {
630    #[doc = "0: Disable."]
631    Disabled = 0,
632    #[doc = "1: Enable."]
633    Enabled = 1,
634}
635impl From<Iiena> for bool {
636    #[inline(always)]
637    fn from(variant: Iiena) -> Self {
638        variant as u8 != 0
639    }
640}
641#[doc = "Field `IIENA` reader - Input Invert Enable. . ."]
642pub type IienaR = crate::BitReader<Iiena>;
643impl IienaR {
644    #[doc = "Get enumerated values variant"]
645    #[inline(always)]
646    pub const fn variant(&self) -> Iiena {
647        match self.bits {
648            false => Iiena::Disabled,
649            true => Iiena::Enabled,
650        }
651    }
652    #[doc = "Disable."]
653    #[inline(always)]
654    pub fn is_disabled(&self) -> bool {
655        *self == Iiena::Disabled
656    }
657    #[doc = "Enable."]
658    #[inline(always)]
659    pub fn is_enabled(&self) -> bool {
660        *self == Iiena::Enabled
661    }
662}
663#[doc = "Field `IIENA` writer - Input Invert Enable. . ."]
664pub type IienaW<'a, REG> = crate::BitWriter<'a, REG, Iiena>;
665impl<'a, REG> IienaW<'a, REG>
666where
667    REG: crate::Writable + crate::RegisterSpec,
668{
669    #[doc = "Disable."]
670    #[inline(always)]
671    pub fn disabled(self) -> &'a mut crate::W<REG> {
672        self.variant(Iiena::Disabled)
673    }
674    #[doc = "Enable."]
675    #[inline(always)]
676    pub fn enabled(self) -> &'a mut crate::W<REG> {
677        self.variant(Iiena::Enabled)
678    }
679}
680impl R {
681    #[doc = "Bits 0:3 - Function Selector. . .(FSELs Sources can be found in the next several pages.)"]
682    #[inline(always)]
683    pub fn fsel(&self) -> FselR {
684        FselR::new((self.bits & 0x0f) as u8)
685    }
686    #[doc = "Bit 4 - Pullup / Pulldown Enable. . ."]
687    #[inline(always)]
688    pub fn pupdena(&self) -> PupdenaR {
689        PupdenaR::new(((self.bits >> 4) & 1) != 0)
690    }
691    #[doc = "Bit 5 - Pullup or Pulldown Selector. . ."]
692    #[inline(always)]
693    pub fn pupdsel(&self) -> PupdselR {
694        PupdselR::new(((self.bits >> 5) & 1) != 0)
695    }
696    #[doc = "Bit 6 - Input Buffer Enable. ."]
697    #[inline(always)]
698    pub fn ibena(&self) -> IbenaR {
699        IbenaR::new(((self.bits >> 6) & 1) != 0)
700    }
701    #[doc = "Bit 7 - Slew Rate Control. . ."]
702    #[inline(always)]
703    pub fn slewrate(&self) -> SlewrateR {
704        SlewrateR::new(((self.bits >> 7) & 1) != 0)
705    }
706    #[doc = "Bit 8 - Drive Selector. . ."]
707    #[inline(always)]
708    pub fn fulldrive(&self) -> FulldriveR {
709        FulldriveR::new(((self.bits >> 8) & 1) != 0)
710    }
711    #[doc = "Bit 9 - Analog Mux Enable. . ."]
712    #[inline(always)]
713    pub fn amena(&self) -> AmenaR {
714        AmenaR::new(((self.bits >> 9) & 1) != 0)
715    }
716    #[doc = "Bit 10 - Pseudo Output Drain Enable. . ."]
717    #[inline(always)]
718    pub fn odena(&self) -> OdenaR {
719        OdenaR::new(((self.bits >> 10) & 1) != 0)
720    }
721    #[doc = "Bit 11 - Input Invert Enable. . ."]
722    #[inline(always)]
723    pub fn iiena(&self) -> IienaR {
724        IienaR::new(((self.bits >> 11) & 1) != 0)
725    }
726}
727#[cfg(feature = "debug")]
728impl core::fmt::Debug for R {
729    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
730        f.debug_struct("PIO0_21")
731            .field("fsel", &self.fsel())
732            .field("pupdena", &self.pupdena())
733            .field("pupdsel", &self.pupdsel())
734            .field("ibena", &self.ibena())
735            .field("slewrate", &self.slewrate())
736            .field("fulldrive", &self.fulldrive())
737            .field("amena", &self.amena())
738            .field("odena", &self.odena())
739            .field("iiena", &self.iiena())
740            .finish()
741    }
742}
743impl W {
744    #[doc = "Bits 0:3 - Function Selector. . .(FSELs Sources can be found in the next several pages.)"]
745    #[inline(always)]
746    pub fn fsel(&mut self) -> FselW<Pio0_21Spec> {
747        FselW::new(self, 0)
748    }
749    #[doc = "Bit 4 - Pullup / Pulldown Enable. . ."]
750    #[inline(always)]
751    pub fn pupdena(&mut self) -> PupdenaW<Pio0_21Spec> {
752        PupdenaW::new(self, 4)
753    }
754    #[doc = "Bit 5 - Pullup or Pulldown Selector. . ."]
755    #[inline(always)]
756    pub fn pupdsel(&mut self) -> PupdselW<Pio0_21Spec> {
757        PupdselW::new(self, 5)
758    }
759    #[doc = "Bit 6 - Input Buffer Enable. ."]
760    #[inline(always)]
761    pub fn ibena(&mut self) -> IbenaW<Pio0_21Spec> {
762        IbenaW::new(self, 6)
763    }
764    #[doc = "Bit 7 - Slew Rate Control. . ."]
765    #[inline(always)]
766    pub fn slewrate(&mut self) -> SlewrateW<Pio0_21Spec> {
767        SlewrateW::new(self, 7)
768    }
769    #[doc = "Bit 8 - Drive Selector. . ."]
770    #[inline(always)]
771    pub fn fulldrive(&mut self) -> FulldriveW<Pio0_21Spec> {
772        FulldriveW::new(self, 8)
773    }
774    #[doc = "Bit 9 - Analog Mux Enable. . ."]
775    #[inline(always)]
776    pub fn amena(&mut self) -> AmenaW<Pio0_21Spec> {
777        AmenaW::new(self, 9)
778    }
779    #[doc = "Bit 10 - Pseudo Output Drain Enable. . ."]
780    #[inline(always)]
781    pub fn odena(&mut self) -> OdenaW<Pio0_21Spec> {
782        OdenaW::new(self, 10)
783    }
784    #[doc = "Bit 11 - Input Invert Enable. . ."]
785    #[inline(always)]
786    pub fn iiena(&mut self) -> IienaW<Pio0_21Spec> {
787        IienaW::new(self, 11)
788    }
789}
790#[doc = "iop pad control register for port0 to port5\n\nYou can [`read`](crate::Reg::read) this register and get [`pio0_21::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pio0_21::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
791pub struct Pio0_21Spec;
792impl crate::RegisterSpec for Pio0_21Spec {
793    type Ux = u32;
794}
795#[doc = "`read()` method returns [`pio0_21::R`](R) reader structure"]
796impl crate::Readable for Pio0_21Spec {}
797#[doc = "`write(|w| ..)` method takes [`pio0_21::W`](W) writer structure"]
798impl crate::Writable for Pio0_21Spec {
799    type Safety = crate::Unsafe;
800    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
801    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
802}
803#[doc = "`reset()` method sets PIO0_21 to value 0"]
804impl crate::Resettable for Pio0_21Spec {
805    const RESET_VALUE: u32 = 0;
806}