eos_s3/iomux/
io_reg_sel.rs

1#[doc = "Register `IO_REG_SEL` reader"]
2pub struct R(crate::R<IO_REG_SEL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<IO_REG_SEL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<IO_REG_SEL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<IO_REG_SEL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `IO_REG_SEL` writer"]
17pub struct W(crate::W<IO_REG_SEL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<IO_REG_SEL_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<IO_REG_SEL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<IO_REG_SEL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Select pad for IO maped to bit 0\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39pub enum IO_SEL_0_A {
40    #[doc = "0: Enable pad #6 as GPIO"]
41    PAD_06 = 0,
42    #[doc = "1: Enable pad #24 as GPIO"]
43    PAD_24 = 1,
44}
45impl From<IO_SEL_0_A> for bool {
46    #[inline(always)]
47    fn from(variant: IO_SEL_0_A) -> Self {
48        variant as u8 != 0
49    }
50}
51#[doc = "Field `IO_SEL_0` reader - Select pad for IO maped to bit 0"]
52pub struct IO_SEL_0_R(crate::FieldReader<bool, IO_SEL_0_A>);
53impl IO_SEL_0_R {
54    #[inline(always)]
55    pub(crate) fn new(bits: bool) -> Self {
56        IO_SEL_0_R(crate::FieldReader::new(bits))
57    }
58    #[doc = r"Get enumerated values variant"]
59    #[inline(always)]
60    pub fn variant(&self) -> IO_SEL_0_A {
61        match self.bits {
62            false => IO_SEL_0_A::PAD_06,
63            true => IO_SEL_0_A::PAD_24,
64        }
65    }
66    #[doc = "Checks if the value of the field is `PAD_06`"]
67    #[inline(always)]
68    pub fn is_pad_06(&self) -> bool {
69        **self == IO_SEL_0_A::PAD_06
70    }
71    #[doc = "Checks if the value of the field is `PAD_24`"]
72    #[inline(always)]
73    pub fn is_pad_24(&self) -> bool {
74        **self == IO_SEL_0_A::PAD_24
75    }
76}
77impl core::ops::Deref for IO_SEL_0_R {
78    type Target = crate::FieldReader<bool, IO_SEL_0_A>;
79    #[inline(always)]
80    fn deref(&self) -> &Self::Target {
81        &self.0
82    }
83}
84#[doc = "Field `IO_SEL_0` writer - Select pad for IO maped to bit 0"]
85pub struct IO_SEL_0_W<'a> {
86    w: &'a mut W,
87}
88impl<'a> IO_SEL_0_W<'a> {
89    #[doc = r"Writes `variant` to the field"]
90    #[inline(always)]
91    pub fn variant(self, variant: IO_SEL_0_A) -> &'a mut W {
92        self.bit(variant.into())
93    }
94    #[doc = "Enable pad #6 as GPIO"]
95    #[inline(always)]
96    pub fn pad_06(self) -> &'a mut W {
97        self.variant(IO_SEL_0_A::PAD_06)
98    }
99    #[doc = "Enable pad #24 as GPIO"]
100    #[inline(always)]
101    pub fn pad_24(self) -> &'a mut W {
102        self.variant(IO_SEL_0_A::PAD_24)
103    }
104    #[doc = r"Sets the field bit"]
105    #[inline(always)]
106    pub fn set_bit(self) -> &'a mut W {
107        self.bit(true)
108    }
109    #[doc = r"Clears the field bit"]
110    #[inline(always)]
111    pub fn clear_bit(self) -> &'a mut W {
112        self.bit(false)
113    }
114    #[doc = r"Writes raw bits to the field"]
115    #[inline(always)]
116    pub fn bit(self, value: bool) -> &'a mut W {
117        self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
118        self.w
119    }
120}
121#[doc = "Select pad for IO maped to bit 1\n\nValue on reset: 0"]
122#[derive(Clone, Copy, Debug, PartialEq)]
123pub enum IO_SEL_1_A {
124    #[doc = "0: Enable pad #9 as GPIO"]
125    PAD_09 = 0,
126    #[doc = "1: Enable pad #26 as GPIO"]
127    PAD_26 = 1,
128}
129impl From<IO_SEL_1_A> for bool {
130    #[inline(always)]
131    fn from(variant: IO_SEL_1_A) -> Self {
132        variant as u8 != 0
133    }
134}
135#[doc = "Field `IO_SEL_1` reader - Select pad for IO maped to bit 1"]
136pub struct IO_SEL_1_R(crate::FieldReader<bool, IO_SEL_1_A>);
137impl IO_SEL_1_R {
138    #[inline(always)]
139    pub(crate) fn new(bits: bool) -> Self {
140        IO_SEL_1_R(crate::FieldReader::new(bits))
141    }
142    #[doc = r"Get enumerated values variant"]
143    #[inline(always)]
144    pub fn variant(&self) -> IO_SEL_1_A {
145        match self.bits {
146            false => IO_SEL_1_A::PAD_09,
147            true => IO_SEL_1_A::PAD_26,
148        }
149    }
150    #[doc = "Checks if the value of the field is `PAD_09`"]
151    #[inline(always)]
152    pub fn is_pad_09(&self) -> bool {
153        **self == IO_SEL_1_A::PAD_09
154    }
155    #[doc = "Checks if the value of the field is `PAD_26`"]
156    #[inline(always)]
157    pub fn is_pad_26(&self) -> bool {
158        **self == IO_SEL_1_A::PAD_26
159    }
160}
161impl core::ops::Deref for IO_SEL_1_R {
162    type Target = crate::FieldReader<bool, IO_SEL_1_A>;
163    #[inline(always)]
164    fn deref(&self) -> &Self::Target {
165        &self.0
166    }
167}
168#[doc = "Field `IO_SEL_1` writer - Select pad for IO maped to bit 1"]
169pub struct IO_SEL_1_W<'a> {
170    w: &'a mut W,
171}
172impl<'a> IO_SEL_1_W<'a> {
173    #[doc = r"Writes `variant` to the field"]
174    #[inline(always)]
175    pub fn variant(self, variant: IO_SEL_1_A) -> &'a mut W {
176        self.bit(variant.into())
177    }
178    #[doc = "Enable pad #9 as GPIO"]
179    #[inline(always)]
180    pub fn pad_09(self) -> &'a mut W {
181        self.variant(IO_SEL_1_A::PAD_09)
182    }
183    #[doc = "Enable pad #26 as GPIO"]
184    #[inline(always)]
185    pub fn pad_26(self) -> &'a mut W {
186        self.variant(IO_SEL_1_A::PAD_26)
187    }
188    #[doc = r"Sets the field bit"]
189    #[inline(always)]
190    pub fn set_bit(self) -> &'a mut W {
191        self.bit(true)
192    }
193    #[doc = r"Clears the field bit"]
194    #[inline(always)]
195    pub fn clear_bit(self) -> &'a mut W {
196        self.bit(false)
197    }
198    #[doc = r"Writes raw bits to the field"]
199    #[inline(always)]
200    pub fn bit(self, value: bool) -> &'a mut W {
201        self.w.bits =
202            (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
203        self.w
204    }
205}
206#[doc = "Select pad for IO maped to bit 2\n\nValue on reset: 0"]
207#[derive(Clone, Copy, Debug, PartialEq)]
208pub enum IO_SEL_2_A {
209    #[doc = "0: Enable pad #11 as GPIO"]
210    PAD_11 = 0,
211    #[doc = "1: Enable pad #28 as GPIO"]
212    PAD_28 = 1,
213}
214impl From<IO_SEL_2_A> for bool {
215    #[inline(always)]
216    fn from(variant: IO_SEL_2_A) -> Self {
217        variant as u8 != 0
218    }
219}
220#[doc = "Field `IO_SEL_2` reader - Select pad for IO maped to bit 2"]
221pub struct IO_SEL_2_R(crate::FieldReader<bool, IO_SEL_2_A>);
222impl IO_SEL_2_R {
223    #[inline(always)]
224    pub(crate) fn new(bits: bool) -> Self {
225        IO_SEL_2_R(crate::FieldReader::new(bits))
226    }
227    #[doc = r"Get enumerated values variant"]
228    #[inline(always)]
229    pub fn variant(&self) -> IO_SEL_2_A {
230        match self.bits {
231            false => IO_SEL_2_A::PAD_11,
232            true => IO_SEL_2_A::PAD_28,
233        }
234    }
235    #[doc = "Checks if the value of the field is `PAD_11`"]
236    #[inline(always)]
237    pub fn is_pad_11(&self) -> bool {
238        **self == IO_SEL_2_A::PAD_11
239    }
240    #[doc = "Checks if the value of the field is `PAD_28`"]
241    #[inline(always)]
242    pub fn is_pad_28(&self) -> bool {
243        **self == IO_SEL_2_A::PAD_28
244    }
245}
246impl core::ops::Deref for IO_SEL_2_R {
247    type Target = crate::FieldReader<bool, IO_SEL_2_A>;
248    #[inline(always)]
249    fn deref(&self) -> &Self::Target {
250        &self.0
251    }
252}
253#[doc = "Field `IO_SEL_2` writer - Select pad for IO maped to bit 2"]
254pub struct IO_SEL_2_W<'a> {
255    w: &'a mut W,
256}
257impl<'a> IO_SEL_2_W<'a> {
258    #[doc = r"Writes `variant` to the field"]
259    #[inline(always)]
260    pub fn variant(self, variant: IO_SEL_2_A) -> &'a mut W {
261        self.bit(variant.into())
262    }
263    #[doc = "Enable pad #11 as GPIO"]
264    #[inline(always)]
265    pub fn pad_11(self) -> &'a mut W {
266        self.variant(IO_SEL_2_A::PAD_11)
267    }
268    #[doc = "Enable pad #28 as GPIO"]
269    #[inline(always)]
270    pub fn pad_28(self) -> &'a mut W {
271        self.variant(IO_SEL_2_A::PAD_28)
272    }
273    #[doc = r"Sets the field bit"]
274    #[inline(always)]
275    pub fn set_bit(self) -> &'a mut W {
276        self.bit(true)
277    }
278    #[doc = r"Clears the field bit"]
279    #[inline(always)]
280    pub fn clear_bit(self) -> &'a mut W {
281        self.bit(false)
282    }
283    #[doc = r"Writes raw bits to the field"]
284    #[inline(always)]
285    pub fn bit(self, value: bool) -> &'a mut W {
286        self.w.bits =
287            (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
288        self.w
289    }
290}
291#[doc = "Select pad for IO maped to bit 3\n\nValue on reset: 0"]
292#[derive(Clone, Copy, Debug, PartialEq)]
293pub enum IO_SEL_3_A {
294    #[doc = "0: Enable pad #14 as GPIO"]
295    PAD_14 = 0,
296    #[doc = "1: Enable pad #30 as GPIO"]
297    PAD_30 = 1,
298}
299impl From<IO_SEL_3_A> for bool {
300    #[inline(always)]
301    fn from(variant: IO_SEL_3_A) -> Self {
302        variant as u8 != 0
303    }
304}
305#[doc = "Field `IO_SEL_3` reader - Select pad for IO maped to bit 3"]
306pub struct IO_SEL_3_R(crate::FieldReader<bool, IO_SEL_3_A>);
307impl IO_SEL_3_R {
308    #[inline(always)]
309    pub(crate) fn new(bits: bool) -> Self {
310        IO_SEL_3_R(crate::FieldReader::new(bits))
311    }
312    #[doc = r"Get enumerated values variant"]
313    #[inline(always)]
314    pub fn variant(&self) -> IO_SEL_3_A {
315        match self.bits {
316            false => IO_SEL_3_A::PAD_14,
317            true => IO_SEL_3_A::PAD_30,
318        }
319    }
320    #[doc = "Checks if the value of the field is `PAD_14`"]
321    #[inline(always)]
322    pub fn is_pad_14(&self) -> bool {
323        **self == IO_SEL_3_A::PAD_14
324    }
325    #[doc = "Checks if the value of the field is `PAD_30`"]
326    #[inline(always)]
327    pub fn is_pad_30(&self) -> bool {
328        **self == IO_SEL_3_A::PAD_30
329    }
330}
331impl core::ops::Deref for IO_SEL_3_R {
332    type Target = crate::FieldReader<bool, IO_SEL_3_A>;
333    #[inline(always)]
334    fn deref(&self) -> &Self::Target {
335        &self.0
336    }
337}
338#[doc = "Field `IO_SEL_3` writer - Select pad for IO maped to bit 3"]
339pub struct IO_SEL_3_W<'a> {
340    w: &'a mut W,
341}
342impl<'a> IO_SEL_3_W<'a> {
343    #[doc = r"Writes `variant` to the field"]
344    #[inline(always)]
345    pub fn variant(self, variant: IO_SEL_3_A) -> &'a mut W {
346        self.bit(variant.into())
347    }
348    #[doc = "Enable pad #14 as GPIO"]
349    #[inline(always)]
350    pub fn pad_14(self) -> &'a mut W {
351        self.variant(IO_SEL_3_A::PAD_14)
352    }
353    #[doc = "Enable pad #30 as GPIO"]
354    #[inline(always)]
355    pub fn pad_30(self) -> &'a mut W {
356        self.variant(IO_SEL_3_A::PAD_30)
357    }
358    #[doc = r"Sets the field bit"]
359    #[inline(always)]
360    pub fn set_bit(self) -> &'a mut W {
361        self.bit(true)
362    }
363    #[doc = r"Clears the field bit"]
364    #[inline(always)]
365    pub fn clear_bit(self) -> &'a mut W {
366        self.bit(false)
367    }
368    #[doc = r"Writes raw bits to the field"]
369    #[inline(always)]
370    pub fn bit(self, value: bool) -> &'a mut W {
371        self.w.bits =
372            (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
373        self.w
374    }
375}
376#[doc = "Select pad for IO maped to bit 4\n\nValue on reset: 0"]
377#[derive(Clone, Copy, Debug, PartialEq)]
378pub enum IO_SEL_4_A {
379    #[doc = "0: Enable pad #18 as GPIO"]
380    PAD_18 = 0,
381    #[doc = "1: Enable pad #31 as GPIO"]
382    PAD_31 = 1,
383}
384impl From<IO_SEL_4_A> for bool {
385    #[inline(always)]
386    fn from(variant: IO_SEL_4_A) -> Self {
387        variant as u8 != 0
388    }
389}
390#[doc = "Field `IO_SEL_4` reader - Select pad for IO maped to bit 4"]
391pub struct IO_SEL_4_R(crate::FieldReader<bool, IO_SEL_4_A>);
392impl IO_SEL_4_R {
393    #[inline(always)]
394    pub(crate) fn new(bits: bool) -> Self {
395        IO_SEL_4_R(crate::FieldReader::new(bits))
396    }
397    #[doc = r"Get enumerated values variant"]
398    #[inline(always)]
399    pub fn variant(&self) -> IO_SEL_4_A {
400        match self.bits {
401            false => IO_SEL_4_A::PAD_18,
402            true => IO_SEL_4_A::PAD_31,
403        }
404    }
405    #[doc = "Checks if the value of the field is `PAD_18`"]
406    #[inline(always)]
407    pub fn is_pad_18(&self) -> bool {
408        **self == IO_SEL_4_A::PAD_18
409    }
410    #[doc = "Checks if the value of the field is `PAD_31`"]
411    #[inline(always)]
412    pub fn is_pad_31(&self) -> bool {
413        **self == IO_SEL_4_A::PAD_31
414    }
415}
416impl core::ops::Deref for IO_SEL_4_R {
417    type Target = crate::FieldReader<bool, IO_SEL_4_A>;
418    #[inline(always)]
419    fn deref(&self) -> &Self::Target {
420        &self.0
421    }
422}
423#[doc = "Field `IO_SEL_4` writer - Select pad for IO maped to bit 4"]
424pub struct IO_SEL_4_W<'a> {
425    w: &'a mut W,
426}
427impl<'a> IO_SEL_4_W<'a> {
428    #[doc = r"Writes `variant` to the field"]
429    #[inline(always)]
430    pub fn variant(self, variant: IO_SEL_4_A) -> &'a mut W {
431        self.bit(variant.into())
432    }
433    #[doc = "Enable pad #18 as GPIO"]
434    #[inline(always)]
435    pub fn pad_18(self) -> &'a mut W {
436        self.variant(IO_SEL_4_A::PAD_18)
437    }
438    #[doc = "Enable pad #31 as GPIO"]
439    #[inline(always)]
440    pub fn pad_31(self) -> &'a mut W {
441        self.variant(IO_SEL_4_A::PAD_31)
442    }
443    #[doc = r"Sets the field bit"]
444    #[inline(always)]
445    pub fn set_bit(self) -> &'a mut W {
446        self.bit(true)
447    }
448    #[doc = r"Clears the field bit"]
449    #[inline(always)]
450    pub fn clear_bit(self) -> &'a mut W {
451        self.bit(false)
452    }
453    #[doc = r"Writes raw bits to the field"]
454    #[inline(always)]
455    pub fn bit(self, value: bool) -> &'a mut W {
456        self.w.bits =
457            (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
458        self.w
459    }
460}
461#[doc = "Select pad for IO maped to bit 5\n\nValue on reset: 0"]
462#[derive(Clone, Copy, Debug, PartialEq)]
463pub enum IO_SEL_5_A {
464    #[doc = "0: Enable pad #21 as GPIO"]
465    PAD_21 = 0,
466    #[doc = "1: Enable pad #26 as GPIO"]
467    PAD_26 = 1,
468}
469impl From<IO_SEL_5_A> for bool {
470    #[inline(always)]
471    fn from(variant: IO_SEL_5_A) -> Self {
472        variant as u8 != 0
473    }
474}
475#[doc = "Field `IO_SEL_5` reader - Select pad for IO maped to bit 5"]
476pub struct IO_SEL_5_R(crate::FieldReader<bool, IO_SEL_5_A>);
477impl IO_SEL_5_R {
478    #[inline(always)]
479    pub(crate) fn new(bits: bool) -> Self {
480        IO_SEL_5_R(crate::FieldReader::new(bits))
481    }
482    #[doc = r"Get enumerated values variant"]
483    #[inline(always)]
484    pub fn variant(&self) -> IO_SEL_5_A {
485        match self.bits {
486            false => IO_SEL_5_A::PAD_21,
487            true => IO_SEL_5_A::PAD_26,
488        }
489    }
490    #[doc = "Checks if the value of the field is `PAD_21`"]
491    #[inline(always)]
492    pub fn is_pad_21(&self) -> bool {
493        **self == IO_SEL_5_A::PAD_21
494    }
495    #[doc = "Checks if the value of the field is `PAD_26`"]
496    #[inline(always)]
497    pub fn is_pad_26(&self) -> bool {
498        **self == IO_SEL_5_A::PAD_26
499    }
500}
501impl core::ops::Deref for IO_SEL_5_R {
502    type Target = crate::FieldReader<bool, IO_SEL_5_A>;
503    #[inline(always)]
504    fn deref(&self) -> &Self::Target {
505        &self.0
506    }
507}
508#[doc = "Field `IO_SEL_5` writer - Select pad for IO maped to bit 5"]
509pub struct IO_SEL_5_W<'a> {
510    w: &'a mut W,
511}
512impl<'a> IO_SEL_5_W<'a> {
513    #[doc = r"Writes `variant` to the field"]
514    #[inline(always)]
515    pub fn variant(self, variant: IO_SEL_5_A) -> &'a mut W {
516        self.bit(variant.into())
517    }
518    #[doc = "Enable pad #21 as GPIO"]
519    #[inline(always)]
520    pub fn pad_21(self) -> &'a mut W {
521        self.variant(IO_SEL_5_A::PAD_21)
522    }
523    #[doc = "Enable pad #26 as GPIO"]
524    #[inline(always)]
525    pub fn pad_26(self) -> &'a mut W {
526        self.variant(IO_SEL_5_A::PAD_26)
527    }
528    #[doc = r"Sets the field bit"]
529    #[inline(always)]
530    pub fn set_bit(self) -> &'a mut W {
531        self.bit(true)
532    }
533    #[doc = r"Clears the field bit"]
534    #[inline(always)]
535    pub fn clear_bit(self) -> &'a mut W {
536        self.bit(false)
537    }
538    #[doc = r"Writes raw bits to the field"]
539    #[inline(always)]
540    pub fn bit(self, value: bool) -> &'a mut W {
541        self.w.bits =
542            (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5);
543        self.w
544    }
545}
546#[doc = "Select pad for IO maped to bit 6\n\nValue on reset: 0"]
547#[derive(Clone, Copy, Debug, PartialEq)]
548pub enum IO_SEL_6_A {
549    #[doc = "0: Enable pad #22 as GPIO"]
550    PAD_22 = 0,
551    #[doc = "1: Enable pad #38 as GPIO"]
552    PAD_38 = 1,
553}
554impl From<IO_SEL_6_A> for bool {
555    #[inline(always)]
556    fn from(variant: IO_SEL_6_A) -> Self {
557        variant as u8 != 0
558    }
559}
560#[doc = "Field `IO_SEL_6` reader - Select pad for IO maped to bit 6"]
561pub struct IO_SEL_6_R(crate::FieldReader<bool, IO_SEL_6_A>);
562impl IO_SEL_6_R {
563    #[inline(always)]
564    pub(crate) fn new(bits: bool) -> Self {
565        IO_SEL_6_R(crate::FieldReader::new(bits))
566    }
567    #[doc = r"Get enumerated values variant"]
568    #[inline(always)]
569    pub fn variant(&self) -> IO_SEL_6_A {
570        match self.bits {
571            false => IO_SEL_6_A::PAD_22,
572            true => IO_SEL_6_A::PAD_38,
573        }
574    }
575    #[doc = "Checks if the value of the field is `PAD_22`"]
576    #[inline(always)]
577    pub fn is_pad_22(&self) -> bool {
578        **self == IO_SEL_6_A::PAD_22
579    }
580    #[doc = "Checks if the value of the field is `PAD_38`"]
581    #[inline(always)]
582    pub fn is_pad_38(&self) -> bool {
583        **self == IO_SEL_6_A::PAD_38
584    }
585}
586impl core::ops::Deref for IO_SEL_6_R {
587    type Target = crate::FieldReader<bool, IO_SEL_6_A>;
588    #[inline(always)]
589    fn deref(&self) -> &Self::Target {
590        &self.0
591    }
592}
593#[doc = "Field `IO_SEL_6` writer - Select pad for IO maped to bit 6"]
594pub struct IO_SEL_6_W<'a> {
595    w: &'a mut W,
596}
597impl<'a> IO_SEL_6_W<'a> {
598    #[doc = r"Writes `variant` to the field"]
599    #[inline(always)]
600    pub fn variant(self, variant: IO_SEL_6_A) -> &'a mut W {
601        self.bit(variant.into())
602    }
603    #[doc = "Enable pad #22 as GPIO"]
604    #[inline(always)]
605    pub fn pad_22(self) -> &'a mut W {
606        self.variant(IO_SEL_6_A::PAD_22)
607    }
608    #[doc = "Enable pad #38 as GPIO"]
609    #[inline(always)]
610    pub fn pad_38(self) -> &'a mut W {
611        self.variant(IO_SEL_6_A::PAD_38)
612    }
613    #[doc = r"Sets the field bit"]
614    #[inline(always)]
615    pub fn set_bit(self) -> &'a mut W {
616        self.bit(true)
617    }
618    #[doc = r"Clears the field bit"]
619    #[inline(always)]
620    pub fn clear_bit(self) -> &'a mut W {
621        self.bit(false)
622    }
623    #[doc = r"Writes raw bits to the field"]
624    #[inline(always)]
625    pub fn bit(self, value: bool) -> &'a mut W {
626        self.w.bits =
627            (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6);
628        self.w
629    }
630}
631#[doc = "Select pad for IO maped to bit 7\n\nValue on reset: 0"]
632#[derive(Clone, Copy, Debug, PartialEq)]
633pub enum IO_SEL_7_A {
634    #[doc = "0: Enable pad #23 as GPIO"]
635    PAD_23 = 0,
636    #[doc = "1: Enable pad #45 as GPIO"]
637    PAD_45 = 1,
638}
639impl From<IO_SEL_7_A> for bool {
640    #[inline(always)]
641    fn from(variant: IO_SEL_7_A) -> Self {
642        variant as u8 != 0
643    }
644}
645#[doc = "Field `IO_SEL_7` reader - Select pad for IO maped to bit 7"]
646pub struct IO_SEL_7_R(crate::FieldReader<bool, IO_SEL_7_A>);
647impl IO_SEL_7_R {
648    #[inline(always)]
649    pub(crate) fn new(bits: bool) -> Self {
650        IO_SEL_7_R(crate::FieldReader::new(bits))
651    }
652    #[doc = r"Get enumerated values variant"]
653    #[inline(always)]
654    pub fn variant(&self) -> IO_SEL_7_A {
655        match self.bits {
656            false => IO_SEL_7_A::PAD_23,
657            true => IO_SEL_7_A::PAD_45,
658        }
659    }
660    #[doc = "Checks if the value of the field is `PAD_23`"]
661    #[inline(always)]
662    pub fn is_pad_23(&self) -> bool {
663        **self == IO_SEL_7_A::PAD_23
664    }
665    #[doc = "Checks if the value of the field is `PAD_45`"]
666    #[inline(always)]
667    pub fn is_pad_45(&self) -> bool {
668        **self == IO_SEL_7_A::PAD_45
669    }
670}
671impl core::ops::Deref for IO_SEL_7_R {
672    type Target = crate::FieldReader<bool, IO_SEL_7_A>;
673    #[inline(always)]
674    fn deref(&self) -> &Self::Target {
675        &self.0
676    }
677}
678#[doc = "Field `IO_SEL_7` writer - Select pad for IO maped to bit 7"]
679pub struct IO_SEL_7_W<'a> {
680    w: &'a mut W,
681}
682impl<'a> IO_SEL_7_W<'a> {
683    #[doc = r"Writes `variant` to the field"]
684    #[inline(always)]
685    pub fn variant(self, variant: IO_SEL_7_A) -> &'a mut W {
686        self.bit(variant.into())
687    }
688    #[doc = "Enable pad #23 as GPIO"]
689    #[inline(always)]
690    pub fn pad_23(self) -> &'a mut W {
691        self.variant(IO_SEL_7_A::PAD_23)
692    }
693    #[doc = "Enable pad #45 as GPIO"]
694    #[inline(always)]
695    pub fn pad_45(self) -> &'a mut W {
696        self.variant(IO_SEL_7_A::PAD_45)
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 =
712            (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7);
713        self.w
714    }
715}
716impl R {
717    #[doc = "Bit 0 - Select pad for IO maped to bit 0"]
718    #[inline(always)]
719    pub fn io_sel_0(&self) -> IO_SEL_0_R {
720        IO_SEL_0_R::new((self.bits & 0x01) != 0)
721    }
722    #[doc = "Bit 1 - Select pad for IO maped to bit 1"]
723    #[inline(always)]
724    pub fn io_sel_1(&self) -> IO_SEL_1_R {
725        IO_SEL_1_R::new(((self.bits >> 1) & 0x01) != 0)
726    }
727    #[doc = "Bit 2 - Select pad for IO maped to bit 2"]
728    #[inline(always)]
729    pub fn io_sel_2(&self) -> IO_SEL_2_R {
730        IO_SEL_2_R::new(((self.bits >> 2) & 0x01) != 0)
731    }
732    #[doc = "Bit 3 - Select pad for IO maped to bit 3"]
733    #[inline(always)]
734    pub fn io_sel_3(&self) -> IO_SEL_3_R {
735        IO_SEL_3_R::new(((self.bits >> 3) & 0x01) != 0)
736    }
737    #[doc = "Bit 4 - Select pad for IO maped to bit 4"]
738    #[inline(always)]
739    pub fn io_sel_4(&self) -> IO_SEL_4_R {
740        IO_SEL_4_R::new(((self.bits >> 4) & 0x01) != 0)
741    }
742    #[doc = "Bit 5 - Select pad for IO maped to bit 5"]
743    #[inline(always)]
744    pub fn io_sel_5(&self) -> IO_SEL_5_R {
745        IO_SEL_5_R::new(((self.bits >> 5) & 0x01) != 0)
746    }
747    #[doc = "Bit 6 - Select pad for IO maped to bit 6"]
748    #[inline(always)]
749    pub fn io_sel_6(&self) -> IO_SEL_6_R {
750        IO_SEL_6_R::new(((self.bits >> 6) & 0x01) != 0)
751    }
752    #[doc = "Bit 7 - Select pad for IO maped to bit 7"]
753    #[inline(always)]
754    pub fn io_sel_7(&self) -> IO_SEL_7_R {
755        IO_SEL_7_R::new(((self.bits >> 7) & 0x01) != 0)
756    }
757}
758impl W {
759    #[doc = "Bit 0 - Select pad for IO maped to bit 0"]
760    #[inline(always)]
761    pub fn io_sel_0(&mut self) -> IO_SEL_0_W {
762        IO_SEL_0_W { w: self }
763    }
764    #[doc = "Bit 1 - Select pad for IO maped to bit 1"]
765    #[inline(always)]
766    pub fn io_sel_1(&mut self) -> IO_SEL_1_W {
767        IO_SEL_1_W { w: self }
768    }
769    #[doc = "Bit 2 - Select pad for IO maped to bit 2"]
770    #[inline(always)]
771    pub fn io_sel_2(&mut self) -> IO_SEL_2_W {
772        IO_SEL_2_W { w: self }
773    }
774    #[doc = "Bit 3 - Select pad for IO maped to bit 3"]
775    #[inline(always)]
776    pub fn io_sel_3(&mut self) -> IO_SEL_3_W {
777        IO_SEL_3_W { w: self }
778    }
779    #[doc = "Bit 4 - Select pad for IO maped to bit 4"]
780    #[inline(always)]
781    pub fn io_sel_4(&mut self) -> IO_SEL_4_W {
782        IO_SEL_4_W { w: self }
783    }
784    #[doc = "Bit 5 - Select pad for IO maped to bit 5"]
785    #[inline(always)]
786    pub fn io_sel_5(&mut self) -> IO_SEL_5_W {
787        IO_SEL_5_W { w: self }
788    }
789    #[doc = "Bit 6 - Select pad for IO maped to bit 6"]
790    #[inline(always)]
791    pub fn io_sel_6(&mut self) -> IO_SEL_6_W {
792        IO_SEL_6_W { w: self }
793    }
794    #[doc = "Bit 7 - Select pad for IO maped to bit 7"]
795    #[inline(always)]
796    pub fn io_sel_7(&mut self) -> IO_SEL_7_W {
797        IO_SEL_7_W { w: self }
798    }
799    #[doc = "Writes raw bits to the register."]
800    #[inline(always)]
801    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
802        self.0.bits(bits);
803        self
804    }
805}
806#[doc = "Selects which IO input will be registered (Pads used as GPIOS)\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 [io_reg_sel](index.html) module"]
807pub struct IO_REG_SEL_SPEC;
808impl crate::RegisterSpec for IO_REG_SEL_SPEC {
809    type Ux = u32;
810}
811#[doc = "`read()` method returns [io_reg_sel::R](R) reader structure"]
812impl crate::Readable for IO_REG_SEL_SPEC {
813    type Reader = R;
814}
815#[doc = "`write(|w| ..)` method takes [io_reg_sel::W](W) writer structure"]
816impl crate::Writable for IO_REG_SEL_SPEC {
817    type Writer = W;
818}
819#[doc = "`reset()` method sets IO_REG_SEL to value 0"]
820impl crate::Resettable for IO_REG_SEL_SPEC {
821    #[inline(always)]
822    fn reset_value() -> Self::Ux {
823        0
824    }
825}