1#[doc = "Register `PRSSEL` reader"]
2pub struct R(crate::R<PRSSEL_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<PRSSEL_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<PRSSEL_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<PRSSEL_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `PRSSEL` writer"]
17pub struct W(crate::W<PRSSEL_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<PRSSEL_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<PRSSEL_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<PRSSEL_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `PRSSTARTSEL` reader - PRS Start Select"]
38pub type PRSSTARTSEL_R = crate::FieldReader<u8, PRSSTARTSEL_A>;
39#[doc = "PRS Start Select\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41#[repr(u8)]
42pub enum PRSSTARTSEL_A {
43 #[doc = "0: PRS Channel 0 selected as input"]
44 PRSCH0 = 0,
45 #[doc = "1: PRS Channel 1 selected as input"]
46 PRSCH1 = 1,
47 #[doc = "2: PRS Channel 2 selected as input"]
48 PRSCH2 = 2,
49 #[doc = "3: PRS Channel 3 selected as input"]
50 PRSCH3 = 3,
51 #[doc = "4: PRS Channel 4 selected as input"]
52 PRSCH4 = 4,
53 #[doc = "5: PRS Channel 5 selected as input"]
54 PRSCH5 = 5,
55 #[doc = "6: PRS Channel 6 selected as input"]
56 PRSCH6 = 6,
57 #[doc = "7: PRS Channel 7 selected as input"]
58 PRSCH7 = 7,
59}
60impl From<PRSSTARTSEL_A> for u8 {
61 #[inline(always)]
62 fn from(variant: PRSSTARTSEL_A) -> Self {
63 variant as _
64 }
65}
66impl PRSSTARTSEL_R {
67 #[doc = "Get enumerated values variant"]
68 #[inline(always)]
69 pub fn variant(&self) -> PRSSTARTSEL_A {
70 match self.bits {
71 0 => PRSSTARTSEL_A::PRSCH0,
72 1 => PRSSTARTSEL_A::PRSCH1,
73 2 => PRSSTARTSEL_A::PRSCH2,
74 3 => PRSSTARTSEL_A::PRSCH3,
75 4 => PRSSTARTSEL_A::PRSCH4,
76 5 => PRSSTARTSEL_A::PRSCH5,
77 6 => PRSSTARTSEL_A::PRSCH6,
78 7 => PRSSTARTSEL_A::PRSCH7,
79 _ => unreachable!(),
80 }
81 }
82 #[doc = "Checks if the value of the field is `PRSCH0`"]
83 #[inline(always)]
84 pub fn is_prsch0(&self) -> bool {
85 *self == PRSSTARTSEL_A::PRSCH0
86 }
87 #[doc = "Checks if the value of the field is `PRSCH1`"]
88 #[inline(always)]
89 pub fn is_prsch1(&self) -> bool {
90 *self == PRSSTARTSEL_A::PRSCH1
91 }
92 #[doc = "Checks if the value of the field is `PRSCH2`"]
93 #[inline(always)]
94 pub fn is_prsch2(&self) -> bool {
95 *self == PRSSTARTSEL_A::PRSCH2
96 }
97 #[doc = "Checks if the value of the field is `PRSCH3`"]
98 #[inline(always)]
99 pub fn is_prsch3(&self) -> bool {
100 *self == PRSSTARTSEL_A::PRSCH3
101 }
102 #[doc = "Checks if the value of the field is `PRSCH4`"]
103 #[inline(always)]
104 pub fn is_prsch4(&self) -> bool {
105 *self == PRSSTARTSEL_A::PRSCH4
106 }
107 #[doc = "Checks if the value of the field is `PRSCH5`"]
108 #[inline(always)]
109 pub fn is_prsch5(&self) -> bool {
110 *self == PRSSTARTSEL_A::PRSCH5
111 }
112 #[doc = "Checks if the value of the field is `PRSCH6`"]
113 #[inline(always)]
114 pub fn is_prsch6(&self) -> bool {
115 *self == PRSSTARTSEL_A::PRSCH6
116 }
117 #[doc = "Checks if the value of the field is `PRSCH7`"]
118 #[inline(always)]
119 pub fn is_prsch7(&self) -> bool {
120 *self == PRSSTARTSEL_A::PRSCH7
121 }
122}
123#[doc = "Field `PRSSTARTSEL` writer - PRS Start Select"]
124pub type PRSSTARTSEL_W<'a, const O: u8> =
125 crate::FieldWriterSafe<'a, u32, PRSSEL_SPEC, u8, PRSSTARTSEL_A, 3, O>;
126impl<'a, const O: u8> PRSSTARTSEL_W<'a, O> {
127 #[doc = "PRS Channel 0 selected as input"]
128 #[inline(always)]
129 pub fn prsch0(self) -> &'a mut W {
130 self.variant(PRSSTARTSEL_A::PRSCH0)
131 }
132 #[doc = "PRS Channel 1 selected as input"]
133 #[inline(always)]
134 pub fn prsch1(self) -> &'a mut W {
135 self.variant(PRSSTARTSEL_A::PRSCH1)
136 }
137 #[doc = "PRS Channel 2 selected as input"]
138 #[inline(always)]
139 pub fn prsch2(self) -> &'a mut W {
140 self.variant(PRSSTARTSEL_A::PRSCH2)
141 }
142 #[doc = "PRS Channel 3 selected as input"]
143 #[inline(always)]
144 pub fn prsch3(self) -> &'a mut W {
145 self.variant(PRSSTARTSEL_A::PRSCH3)
146 }
147 #[doc = "PRS Channel 4 selected as input"]
148 #[inline(always)]
149 pub fn prsch4(self) -> &'a mut W {
150 self.variant(PRSSTARTSEL_A::PRSCH4)
151 }
152 #[doc = "PRS Channel 5 selected as input"]
153 #[inline(always)]
154 pub fn prsch5(self) -> &'a mut W {
155 self.variant(PRSSTARTSEL_A::PRSCH5)
156 }
157 #[doc = "PRS Channel 6 selected as input"]
158 #[inline(always)]
159 pub fn prsch6(self) -> &'a mut W {
160 self.variant(PRSSTARTSEL_A::PRSCH6)
161 }
162 #[doc = "PRS Channel 7 selected as input"]
163 #[inline(always)]
164 pub fn prsch7(self) -> &'a mut W {
165 self.variant(PRSSTARTSEL_A::PRSCH7)
166 }
167}
168#[doc = "Field `PRSSTOPSEL` reader - PRS Stop Select"]
169pub type PRSSTOPSEL_R = crate::FieldReader<u8, PRSSTOPSEL_A>;
170#[doc = "PRS Stop Select\n\nValue on reset: 0"]
171#[derive(Clone, Copy, Debug, PartialEq, Eq)]
172#[repr(u8)]
173pub enum PRSSTOPSEL_A {
174 #[doc = "0: PRS Channel 0 selected as input"]
175 PRSCH0 = 0,
176 #[doc = "1: PRS Channel 1 selected as input"]
177 PRSCH1 = 1,
178 #[doc = "2: PRS Channel 2 selected as input"]
179 PRSCH2 = 2,
180 #[doc = "3: PRS Channel 3 selected as input"]
181 PRSCH3 = 3,
182 #[doc = "4: PRS Channel 4 selected as input"]
183 PRSCH4 = 4,
184 #[doc = "5: PRS Channel 5 selected as input"]
185 PRSCH5 = 5,
186 #[doc = "6: PRS Channel 6 selected as input"]
187 PRSCH6 = 6,
188 #[doc = "7: PRS Channel 7 selected as input"]
189 PRSCH7 = 7,
190}
191impl From<PRSSTOPSEL_A> for u8 {
192 #[inline(always)]
193 fn from(variant: PRSSTOPSEL_A) -> Self {
194 variant as _
195 }
196}
197impl PRSSTOPSEL_R {
198 #[doc = "Get enumerated values variant"]
199 #[inline(always)]
200 pub fn variant(&self) -> PRSSTOPSEL_A {
201 match self.bits {
202 0 => PRSSTOPSEL_A::PRSCH0,
203 1 => PRSSTOPSEL_A::PRSCH1,
204 2 => PRSSTOPSEL_A::PRSCH2,
205 3 => PRSSTOPSEL_A::PRSCH3,
206 4 => PRSSTOPSEL_A::PRSCH4,
207 5 => PRSSTOPSEL_A::PRSCH5,
208 6 => PRSSTOPSEL_A::PRSCH6,
209 7 => PRSSTOPSEL_A::PRSCH7,
210 _ => unreachable!(),
211 }
212 }
213 #[doc = "Checks if the value of the field is `PRSCH0`"]
214 #[inline(always)]
215 pub fn is_prsch0(&self) -> bool {
216 *self == PRSSTOPSEL_A::PRSCH0
217 }
218 #[doc = "Checks if the value of the field is `PRSCH1`"]
219 #[inline(always)]
220 pub fn is_prsch1(&self) -> bool {
221 *self == PRSSTOPSEL_A::PRSCH1
222 }
223 #[doc = "Checks if the value of the field is `PRSCH2`"]
224 #[inline(always)]
225 pub fn is_prsch2(&self) -> bool {
226 *self == PRSSTOPSEL_A::PRSCH2
227 }
228 #[doc = "Checks if the value of the field is `PRSCH3`"]
229 #[inline(always)]
230 pub fn is_prsch3(&self) -> bool {
231 *self == PRSSTOPSEL_A::PRSCH3
232 }
233 #[doc = "Checks if the value of the field is `PRSCH4`"]
234 #[inline(always)]
235 pub fn is_prsch4(&self) -> bool {
236 *self == PRSSTOPSEL_A::PRSCH4
237 }
238 #[doc = "Checks if the value of the field is `PRSCH5`"]
239 #[inline(always)]
240 pub fn is_prsch5(&self) -> bool {
241 *self == PRSSTOPSEL_A::PRSCH5
242 }
243 #[doc = "Checks if the value of the field is `PRSCH6`"]
244 #[inline(always)]
245 pub fn is_prsch6(&self) -> bool {
246 *self == PRSSTOPSEL_A::PRSCH6
247 }
248 #[doc = "Checks if the value of the field is `PRSCH7`"]
249 #[inline(always)]
250 pub fn is_prsch7(&self) -> bool {
251 *self == PRSSTOPSEL_A::PRSCH7
252 }
253}
254#[doc = "Field `PRSSTOPSEL` writer - PRS Stop Select"]
255pub type PRSSTOPSEL_W<'a, const O: u8> =
256 crate::FieldWriterSafe<'a, u32, PRSSEL_SPEC, u8, PRSSTOPSEL_A, 3, O>;
257impl<'a, const O: u8> PRSSTOPSEL_W<'a, O> {
258 #[doc = "PRS Channel 0 selected as input"]
259 #[inline(always)]
260 pub fn prsch0(self) -> &'a mut W {
261 self.variant(PRSSTOPSEL_A::PRSCH0)
262 }
263 #[doc = "PRS Channel 1 selected as input"]
264 #[inline(always)]
265 pub fn prsch1(self) -> &'a mut W {
266 self.variant(PRSSTOPSEL_A::PRSCH1)
267 }
268 #[doc = "PRS Channel 2 selected as input"]
269 #[inline(always)]
270 pub fn prsch2(self) -> &'a mut W {
271 self.variant(PRSSTOPSEL_A::PRSCH2)
272 }
273 #[doc = "PRS Channel 3 selected as input"]
274 #[inline(always)]
275 pub fn prsch3(self) -> &'a mut W {
276 self.variant(PRSSTOPSEL_A::PRSCH3)
277 }
278 #[doc = "PRS Channel 4 selected as input"]
279 #[inline(always)]
280 pub fn prsch4(self) -> &'a mut W {
281 self.variant(PRSSTOPSEL_A::PRSCH4)
282 }
283 #[doc = "PRS Channel 5 selected as input"]
284 #[inline(always)]
285 pub fn prsch5(self) -> &'a mut W {
286 self.variant(PRSSTOPSEL_A::PRSCH5)
287 }
288 #[doc = "PRS Channel 6 selected as input"]
289 #[inline(always)]
290 pub fn prsch6(self) -> &'a mut W {
291 self.variant(PRSSTOPSEL_A::PRSCH6)
292 }
293 #[doc = "PRS Channel 7 selected as input"]
294 #[inline(always)]
295 pub fn prsch7(self) -> &'a mut W {
296 self.variant(PRSSTOPSEL_A::PRSCH7)
297 }
298}
299#[doc = "Field `PRSCLEARSEL` reader - PRS Clear Select"]
300pub type PRSCLEARSEL_R = crate::FieldReader<u8, PRSCLEARSEL_A>;
301#[doc = "PRS Clear Select\n\nValue on reset: 0"]
302#[derive(Clone, Copy, Debug, PartialEq, Eq)]
303#[repr(u8)]
304pub enum PRSCLEARSEL_A {
305 #[doc = "0: PRS Channel 0 selected as input"]
306 PRSCH0 = 0,
307 #[doc = "1: PRS Channel 1 selected as input"]
308 PRSCH1 = 1,
309 #[doc = "2: PRS Channel 2 selected as input"]
310 PRSCH2 = 2,
311 #[doc = "3: PRS Channel 3 selected as input"]
312 PRSCH3 = 3,
313 #[doc = "4: PRS Channel 4 selected as input"]
314 PRSCH4 = 4,
315 #[doc = "5: PRS Channel 5 selected as input"]
316 PRSCH5 = 5,
317 #[doc = "6: PRS Channel 6 selected as input"]
318 PRSCH6 = 6,
319 #[doc = "7: PRS Channel 7 selected as input"]
320 PRSCH7 = 7,
321}
322impl From<PRSCLEARSEL_A> for u8 {
323 #[inline(always)]
324 fn from(variant: PRSCLEARSEL_A) -> Self {
325 variant as _
326 }
327}
328impl PRSCLEARSEL_R {
329 #[doc = "Get enumerated values variant"]
330 #[inline(always)]
331 pub fn variant(&self) -> PRSCLEARSEL_A {
332 match self.bits {
333 0 => PRSCLEARSEL_A::PRSCH0,
334 1 => PRSCLEARSEL_A::PRSCH1,
335 2 => PRSCLEARSEL_A::PRSCH2,
336 3 => PRSCLEARSEL_A::PRSCH3,
337 4 => PRSCLEARSEL_A::PRSCH4,
338 5 => PRSCLEARSEL_A::PRSCH5,
339 6 => PRSCLEARSEL_A::PRSCH6,
340 7 => PRSCLEARSEL_A::PRSCH7,
341 _ => unreachable!(),
342 }
343 }
344 #[doc = "Checks if the value of the field is `PRSCH0`"]
345 #[inline(always)]
346 pub fn is_prsch0(&self) -> bool {
347 *self == PRSCLEARSEL_A::PRSCH0
348 }
349 #[doc = "Checks if the value of the field is `PRSCH1`"]
350 #[inline(always)]
351 pub fn is_prsch1(&self) -> bool {
352 *self == PRSCLEARSEL_A::PRSCH1
353 }
354 #[doc = "Checks if the value of the field is `PRSCH2`"]
355 #[inline(always)]
356 pub fn is_prsch2(&self) -> bool {
357 *self == PRSCLEARSEL_A::PRSCH2
358 }
359 #[doc = "Checks if the value of the field is `PRSCH3`"]
360 #[inline(always)]
361 pub fn is_prsch3(&self) -> bool {
362 *self == PRSCLEARSEL_A::PRSCH3
363 }
364 #[doc = "Checks if the value of the field is `PRSCH4`"]
365 #[inline(always)]
366 pub fn is_prsch4(&self) -> bool {
367 *self == PRSCLEARSEL_A::PRSCH4
368 }
369 #[doc = "Checks if the value of the field is `PRSCH5`"]
370 #[inline(always)]
371 pub fn is_prsch5(&self) -> bool {
372 *self == PRSCLEARSEL_A::PRSCH5
373 }
374 #[doc = "Checks if the value of the field is `PRSCH6`"]
375 #[inline(always)]
376 pub fn is_prsch6(&self) -> bool {
377 *self == PRSCLEARSEL_A::PRSCH6
378 }
379 #[doc = "Checks if the value of the field is `PRSCH7`"]
380 #[inline(always)]
381 pub fn is_prsch7(&self) -> bool {
382 *self == PRSCLEARSEL_A::PRSCH7
383 }
384}
385#[doc = "Field `PRSCLEARSEL` writer - PRS Clear Select"]
386pub type PRSCLEARSEL_W<'a, const O: u8> =
387 crate::FieldWriterSafe<'a, u32, PRSSEL_SPEC, u8, PRSCLEARSEL_A, 3, O>;
388impl<'a, const O: u8> PRSCLEARSEL_W<'a, O> {
389 #[doc = "PRS Channel 0 selected as input"]
390 #[inline(always)]
391 pub fn prsch0(self) -> &'a mut W {
392 self.variant(PRSCLEARSEL_A::PRSCH0)
393 }
394 #[doc = "PRS Channel 1 selected as input"]
395 #[inline(always)]
396 pub fn prsch1(self) -> &'a mut W {
397 self.variant(PRSCLEARSEL_A::PRSCH1)
398 }
399 #[doc = "PRS Channel 2 selected as input"]
400 #[inline(always)]
401 pub fn prsch2(self) -> &'a mut W {
402 self.variant(PRSCLEARSEL_A::PRSCH2)
403 }
404 #[doc = "PRS Channel 3 selected as input"]
405 #[inline(always)]
406 pub fn prsch3(self) -> &'a mut W {
407 self.variant(PRSCLEARSEL_A::PRSCH3)
408 }
409 #[doc = "PRS Channel 4 selected as input"]
410 #[inline(always)]
411 pub fn prsch4(self) -> &'a mut W {
412 self.variant(PRSCLEARSEL_A::PRSCH4)
413 }
414 #[doc = "PRS Channel 5 selected as input"]
415 #[inline(always)]
416 pub fn prsch5(self) -> &'a mut W {
417 self.variant(PRSCLEARSEL_A::PRSCH5)
418 }
419 #[doc = "PRS Channel 6 selected as input"]
420 #[inline(always)]
421 pub fn prsch6(self) -> &'a mut W {
422 self.variant(PRSCLEARSEL_A::PRSCH6)
423 }
424 #[doc = "PRS Channel 7 selected as input"]
425 #[inline(always)]
426 pub fn prsch7(self) -> &'a mut W {
427 self.variant(PRSCLEARSEL_A::PRSCH7)
428 }
429}
430#[doc = "Field `PRSSTARTMODE` reader - PRS Start Mode"]
431pub type PRSSTARTMODE_R = crate::FieldReader<u8, PRSSTARTMODE_A>;
432#[doc = "PRS Start Mode\n\nValue on reset: 0"]
433#[derive(Clone, Copy, Debug, PartialEq, Eq)]
434#[repr(u8)]
435pub enum PRSSTARTMODE_A {
436 #[doc = "0: PRS cannot start the LETIMER"]
437 NONE = 0,
438 #[doc = "1: Rising edge of selected PRS input can start the LETIMER"]
439 RISING = 1,
440 #[doc = "2: Falling edge of selected PRS input can start the LETIMER"]
441 FALLING = 2,
442 #[doc = "3: Both the rising or falling edge of the selected PRS input can start the LETIMER"]
443 BOTH = 3,
444}
445impl From<PRSSTARTMODE_A> for u8 {
446 #[inline(always)]
447 fn from(variant: PRSSTARTMODE_A) -> Self {
448 variant as _
449 }
450}
451impl PRSSTARTMODE_R {
452 #[doc = "Get enumerated values variant"]
453 #[inline(always)]
454 pub fn variant(&self) -> PRSSTARTMODE_A {
455 match self.bits {
456 0 => PRSSTARTMODE_A::NONE,
457 1 => PRSSTARTMODE_A::RISING,
458 2 => PRSSTARTMODE_A::FALLING,
459 3 => PRSSTARTMODE_A::BOTH,
460 _ => unreachable!(),
461 }
462 }
463 #[doc = "Checks if the value of the field is `NONE`"]
464 #[inline(always)]
465 pub fn is_none(&self) -> bool {
466 *self == PRSSTARTMODE_A::NONE
467 }
468 #[doc = "Checks if the value of the field is `RISING`"]
469 #[inline(always)]
470 pub fn is_rising(&self) -> bool {
471 *self == PRSSTARTMODE_A::RISING
472 }
473 #[doc = "Checks if the value of the field is `FALLING`"]
474 #[inline(always)]
475 pub fn is_falling(&self) -> bool {
476 *self == PRSSTARTMODE_A::FALLING
477 }
478 #[doc = "Checks if the value of the field is `BOTH`"]
479 #[inline(always)]
480 pub fn is_both(&self) -> bool {
481 *self == PRSSTARTMODE_A::BOTH
482 }
483}
484#[doc = "Field `PRSSTARTMODE` writer - PRS Start Mode"]
485pub type PRSSTARTMODE_W<'a, const O: u8> =
486 crate::FieldWriterSafe<'a, u32, PRSSEL_SPEC, u8, PRSSTARTMODE_A, 2, O>;
487impl<'a, const O: u8> PRSSTARTMODE_W<'a, O> {
488 #[doc = "PRS cannot start the LETIMER"]
489 #[inline(always)]
490 pub fn none(self) -> &'a mut W {
491 self.variant(PRSSTARTMODE_A::NONE)
492 }
493 #[doc = "Rising edge of selected PRS input can start the LETIMER"]
494 #[inline(always)]
495 pub fn rising(self) -> &'a mut W {
496 self.variant(PRSSTARTMODE_A::RISING)
497 }
498 #[doc = "Falling edge of selected PRS input can start the LETIMER"]
499 #[inline(always)]
500 pub fn falling(self) -> &'a mut W {
501 self.variant(PRSSTARTMODE_A::FALLING)
502 }
503 #[doc = "Both the rising or falling edge of the selected PRS input can start the LETIMER"]
504 #[inline(always)]
505 pub fn both(self) -> &'a mut W {
506 self.variant(PRSSTARTMODE_A::BOTH)
507 }
508}
509#[doc = "Field `PRSSTOPMODE` reader - PRS Stop Mode"]
510pub type PRSSTOPMODE_R = crate::FieldReader<u8, PRSSTOPMODE_A>;
511#[doc = "PRS Stop Mode\n\nValue on reset: 0"]
512#[derive(Clone, Copy, Debug, PartialEq, Eq)]
513#[repr(u8)]
514pub enum PRSSTOPMODE_A {
515 #[doc = "0: PRS cannot stop the LETIMER"]
516 NONE = 0,
517 #[doc = "1: Rising edge of selected PRS input can stop the LETIMER"]
518 RISING = 1,
519 #[doc = "2: Falling edge of selected PRS input can stop the LETIMER"]
520 FALLING = 2,
521 #[doc = "3: Both the rising or falling edge of the selected PRS input can stop the LETIMER"]
522 BOTH = 3,
523}
524impl From<PRSSTOPMODE_A> for u8 {
525 #[inline(always)]
526 fn from(variant: PRSSTOPMODE_A) -> Self {
527 variant as _
528 }
529}
530impl PRSSTOPMODE_R {
531 #[doc = "Get enumerated values variant"]
532 #[inline(always)]
533 pub fn variant(&self) -> PRSSTOPMODE_A {
534 match self.bits {
535 0 => PRSSTOPMODE_A::NONE,
536 1 => PRSSTOPMODE_A::RISING,
537 2 => PRSSTOPMODE_A::FALLING,
538 3 => PRSSTOPMODE_A::BOTH,
539 _ => unreachable!(),
540 }
541 }
542 #[doc = "Checks if the value of the field is `NONE`"]
543 #[inline(always)]
544 pub fn is_none(&self) -> bool {
545 *self == PRSSTOPMODE_A::NONE
546 }
547 #[doc = "Checks if the value of the field is `RISING`"]
548 #[inline(always)]
549 pub fn is_rising(&self) -> bool {
550 *self == PRSSTOPMODE_A::RISING
551 }
552 #[doc = "Checks if the value of the field is `FALLING`"]
553 #[inline(always)]
554 pub fn is_falling(&self) -> bool {
555 *self == PRSSTOPMODE_A::FALLING
556 }
557 #[doc = "Checks if the value of the field is `BOTH`"]
558 #[inline(always)]
559 pub fn is_both(&self) -> bool {
560 *self == PRSSTOPMODE_A::BOTH
561 }
562}
563#[doc = "Field `PRSSTOPMODE` writer - PRS Stop Mode"]
564pub type PRSSTOPMODE_W<'a, const O: u8> =
565 crate::FieldWriterSafe<'a, u32, PRSSEL_SPEC, u8, PRSSTOPMODE_A, 2, O>;
566impl<'a, const O: u8> PRSSTOPMODE_W<'a, O> {
567 #[doc = "PRS cannot stop the LETIMER"]
568 #[inline(always)]
569 pub fn none(self) -> &'a mut W {
570 self.variant(PRSSTOPMODE_A::NONE)
571 }
572 #[doc = "Rising edge of selected PRS input can stop the LETIMER"]
573 #[inline(always)]
574 pub fn rising(self) -> &'a mut W {
575 self.variant(PRSSTOPMODE_A::RISING)
576 }
577 #[doc = "Falling edge of selected PRS input can stop the LETIMER"]
578 #[inline(always)]
579 pub fn falling(self) -> &'a mut W {
580 self.variant(PRSSTOPMODE_A::FALLING)
581 }
582 #[doc = "Both the rising or falling edge of the selected PRS input can stop the LETIMER"]
583 #[inline(always)]
584 pub fn both(self) -> &'a mut W {
585 self.variant(PRSSTOPMODE_A::BOTH)
586 }
587}
588#[doc = "Field `PRSCLEARMODE` reader - PRS Clear Mode"]
589pub type PRSCLEARMODE_R = crate::FieldReader<u8, PRSCLEARMODE_A>;
590#[doc = "PRS Clear Mode\n\nValue on reset: 0"]
591#[derive(Clone, Copy, Debug, PartialEq, Eq)]
592#[repr(u8)]
593pub enum PRSCLEARMODE_A {
594 #[doc = "0: PRS cannot clear the LETIMER"]
595 NONE = 0,
596 #[doc = "1: Rising edge of selected PRS input can clear the LETIMER"]
597 RISING = 1,
598 #[doc = "2: Falling edge of selected PRS input can clear the LETIMER"]
599 FALLING = 2,
600 #[doc = "3: Both the rising or falling edge of the selected PRS input can clear the LETIMER"]
601 BOTH = 3,
602}
603impl From<PRSCLEARMODE_A> for u8 {
604 #[inline(always)]
605 fn from(variant: PRSCLEARMODE_A) -> Self {
606 variant as _
607 }
608}
609impl PRSCLEARMODE_R {
610 #[doc = "Get enumerated values variant"]
611 #[inline(always)]
612 pub fn variant(&self) -> PRSCLEARMODE_A {
613 match self.bits {
614 0 => PRSCLEARMODE_A::NONE,
615 1 => PRSCLEARMODE_A::RISING,
616 2 => PRSCLEARMODE_A::FALLING,
617 3 => PRSCLEARMODE_A::BOTH,
618 _ => unreachable!(),
619 }
620 }
621 #[doc = "Checks if the value of the field is `NONE`"]
622 #[inline(always)]
623 pub fn is_none(&self) -> bool {
624 *self == PRSCLEARMODE_A::NONE
625 }
626 #[doc = "Checks if the value of the field is `RISING`"]
627 #[inline(always)]
628 pub fn is_rising(&self) -> bool {
629 *self == PRSCLEARMODE_A::RISING
630 }
631 #[doc = "Checks if the value of the field is `FALLING`"]
632 #[inline(always)]
633 pub fn is_falling(&self) -> bool {
634 *self == PRSCLEARMODE_A::FALLING
635 }
636 #[doc = "Checks if the value of the field is `BOTH`"]
637 #[inline(always)]
638 pub fn is_both(&self) -> bool {
639 *self == PRSCLEARMODE_A::BOTH
640 }
641}
642#[doc = "Field `PRSCLEARMODE` writer - PRS Clear Mode"]
643pub type PRSCLEARMODE_W<'a, const O: u8> =
644 crate::FieldWriterSafe<'a, u32, PRSSEL_SPEC, u8, PRSCLEARMODE_A, 2, O>;
645impl<'a, const O: u8> PRSCLEARMODE_W<'a, O> {
646 #[doc = "PRS cannot clear the LETIMER"]
647 #[inline(always)]
648 pub fn none(self) -> &'a mut W {
649 self.variant(PRSCLEARMODE_A::NONE)
650 }
651 #[doc = "Rising edge of selected PRS input can clear the LETIMER"]
652 #[inline(always)]
653 pub fn rising(self) -> &'a mut W {
654 self.variant(PRSCLEARMODE_A::RISING)
655 }
656 #[doc = "Falling edge of selected PRS input can clear the LETIMER"]
657 #[inline(always)]
658 pub fn falling(self) -> &'a mut W {
659 self.variant(PRSCLEARMODE_A::FALLING)
660 }
661 #[doc = "Both the rising or falling edge of the selected PRS input can clear the LETIMER"]
662 #[inline(always)]
663 pub fn both(self) -> &'a mut W {
664 self.variant(PRSCLEARMODE_A::BOTH)
665 }
666}
667impl R {
668 #[doc = "Bits 0:2 - PRS Start Select"]
669 #[inline(always)]
670 pub fn prsstartsel(&self) -> PRSSTARTSEL_R {
671 PRSSTARTSEL_R::new((self.bits & 7) as u8)
672 }
673 #[doc = "Bits 6:8 - PRS Stop Select"]
674 #[inline(always)]
675 pub fn prsstopsel(&self) -> PRSSTOPSEL_R {
676 PRSSTOPSEL_R::new(((self.bits >> 6) & 7) as u8)
677 }
678 #[doc = "Bits 12:14 - PRS Clear Select"]
679 #[inline(always)]
680 pub fn prsclearsel(&self) -> PRSCLEARSEL_R {
681 PRSCLEARSEL_R::new(((self.bits >> 12) & 7) as u8)
682 }
683 #[doc = "Bits 18:19 - PRS Start Mode"]
684 #[inline(always)]
685 pub fn prsstartmode(&self) -> PRSSTARTMODE_R {
686 PRSSTARTMODE_R::new(((self.bits >> 18) & 3) as u8)
687 }
688 #[doc = "Bits 22:23 - PRS Stop Mode"]
689 #[inline(always)]
690 pub fn prsstopmode(&self) -> PRSSTOPMODE_R {
691 PRSSTOPMODE_R::new(((self.bits >> 22) & 3) as u8)
692 }
693 #[doc = "Bits 26:27 - PRS Clear Mode"]
694 #[inline(always)]
695 pub fn prsclearmode(&self) -> PRSCLEARMODE_R {
696 PRSCLEARMODE_R::new(((self.bits >> 26) & 3) as u8)
697 }
698}
699impl W {
700 #[doc = "Bits 0:2 - PRS Start Select"]
701 #[inline(always)]
702 #[must_use]
703 pub fn prsstartsel(&mut self) -> PRSSTARTSEL_W<0> {
704 PRSSTARTSEL_W::new(self)
705 }
706 #[doc = "Bits 6:8 - PRS Stop Select"]
707 #[inline(always)]
708 #[must_use]
709 pub fn prsstopsel(&mut self) -> PRSSTOPSEL_W<6> {
710 PRSSTOPSEL_W::new(self)
711 }
712 #[doc = "Bits 12:14 - PRS Clear Select"]
713 #[inline(always)]
714 #[must_use]
715 pub fn prsclearsel(&mut self) -> PRSCLEARSEL_W<12> {
716 PRSCLEARSEL_W::new(self)
717 }
718 #[doc = "Bits 18:19 - PRS Start Mode"]
719 #[inline(always)]
720 #[must_use]
721 pub fn prsstartmode(&mut self) -> PRSSTARTMODE_W<18> {
722 PRSSTARTMODE_W::new(self)
723 }
724 #[doc = "Bits 22:23 - PRS Stop Mode"]
725 #[inline(always)]
726 #[must_use]
727 pub fn prsstopmode(&mut self) -> PRSSTOPMODE_W<22> {
728 PRSSTOPMODE_W::new(self)
729 }
730 #[doc = "Bits 26:27 - PRS Clear Mode"]
731 #[inline(always)]
732 #[must_use]
733 pub fn prsclearmode(&mut self) -> PRSCLEARMODE_W<26> {
734 PRSCLEARMODE_W::new(self)
735 }
736 #[doc = "Writes raw bits to the register."]
737 #[inline(always)]
738 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
739 self.0.bits(bits);
740 self
741 }
742}
743#[doc = "PRS Input Select 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 [prssel](index.html) module"]
744pub struct PRSSEL_SPEC;
745impl crate::RegisterSpec for PRSSEL_SPEC {
746 type Ux = u32;
747}
748#[doc = "`read()` method returns [prssel::R](R) reader structure"]
749impl crate::Readable for PRSSEL_SPEC {
750 type Reader = R;
751}
752#[doc = "`write(|w| ..)` method takes [prssel::W](W) writer structure"]
753impl crate::Writable for PRSSEL_SPEC {
754 type Writer = W;
755 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
756 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
757}
758#[doc = "`reset()` method sets PRSSEL to value 0"]
759impl crate::Resettable for PRSSEL_SPEC {
760 const RESET_VALUE: Self::Ux = 0;
761}