efm32gg12b390_pac/uart0/
routeloc1.rs1#[doc = "Register `ROUTELOC1` reader"]
2pub struct R(crate::R<ROUTELOC1_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<ROUTELOC1_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<ROUTELOC1_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<ROUTELOC1_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `ROUTELOC1` writer"]
17pub struct W(crate::W<ROUTELOC1_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<ROUTELOC1_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<ROUTELOC1_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<ROUTELOC1_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "I/O Location\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39#[repr(u8)]
40pub enum CTSLOC_A {
41 #[doc = "0: Location 0"]
42 LOC0 = 0,
43 #[doc = "1: Location 1"]
44 LOC1 = 1,
45 #[doc = "2: Location 2"]
46 LOC2 = 2,
47 #[doc = "3: Location 3"]
48 LOC3 = 3,
49 #[doc = "4: Location 4"]
50 LOC4 = 4,
51 #[doc = "5: Location 5"]
52 LOC5 = 5,
53}
54impl From<CTSLOC_A> for u8 {
55 #[inline(always)]
56 fn from(variant: CTSLOC_A) -> Self {
57 variant as _
58 }
59}
60#[doc = "Field `CTSLOC` reader - I/O Location"]
61pub type CTSLOC_R = crate::FieldReader<u8, CTSLOC_A>;
62impl CTSLOC_R {
63 #[doc = "Get enumerated values variant"]
64 #[inline(always)]
65 pub fn variant(&self) -> Option<CTSLOC_A> {
66 match self.bits {
67 0 => Some(CTSLOC_A::LOC0),
68 1 => Some(CTSLOC_A::LOC1),
69 2 => Some(CTSLOC_A::LOC2),
70 3 => Some(CTSLOC_A::LOC3),
71 4 => Some(CTSLOC_A::LOC4),
72 5 => Some(CTSLOC_A::LOC5),
73 _ => None,
74 }
75 }
76 #[doc = "Checks if the value of the field is `LOC0`"]
77 #[inline(always)]
78 pub fn is_loc0(&self) -> bool {
79 *self == CTSLOC_A::LOC0
80 }
81 #[doc = "Checks if the value of the field is `LOC1`"]
82 #[inline(always)]
83 pub fn is_loc1(&self) -> bool {
84 *self == CTSLOC_A::LOC1
85 }
86 #[doc = "Checks if the value of the field is `LOC2`"]
87 #[inline(always)]
88 pub fn is_loc2(&self) -> bool {
89 *self == CTSLOC_A::LOC2
90 }
91 #[doc = "Checks if the value of the field is `LOC3`"]
92 #[inline(always)]
93 pub fn is_loc3(&self) -> bool {
94 *self == CTSLOC_A::LOC3
95 }
96 #[doc = "Checks if the value of the field is `LOC4`"]
97 #[inline(always)]
98 pub fn is_loc4(&self) -> bool {
99 *self == CTSLOC_A::LOC4
100 }
101 #[doc = "Checks if the value of the field is `LOC5`"]
102 #[inline(always)]
103 pub fn is_loc5(&self) -> bool {
104 *self == CTSLOC_A::LOC5
105 }
106}
107#[doc = "Field `CTSLOC` writer - I/O Location"]
108pub type CTSLOC_W<'a> = crate::FieldWriter<'a, u32, ROUTELOC1_SPEC, u8, CTSLOC_A, 6, 0>;
109impl<'a> CTSLOC_W<'a> {
110 #[doc = "Location 0"]
111 #[inline(always)]
112 pub fn loc0(self) -> &'a mut W {
113 self.variant(CTSLOC_A::LOC0)
114 }
115 #[doc = "Location 1"]
116 #[inline(always)]
117 pub fn loc1(self) -> &'a mut W {
118 self.variant(CTSLOC_A::LOC1)
119 }
120 #[doc = "Location 2"]
121 #[inline(always)]
122 pub fn loc2(self) -> &'a mut W {
123 self.variant(CTSLOC_A::LOC2)
124 }
125 #[doc = "Location 3"]
126 #[inline(always)]
127 pub fn loc3(self) -> &'a mut W {
128 self.variant(CTSLOC_A::LOC3)
129 }
130 #[doc = "Location 4"]
131 #[inline(always)]
132 pub fn loc4(self) -> &'a mut W {
133 self.variant(CTSLOC_A::LOC4)
134 }
135 #[doc = "Location 5"]
136 #[inline(always)]
137 pub fn loc5(self) -> &'a mut W {
138 self.variant(CTSLOC_A::LOC5)
139 }
140}
141#[doc = "I/O Location\n\nValue on reset: 0"]
142#[derive(Clone, Copy, Debug, PartialEq)]
143#[repr(u8)]
144pub enum RTSLOC_A {
145 #[doc = "0: Location 0"]
146 LOC0 = 0,
147 #[doc = "1: Location 1"]
148 LOC1 = 1,
149 #[doc = "2: Location 2"]
150 LOC2 = 2,
151 #[doc = "3: Location 3"]
152 LOC3 = 3,
153 #[doc = "4: Location 4"]
154 LOC4 = 4,
155 #[doc = "5: Location 5"]
156 LOC5 = 5,
157}
158impl From<RTSLOC_A> for u8 {
159 #[inline(always)]
160 fn from(variant: RTSLOC_A) -> Self {
161 variant as _
162 }
163}
164#[doc = "Field `RTSLOC` reader - I/O Location"]
165pub type RTSLOC_R = crate::FieldReader<u8, RTSLOC_A>;
166impl RTSLOC_R {
167 #[doc = "Get enumerated values variant"]
168 #[inline(always)]
169 pub fn variant(&self) -> Option<RTSLOC_A> {
170 match self.bits {
171 0 => Some(RTSLOC_A::LOC0),
172 1 => Some(RTSLOC_A::LOC1),
173 2 => Some(RTSLOC_A::LOC2),
174 3 => Some(RTSLOC_A::LOC3),
175 4 => Some(RTSLOC_A::LOC4),
176 5 => Some(RTSLOC_A::LOC5),
177 _ => None,
178 }
179 }
180 #[doc = "Checks if the value of the field is `LOC0`"]
181 #[inline(always)]
182 pub fn is_loc0(&self) -> bool {
183 *self == RTSLOC_A::LOC0
184 }
185 #[doc = "Checks if the value of the field is `LOC1`"]
186 #[inline(always)]
187 pub fn is_loc1(&self) -> bool {
188 *self == RTSLOC_A::LOC1
189 }
190 #[doc = "Checks if the value of the field is `LOC2`"]
191 #[inline(always)]
192 pub fn is_loc2(&self) -> bool {
193 *self == RTSLOC_A::LOC2
194 }
195 #[doc = "Checks if the value of the field is `LOC3`"]
196 #[inline(always)]
197 pub fn is_loc3(&self) -> bool {
198 *self == RTSLOC_A::LOC3
199 }
200 #[doc = "Checks if the value of the field is `LOC4`"]
201 #[inline(always)]
202 pub fn is_loc4(&self) -> bool {
203 *self == RTSLOC_A::LOC4
204 }
205 #[doc = "Checks if the value of the field is `LOC5`"]
206 #[inline(always)]
207 pub fn is_loc5(&self) -> bool {
208 *self == RTSLOC_A::LOC5
209 }
210}
211#[doc = "Field `RTSLOC` writer - I/O Location"]
212pub type RTSLOC_W<'a> = crate::FieldWriter<'a, u32, ROUTELOC1_SPEC, u8, RTSLOC_A, 6, 8>;
213impl<'a> RTSLOC_W<'a> {
214 #[doc = "Location 0"]
215 #[inline(always)]
216 pub fn loc0(self) -> &'a mut W {
217 self.variant(RTSLOC_A::LOC0)
218 }
219 #[doc = "Location 1"]
220 #[inline(always)]
221 pub fn loc1(self) -> &'a mut W {
222 self.variant(RTSLOC_A::LOC1)
223 }
224 #[doc = "Location 2"]
225 #[inline(always)]
226 pub fn loc2(self) -> &'a mut W {
227 self.variant(RTSLOC_A::LOC2)
228 }
229 #[doc = "Location 3"]
230 #[inline(always)]
231 pub fn loc3(self) -> &'a mut W {
232 self.variant(RTSLOC_A::LOC3)
233 }
234 #[doc = "Location 4"]
235 #[inline(always)]
236 pub fn loc4(self) -> &'a mut W {
237 self.variant(RTSLOC_A::LOC4)
238 }
239 #[doc = "Location 5"]
240 #[inline(always)]
241 pub fn loc5(self) -> &'a mut W {
242 self.variant(RTSLOC_A::LOC5)
243 }
244}
245impl R {
246 #[doc = "Bits 0:5 - I/O Location"]
247 #[inline(always)]
248 pub fn ctsloc(&self) -> CTSLOC_R {
249 CTSLOC_R::new((self.bits & 0x3f) as u8)
250 }
251 #[doc = "Bits 8:13 - I/O Location"]
252 #[inline(always)]
253 pub fn rtsloc(&self) -> RTSLOC_R {
254 RTSLOC_R::new(((self.bits >> 8) & 0x3f) as u8)
255 }
256}
257impl W {
258 #[doc = "Bits 0:5 - I/O Location"]
259 #[inline(always)]
260 pub fn ctsloc(&mut self) -> CTSLOC_W {
261 CTSLOC_W::new(self)
262 }
263 #[doc = "Bits 8:13 - I/O Location"]
264 #[inline(always)]
265 pub fn rtsloc(&mut self) -> RTSLOC_W {
266 RTSLOC_W::new(self)
267 }
268 #[doc = "Writes raw bits to the register."]
269 #[inline(always)]
270 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
271 self.0.bits(bits);
272 self
273 }
274}
275#[doc = "I/O Routing Location Register\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 [routeloc1](index.html) module"]
276pub struct ROUTELOC1_SPEC;
277impl crate::RegisterSpec for ROUTELOC1_SPEC {
278 type Ux = u32;
279}
280#[doc = "`read()` method returns [routeloc1::R](R) reader structure"]
281impl crate::Readable for ROUTELOC1_SPEC {
282 type Reader = R;
283}
284#[doc = "`write(|w| ..)` method takes [routeloc1::W](W) writer structure"]
285impl crate::Writable for ROUTELOC1_SPEC {
286 type Writer = W;
287}
288#[doc = "`reset()` method sets ROUTELOC1 to value 0"]
289impl crate::Resettable for ROUTELOC1_SPEC {
290 #[inline(always)]
291 fn reset_value() -> Self::Ux {
292 0
293 }
294}