lpc11xx/gpio0/
dir.rs

1#[doc = "Reader of register DIR"]
2pub type R = crate::R<u32, super::DIR>;
3#[doc = "Writer for register DIR"]
4pub type W = crate::W<u32, super::DIR>;
5#[doc = "Register DIR `reset()`'s with value 0"]
6impl crate::ResetValue for super::DIR {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0
11    }
12}
13#[doc = "PIOn_0.\n\nValue on reset: 0"]
14#[derive(Clone, Copy, Debug, PartialEq)]
15pub enum DIR0_A {
16    #[doc = "0: Pin is configured as an input"]
17    INPUT,
18    #[doc = "1: Pin is configured as an output"]
19    OUTPUT,
20}
21impl From<DIR0_A> for bool {
22    #[inline(always)]
23    fn from(variant: DIR0_A) -> Self {
24        match variant {
25            DIR0_A::INPUT => false,
26            DIR0_A::OUTPUT => true,
27        }
28    }
29}
30#[doc = "Reader of field `DIR0`"]
31pub type DIR0_R = crate::R<bool, DIR0_A>;
32impl DIR0_R {
33    #[doc = r"Get enumerated values variant"]
34    #[inline(always)]
35    pub fn variant(&self) -> DIR0_A {
36        match self.bits {
37            false => DIR0_A::INPUT,
38            true => DIR0_A::OUTPUT,
39        }
40    }
41    #[doc = "Checks if the value of the field is `INPUT`"]
42    #[inline(always)]
43    pub fn is_input(&self) -> bool {
44        *self == DIR0_A::INPUT
45    }
46    #[doc = "Checks if the value of the field is `OUTPUT`"]
47    #[inline(always)]
48    pub fn is_output(&self) -> bool {
49        *self == DIR0_A::OUTPUT
50    }
51}
52#[doc = "Write proxy for field `DIR0`"]
53pub struct DIR0_W<'a> {
54    w: &'a mut W,
55}
56impl<'a> DIR0_W<'a> {
57    #[doc = r"Writes `variant` to the field"]
58    #[inline(always)]
59    pub fn variant(self, variant: DIR0_A) -> &'a mut W {
60        {
61            self.bit(variant.into())
62        }
63    }
64    #[doc = "Pin is configured as an input"]
65    #[inline(always)]
66    pub fn input(self) -> &'a mut W {
67        self.variant(DIR0_A::INPUT)
68    }
69    #[doc = "Pin is configured as an output"]
70    #[inline(always)]
71    pub fn output(self) -> &'a mut W {
72        self.variant(DIR0_A::OUTPUT)
73    }
74    #[doc = r"Sets the field bit"]
75    #[inline(always)]
76    pub fn set_bit(self) -> &'a mut W {
77        self.bit(true)
78    }
79    #[doc = r"Clears the field bit"]
80    #[inline(always)]
81    pub fn clear_bit(self) -> &'a mut W {
82        self.bit(false)
83    }
84    #[doc = r"Writes raw bits to the field"]
85    #[inline(always)]
86    pub fn bit(self, value: bool) -> &'a mut W {
87        self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
88        self.w
89    }
90}
91#[doc = "PIOn_1.\n\nValue on reset: 0"]
92#[derive(Clone, Copy, Debug, PartialEq)]
93pub enum DIR1_A {
94    #[doc = "0: Pin is configured as an input"]
95    INPUT,
96    #[doc = "1: Pin is configured as an output"]
97    OUTPUT,
98}
99impl From<DIR1_A> for bool {
100    #[inline(always)]
101    fn from(variant: DIR1_A) -> Self {
102        match variant {
103            DIR1_A::INPUT => false,
104            DIR1_A::OUTPUT => true,
105        }
106    }
107}
108#[doc = "Reader of field `DIR1`"]
109pub type DIR1_R = crate::R<bool, DIR1_A>;
110impl DIR1_R {
111    #[doc = r"Get enumerated values variant"]
112    #[inline(always)]
113    pub fn variant(&self) -> DIR1_A {
114        match self.bits {
115            false => DIR1_A::INPUT,
116            true => DIR1_A::OUTPUT,
117        }
118    }
119    #[doc = "Checks if the value of the field is `INPUT`"]
120    #[inline(always)]
121    pub fn is_input(&self) -> bool {
122        *self == DIR1_A::INPUT
123    }
124    #[doc = "Checks if the value of the field is `OUTPUT`"]
125    #[inline(always)]
126    pub fn is_output(&self) -> bool {
127        *self == DIR1_A::OUTPUT
128    }
129}
130#[doc = "Write proxy for field `DIR1`"]
131pub struct DIR1_W<'a> {
132    w: &'a mut W,
133}
134impl<'a> DIR1_W<'a> {
135    #[doc = r"Writes `variant` to the field"]
136    #[inline(always)]
137    pub fn variant(self, variant: DIR1_A) -> &'a mut W {
138        {
139            self.bit(variant.into())
140        }
141    }
142    #[doc = "Pin is configured as an input"]
143    #[inline(always)]
144    pub fn input(self) -> &'a mut W {
145        self.variant(DIR1_A::INPUT)
146    }
147    #[doc = "Pin is configured as an output"]
148    #[inline(always)]
149    pub fn output(self) -> &'a mut W {
150        self.variant(DIR1_A::OUTPUT)
151    }
152    #[doc = r"Sets the field bit"]
153    #[inline(always)]
154    pub fn set_bit(self) -> &'a mut W {
155        self.bit(true)
156    }
157    #[doc = r"Clears the field bit"]
158    #[inline(always)]
159    pub fn clear_bit(self) -> &'a mut W {
160        self.bit(false)
161    }
162    #[doc = r"Writes raw bits to the field"]
163    #[inline(always)]
164    pub fn bit(self, value: bool) -> &'a mut W {
165        self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
166        self.w
167    }
168}
169#[doc = "PIOn_2.\n\nValue on reset: 0"]
170#[derive(Clone, Copy, Debug, PartialEq)]
171pub enum DIR2_A {
172    #[doc = "0: Pin is configured as an input"]
173    INPUT,
174    #[doc = "1: Pin is configured as an output"]
175    OUTPUT,
176}
177impl From<DIR2_A> for bool {
178    #[inline(always)]
179    fn from(variant: DIR2_A) -> Self {
180        match variant {
181            DIR2_A::INPUT => false,
182            DIR2_A::OUTPUT => true,
183        }
184    }
185}
186#[doc = "Reader of field `DIR2`"]
187pub type DIR2_R = crate::R<bool, DIR2_A>;
188impl DIR2_R {
189    #[doc = r"Get enumerated values variant"]
190    #[inline(always)]
191    pub fn variant(&self) -> DIR2_A {
192        match self.bits {
193            false => DIR2_A::INPUT,
194            true => DIR2_A::OUTPUT,
195        }
196    }
197    #[doc = "Checks if the value of the field is `INPUT`"]
198    #[inline(always)]
199    pub fn is_input(&self) -> bool {
200        *self == DIR2_A::INPUT
201    }
202    #[doc = "Checks if the value of the field is `OUTPUT`"]
203    #[inline(always)]
204    pub fn is_output(&self) -> bool {
205        *self == DIR2_A::OUTPUT
206    }
207}
208#[doc = "Write proxy for field `DIR2`"]
209pub struct DIR2_W<'a> {
210    w: &'a mut W,
211}
212impl<'a> DIR2_W<'a> {
213    #[doc = r"Writes `variant` to the field"]
214    #[inline(always)]
215    pub fn variant(self, variant: DIR2_A) -> &'a mut W {
216        {
217            self.bit(variant.into())
218        }
219    }
220    #[doc = "Pin is configured as an input"]
221    #[inline(always)]
222    pub fn input(self) -> &'a mut W {
223        self.variant(DIR2_A::INPUT)
224    }
225    #[doc = "Pin is configured as an output"]
226    #[inline(always)]
227    pub fn output(self) -> &'a mut W {
228        self.variant(DIR2_A::OUTPUT)
229    }
230    #[doc = r"Sets the field bit"]
231    #[inline(always)]
232    pub fn set_bit(self) -> &'a mut W {
233        self.bit(true)
234    }
235    #[doc = r"Clears the field bit"]
236    #[inline(always)]
237    pub fn clear_bit(self) -> &'a mut W {
238        self.bit(false)
239    }
240    #[doc = r"Writes raw bits to the field"]
241    #[inline(always)]
242    pub fn bit(self, value: bool) -> &'a mut W {
243        self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
244        self.w
245    }
246}
247#[doc = "PIOn_3.\n\nValue on reset: 0"]
248#[derive(Clone, Copy, Debug, PartialEq)]
249pub enum DIR3_A {
250    #[doc = "0: Pin is configured as an input"]
251    INPUT,
252    #[doc = "1: Pin is configured as an output"]
253    OUTPUT,
254}
255impl From<DIR3_A> for bool {
256    #[inline(always)]
257    fn from(variant: DIR3_A) -> Self {
258        match variant {
259            DIR3_A::INPUT => false,
260            DIR3_A::OUTPUT => true,
261        }
262    }
263}
264#[doc = "Reader of field `DIR3`"]
265pub type DIR3_R = crate::R<bool, DIR3_A>;
266impl DIR3_R {
267    #[doc = r"Get enumerated values variant"]
268    #[inline(always)]
269    pub fn variant(&self) -> DIR3_A {
270        match self.bits {
271            false => DIR3_A::INPUT,
272            true => DIR3_A::OUTPUT,
273        }
274    }
275    #[doc = "Checks if the value of the field is `INPUT`"]
276    #[inline(always)]
277    pub fn is_input(&self) -> bool {
278        *self == DIR3_A::INPUT
279    }
280    #[doc = "Checks if the value of the field is `OUTPUT`"]
281    #[inline(always)]
282    pub fn is_output(&self) -> bool {
283        *self == DIR3_A::OUTPUT
284    }
285}
286#[doc = "Write proxy for field `DIR3`"]
287pub struct DIR3_W<'a> {
288    w: &'a mut W,
289}
290impl<'a> DIR3_W<'a> {
291    #[doc = r"Writes `variant` to the field"]
292    #[inline(always)]
293    pub fn variant(self, variant: DIR3_A) -> &'a mut W {
294        {
295            self.bit(variant.into())
296        }
297    }
298    #[doc = "Pin is configured as an input"]
299    #[inline(always)]
300    pub fn input(self) -> &'a mut W {
301        self.variant(DIR3_A::INPUT)
302    }
303    #[doc = "Pin is configured as an output"]
304    #[inline(always)]
305    pub fn output(self) -> &'a mut W {
306        self.variant(DIR3_A::OUTPUT)
307    }
308    #[doc = r"Sets the field bit"]
309    #[inline(always)]
310    pub fn set_bit(self) -> &'a mut W {
311        self.bit(true)
312    }
313    #[doc = r"Clears the field bit"]
314    #[inline(always)]
315    pub fn clear_bit(self) -> &'a mut W {
316        self.bit(false)
317    }
318    #[doc = r"Writes raw bits to the field"]
319    #[inline(always)]
320    pub fn bit(self, value: bool) -> &'a mut W {
321        self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
322        self.w
323    }
324}
325#[doc = "PIOn_4.\n\nValue on reset: 0"]
326#[derive(Clone, Copy, Debug, PartialEq)]
327pub enum DIR4_A {
328    #[doc = "0: Pin is configured as an input"]
329    INPUT,
330    #[doc = "1: Pin is configured as an output"]
331    OUTPUT,
332}
333impl From<DIR4_A> for bool {
334    #[inline(always)]
335    fn from(variant: DIR4_A) -> Self {
336        match variant {
337            DIR4_A::INPUT => false,
338            DIR4_A::OUTPUT => true,
339        }
340    }
341}
342#[doc = "Reader of field `DIR4`"]
343pub type DIR4_R = crate::R<bool, DIR4_A>;
344impl DIR4_R {
345    #[doc = r"Get enumerated values variant"]
346    #[inline(always)]
347    pub fn variant(&self) -> DIR4_A {
348        match self.bits {
349            false => DIR4_A::INPUT,
350            true => DIR4_A::OUTPUT,
351        }
352    }
353    #[doc = "Checks if the value of the field is `INPUT`"]
354    #[inline(always)]
355    pub fn is_input(&self) -> bool {
356        *self == DIR4_A::INPUT
357    }
358    #[doc = "Checks if the value of the field is `OUTPUT`"]
359    #[inline(always)]
360    pub fn is_output(&self) -> bool {
361        *self == DIR4_A::OUTPUT
362    }
363}
364#[doc = "Write proxy for field `DIR4`"]
365pub struct DIR4_W<'a> {
366    w: &'a mut W,
367}
368impl<'a> DIR4_W<'a> {
369    #[doc = r"Writes `variant` to the field"]
370    #[inline(always)]
371    pub fn variant(self, variant: DIR4_A) -> &'a mut W {
372        {
373            self.bit(variant.into())
374        }
375    }
376    #[doc = "Pin is configured as an input"]
377    #[inline(always)]
378    pub fn input(self) -> &'a mut W {
379        self.variant(DIR4_A::INPUT)
380    }
381    #[doc = "Pin is configured as an output"]
382    #[inline(always)]
383    pub fn output(self) -> &'a mut W {
384        self.variant(DIR4_A::OUTPUT)
385    }
386    #[doc = r"Sets the field bit"]
387    #[inline(always)]
388    pub fn set_bit(self) -> &'a mut W {
389        self.bit(true)
390    }
391    #[doc = r"Clears the field bit"]
392    #[inline(always)]
393    pub fn clear_bit(self) -> &'a mut W {
394        self.bit(false)
395    }
396    #[doc = r"Writes raw bits to the field"]
397    #[inline(always)]
398    pub fn bit(self, value: bool) -> &'a mut W {
399        self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
400        self.w
401    }
402}
403#[doc = "PIOn_5.\n\nValue on reset: 0"]
404#[derive(Clone, Copy, Debug, PartialEq)]
405pub enum DIR5_A {
406    #[doc = "0: Pin is configured as an input"]
407    INPUT,
408    #[doc = "1: Pin is configured as an output"]
409    OUTPUT,
410}
411impl From<DIR5_A> for bool {
412    #[inline(always)]
413    fn from(variant: DIR5_A) -> Self {
414        match variant {
415            DIR5_A::INPUT => false,
416            DIR5_A::OUTPUT => true,
417        }
418    }
419}
420#[doc = "Reader of field `DIR5`"]
421pub type DIR5_R = crate::R<bool, DIR5_A>;
422impl DIR5_R {
423    #[doc = r"Get enumerated values variant"]
424    #[inline(always)]
425    pub fn variant(&self) -> DIR5_A {
426        match self.bits {
427            false => DIR5_A::INPUT,
428            true => DIR5_A::OUTPUT,
429        }
430    }
431    #[doc = "Checks if the value of the field is `INPUT`"]
432    #[inline(always)]
433    pub fn is_input(&self) -> bool {
434        *self == DIR5_A::INPUT
435    }
436    #[doc = "Checks if the value of the field is `OUTPUT`"]
437    #[inline(always)]
438    pub fn is_output(&self) -> bool {
439        *self == DIR5_A::OUTPUT
440    }
441}
442#[doc = "Write proxy for field `DIR5`"]
443pub struct DIR5_W<'a> {
444    w: &'a mut W,
445}
446impl<'a> DIR5_W<'a> {
447    #[doc = r"Writes `variant` to the field"]
448    #[inline(always)]
449    pub fn variant(self, variant: DIR5_A) -> &'a mut W {
450        {
451            self.bit(variant.into())
452        }
453    }
454    #[doc = "Pin is configured as an input"]
455    #[inline(always)]
456    pub fn input(self) -> &'a mut W {
457        self.variant(DIR5_A::INPUT)
458    }
459    #[doc = "Pin is configured as an output"]
460    #[inline(always)]
461    pub fn output(self) -> &'a mut W {
462        self.variant(DIR5_A::OUTPUT)
463    }
464    #[doc = r"Sets the field bit"]
465    #[inline(always)]
466    pub fn set_bit(self) -> &'a mut W {
467        self.bit(true)
468    }
469    #[doc = r"Clears the field bit"]
470    #[inline(always)]
471    pub fn clear_bit(self) -> &'a mut W {
472        self.bit(false)
473    }
474    #[doc = r"Writes raw bits to the field"]
475    #[inline(always)]
476    pub fn bit(self, value: bool) -> &'a mut W {
477        self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5);
478        self.w
479    }
480}
481#[doc = "PIOn_6.\n\nValue on reset: 0"]
482#[derive(Clone, Copy, Debug, PartialEq)]
483pub enum DIR6_A {
484    #[doc = "0: Pin is configured as an input"]
485    INPUT,
486    #[doc = "1: Pin is configured as an output"]
487    OUTPUT,
488}
489impl From<DIR6_A> for bool {
490    #[inline(always)]
491    fn from(variant: DIR6_A) -> Self {
492        match variant {
493            DIR6_A::INPUT => false,
494            DIR6_A::OUTPUT => true,
495        }
496    }
497}
498#[doc = "Reader of field `DIR6`"]
499pub type DIR6_R = crate::R<bool, DIR6_A>;
500impl DIR6_R {
501    #[doc = r"Get enumerated values variant"]
502    #[inline(always)]
503    pub fn variant(&self) -> DIR6_A {
504        match self.bits {
505            false => DIR6_A::INPUT,
506            true => DIR6_A::OUTPUT,
507        }
508    }
509    #[doc = "Checks if the value of the field is `INPUT`"]
510    #[inline(always)]
511    pub fn is_input(&self) -> bool {
512        *self == DIR6_A::INPUT
513    }
514    #[doc = "Checks if the value of the field is `OUTPUT`"]
515    #[inline(always)]
516    pub fn is_output(&self) -> bool {
517        *self == DIR6_A::OUTPUT
518    }
519}
520#[doc = "Write proxy for field `DIR6`"]
521pub struct DIR6_W<'a> {
522    w: &'a mut W,
523}
524impl<'a> DIR6_W<'a> {
525    #[doc = r"Writes `variant` to the field"]
526    #[inline(always)]
527    pub fn variant(self, variant: DIR6_A) -> &'a mut W {
528        {
529            self.bit(variant.into())
530        }
531    }
532    #[doc = "Pin is configured as an input"]
533    #[inline(always)]
534    pub fn input(self) -> &'a mut W {
535        self.variant(DIR6_A::INPUT)
536    }
537    #[doc = "Pin is configured as an output"]
538    #[inline(always)]
539    pub fn output(self) -> &'a mut W {
540        self.variant(DIR6_A::OUTPUT)
541    }
542    #[doc = r"Sets the field bit"]
543    #[inline(always)]
544    pub fn set_bit(self) -> &'a mut W {
545        self.bit(true)
546    }
547    #[doc = r"Clears the field bit"]
548    #[inline(always)]
549    pub fn clear_bit(self) -> &'a mut W {
550        self.bit(false)
551    }
552    #[doc = r"Writes raw bits to the field"]
553    #[inline(always)]
554    pub fn bit(self, value: bool) -> &'a mut W {
555        self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6);
556        self.w
557    }
558}
559#[doc = "PIOn_7.\n\nValue on reset: 0"]
560#[derive(Clone, Copy, Debug, PartialEq)]
561pub enum DIR7_A {
562    #[doc = "0: Pin is configured as an input"]
563    INPUT,
564    #[doc = "1: Pin is configured as an output"]
565    OUTPUT,
566}
567impl From<DIR7_A> for bool {
568    #[inline(always)]
569    fn from(variant: DIR7_A) -> Self {
570        match variant {
571            DIR7_A::INPUT => false,
572            DIR7_A::OUTPUT => true,
573        }
574    }
575}
576#[doc = "Reader of field `DIR7`"]
577pub type DIR7_R = crate::R<bool, DIR7_A>;
578impl DIR7_R {
579    #[doc = r"Get enumerated values variant"]
580    #[inline(always)]
581    pub fn variant(&self) -> DIR7_A {
582        match self.bits {
583            false => DIR7_A::INPUT,
584            true => DIR7_A::OUTPUT,
585        }
586    }
587    #[doc = "Checks if the value of the field is `INPUT`"]
588    #[inline(always)]
589    pub fn is_input(&self) -> bool {
590        *self == DIR7_A::INPUT
591    }
592    #[doc = "Checks if the value of the field is `OUTPUT`"]
593    #[inline(always)]
594    pub fn is_output(&self) -> bool {
595        *self == DIR7_A::OUTPUT
596    }
597}
598#[doc = "Write proxy for field `DIR7`"]
599pub struct DIR7_W<'a> {
600    w: &'a mut W,
601}
602impl<'a> DIR7_W<'a> {
603    #[doc = r"Writes `variant` to the field"]
604    #[inline(always)]
605    pub fn variant(self, variant: DIR7_A) -> &'a mut W {
606        {
607            self.bit(variant.into())
608        }
609    }
610    #[doc = "Pin is configured as an input"]
611    #[inline(always)]
612    pub fn input(self) -> &'a mut W {
613        self.variant(DIR7_A::INPUT)
614    }
615    #[doc = "Pin is configured as an output"]
616    #[inline(always)]
617    pub fn output(self) -> &'a mut W {
618        self.variant(DIR7_A::OUTPUT)
619    }
620    #[doc = r"Sets the field bit"]
621    #[inline(always)]
622    pub fn set_bit(self) -> &'a mut W {
623        self.bit(true)
624    }
625    #[doc = r"Clears the field bit"]
626    #[inline(always)]
627    pub fn clear_bit(self) -> &'a mut W {
628        self.bit(false)
629    }
630    #[doc = r"Writes raw bits to the field"]
631    #[inline(always)]
632    pub fn bit(self, value: bool) -> &'a mut W {
633        self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7);
634        self.w
635    }
636}
637#[doc = "PIOn_8.\n\nValue on reset: 0"]
638#[derive(Clone, Copy, Debug, PartialEq)]
639pub enum DIR8_A {
640    #[doc = "0: Pin is configured as an input"]
641    INPUT,
642    #[doc = "1: Pin is configured as an output"]
643    OUTPUT,
644}
645impl From<DIR8_A> for bool {
646    #[inline(always)]
647    fn from(variant: DIR8_A) -> Self {
648        match variant {
649            DIR8_A::INPUT => false,
650            DIR8_A::OUTPUT => true,
651        }
652    }
653}
654#[doc = "Reader of field `DIR8`"]
655pub type DIR8_R = crate::R<bool, DIR8_A>;
656impl DIR8_R {
657    #[doc = r"Get enumerated values variant"]
658    #[inline(always)]
659    pub fn variant(&self) -> DIR8_A {
660        match self.bits {
661            false => DIR8_A::INPUT,
662            true => DIR8_A::OUTPUT,
663        }
664    }
665    #[doc = "Checks if the value of the field is `INPUT`"]
666    #[inline(always)]
667    pub fn is_input(&self) -> bool {
668        *self == DIR8_A::INPUT
669    }
670    #[doc = "Checks if the value of the field is `OUTPUT`"]
671    #[inline(always)]
672    pub fn is_output(&self) -> bool {
673        *self == DIR8_A::OUTPUT
674    }
675}
676#[doc = "Write proxy for field `DIR8`"]
677pub struct DIR8_W<'a> {
678    w: &'a mut W,
679}
680impl<'a> DIR8_W<'a> {
681    #[doc = r"Writes `variant` to the field"]
682    #[inline(always)]
683    pub fn variant(self, variant: DIR8_A) -> &'a mut W {
684        {
685            self.bit(variant.into())
686        }
687    }
688    #[doc = "Pin is configured as an input"]
689    #[inline(always)]
690    pub fn input(self) -> &'a mut W {
691        self.variant(DIR8_A::INPUT)
692    }
693    #[doc = "Pin is configured as an output"]
694    #[inline(always)]
695    pub fn output(self) -> &'a mut W {
696        self.variant(DIR8_A::OUTPUT)
697    }
698    #[doc = r"Sets the field bit"]
699    #[inline(always)]
700    pub fn set_bit(self) -> &'a mut W {
701        self.bit(true)
702    }
703    #[doc = r"Clears the field bit"]
704    #[inline(always)]
705    pub fn clear_bit(self) -> &'a mut W {
706        self.bit(false)
707    }
708    #[doc = r"Writes raw bits to the field"]
709    #[inline(always)]
710    pub fn bit(self, value: bool) -> &'a mut W {
711        self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8);
712        self.w
713    }
714}
715#[doc = "PIOn_9.\n\nValue on reset: 0"]
716#[derive(Clone, Copy, Debug, PartialEq)]
717pub enum DIR9_A {
718    #[doc = "0: Pin is configured as an input"]
719    INPUT,
720    #[doc = "1: Pin is configured as an output"]
721    OUTPUT,
722}
723impl From<DIR9_A> for bool {
724    #[inline(always)]
725    fn from(variant: DIR9_A) -> Self {
726        match variant {
727            DIR9_A::INPUT => false,
728            DIR9_A::OUTPUT => true,
729        }
730    }
731}
732#[doc = "Reader of field `DIR9`"]
733pub type DIR9_R = crate::R<bool, DIR9_A>;
734impl DIR9_R {
735    #[doc = r"Get enumerated values variant"]
736    #[inline(always)]
737    pub fn variant(&self) -> DIR9_A {
738        match self.bits {
739            false => DIR9_A::INPUT,
740            true => DIR9_A::OUTPUT,
741        }
742    }
743    #[doc = "Checks if the value of the field is `INPUT`"]
744    #[inline(always)]
745    pub fn is_input(&self) -> bool {
746        *self == DIR9_A::INPUT
747    }
748    #[doc = "Checks if the value of the field is `OUTPUT`"]
749    #[inline(always)]
750    pub fn is_output(&self) -> bool {
751        *self == DIR9_A::OUTPUT
752    }
753}
754#[doc = "Write proxy for field `DIR9`"]
755pub struct DIR9_W<'a> {
756    w: &'a mut W,
757}
758impl<'a> DIR9_W<'a> {
759    #[doc = r"Writes `variant` to the field"]
760    #[inline(always)]
761    pub fn variant(self, variant: DIR9_A) -> &'a mut W {
762        {
763            self.bit(variant.into())
764        }
765    }
766    #[doc = "Pin is configured as an input"]
767    #[inline(always)]
768    pub fn input(self) -> &'a mut W {
769        self.variant(DIR9_A::INPUT)
770    }
771    #[doc = "Pin is configured as an output"]
772    #[inline(always)]
773    pub fn output(self) -> &'a mut W {
774        self.variant(DIR9_A::OUTPUT)
775    }
776    #[doc = r"Sets the field bit"]
777    #[inline(always)]
778    pub fn set_bit(self) -> &'a mut W {
779        self.bit(true)
780    }
781    #[doc = r"Clears the field bit"]
782    #[inline(always)]
783    pub fn clear_bit(self) -> &'a mut W {
784        self.bit(false)
785    }
786    #[doc = r"Writes raw bits to the field"]
787    #[inline(always)]
788    pub fn bit(self, value: bool) -> &'a mut W {
789        self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9);
790        self.w
791    }
792}
793#[doc = "PIOn_10.\n\nValue on reset: 0"]
794#[derive(Clone, Copy, Debug, PartialEq)]
795pub enum DIR10_A {
796    #[doc = "0: Pin is configured as an input"]
797    INPUT,
798    #[doc = "1: Pin is configured as an output"]
799    OUTPUT,
800}
801impl From<DIR10_A> for bool {
802    #[inline(always)]
803    fn from(variant: DIR10_A) -> Self {
804        match variant {
805            DIR10_A::INPUT => false,
806            DIR10_A::OUTPUT => true,
807        }
808    }
809}
810#[doc = "Reader of field `DIR10`"]
811pub type DIR10_R = crate::R<bool, DIR10_A>;
812impl DIR10_R {
813    #[doc = r"Get enumerated values variant"]
814    #[inline(always)]
815    pub fn variant(&self) -> DIR10_A {
816        match self.bits {
817            false => DIR10_A::INPUT,
818            true => DIR10_A::OUTPUT,
819        }
820    }
821    #[doc = "Checks if the value of the field is `INPUT`"]
822    #[inline(always)]
823    pub fn is_input(&self) -> bool {
824        *self == DIR10_A::INPUT
825    }
826    #[doc = "Checks if the value of the field is `OUTPUT`"]
827    #[inline(always)]
828    pub fn is_output(&self) -> bool {
829        *self == DIR10_A::OUTPUT
830    }
831}
832#[doc = "Write proxy for field `DIR10`"]
833pub struct DIR10_W<'a> {
834    w: &'a mut W,
835}
836impl<'a> DIR10_W<'a> {
837    #[doc = r"Writes `variant` to the field"]
838    #[inline(always)]
839    pub fn variant(self, variant: DIR10_A) -> &'a mut W {
840        {
841            self.bit(variant.into())
842        }
843    }
844    #[doc = "Pin is configured as an input"]
845    #[inline(always)]
846    pub fn input(self) -> &'a mut W {
847        self.variant(DIR10_A::INPUT)
848    }
849    #[doc = "Pin is configured as an output"]
850    #[inline(always)]
851    pub fn output(self) -> &'a mut W {
852        self.variant(DIR10_A::OUTPUT)
853    }
854    #[doc = r"Sets the field bit"]
855    #[inline(always)]
856    pub fn set_bit(self) -> &'a mut W {
857        self.bit(true)
858    }
859    #[doc = r"Clears the field bit"]
860    #[inline(always)]
861    pub fn clear_bit(self) -> &'a mut W {
862        self.bit(false)
863    }
864    #[doc = r"Writes raw bits to the field"]
865    #[inline(always)]
866    pub fn bit(self, value: bool) -> &'a mut W {
867        self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10);
868        self.w
869    }
870}
871#[doc = "PIOn_11.\n\nValue on reset: 0"]
872#[derive(Clone, Copy, Debug, PartialEq)]
873pub enum DIR11_A {
874    #[doc = "0: Pin is configured as an input"]
875    INPUT,
876    #[doc = "1: Pin is configured as an output"]
877    OUTPUT,
878}
879impl From<DIR11_A> for bool {
880    #[inline(always)]
881    fn from(variant: DIR11_A) -> Self {
882        match variant {
883            DIR11_A::INPUT => false,
884            DIR11_A::OUTPUT => true,
885        }
886    }
887}
888#[doc = "Reader of field `DIR11`"]
889pub type DIR11_R = crate::R<bool, DIR11_A>;
890impl DIR11_R {
891    #[doc = r"Get enumerated values variant"]
892    #[inline(always)]
893    pub fn variant(&self) -> DIR11_A {
894        match self.bits {
895            false => DIR11_A::INPUT,
896            true => DIR11_A::OUTPUT,
897        }
898    }
899    #[doc = "Checks if the value of the field is `INPUT`"]
900    #[inline(always)]
901    pub fn is_input(&self) -> bool {
902        *self == DIR11_A::INPUT
903    }
904    #[doc = "Checks if the value of the field is `OUTPUT`"]
905    #[inline(always)]
906    pub fn is_output(&self) -> bool {
907        *self == DIR11_A::OUTPUT
908    }
909}
910#[doc = "Write proxy for field `DIR11`"]
911pub struct DIR11_W<'a> {
912    w: &'a mut W,
913}
914impl<'a> DIR11_W<'a> {
915    #[doc = r"Writes `variant` to the field"]
916    #[inline(always)]
917    pub fn variant(self, variant: DIR11_A) -> &'a mut W {
918        {
919            self.bit(variant.into())
920        }
921    }
922    #[doc = "Pin is configured as an input"]
923    #[inline(always)]
924    pub fn input(self) -> &'a mut W {
925        self.variant(DIR11_A::INPUT)
926    }
927    #[doc = "Pin is configured as an output"]
928    #[inline(always)]
929    pub fn output(self) -> &'a mut W {
930        self.variant(DIR11_A::OUTPUT)
931    }
932    #[doc = r"Sets the field bit"]
933    #[inline(always)]
934    pub fn set_bit(self) -> &'a mut W {
935        self.bit(true)
936    }
937    #[doc = r"Clears the field bit"]
938    #[inline(always)]
939    pub fn clear_bit(self) -> &'a mut W {
940        self.bit(false)
941    }
942    #[doc = r"Writes raw bits to the field"]
943    #[inline(always)]
944    pub fn bit(self, value: bool) -> &'a mut W {
945        self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11);
946        self.w
947    }
948}
949impl R {
950    #[doc = "Bit 0 - PIOn_0."]
951    #[inline(always)]
952    pub fn dir0(&self) -> DIR0_R {
953        DIR0_R::new((self.bits & 0x01) != 0)
954    }
955    #[doc = "Bit 1 - PIOn_1."]
956    #[inline(always)]
957    pub fn dir1(&self) -> DIR1_R {
958        DIR1_R::new(((self.bits >> 1) & 0x01) != 0)
959    }
960    #[doc = "Bit 2 - PIOn_2."]
961    #[inline(always)]
962    pub fn dir2(&self) -> DIR2_R {
963        DIR2_R::new(((self.bits >> 2) & 0x01) != 0)
964    }
965    #[doc = "Bit 3 - PIOn_3."]
966    #[inline(always)]
967    pub fn dir3(&self) -> DIR3_R {
968        DIR3_R::new(((self.bits >> 3) & 0x01) != 0)
969    }
970    #[doc = "Bit 4 - PIOn_4."]
971    #[inline(always)]
972    pub fn dir4(&self) -> DIR4_R {
973        DIR4_R::new(((self.bits >> 4) & 0x01) != 0)
974    }
975    #[doc = "Bit 5 - PIOn_5."]
976    #[inline(always)]
977    pub fn dir5(&self) -> DIR5_R {
978        DIR5_R::new(((self.bits >> 5) & 0x01) != 0)
979    }
980    #[doc = "Bit 6 - PIOn_6."]
981    #[inline(always)]
982    pub fn dir6(&self) -> DIR6_R {
983        DIR6_R::new(((self.bits >> 6) & 0x01) != 0)
984    }
985    #[doc = "Bit 7 - PIOn_7."]
986    #[inline(always)]
987    pub fn dir7(&self) -> DIR7_R {
988        DIR7_R::new(((self.bits >> 7) & 0x01) != 0)
989    }
990    #[doc = "Bit 8 - PIOn_8."]
991    #[inline(always)]
992    pub fn dir8(&self) -> DIR8_R {
993        DIR8_R::new(((self.bits >> 8) & 0x01) != 0)
994    }
995    #[doc = "Bit 9 - PIOn_9."]
996    #[inline(always)]
997    pub fn dir9(&self) -> DIR9_R {
998        DIR9_R::new(((self.bits >> 9) & 0x01) != 0)
999    }
1000    #[doc = "Bit 10 - PIOn_10."]
1001    #[inline(always)]
1002    pub fn dir10(&self) -> DIR10_R {
1003        DIR10_R::new(((self.bits >> 10) & 0x01) != 0)
1004    }
1005    #[doc = "Bit 11 - PIOn_11."]
1006    #[inline(always)]
1007    pub fn dir11(&self) -> DIR11_R {
1008        DIR11_R::new(((self.bits >> 11) & 0x01) != 0)
1009    }
1010}
1011impl W {
1012    #[doc = "Bit 0 - PIOn_0."]
1013    #[inline(always)]
1014    pub fn dir0(&mut self) -> DIR0_W {
1015        DIR0_W { w: self }
1016    }
1017    #[doc = "Bit 1 - PIOn_1."]
1018    #[inline(always)]
1019    pub fn dir1(&mut self) -> DIR1_W {
1020        DIR1_W { w: self }
1021    }
1022    #[doc = "Bit 2 - PIOn_2."]
1023    #[inline(always)]
1024    pub fn dir2(&mut self) -> DIR2_W {
1025        DIR2_W { w: self }
1026    }
1027    #[doc = "Bit 3 - PIOn_3."]
1028    #[inline(always)]
1029    pub fn dir3(&mut self) -> DIR3_W {
1030        DIR3_W { w: self }
1031    }
1032    #[doc = "Bit 4 - PIOn_4."]
1033    #[inline(always)]
1034    pub fn dir4(&mut self) -> DIR4_W {
1035        DIR4_W { w: self }
1036    }
1037    #[doc = "Bit 5 - PIOn_5."]
1038    #[inline(always)]
1039    pub fn dir5(&mut self) -> DIR5_W {
1040        DIR5_W { w: self }
1041    }
1042    #[doc = "Bit 6 - PIOn_6."]
1043    #[inline(always)]
1044    pub fn dir6(&mut self) -> DIR6_W {
1045        DIR6_W { w: self }
1046    }
1047    #[doc = "Bit 7 - PIOn_7."]
1048    #[inline(always)]
1049    pub fn dir7(&mut self) -> DIR7_W {
1050        DIR7_W { w: self }
1051    }
1052    #[doc = "Bit 8 - PIOn_8."]
1053    #[inline(always)]
1054    pub fn dir8(&mut self) -> DIR8_W {
1055        DIR8_W { w: self }
1056    }
1057    #[doc = "Bit 9 - PIOn_9."]
1058    #[inline(always)]
1059    pub fn dir9(&mut self) -> DIR9_W {
1060        DIR9_W { w: self }
1061    }
1062    #[doc = "Bit 10 - PIOn_10."]
1063    #[inline(always)]
1064    pub fn dir10(&mut self) -> DIR10_W {
1065        DIR10_W { w: self }
1066    }
1067    #[doc = "Bit 11 - PIOn_11."]
1068    #[inline(always)]
1069    pub fn dir11(&mut self) -> DIR11_W {
1070        DIR11_W { w: self }
1071    }
1072}