lpc550x/inputmux/
timer3captsel.rs1#[doc = "Register `TIMER3CAPTSEL[%s]` reader"]
2pub struct R(crate::R<TIMER3CAPTSEL_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<TIMER3CAPTSEL_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<TIMER3CAPTSEL_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<TIMER3CAPTSEL_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `TIMER3CAPTSEL[%s]` writer"]
17pub struct W(crate::W<TIMER3CAPTSEL_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<TIMER3CAPTSEL_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<TIMER3CAPTSEL_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<TIMER3CAPTSEL_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `CAPTSEL` reader - Input number to TIMER3 capture inputs 0 to 4."]
38pub type CAPTSEL_R = crate::FieldReader<u8, CAPTSEL_A>;
39#[doc = "Input number to TIMER3 capture inputs 0 to 4.\n\nValue on reset: 31"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41#[repr(u8)]
42pub enum CAPTSEL_A {
43 #[doc = "0: CT_INP0 function selected from IOCON register."]
44 VAL0 = 0,
45 #[doc = "1: CT_INP1 function selected from IOCON register."]
46 VAL1 = 1,
47 #[doc = "2: CT_INP2 function selected from IOCON register."]
48 VAL2 = 2,
49 #[doc = "3: CT_INP3 function selected from IOCON register."]
50 VAL3 = 3,
51 #[doc = "4: CT_INP4 function selected from IOCON register."]
52 VAL4 = 4,
53 #[doc = "5: CT_INP5 function selected from IOCON register."]
54 VAL5 = 5,
55 #[doc = "6: CT_INP6 function selected from IOCON register."]
56 VAL6 = 6,
57 #[doc = "7: CT_INP7 function selected from IOCON register."]
58 VAL7 = 7,
59 #[doc = "8: CT_INP8 function selected from IOCON register."]
60 VAL8 = 8,
61 #[doc = "9: CT_INP9 function selected from IOCON register."]
62 VAL9 = 9,
63 #[doc = "10: CT_INP10 function selected from IOCON register."]
64 VAL10 = 10,
65 #[doc = "11: CT_INP11 function selected from IOCON register."]
66 VAL11 = 11,
67 #[doc = "12: CT_INP12 function selected from IOCON register."]
68 VAL12 = 12,
69 #[doc = "13: CT_INP13 function selected from IOCON register."]
70 VAL13 = 13,
71 #[doc = "14: CT_INP14 function selected from IOCON register."]
72 VAL14 = 14,
73 #[doc = "15: CT_INP15 function selected from IOCON register."]
74 VAL15 = 15,
75 #[doc = "16: CT_INP16 function selected from IOCON register."]
76 VAL16 = 16,
77 #[doc = "17: None."]
78 VAL17 = 17,
79 #[doc = "18: None."]
80 VAL18 = 18,
81 #[doc = "19: None."]
82 VAL19 = 19,
83 #[doc = "20: None."]
84 VAL20 = 20,
85 #[doc = "21: None."]
86 VAL21 = 21,
87 #[doc = "22: COMP_OUTPUT output from analog comparator."]
88 VAL22 = 22,
89 #[doc = "23: I2S_SHARED_WS\\[0\\]
90output from I2S pin sharing."]
91 VAL23 = 23,
92 #[doc = "24: I2S_SHARED_WS\\[1\\]
93output from I2S pin sharing."]
94 VAL24 = 24,
95 #[doc = "25: None."]
96 VAL25 = 25,
97 #[doc = "26: None."]
98 VAL26 = 26,
99 #[doc = "27: None."]
100 VAL27 = 27,
101 #[doc = "28: None."]
102 VAL28 = 28,
103 #[doc = "29: None."]
104 VAL29 = 29,
105 #[doc = "30: None."]
106 VAL30 = 30,
107 #[doc = "31: None."]
108 VAL31 = 31,
109}
110impl From<CAPTSEL_A> for u8 {
111 #[inline(always)]
112 fn from(variant: CAPTSEL_A) -> Self {
113 variant as _
114 }
115}
116impl CAPTSEL_R {
117 #[doc = "Get enumerated values variant"]
118 #[inline(always)]
119 pub fn variant(&self) -> CAPTSEL_A {
120 match self.bits {
121 0 => CAPTSEL_A::VAL0,
122 1 => CAPTSEL_A::VAL1,
123 2 => CAPTSEL_A::VAL2,
124 3 => CAPTSEL_A::VAL3,
125 4 => CAPTSEL_A::VAL4,
126 5 => CAPTSEL_A::VAL5,
127 6 => CAPTSEL_A::VAL6,
128 7 => CAPTSEL_A::VAL7,
129 8 => CAPTSEL_A::VAL8,
130 9 => CAPTSEL_A::VAL9,
131 10 => CAPTSEL_A::VAL10,
132 11 => CAPTSEL_A::VAL11,
133 12 => CAPTSEL_A::VAL12,
134 13 => CAPTSEL_A::VAL13,
135 14 => CAPTSEL_A::VAL14,
136 15 => CAPTSEL_A::VAL15,
137 16 => CAPTSEL_A::VAL16,
138 17 => CAPTSEL_A::VAL17,
139 18 => CAPTSEL_A::VAL18,
140 19 => CAPTSEL_A::VAL19,
141 20 => CAPTSEL_A::VAL20,
142 21 => CAPTSEL_A::VAL21,
143 22 => CAPTSEL_A::VAL22,
144 23 => CAPTSEL_A::VAL23,
145 24 => CAPTSEL_A::VAL24,
146 25 => CAPTSEL_A::VAL25,
147 26 => CAPTSEL_A::VAL26,
148 27 => CAPTSEL_A::VAL27,
149 28 => CAPTSEL_A::VAL28,
150 29 => CAPTSEL_A::VAL29,
151 30 => CAPTSEL_A::VAL30,
152 31 => CAPTSEL_A::VAL31,
153 _ => unreachable!(),
154 }
155 }
156 #[doc = "Checks if the value of the field is `VAL0`"]
157 #[inline(always)]
158 pub fn is_val0(&self) -> bool {
159 *self == CAPTSEL_A::VAL0
160 }
161 #[doc = "Checks if the value of the field is `VAL1`"]
162 #[inline(always)]
163 pub fn is_val1(&self) -> bool {
164 *self == CAPTSEL_A::VAL1
165 }
166 #[doc = "Checks if the value of the field is `VAL2`"]
167 #[inline(always)]
168 pub fn is_val2(&self) -> bool {
169 *self == CAPTSEL_A::VAL2
170 }
171 #[doc = "Checks if the value of the field is `VAL3`"]
172 #[inline(always)]
173 pub fn is_val3(&self) -> bool {
174 *self == CAPTSEL_A::VAL3
175 }
176 #[doc = "Checks if the value of the field is `VAL4`"]
177 #[inline(always)]
178 pub fn is_val4(&self) -> bool {
179 *self == CAPTSEL_A::VAL4
180 }
181 #[doc = "Checks if the value of the field is `VAL5`"]
182 #[inline(always)]
183 pub fn is_val5(&self) -> bool {
184 *self == CAPTSEL_A::VAL5
185 }
186 #[doc = "Checks if the value of the field is `VAL6`"]
187 #[inline(always)]
188 pub fn is_val6(&self) -> bool {
189 *self == CAPTSEL_A::VAL6
190 }
191 #[doc = "Checks if the value of the field is `VAL7`"]
192 #[inline(always)]
193 pub fn is_val7(&self) -> bool {
194 *self == CAPTSEL_A::VAL7
195 }
196 #[doc = "Checks if the value of the field is `VAL8`"]
197 #[inline(always)]
198 pub fn is_val8(&self) -> bool {
199 *self == CAPTSEL_A::VAL8
200 }
201 #[doc = "Checks if the value of the field is `VAL9`"]
202 #[inline(always)]
203 pub fn is_val9(&self) -> bool {
204 *self == CAPTSEL_A::VAL9
205 }
206 #[doc = "Checks if the value of the field is `VAL10`"]
207 #[inline(always)]
208 pub fn is_val10(&self) -> bool {
209 *self == CAPTSEL_A::VAL10
210 }
211 #[doc = "Checks if the value of the field is `VAL11`"]
212 #[inline(always)]
213 pub fn is_val11(&self) -> bool {
214 *self == CAPTSEL_A::VAL11
215 }
216 #[doc = "Checks if the value of the field is `VAL12`"]
217 #[inline(always)]
218 pub fn is_val12(&self) -> bool {
219 *self == CAPTSEL_A::VAL12
220 }
221 #[doc = "Checks if the value of the field is `VAL13`"]
222 #[inline(always)]
223 pub fn is_val13(&self) -> bool {
224 *self == CAPTSEL_A::VAL13
225 }
226 #[doc = "Checks if the value of the field is `VAL14`"]
227 #[inline(always)]
228 pub fn is_val14(&self) -> bool {
229 *self == CAPTSEL_A::VAL14
230 }
231 #[doc = "Checks if the value of the field is `VAL15`"]
232 #[inline(always)]
233 pub fn is_val15(&self) -> bool {
234 *self == CAPTSEL_A::VAL15
235 }
236 #[doc = "Checks if the value of the field is `VAL16`"]
237 #[inline(always)]
238 pub fn is_val16(&self) -> bool {
239 *self == CAPTSEL_A::VAL16
240 }
241 #[doc = "Checks if the value of the field is `VAL17`"]
242 #[inline(always)]
243 pub fn is_val17(&self) -> bool {
244 *self == CAPTSEL_A::VAL17
245 }
246 #[doc = "Checks if the value of the field is `VAL18`"]
247 #[inline(always)]
248 pub fn is_val18(&self) -> bool {
249 *self == CAPTSEL_A::VAL18
250 }
251 #[doc = "Checks if the value of the field is `VAL19`"]
252 #[inline(always)]
253 pub fn is_val19(&self) -> bool {
254 *self == CAPTSEL_A::VAL19
255 }
256 #[doc = "Checks if the value of the field is `VAL20`"]
257 #[inline(always)]
258 pub fn is_val20(&self) -> bool {
259 *self == CAPTSEL_A::VAL20
260 }
261 #[doc = "Checks if the value of the field is `VAL21`"]
262 #[inline(always)]
263 pub fn is_val21(&self) -> bool {
264 *self == CAPTSEL_A::VAL21
265 }
266 #[doc = "Checks if the value of the field is `VAL22`"]
267 #[inline(always)]
268 pub fn is_val22(&self) -> bool {
269 *self == CAPTSEL_A::VAL22
270 }
271 #[doc = "Checks if the value of the field is `VAL23`"]
272 #[inline(always)]
273 pub fn is_val23(&self) -> bool {
274 *self == CAPTSEL_A::VAL23
275 }
276 #[doc = "Checks if the value of the field is `VAL24`"]
277 #[inline(always)]
278 pub fn is_val24(&self) -> bool {
279 *self == CAPTSEL_A::VAL24
280 }
281 #[doc = "Checks if the value of the field is `VAL25`"]
282 #[inline(always)]
283 pub fn is_val25(&self) -> bool {
284 *self == CAPTSEL_A::VAL25
285 }
286 #[doc = "Checks if the value of the field is `VAL26`"]
287 #[inline(always)]
288 pub fn is_val26(&self) -> bool {
289 *self == CAPTSEL_A::VAL26
290 }
291 #[doc = "Checks if the value of the field is `VAL27`"]
292 #[inline(always)]
293 pub fn is_val27(&self) -> bool {
294 *self == CAPTSEL_A::VAL27
295 }
296 #[doc = "Checks if the value of the field is `VAL28`"]
297 #[inline(always)]
298 pub fn is_val28(&self) -> bool {
299 *self == CAPTSEL_A::VAL28
300 }
301 #[doc = "Checks if the value of the field is `VAL29`"]
302 #[inline(always)]
303 pub fn is_val29(&self) -> bool {
304 *self == CAPTSEL_A::VAL29
305 }
306 #[doc = "Checks if the value of the field is `VAL30`"]
307 #[inline(always)]
308 pub fn is_val30(&self) -> bool {
309 *self == CAPTSEL_A::VAL30
310 }
311 #[doc = "Checks if the value of the field is `VAL31`"]
312 #[inline(always)]
313 pub fn is_val31(&self) -> bool {
314 *self == CAPTSEL_A::VAL31
315 }
316}
317#[doc = "Field `CAPTSEL` writer - Input number to TIMER3 capture inputs 0 to 4."]
318pub type CAPTSEL_W<'a, const O: u8> =
319 crate::FieldWriterSafe<'a, u32, TIMER3CAPTSEL_SPEC, u8, CAPTSEL_A, 5, O>;
320impl<'a, const O: u8> CAPTSEL_W<'a, O> {
321 #[doc = "CT_INP0 function selected from IOCON register."]
322 #[inline(always)]
323 pub fn val0(self) -> &'a mut W {
324 self.variant(CAPTSEL_A::VAL0)
325 }
326 #[doc = "CT_INP1 function selected from IOCON register."]
327 #[inline(always)]
328 pub fn val1(self) -> &'a mut W {
329 self.variant(CAPTSEL_A::VAL1)
330 }
331 #[doc = "CT_INP2 function selected from IOCON register."]
332 #[inline(always)]
333 pub fn val2(self) -> &'a mut W {
334 self.variant(CAPTSEL_A::VAL2)
335 }
336 #[doc = "CT_INP3 function selected from IOCON register."]
337 #[inline(always)]
338 pub fn val3(self) -> &'a mut W {
339 self.variant(CAPTSEL_A::VAL3)
340 }
341 #[doc = "CT_INP4 function selected from IOCON register."]
342 #[inline(always)]
343 pub fn val4(self) -> &'a mut W {
344 self.variant(CAPTSEL_A::VAL4)
345 }
346 #[doc = "CT_INP5 function selected from IOCON register."]
347 #[inline(always)]
348 pub fn val5(self) -> &'a mut W {
349 self.variant(CAPTSEL_A::VAL5)
350 }
351 #[doc = "CT_INP6 function selected from IOCON register."]
352 #[inline(always)]
353 pub fn val6(self) -> &'a mut W {
354 self.variant(CAPTSEL_A::VAL6)
355 }
356 #[doc = "CT_INP7 function selected from IOCON register."]
357 #[inline(always)]
358 pub fn val7(self) -> &'a mut W {
359 self.variant(CAPTSEL_A::VAL7)
360 }
361 #[doc = "CT_INP8 function selected from IOCON register."]
362 #[inline(always)]
363 pub fn val8(self) -> &'a mut W {
364 self.variant(CAPTSEL_A::VAL8)
365 }
366 #[doc = "CT_INP9 function selected from IOCON register."]
367 #[inline(always)]
368 pub fn val9(self) -> &'a mut W {
369 self.variant(CAPTSEL_A::VAL9)
370 }
371 #[doc = "CT_INP10 function selected from IOCON register."]
372 #[inline(always)]
373 pub fn val10(self) -> &'a mut W {
374 self.variant(CAPTSEL_A::VAL10)
375 }
376 #[doc = "CT_INP11 function selected from IOCON register."]
377 #[inline(always)]
378 pub fn val11(self) -> &'a mut W {
379 self.variant(CAPTSEL_A::VAL11)
380 }
381 #[doc = "CT_INP12 function selected from IOCON register."]
382 #[inline(always)]
383 pub fn val12(self) -> &'a mut W {
384 self.variant(CAPTSEL_A::VAL12)
385 }
386 #[doc = "CT_INP13 function selected from IOCON register."]
387 #[inline(always)]
388 pub fn val13(self) -> &'a mut W {
389 self.variant(CAPTSEL_A::VAL13)
390 }
391 #[doc = "CT_INP14 function selected from IOCON register."]
392 #[inline(always)]
393 pub fn val14(self) -> &'a mut W {
394 self.variant(CAPTSEL_A::VAL14)
395 }
396 #[doc = "CT_INP15 function selected from IOCON register."]
397 #[inline(always)]
398 pub fn val15(self) -> &'a mut W {
399 self.variant(CAPTSEL_A::VAL15)
400 }
401 #[doc = "CT_INP16 function selected from IOCON register."]
402 #[inline(always)]
403 pub fn val16(self) -> &'a mut W {
404 self.variant(CAPTSEL_A::VAL16)
405 }
406 #[doc = "None."]
407 #[inline(always)]
408 pub fn val17(self) -> &'a mut W {
409 self.variant(CAPTSEL_A::VAL17)
410 }
411 #[doc = "None."]
412 #[inline(always)]
413 pub fn val18(self) -> &'a mut W {
414 self.variant(CAPTSEL_A::VAL18)
415 }
416 #[doc = "None."]
417 #[inline(always)]
418 pub fn val19(self) -> &'a mut W {
419 self.variant(CAPTSEL_A::VAL19)
420 }
421 #[doc = "None."]
422 #[inline(always)]
423 pub fn val20(self) -> &'a mut W {
424 self.variant(CAPTSEL_A::VAL20)
425 }
426 #[doc = "None."]
427 #[inline(always)]
428 pub fn val21(self) -> &'a mut W {
429 self.variant(CAPTSEL_A::VAL21)
430 }
431 #[doc = "COMP_OUTPUT output from analog comparator."]
432 #[inline(always)]
433 pub fn val22(self) -> &'a mut W {
434 self.variant(CAPTSEL_A::VAL22)
435 }
436 #[doc = "I2S_SHARED_WS\\[0\\]
437output from I2S pin sharing."]
438 #[inline(always)]
439 pub fn val23(self) -> &'a mut W {
440 self.variant(CAPTSEL_A::VAL23)
441 }
442 #[doc = "I2S_SHARED_WS\\[1\\]
443output from I2S pin sharing."]
444 #[inline(always)]
445 pub fn val24(self) -> &'a mut W {
446 self.variant(CAPTSEL_A::VAL24)
447 }
448 #[doc = "None."]
449 #[inline(always)]
450 pub fn val25(self) -> &'a mut W {
451 self.variant(CAPTSEL_A::VAL25)
452 }
453 #[doc = "None."]
454 #[inline(always)]
455 pub fn val26(self) -> &'a mut W {
456 self.variant(CAPTSEL_A::VAL26)
457 }
458 #[doc = "None."]
459 #[inline(always)]
460 pub fn val27(self) -> &'a mut W {
461 self.variant(CAPTSEL_A::VAL27)
462 }
463 #[doc = "None."]
464 #[inline(always)]
465 pub fn val28(self) -> &'a mut W {
466 self.variant(CAPTSEL_A::VAL28)
467 }
468 #[doc = "None."]
469 #[inline(always)]
470 pub fn val29(self) -> &'a mut W {
471 self.variant(CAPTSEL_A::VAL29)
472 }
473 #[doc = "None."]
474 #[inline(always)]
475 pub fn val30(self) -> &'a mut W {
476 self.variant(CAPTSEL_A::VAL30)
477 }
478 #[doc = "None."]
479 #[inline(always)]
480 pub fn val31(self) -> &'a mut W {
481 self.variant(CAPTSEL_A::VAL31)
482 }
483}
484impl R {
485 #[doc = "Bits 0:4 - Input number to TIMER3 capture inputs 0 to 4."]
486 #[inline(always)]
487 pub fn captsel(&self) -> CAPTSEL_R {
488 CAPTSEL_R::new((self.bits & 0x1f) as u8)
489 }
490}
491impl W {
492 #[doc = "Bits 0:4 - Input number to TIMER3 capture inputs 0 to 4."]
493 #[inline(always)]
494 pub fn captsel(&mut self) -> CAPTSEL_W<0> {
495 CAPTSEL_W::new(self)
496 }
497 #[doc = "Writes raw bits to the register."]
498 #[inline(always)]
499 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
500 self.0.bits(bits);
501 self
502 }
503}
504#[doc = "Capture select registers for TIMER3 inputs.\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 [timer3captsel](index.html) module"]
505pub struct TIMER3CAPTSEL_SPEC;
506impl crate::RegisterSpec for TIMER3CAPTSEL_SPEC {
507 type Ux = u32;
508}
509#[doc = "`read()` method returns [timer3captsel::R](R) reader structure"]
510impl crate::Readable for TIMER3CAPTSEL_SPEC {
511 type Reader = R;
512}
513#[doc = "`write(|w| ..)` method takes [timer3captsel::W](W) writer structure"]
514impl crate::Writable for TIMER3CAPTSEL_SPEC {
515 type Writer = W;
516}
517#[doc = "`reset()` method sets TIMER3CAPTSEL[%s]
518to value 0x1f"]
519impl crate::Resettable for TIMER3CAPTSEL_SPEC {
520 #[inline(always)]
521 fn reset_value() -> Self::Ux {
522 0x1f
523 }
524}