efm32pg12_pac/prs/
routepen.rs1#[doc = "Reader of register ROUTEPEN"]
2pub type R = crate::R<u32, super::ROUTEPEN>;
3#[doc = "Writer for register ROUTEPEN"]
4pub type W = crate::W<u32, super::ROUTEPEN>;
5#[doc = "Register ROUTEPEN `reset()`'s with value 0"]
6impl crate::ResetValue for super::ROUTEPEN {
7 type Type = u32;
8 #[inline(always)]
9 fn reset_value() -> Self::Type {
10 0
11 }
12}
13#[doc = "Reader of field `CH0PEN`"]
14pub type CH0PEN_R = crate::R<bool, bool>;
15#[doc = "Write proxy for field `CH0PEN`"]
16pub struct CH0PEN_W<'a> {
17 w: &'a mut W,
18}
19impl<'a> CH0PEN_W<'a> {
20 #[doc = r"Sets the field bit"]
21 #[inline(always)]
22 pub fn set_bit(self) -> &'a mut W {
23 self.bit(true)
24 }
25 #[doc = r"Clears the field bit"]
26 #[inline(always)]
27 pub fn clear_bit(self) -> &'a mut W {
28 self.bit(false)
29 }
30 #[doc = r"Writes raw bits to the field"]
31 #[inline(always)]
32 pub fn bit(self, value: bool) -> &'a mut W {
33 self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
34 self.w
35 }
36}
37#[doc = "Reader of field `CH1PEN`"]
38pub type CH1PEN_R = crate::R<bool, bool>;
39#[doc = "Write proxy for field `CH1PEN`"]
40pub struct CH1PEN_W<'a> {
41 w: &'a mut W,
42}
43impl<'a> CH1PEN_W<'a> {
44 #[doc = r"Sets the field bit"]
45 #[inline(always)]
46 pub fn set_bit(self) -> &'a mut W {
47 self.bit(true)
48 }
49 #[doc = r"Clears the field bit"]
50 #[inline(always)]
51 pub fn clear_bit(self) -> &'a mut W {
52 self.bit(false)
53 }
54 #[doc = r"Writes raw bits to the field"]
55 #[inline(always)]
56 pub fn bit(self, value: bool) -> &'a mut W {
57 self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
58 self.w
59 }
60}
61#[doc = "Reader of field `CH2PEN`"]
62pub type CH2PEN_R = crate::R<bool, bool>;
63#[doc = "Write proxy for field `CH2PEN`"]
64pub struct CH2PEN_W<'a> {
65 w: &'a mut W,
66}
67impl<'a> CH2PEN_W<'a> {
68 #[doc = r"Sets the field bit"]
69 #[inline(always)]
70 pub fn set_bit(self) -> &'a mut W {
71 self.bit(true)
72 }
73 #[doc = r"Clears the field bit"]
74 #[inline(always)]
75 pub fn clear_bit(self) -> &'a mut W {
76 self.bit(false)
77 }
78 #[doc = r"Writes raw bits to the field"]
79 #[inline(always)]
80 pub fn bit(self, value: bool) -> &'a mut W {
81 self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
82 self.w
83 }
84}
85#[doc = "Reader of field `CH3PEN`"]
86pub type CH3PEN_R = crate::R<bool, bool>;
87#[doc = "Write proxy for field `CH3PEN`"]
88pub struct CH3PEN_W<'a> {
89 w: &'a mut W,
90}
91impl<'a> CH3PEN_W<'a> {
92 #[doc = r"Sets the field bit"]
93 #[inline(always)]
94 pub fn set_bit(self) -> &'a mut W {
95 self.bit(true)
96 }
97 #[doc = r"Clears the field bit"]
98 #[inline(always)]
99 pub fn clear_bit(self) -> &'a mut W {
100 self.bit(false)
101 }
102 #[doc = r"Writes raw bits to the field"]
103 #[inline(always)]
104 pub fn bit(self, value: bool) -> &'a mut W {
105 self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
106 self.w
107 }
108}
109#[doc = "Reader of field `CH4PEN`"]
110pub type CH4PEN_R = crate::R<bool, bool>;
111#[doc = "Write proxy for field `CH4PEN`"]
112pub struct CH4PEN_W<'a> {
113 w: &'a mut W,
114}
115impl<'a> CH4PEN_W<'a> {
116 #[doc = r"Sets the field bit"]
117 #[inline(always)]
118 pub fn set_bit(self) -> &'a mut W {
119 self.bit(true)
120 }
121 #[doc = r"Clears the field bit"]
122 #[inline(always)]
123 pub fn clear_bit(self) -> &'a mut W {
124 self.bit(false)
125 }
126 #[doc = r"Writes raw bits to the field"]
127 #[inline(always)]
128 pub fn bit(self, value: bool) -> &'a mut W {
129 self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
130 self.w
131 }
132}
133#[doc = "Reader of field `CH5PEN`"]
134pub type CH5PEN_R = crate::R<bool, bool>;
135#[doc = "Write proxy for field `CH5PEN`"]
136pub struct CH5PEN_W<'a> {
137 w: &'a mut W,
138}
139impl<'a> CH5PEN_W<'a> {
140 #[doc = r"Sets the field bit"]
141 #[inline(always)]
142 pub fn set_bit(self) -> &'a mut W {
143 self.bit(true)
144 }
145 #[doc = r"Clears the field bit"]
146 #[inline(always)]
147 pub fn clear_bit(self) -> &'a mut W {
148 self.bit(false)
149 }
150 #[doc = r"Writes raw bits to the field"]
151 #[inline(always)]
152 pub fn bit(self, value: bool) -> &'a mut W {
153 self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5);
154 self.w
155 }
156}
157#[doc = "Reader of field `CH6PEN`"]
158pub type CH6PEN_R = crate::R<bool, bool>;
159#[doc = "Write proxy for field `CH6PEN`"]
160pub struct CH6PEN_W<'a> {
161 w: &'a mut W,
162}
163impl<'a> CH6PEN_W<'a> {
164 #[doc = r"Sets the field bit"]
165 #[inline(always)]
166 pub fn set_bit(self) -> &'a mut W {
167 self.bit(true)
168 }
169 #[doc = r"Clears the field bit"]
170 #[inline(always)]
171 pub fn clear_bit(self) -> &'a mut W {
172 self.bit(false)
173 }
174 #[doc = r"Writes raw bits to the field"]
175 #[inline(always)]
176 pub fn bit(self, value: bool) -> &'a mut W {
177 self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6);
178 self.w
179 }
180}
181#[doc = "Reader of field `CH7PEN`"]
182pub type CH7PEN_R = crate::R<bool, bool>;
183#[doc = "Write proxy for field `CH7PEN`"]
184pub struct CH7PEN_W<'a> {
185 w: &'a mut W,
186}
187impl<'a> CH7PEN_W<'a> {
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 = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7);
202 self.w
203 }
204}
205#[doc = "Reader of field `CH8PEN`"]
206pub type CH8PEN_R = crate::R<bool, bool>;
207#[doc = "Write proxy for field `CH8PEN`"]
208pub struct CH8PEN_W<'a> {
209 w: &'a mut W,
210}
211impl<'a> CH8PEN_W<'a> {
212 #[doc = r"Sets the field bit"]
213 #[inline(always)]
214 pub fn set_bit(self) -> &'a mut W {
215 self.bit(true)
216 }
217 #[doc = r"Clears the field bit"]
218 #[inline(always)]
219 pub fn clear_bit(self) -> &'a mut W {
220 self.bit(false)
221 }
222 #[doc = r"Writes raw bits to the field"]
223 #[inline(always)]
224 pub fn bit(self, value: bool) -> &'a mut W {
225 self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8);
226 self.w
227 }
228}
229#[doc = "Reader of field `CH9PEN`"]
230pub type CH9PEN_R = crate::R<bool, bool>;
231#[doc = "Write proxy for field `CH9PEN`"]
232pub struct CH9PEN_W<'a> {
233 w: &'a mut W,
234}
235impl<'a> CH9PEN_W<'a> {
236 #[doc = r"Sets the field bit"]
237 #[inline(always)]
238 pub fn set_bit(self) -> &'a mut W {
239 self.bit(true)
240 }
241 #[doc = r"Clears the field bit"]
242 #[inline(always)]
243 pub fn clear_bit(self) -> &'a mut W {
244 self.bit(false)
245 }
246 #[doc = r"Writes raw bits to the field"]
247 #[inline(always)]
248 pub fn bit(self, value: bool) -> &'a mut W {
249 self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9);
250 self.w
251 }
252}
253#[doc = "Reader of field `CH10PEN`"]
254pub type CH10PEN_R = crate::R<bool, bool>;
255#[doc = "Write proxy for field `CH10PEN`"]
256pub struct CH10PEN_W<'a> {
257 w: &'a mut W,
258}
259impl<'a> CH10PEN_W<'a> {
260 #[doc = r"Sets the field bit"]
261 #[inline(always)]
262 pub fn set_bit(self) -> &'a mut W {
263 self.bit(true)
264 }
265 #[doc = r"Clears the field bit"]
266 #[inline(always)]
267 pub fn clear_bit(self) -> &'a mut W {
268 self.bit(false)
269 }
270 #[doc = r"Writes raw bits to the field"]
271 #[inline(always)]
272 pub fn bit(self, value: bool) -> &'a mut W {
273 self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10);
274 self.w
275 }
276}
277#[doc = "Reader of field `CH11PEN`"]
278pub type CH11PEN_R = crate::R<bool, bool>;
279#[doc = "Write proxy for field `CH11PEN`"]
280pub struct CH11PEN_W<'a> {
281 w: &'a mut W,
282}
283impl<'a> CH11PEN_W<'a> {
284 #[doc = r"Sets the field bit"]
285 #[inline(always)]
286 pub fn set_bit(self) -> &'a mut W {
287 self.bit(true)
288 }
289 #[doc = r"Clears the field bit"]
290 #[inline(always)]
291 pub fn clear_bit(self) -> &'a mut W {
292 self.bit(false)
293 }
294 #[doc = r"Writes raw bits to the field"]
295 #[inline(always)]
296 pub fn bit(self, value: bool) -> &'a mut W {
297 self.w.bits = (self.w.bits & !(0x01 << 11)) | (((value as u32) & 0x01) << 11);
298 self.w
299 }
300}
301impl R {
302 #[doc = "Bit 0 - CH0 Pin Enable"]
303 #[inline(always)]
304 pub fn ch0pen(&self) -> CH0PEN_R {
305 CH0PEN_R::new((self.bits & 0x01) != 0)
306 }
307 #[doc = "Bit 1 - CH1 Pin Enable"]
308 #[inline(always)]
309 pub fn ch1pen(&self) -> CH1PEN_R {
310 CH1PEN_R::new(((self.bits >> 1) & 0x01) != 0)
311 }
312 #[doc = "Bit 2 - CH2 Pin Enable"]
313 #[inline(always)]
314 pub fn ch2pen(&self) -> CH2PEN_R {
315 CH2PEN_R::new(((self.bits >> 2) & 0x01) != 0)
316 }
317 #[doc = "Bit 3 - CH3 Pin Enable"]
318 #[inline(always)]
319 pub fn ch3pen(&self) -> CH3PEN_R {
320 CH3PEN_R::new(((self.bits >> 3) & 0x01) != 0)
321 }
322 #[doc = "Bit 4 - CH4 Pin Enable"]
323 #[inline(always)]
324 pub fn ch4pen(&self) -> CH4PEN_R {
325 CH4PEN_R::new(((self.bits >> 4) & 0x01) != 0)
326 }
327 #[doc = "Bit 5 - CH5 Pin Enable"]
328 #[inline(always)]
329 pub fn ch5pen(&self) -> CH5PEN_R {
330 CH5PEN_R::new(((self.bits >> 5) & 0x01) != 0)
331 }
332 #[doc = "Bit 6 - CH6 Pin Enable"]
333 #[inline(always)]
334 pub fn ch6pen(&self) -> CH6PEN_R {
335 CH6PEN_R::new(((self.bits >> 6) & 0x01) != 0)
336 }
337 #[doc = "Bit 7 - CH7 Pin Enable"]
338 #[inline(always)]
339 pub fn ch7pen(&self) -> CH7PEN_R {
340 CH7PEN_R::new(((self.bits >> 7) & 0x01) != 0)
341 }
342 #[doc = "Bit 8 - CH8 Pin Enable"]
343 #[inline(always)]
344 pub fn ch8pen(&self) -> CH8PEN_R {
345 CH8PEN_R::new(((self.bits >> 8) & 0x01) != 0)
346 }
347 #[doc = "Bit 9 - CH9 Pin Enable"]
348 #[inline(always)]
349 pub fn ch9pen(&self) -> CH9PEN_R {
350 CH9PEN_R::new(((self.bits >> 9) & 0x01) != 0)
351 }
352 #[doc = "Bit 10 - CH10 Pin Enable"]
353 #[inline(always)]
354 pub fn ch10pen(&self) -> CH10PEN_R {
355 CH10PEN_R::new(((self.bits >> 10) & 0x01) != 0)
356 }
357 #[doc = "Bit 11 - CH11 Pin Enable"]
358 #[inline(always)]
359 pub fn ch11pen(&self) -> CH11PEN_R {
360 CH11PEN_R::new(((self.bits >> 11) & 0x01) != 0)
361 }
362}
363impl W {
364 #[doc = "Bit 0 - CH0 Pin Enable"]
365 #[inline(always)]
366 pub fn ch0pen(&mut self) -> CH0PEN_W {
367 CH0PEN_W { w: self }
368 }
369 #[doc = "Bit 1 - CH1 Pin Enable"]
370 #[inline(always)]
371 pub fn ch1pen(&mut self) -> CH1PEN_W {
372 CH1PEN_W { w: self }
373 }
374 #[doc = "Bit 2 - CH2 Pin Enable"]
375 #[inline(always)]
376 pub fn ch2pen(&mut self) -> CH2PEN_W {
377 CH2PEN_W { w: self }
378 }
379 #[doc = "Bit 3 - CH3 Pin Enable"]
380 #[inline(always)]
381 pub fn ch3pen(&mut self) -> CH3PEN_W {
382 CH3PEN_W { w: self }
383 }
384 #[doc = "Bit 4 - CH4 Pin Enable"]
385 #[inline(always)]
386 pub fn ch4pen(&mut self) -> CH4PEN_W {
387 CH4PEN_W { w: self }
388 }
389 #[doc = "Bit 5 - CH5 Pin Enable"]
390 #[inline(always)]
391 pub fn ch5pen(&mut self) -> CH5PEN_W {
392 CH5PEN_W { w: self }
393 }
394 #[doc = "Bit 6 - CH6 Pin Enable"]
395 #[inline(always)]
396 pub fn ch6pen(&mut self) -> CH6PEN_W {
397 CH6PEN_W { w: self }
398 }
399 #[doc = "Bit 7 - CH7 Pin Enable"]
400 #[inline(always)]
401 pub fn ch7pen(&mut self) -> CH7PEN_W {
402 CH7PEN_W { w: self }
403 }
404 #[doc = "Bit 8 - CH8 Pin Enable"]
405 #[inline(always)]
406 pub fn ch8pen(&mut self) -> CH8PEN_W {
407 CH8PEN_W { w: self }
408 }
409 #[doc = "Bit 9 - CH9 Pin Enable"]
410 #[inline(always)]
411 pub fn ch9pen(&mut self) -> CH9PEN_W {
412 CH9PEN_W { w: self }
413 }
414 #[doc = "Bit 10 - CH10 Pin Enable"]
415 #[inline(always)]
416 pub fn ch10pen(&mut self) -> CH10PEN_W {
417 CH10PEN_W { w: self }
418 }
419 #[doc = "Bit 11 - CH11 Pin Enable"]
420 #[inline(always)]
421 pub fn ch11pen(&mut self) -> CH11PEN_W {
422 CH11PEN_W { w: self }
423 }
424}