eos_s3/iomux/
s_intr_2_sel.rs1#[doc = "Register `S_INTR_2_SEL` reader"]
2pub struct R(crate::R<S_INTR_2_SEL_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<S_INTR_2_SEL_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<S_INTR_2_SEL_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<S_INTR_2_SEL_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `S_INTR_2_SEL` writer"]
17pub struct W(crate::W<S_INTR_2_SEL_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<S_INTR_2_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<S_INTR_2_SEL_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<S_INTR_2_SEL_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Sel\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39#[repr(u8)]
40pub enum SEL_A {
41 #[doc = "0: undefined (0:0 in documentation)"]
42 UNDEFINED = 0,
43 #[doc = "1: Selects pad #4 as the trigger"]
44 PAD_04 = 1,
45 #[doc = "2: Selects pad #8 as the trigger"]
46 PAD_08 = 2,
47 #[doc = "3: Selects pad #21 as the trigger"]
48 PAD_21 = 3,
49 #[doc = "4: Selects pad #25 as the trigger"]
50 PAD_25 = 4,
51 #[doc = "5: Selects pad #37 as the trigger"]
52 PAD_37 = 5,
53 #[doc = "6: Selects pad #38 as the trigger"]
54 PAD_38 = 6,
55}
56impl From<SEL_A> for u8 {
57 #[inline(always)]
58 fn from(variant: SEL_A) -> Self {
59 variant as _
60 }
61}
62#[doc = "Field `SEL` reader - Sel"]
63pub struct SEL_R(crate::FieldReader<u8, SEL_A>);
64impl SEL_R {
65 #[inline(always)]
66 pub(crate) fn new(bits: u8) -> Self {
67 SEL_R(crate::FieldReader::new(bits))
68 }
69 #[doc = r"Get enumerated values variant"]
70 #[inline(always)]
71 pub fn variant(&self) -> Option<SEL_A> {
72 match self.bits {
73 0 => Some(SEL_A::UNDEFINED),
74 1 => Some(SEL_A::PAD_04),
75 2 => Some(SEL_A::PAD_08),
76 3 => Some(SEL_A::PAD_21),
77 4 => Some(SEL_A::PAD_25),
78 5 => Some(SEL_A::PAD_37),
79 6 => Some(SEL_A::PAD_38),
80 _ => None,
81 }
82 }
83 #[doc = "Checks if the value of the field is `UNDEFINED`"]
84 #[inline(always)]
85 pub fn is_undefined(&self) -> bool {
86 **self == SEL_A::UNDEFINED
87 }
88 #[doc = "Checks if the value of the field is `PAD_04`"]
89 #[inline(always)]
90 pub fn is_pad_04(&self) -> bool {
91 **self == SEL_A::PAD_04
92 }
93 #[doc = "Checks if the value of the field is `PAD_08`"]
94 #[inline(always)]
95 pub fn is_pad_08(&self) -> bool {
96 **self == SEL_A::PAD_08
97 }
98 #[doc = "Checks if the value of the field is `PAD_21`"]
99 #[inline(always)]
100 pub fn is_pad_21(&self) -> bool {
101 **self == SEL_A::PAD_21
102 }
103 #[doc = "Checks if the value of the field is `PAD_25`"]
104 #[inline(always)]
105 pub fn is_pad_25(&self) -> bool {
106 **self == SEL_A::PAD_25
107 }
108 #[doc = "Checks if the value of the field is `PAD_37`"]
109 #[inline(always)]
110 pub fn is_pad_37(&self) -> bool {
111 **self == SEL_A::PAD_37
112 }
113 #[doc = "Checks if the value of the field is `PAD_38`"]
114 #[inline(always)]
115 pub fn is_pad_38(&self) -> bool {
116 **self == SEL_A::PAD_38
117 }
118}
119impl core::ops::Deref for SEL_R {
120 type Target = crate::FieldReader<u8, SEL_A>;
121 #[inline(always)]
122 fn deref(&self) -> &Self::Target {
123 &self.0
124 }
125}
126#[doc = "Field `SEL` writer - Sel"]
127pub struct SEL_W<'a> {
128 w: &'a mut W,
129}
130impl<'a> SEL_W<'a> {
131 #[doc = r"Writes `variant` to the field"]
132 #[inline(always)]
133 pub fn variant(self, variant: SEL_A) -> &'a mut W {
134 unsafe { self.bits(variant.into()) }
135 }
136 #[doc = "undefined (0:0 in documentation)"]
137 #[inline(always)]
138 pub fn undefined(self) -> &'a mut W {
139 self.variant(SEL_A::UNDEFINED)
140 }
141 #[doc = "Selects pad #4 as the trigger"]
142 #[inline(always)]
143 pub fn pad_04(self) -> &'a mut W {
144 self.variant(SEL_A::PAD_04)
145 }
146 #[doc = "Selects pad #8 as the trigger"]
147 #[inline(always)]
148 pub fn pad_08(self) -> &'a mut W {
149 self.variant(SEL_A::PAD_08)
150 }
151 #[doc = "Selects pad #21 as the trigger"]
152 #[inline(always)]
153 pub fn pad_21(self) -> &'a mut W {
154 self.variant(SEL_A::PAD_21)
155 }
156 #[doc = "Selects pad #25 as the trigger"]
157 #[inline(always)]
158 pub fn pad_25(self) -> &'a mut W {
159 self.variant(SEL_A::PAD_25)
160 }
161 #[doc = "Selects pad #37 as the trigger"]
162 #[inline(always)]
163 pub fn pad_37(self) -> &'a mut W {
164 self.variant(SEL_A::PAD_37)
165 }
166 #[doc = "Selects pad #38 as the trigger"]
167 #[inline(always)]
168 pub fn pad_38(self) -> &'a mut W {
169 self.variant(SEL_A::PAD_38)
170 }
171 #[doc = r"Writes raw bits to the field"]
172 #[inline(always)]
173 pub unsafe fn bits(self, value: u8) -> &'a mut W {
174 self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07);
175 self.w
176 }
177}
178impl R {
179 #[doc = "Bits 0:2 - Sel"]
180 #[inline(always)]
181 pub fn sel(&self) -> SEL_R {
182 SEL_R::new((self.bits & 0x07) as u8)
183 }
184}
185impl W {
186 #[doc = "Bits 0:2 - Sel"]
187 #[inline(always)]
188 pub fn sel(&mut self) -> SEL_W {
189 SEL_W { w: self }
190 }
191 #[doc = "Writes raw bits to the register."]
192 #[inline(always)]
193 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
194 self.0.bits(bits);
195 self
196 }
197}
198#[doc = "Select pad that triggers GPIO interrupt 2\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 [s_intr_2_sel](index.html) module"]
199pub struct S_INTR_2_SEL_SPEC;
200impl crate::RegisterSpec for S_INTR_2_SEL_SPEC {
201 type Ux = u32;
202}
203#[doc = "`read()` method returns [s_intr_2_sel::R](R) reader structure"]
204impl crate::Readable for S_INTR_2_SEL_SPEC {
205 type Reader = R;
206}
207#[doc = "`write(|w| ..)` method takes [s_intr_2_sel::W](W) writer structure"]
208impl crate::Writable for S_INTR_2_SEL_SPEC {
209 type Writer = W;
210}
211#[doc = "`reset()` method sets S_INTR_2_SEL to value 0"]
212impl crate::Resettable for S_INTR_2_SEL_SPEC {
213 #[inline(always)]
214 fn reset_value() -> Self::Ux {
215 0
216 }
217}