1#[doc = "Register `PCR12` reader"]
2pub struct R(crate::R<PCR12_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<PCR12_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<PCR12_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<PCR12_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `PCR12` writer"]
17pub struct W(crate::W<PCR12_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<PCR12_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<PCR12_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<PCR12_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Pull Select\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39pub enum PS_A {
40 #[doc = "0: Internal pulldown resistor is enabled on the corresponding pin, if the corresponding PE field is set."]
41 _0 = 0,
42 #[doc = "1: Internal pullup resistor is enabled on the corresponding pin, if the corresponding PE field is set."]
43 _1 = 1,
44}
45impl From<PS_A> for bool {
46 #[inline(always)]
47 fn from(variant: PS_A) -> Self {
48 variant as u8 != 0
49 }
50}
51#[doc = "Field `PS` reader - Pull Select"]
52pub struct PS_R(crate::FieldReader<bool, PS_A>);
53impl PS_R {
54 #[inline(always)]
55 pub(crate) fn new(bits: bool) -> Self {
56 PS_R(crate::FieldReader::new(bits))
57 }
58 #[doc = r"Get enumerated values variant"]
59 #[inline(always)]
60 pub fn variant(&self) -> PS_A {
61 match self.bits {
62 false => PS_A::_0,
63 true => PS_A::_1,
64 }
65 }
66 #[doc = "Checks if the value of the field is `_0`"]
67 #[inline(always)]
68 pub fn is_0(&self) -> bool {
69 **self == PS_A::_0
70 }
71 #[doc = "Checks if the value of the field is `_1`"]
72 #[inline(always)]
73 pub fn is_1(&self) -> bool {
74 **self == PS_A::_1
75 }
76}
77impl core::ops::Deref for PS_R {
78 type Target = crate::FieldReader<bool, PS_A>;
79 #[inline(always)]
80 fn deref(&self) -> &Self::Target {
81 &self.0
82 }
83}
84#[doc = "Field `PS` writer - Pull Select"]
85pub struct PS_W<'a> {
86 w: &'a mut W,
87}
88impl<'a> PS_W<'a> {
89 #[doc = r"Writes `variant` to the field"]
90 #[inline(always)]
91 pub fn variant(self, variant: PS_A) -> &'a mut W {
92 self.bit(variant.into())
93 }
94 #[doc = "Internal pulldown resistor is enabled on the corresponding pin, if the corresponding PE field is set."]
95 #[inline(always)]
96 pub fn _0(self) -> &'a mut W {
97 self.variant(PS_A::_0)
98 }
99 #[doc = "Internal pullup resistor is enabled on the corresponding pin, if the corresponding PE field is set."]
100 #[inline(always)]
101 pub fn _1(self) -> &'a mut W {
102 self.variant(PS_A::_1)
103 }
104 #[doc = r"Sets the field bit"]
105 #[inline(always)]
106 pub fn set_bit(self) -> &'a mut W {
107 self.bit(true)
108 }
109 #[doc = r"Clears the field bit"]
110 #[inline(always)]
111 pub fn clear_bit(self) -> &'a mut W {
112 self.bit(false)
113 }
114 #[doc = r"Writes raw bits to the field"]
115 #[inline(always)]
116 pub fn bit(self, value: bool) -> &'a mut W {
117 self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
118 self.w
119 }
120}
121#[doc = "Pull Enable\n\nValue on reset: 0"]
122#[derive(Clone, Copy, Debug, PartialEq)]
123pub enum PE_A {
124 #[doc = "0: Internal pullup or pulldown resistor is not enabled on the corresponding pin."]
125 _0 = 0,
126 #[doc = "1: Internal pullup or pulldown resistor is enabled on the corresponding pin, if the pin is configured as a digital input."]
127 _1 = 1,
128}
129impl From<PE_A> for bool {
130 #[inline(always)]
131 fn from(variant: PE_A) -> Self {
132 variant as u8 != 0
133 }
134}
135#[doc = "Field `PE` reader - Pull Enable"]
136pub struct PE_R(crate::FieldReader<bool, PE_A>);
137impl PE_R {
138 #[inline(always)]
139 pub(crate) fn new(bits: bool) -> Self {
140 PE_R(crate::FieldReader::new(bits))
141 }
142 #[doc = r"Get enumerated values variant"]
143 #[inline(always)]
144 pub fn variant(&self) -> PE_A {
145 match self.bits {
146 false => PE_A::_0,
147 true => PE_A::_1,
148 }
149 }
150 #[doc = "Checks if the value of the field is `_0`"]
151 #[inline(always)]
152 pub fn is_0(&self) -> bool {
153 **self == PE_A::_0
154 }
155 #[doc = "Checks if the value of the field is `_1`"]
156 #[inline(always)]
157 pub fn is_1(&self) -> bool {
158 **self == PE_A::_1
159 }
160}
161impl core::ops::Deref for PE_R {
162 type Target = crate::FieldReader<bool, PE_A>;
163 #[inline(always)]
164 fn deref(&self) -> &Self::Target {
165 &self.0
166 }
167}
168#[doc = "Field `PE` writer - Pull Enable"]
169pub struct PE_W<'a> {
170 w: &'a mut W,
171}
172impl<'a> PE_W<'a> {
173 #[doc = r"Writes `variant` to the field"]
174 #[inline(always)]
175 pub fn variant(self, variant: PE_A) -> &'a mut W {
176 self.bit(variant.into())
177 }
178 #[doc = "Internal pullup or pulldown resistor is not enabled on the corresponding pin."]
179 #[inline(always)]
180 pub fn _0(self) -> &'a mut W {
181 self.variant(PE_A::_0)
182 }
183 #[doc = "Internal pullup or pulldown resistor is enabled on the corresponding pin, if the pin is configured as a digital input."]
184 #[inline(always)]
185 pub fn _1(self) -> &'a mut W {
186 self.variant(PE_A::_1)
187 }
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 << 1)) | ((value as u32 & 0x01) << 1);
202 self.w
203 }
204}
205#[doc = "Pin Mux Control\n\nValue on reset: 0"]
206#[derive(Clone, Copy, Debug, PartialEq)]
207#[repr(u8)]
208pub enum MUX_A {
209 #[doc = "0: Pin disabled (Alternative 0) (analog)."]
210 _000 = 0,
211 #[doc = "1: Alternative 1 (GPIO)."]
212 _001 = 1,
213 #[doc = "2: Alternative 2 (chip-specific)."]
214 _010 = 2,
215 #[doc = "3: Alternative 3 (chip-specific)."]
216 _011 = 3,
217 #[doc = "4: Alternative 4 (chip-specific)."]
218 _100 = 4,
219 #[doc = "5: Alternative 5 (chip-specific)."]
220 _101 = 5,
221 #[doc = "6: Alternative 6 (chip-specific)."]
222 _110 = 6,
223 #[doc = "7: Alternative 7 (chip-specific)."]
224 _111 = 7,
225}
226impl From<MUX_A> for u8 {
227 #[inline(always)]
228 fn from(variant: MUX_A) -> Self {
229 variant as _
230 }
231}
232#[doc = "Field `MUX` reader - Pin Mux Control"]
233pub struct MUX_R(crate::FieldReader<u8, MUX_A>);
234impl MUX_R {
235 #[inline(always)]
236 pub(crate) fn new(bits: u8) -> Self {
237 MUX_R(crate::FieldReader::new(bits))
238 }
239 #[doc = r"Get enumerated values variant"]
240 #[inline(always)]
241 pub fn variant(&self) -> MUX_A {
242 match self.bits {
243 0 => MUX_A::_000,
244 1 => MUX_A::_001,
245 2 => MUX_A::_010,
246 3 => MUX_A::_011,
247 4 => MUX_A::_100,
248 5 => MUX_A::_101,
249 6 => MUX_A::_110,
250 7 => MUX_A::_111,
251 _ => unreachable!(),
252 }
253 }
254 #[doc = "Checks if the value of the field is `_000`"]
255 #[inline(always)]
256 pub fn is_000(&self) -> bool {
257 **self == MUX_A::_000
258 }
259 #[doc = "Checks if the value of the field is `_001`"]
260 #[inline(always)]
261 pub fn is_001(&self) -> bool {
262 **self == MUX_A::_001
263 }
264 #[doc = "Checks if the value of the field is `_010`"]
265 #[inline(always)]
266 pub fn is_010(&self) -> bool {
267 **self == MUX_A::_010
268 }
269 #[doc = "Checks if the value of the field is `_011`"]
270 #[inline(always)]
271 pub fn is_011(&self) -> bool {
272 **self == MUX_A::_011
273 }
274 #[doc = "Checks if the value of the field is `_100`"]
275 #[inline(always)]
276 pub fn is_100(&self) -> bool {
277 **self == MUX_A::_100
278 }
279 #[doc = "Checks if the value of the field is `_101`"]
280 #[inline(always)]
281 pub fn is_101(&self) -> bool {
282 **self == MUX_A::_101
283 }
284 #[doc = "Checks if the value of the field is `_110`"]
285 #[inline(always)]
286 pub fn is_110(&self) -> bool {
287 **self == MUX_A::_110
288 }
289 #[doc = "Checks if the value of the field is `_111`"]
290 #[inline(always)]
291 pub fn is_111(&self) -> bool {
292 **self == MUX_A::_111
293 }
294}
295impl core::ops::Deref for MUX_R {
296 type Target = crate::FieldReader<u8, MUX_A>;
297 #[inline(always)]
298 fn deref(&self) -> &Self::Target {
299 &self.0
300 }
301}
302#[doc = "Field `MUX` writer - Pin Mux Control"]
303pub struct MUX_W<'a> {
304 w: &'a mut W,
305}
306impl<'a> MUX_W<'a> {
307 #[doc = r"Writes `variant` to the field"]
308 #[inline(always)]
309 pub fn variant(self, variant: MUX_A) -> &'a mut W {
310 self.bits(variant.into())
311 }
312 #[doc = "Pin disabled (Alternative 0) (analog)."]
313 #[inline(always)]
314 pub fn _000(self) -> &'a mut W {
315 self.variant(MUX_A::_000)
316 }
317 #[doc = "Alternative 1 (GPIO)."]
318 #[inline(always)]
319 pub fn _001(self) -> &'a mut W {
320 self.variant(MUX_A::_001)
321 }
322 #[doc = "Alternative 2 (chip-specific)."]
323 #[inline(always)]
324 pub fn _010(self) -> &'a mut W {
325 self.variant(MUX_A::_010)
326 }
327 #[doc = "Alternative 3 (chip-specific)."]
328 #[inline(always)]
329 pub fn _011(self) -> &'a mut W {
330 self.variant(MUX_A::_011)
331 }
332 #[doc = "Alternative 4 (chip-specific)."]
333 #[inline(always)]
334 pub fn _100(self) -> &'a mut W {
335 self.variant(MUX_A::_100)
336 }
337 #[doc = "Alternative 5 (chip-specific)."]
338 #[inline(always)]
339 pub fn _101(self) -> &'a mut W {
340 self.variant(MUX_A::_101)
341 }
342 #[doc = "Alternative 6 (chip-specific)."]
343 #[inline(always)]
344 pub fn _110(self) -> &'a mut W {
345 self.variant(MUX_A::_110)
346 }
347 #[doc = "Alternative 7 (chip-specific)."]
348 #[inline(always)]
349 pub fn _111(self) -> &'a mut W {
350 self.variant(MUX_A::_111)
351 }
352 #[doc = r"Writes raw bits to the field"]
353 #[inline(always)]
354 pub fn bits(self, value: u8) -> &'a mut W {
355 self.w.bits = (self.w.bits & !(0x07 << 8)) | ((value as u32 & 0x07) << 8);
356 self.w
357 }
358}
359#[doc = "Lock Register\n\nValue on reset: 0"]
360#[derive(Clone, Copy, Debug, PartialEq)]
361pub enum LK_A {
362 #[doc = "0: Pin Control Register fields \\[15:0\\]
363are not locked."]
364 _0 = 0,
365 #[doc = "1: Pin Control Register fields \\[15:0\\]
366are locked and cannot be updated until the next system reset."]
367 _1 = 1,
368}
369impl From<LK_A> for bool {
370 #[inline(always)]
371 fn from(variant: LK_A) -> Self {
372 variant as u8 != 0
373 }
374}
375#[doc = "Field `LK` reader - Lock Register"]
376pub struct LK_R(crate::FieldReader<bool, LK_A>);
377impl LK_R {
378 #[inline(always)]
379 pub(crate) fn new(bits: bool) -> Self {
380 LK_R(crate::FieldReader::new(bits))
381 }
382 #[doc = r"Get enumerated values variant"]
383 #[inline(always)]
384 pub fn variant(&self) -> LK_A {
385 match self.bits {
386 false => LK_A::_0,
387 true => LK_A::_1,
388 }
389 }
390 #[doc = "Checks if the value of the field is `_0`"]
391 #[inline(always)]
392 pub fn is_0(&self) -> bool {
393 **self == LK_A::_0
394 }
395 #[doc = "Checks if the value of the field is `_1`"]
396 #[inline(always)]
397 pub fn is_1(&self) -> bool {
398 **self == LK_A::_1
399 }
400}
401impl core::ops::Deref for LK_R {
402 type Target = crate::FieldReader<bool, LK_A>;
403 #[inline(always)]
404 fn deref(&self) -> &Self::Target {
405 &self.0
406 }
407}
408#[doc = "Field `LK` writer - Lock Register"]
409pub struct LK_W<'a> {
410 w: &'a mut W,
411}
412impl<'a> LK_W<'a> {
413 #[doc = r"Writes `variant` to the field"]
414 #[inline(always)]
415 pub fn variant(self, variant: LK_A) -> &'a mut W {
416 self.bit(variant.into())
417 }
418 #[doc = "Pin Control Register fields \\[15:0\\]
419are not locked."]
420 #[inline(always)]
421 pub fn _0(self) -> &'a mut W {
422 self.variant(LK_A::_0)
423 }
424 #[doc = "Pin Control Register fields \\[15:0\\]
425are locked and cannot be updated until the next system reset."]
426 #[inline(always)]
427 pub fn _1(self) -> &'a mut W {
428 self.variant(LK_A::_1)
429 }
430 #[doc = r"Sets the field bit"]
431 #[inline(always)]
432 pub fn set_bit(self) -> &'a mut W {
433 self.bit(true)
434 }
435 #[doc = r"Clears the field bit"]
436 #[inline(always)]
437 pub fn clear_bit(self) -> &'a mut W {
438 self.bit(false)
439 }
440 #[doc = r"Writes raw bits to the field"]
441 #[inline(always)]
442 pub fn bit(self, value: bool) -> &'a mut W {
443 self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15);
444 self.w
445 }
446}
447#[doc = "Interrupt Configuration\n\nValue on reset: 0"]
448#[derive(Clone, Copy, Debug, PartialEq)]
449#[repr(u8)]
450pub enum IRQC_A {
451 #[doc = "0: Interrupt Status Flag (ISF) is disabled."]
452 _0000 = 0,
453 #[doc = "1: ISF flag and DMA request on rising edge."]
454 _0001 = 1,
455 #[doc = "2: ISF flag and DMA request on falling edge."]
456 _0010 = 2,
457 #[doc = "3: ISF flag and DMA request on either edge."]
458 _0011 = 3,
459 #[doc = "8: ISF flag and Interrupt when logic 0."]
460 _1000 = 8,
461 #[doc = "9: ISF flag and Interrupt on rising-edge."]
462 _1001 = 9,
463 #[doc = "10: ISF flag and Interrupt on falling-edge."]
464 _1010 = 10,
465 #[doc = "11: ISF flag and Interrupt on either edge."]
466 _1011 = 11,
467 #[doc = "12: ISF flag and Interrupt when logic 1."]
468 _1100 = 12,
469}
470impl From<IRQC_A> for u8 {
471 #[inline(always)]
472 fn from(variant: IRQC_A) -> Self {
473 variant as _
474 }
475}
476#[doc = "Field `IRQC` reader - Interrupt Configuration"]
477pub struct IRQC_R(crate::FieldReader<u8, IRQC_A>);
478impl IRQC_R {
479 #[inline(always)]
480 pub(crate) fn new(bits: u8) -> Self {
481 IRQC_R(crate::FieldReader::new(bits))
482 }
483 #[doc = r"Get enumerated values variant"]
484 #[inline(always)]
485 pub fn variant(&self) -> Option<IRQC_A> {
486 match self.bits {
487 0 => Some(IRQC_A::_0000),
488 1 => Some(IRQC_A::_0001),
489 2 => Some(IRQC_A::_0010),
490 3 => Some(IRQC_A::_0011),
491 8 => Some(IRQC_A::_1000),
492 9 => Some(IRQC_A::_1001),
493 10 => Some(IRQC_A::_1010),
494 11 => Some(IRQC_A::_1011),
495 12 => Some(IRQC_A::_1100),
496 _ => None,
497 }
498 }
499 #[doc = "Checks if the value of the field is `_0000`"]
500 #[inline(always)]
501 pub fn is_0000(&self) -> bool {
502 **self == IRQC_A::_0000
503 }
504 #[doc = "Checks if the value of the field is `_0001`"]
505 #[inline(always)]
506 pub fn is_0001(&self) -> bool {
507 **self == IRQC_A::_0001
508 }
509 #[doc = "Checks if the value of the field is `_0010`"]
510 #[inline(always)]
511 pub fn is_0010(&self) -> bool {
512 **self == IRQC_A::_0010
513 }
514 #[doc = "Checks if the value of the field is `_0011`"]
515 #[inline(always)]
516 pub fn is_0011(&self) -> bool {
517 **self == IRQC_A::_0011
518 }
519 #[doc = "Checks if the value of the field is `_1000`"]
520 #[inline(always)]
521 pub fn is_1000(&self) -> bool {
522 **self == IRQC_A::_1000
523 }
524 #[doc = "Checks if the value of the field is `_1001`"]
525 #[inline(always)]
526 pub fn is_1001(&self) -> bool {
527 **self == IRQC_A::_1001
528 }
529 #[doc = "Checks if the value of the field is `_1010`"]
530 #[inline(always)]
531 pub fn is_1010(&self) -> bool {
532 **self == IRQC_A::_1010
533 }
534 #[doc = "Checks if the value of the field is `_1011`"]
535 #[inline(always)]
536 pub fn is_1011(&self) -> bool {
537 **self == IRQC_A::_1011
538 }
539 #[doc = "Checks if the value of the field is `_1100`"]
540 #[inline(always)]
541 pub fn is_1100(&self) -> bool {
542 **self == IRQC_A::_1100
543 }
544}
545impl core::ops::Deref for IRQC_R {
546 type Target = crate::FieldReader<u8, IRQC_A>;
547 #[inline(always)]
548 fn deref(&self) -> &Self::Target {
549 &self.0
550 }
551}
552#[doc = "Field `IRQC` writer - Interrupt Configuration"]
553pub struct IRQC_W<'a> {
554 w: &'a mut W,
555}
556impl<'a> IRQC_W<'a> {
557 #[doc = r"Writes `variant` to the field"]
558 #[inline(always)]
559 pub fn variant(self, variant: IRQC_A) -> &'a mut W {
560 unsafe { self.bits(variant.into()) }
561 }
562 #[doc = "Interrupt Status Flag (ISF) is disabled."]
563 #[inline(always)]
564 pub fn _0000(self) -> &'a mut W {
565 self.variant(IRQC_A::_0000)
566 }
567 #[doc = "ISF flag and DMA request on rising edge."]
568 #[inline(always)]
569 pub fn _0001(self) -> &'a mut W {
570 self.variant(IRQC_A::_0001)
571 }
572 #[doc = "ISF flag and DMA request on falling edge."]
573 #[inline(always)]
574 pub fn _0010(self) -> &'a mut W {
575 self.variant(IRQC_A::_0010)
576 }
577 #[doc = "ISF flag and DMA request on either edge."]
578 #[inline(always)]
579 pub fn _0011(self) -> &'a mut W {
580 self.variant(IRQC_A::_0011)
581 }
582 #[doc = "ISF flag and Interrupt when logic 0."]
583 #[inline(always)]
584 pub fn _1000(self) -> &'a mut W {
585 self.variant(IRQC_A::_1000)
586 }
587 #[doc = "ISF flag and Interrupt on rising-edge."]
588 #[inline(always)]
589 pub fn _1001(self) -> &'a mut W {
590 self.variant(IRQC_A::_1001)
591 }
592 #[doc = "ISF flag and Interrupt on falling-edge."]
593 #[inline(always)]
594 pub fn _1010(self) -> &'a mut W {
595 self.variant(IRQC_A::_1010)
596 }
597 #[doc = "ISF flag and Interrupt on either edge."]
598 #[inline(always)]
599 pub fn _1011(self) -> &'a mut W {
600 self.variant(IRQC_A::_1011)
601 }
602 #[doc = "ISF flag and Interrupt when logic 1."]
603 #[inline(always)]
604 pub fn _1100(self) -> &'a mut W {
605 self.variant(IRQC_A::_1100)
606 }
607 #[doc = r"Writes raw bits to the field"]
608 #[inline(always)]
609 pub unsafe fn bits(self, value: u8) -> &'a mut W {
610 self.w.bits = (self.w.bits & !(0x0f << 16)) | ((value as u32 & 0x0f) << 16);
611 self.w
612 }
613}
614#[doc = "Interrupt Status Flag\n\nValue on reset: 0"]
615#[derive(Clone, Copy, Debug, PartialEq)]
616pub enum ISF_A {
617 #[doc = "0: Configured interrupt is not detected."]
618 _0 = 0,
619 #[doc = "1: Configured interrupt is detected. If the pin is configured to generate a DMA request, then the corresponding flag will be cleared automatically at the completion of the requested DMA transfer. Otherwise, the flag remains set until a logic 1 is written to the flag. If the pin is configured for a level sensitive interrupt and the pin remains asserted, then the flag is set again immediately after it is cleared."]
620 _1 = 1,
621}
622impl From<ISF_A> for bool {
623 #[inline(always)]
624 fn from(variant: ISF_A) -> Self {
625 variant as u8 != 0
626 }
627}
628#[doc = "Field `ISF` reader - Interrupt Status Flag"]
629pub struct ISF_R(crate::FieldReader<bool, ISF_A>);
630impl ISF_R {
631 #[inline(always)]
632 pub(crate) fn new(bits: bool) -> Self {
633 ISF_R(crate::FieldReader::new(bits))
634 }
635 #[doc = r"Get enumerated values variant"]
636 #[inline(always)]
637 pub fn variant(&self) -> ISF_A {
638 match self.bits {
639 false => ISF_A::_0,
640 true => ISF_A::_1,
641 }
642 }
643 #[doc = "Checks if the value of the field is `_0`"]
644 #[inline(always)]
645 pub fn is_0(&self) -> bool {
646 **self == ISF_A::_0
647 }
648 #[doc = "Checks if the value of the field is `_1`"]
649 #[inline(always)]
650 pub fn is_1(&self) -> bool {
651 **self == ISF_A::_1
652 }
653}
654impl core::ops::Deref for ISF_R {
655 type Target = crate::FieldReader<bool, ISF_A>;
656 #[inline(always)]
657 fn deref(&self) -> &Self::Target {
658 &self.0
659 }
660}
661#[doc = "Field `ISF` writer - Interrupt Status Flag"]
662pub struct ISF_W<'a> {
663 w: &'a mut W,
664}
665impl<'a> ISF_W<'a> {
666 #[doc = r"Writes `variant` to the field"]
667 #[inline(always)]
668 pub fn variant(self, variant: ISF_A) -> &'a mut W {
669 self.bit(variant.into())
670 }
671 #[doc = "Configured interrupt is not detected."]
672 #[inline(always)]
673 pub fn _0(self) -> &'a mut W {
674 self.variant(ISF_A::_0)
675 }
676 #[doc = "Configured interrupt is detected. If the pin is configured to generate a DMA request, then the corresponding flag will be cleared automatically at the completion of the requested DMA transfer. Otherwise, the flag remains set until a logic 1 is written to the flag. If the pin is configured for a level sensitive interrupt and the pin remains asserted, then the flag is set again immediately after it is cleared."]
677 #[inline(always)]
678 pub fn _1(self) -> &'a mut W {
679 self.variant(ISF_A::_1)
680 }
681 #[doc = r"Sets the field bit"]
682 #[inline(always)]
683 pub fn set_bit(self) -> &'a mut W {
684 self.bit(true)
685 }
686 #[doc = r"Clears the field bit"]
687 #[inline(always)]
688 pub fn clear_bit(self) -> &'a mut W {
689 self.bit(false)
690 }
691 #[doc = r"Writes raw bits to the field"]
692 #[inline(always)]
693 pub fn bit(self, value: bool) -> &'a mut W {
694 self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24);
695 self.w
696 }
697}
698impl R {
699 #[doc = "Bit 0 - Pull Select"]
700 #[inline(always)]
701 pub fn ps(&self) -> PS_R {
702 PS_R::new((self.bits & 0x01) != 0)
703 }
704 #[doc = "Bit 1 - Pull Enable"]
705 #[inline(always)]
706 pub fn pe(&self) -> PE_R {
707 PE_R::new(((self.bits >> 1) & 0x01) != 0)
708 }
709 #[doc = "Bits 8:10 - Pin Mux Control"]
710 #[inline(always)]
711 pub fn mux(&self) -> MUX_R {
712 MUX_R::new(((self.bits >> 8) & 0x07) as u8)
713 }
714 #[doc = "Bit 15 - Lock Register"]
715 #[inline(always)]
716 pub fn lk(&self) -> LK_R {
717 LK_R::new(((self.bits >> 15) & 0x01) != 0)
718 }
719 #[doc = "Bits 16:19 - Interrupt Configuration"]
720 #[inline(always)]
721 pub fn irqc(&self) -> IRQC_R {
722 IRQC_R::new(((self.bits >> 16) & 0x0f) as u8)
723 }
724 #[doc = "Bit 24 - Interrupt Status Flag"]
725 #[inline(always)]
726 pub fn isf(&self) -> ISF_R {
727 ISF_R::new(((self.bits >> 24) & 0x01) != 0)
728 }
729}
730impl W {
731 #[doc = "Bit 0 - Pull Select"]
732 #[inline(always)]
733 pub fn ps(&mut self) -> PS_W {
734 PS_W { w: self }
735 }
736 #[doc = "Bit 1 - Pull Enable"]
737 #[inline(always)]
738 pub fn pe(&mut self) -> PE_W {
739 PE_W { w: self }
740 }
741 #[doc = "Bits 8:10 - Pin Mux Control"]
742 #[inline(always)]
743 pub fn mux(&mut self) -> MUX_W {
744 MUX_W { w: self }
745 }
746 #[doc = "Bit 15 - Lock Register"]
747 #[inline(always)]
748 pub fn lk(&mut self) -> LK_W {
749 LK_W { w: self }
750 }
751 #[doc = "Bits 16:19 - Interrupt Configuration"]
752 #[inline(always)]
753 pub fn irqc(&mut self) -> IRQC_W {
754 IRQC_W { w: self }
755 }
756 #[doc = "Bit 24 - Interrupt Status Flag"]
757 #[inline(always)]
758 pub fn isf(&mut self) -> ISF_W {
759 ISF_W { w: self }
760 }
761 #[doc = "Writes raw bits to the register."]
762 #[inline(always)]
763 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
764 self.0.bits(bits);
765 self
766 }
767}
768#[doc = "Pin Control Register n\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 [pcr12](index.html) module"]
769pub struct PCR12_SPEC;
770impl crate::RegisterSpec for PCR12_SPEC {
771 type Ux = u32;
772}
773#[doc = "`read()` method returns [pcr12::R](R) reader structure"]
774impl crate::Readable for PCR12_SPEC {
775 type Reader = R;
776}
777#[doc = "`write(|w| ..)` method takes [pcr12::W](W) writer structure"]
778impl crate::Writable for PCR12_SPEC {
779 type Writer = W;
780}
781#[doc = "`reset()` method sets PCR12 to value 0"]
782impl crate::Resettable for PCR12_SPEC {
783 #[inline(always)]
784 fn reset_value() -> Self::Ux {
785 0
786 }
787}