rv32m1_ri5cy_pac/portd/
pcr0.rs

1#[doc = "Reader of register PCR0"]
2pub type R = crate::R<u32, super::PCR0>;
3#[doc = "Writer for register PCR0"]
4pub type W = crate::W<u32, super::PCR0>;
5#[doc = "Register PCR0 `reset()`'s with value 0"]
6impl crate::ResetValue for super::PCR0 {
7  type Type = u32;
8  #[inline(always)]
9  fn reset_value() -> Self::Type {
10    0
11  }
12}
13#[doc = "Pull Select\n\nValue on reset: 0"]
14#[derive(Clone, Copy, Debug, PartialEq)]
15pub enum PS_A {
16  #[doc = "0: Internal pulldown resistor is enabled on the corresponding pin, if the corresponding PE field is set."]
17  PS_0,
18  #[doc = "1: Internal pullup resistor is enabled on the corresponding pin, if the corresponding PE field is set."]
19  PS_1,
20}
21impl From<PS_A> for bool {
22  #[inline(always)]
23  fn from(variant: PS_A) -> Self {
24    match variant {
25      PS_A::PS_0 => false,
26      PS_A::PS_1 => true,
27    }
28  }
29}
30#[doc = "Reader of field `PS`"]
31pub type PS_R = crate::R<bool, PS_A>;
32impl PS_R {
33  #[doc = r"Get enumerated values variant"]
34  #[inline(always)]
35  pub fn variant(&self) -> PS_A {
36    match self.bits {
37      false => PS_A::PS_0,
38      true => PS_A::PS_1,
39    }
40  }
41  #[doc = "Checks if the value of the field is `PS_0`"]
42  #[inline(always)]
43  pub fn is_ps_0(&self) -> bool {
44    *self == PS_A::PS_0
45  }
46  #[doc = "Checks if the value of the field is `PS_1`"]
47  #[inline(always)]
48  pub fn is_ps_1(&self) -> bool {
49    *self == PS_A::PS_1
50  }
51}
52#[doc = "Write proxy for field `PS`"]
53pub struct PS_W<'a> {
54  w: &'a mut W,
55}
56impl<'a> PS_W<'a> {
57  #[doc = r"Writes `variant` to the field"]
58  #[inline(always)]
59  pub fn variant(self, variant: PS_A) -> &'a mut W {
60    {
61      self.bit(variant.into())
62    }
63  }
64  #[doc = "Internal pulldown resistor is enabled on the corresponding pin, if the corresponding PE field is set."]
65  #[inline(always)]
66  pub fn ps_0(self) -> &'a mut W {
67    self.variant(PS_A::PS_0)
68  }
69  #[doc = "Internal pullup resistor is enabled on the corresponding pin, if the corresponding PE field is set."]
70  #[inline(always)]
71  pub fn ps_1(self) -> &'a mut W {
72    self.variant(PS_A::PS_1)
73  }
74  #[doc = r"Sets the field bit"]
75  #[inline(always)]
76  pub fn set_bit(self) -> &'a mut W {
77    self.bit(true)
78  }
79  #[doc = r"Clears the field bit"]
80  #[inline(always)]
81  pub fn clear_bit(self) -> &'a mut W {
82    self.bit(false)
83  }
84  #[doc = r"Writes raw bits to the field"]
85  #[inline(always)]
86  pub fn bit(self, value: bool) -> &'a mut W {
87    self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
88    self.w
89  }
90}
91#[doc = "Pull Enable\n\nValue on reset: 0"]
92#[derive(Clone, Copy, Debug, PartialEq)]
93pub enum PE_A {
94  #[doc = "0: no description available"]
95  PE_0,
96  #[doc = "1: no description available"]
97  PE_1,
98}
99impl From<PE_A> for bool {
100  #[inline(always)]
101  fn from(variant: PE_A) -> Self {
102    match variant {
103      PE_A::PE_0 => false,
104      PE_A::PE_1 => true,
105    }
106  }
107}
108#[doc = "Reader of field `PE`"]
109pub type PE_R = crate::R<bool, PE_A>;
110impl PE_R {
111  #[doc = r"Get enumerated values variant"]
112  #[inline(always)]
113  pub fn variant(&self) -> PE_A {
114    match self.bits {
115      false => PE_A::PE_0,
116      true => PE_A::PE_1,
117    }
118  }
119  #[doc = "Checks if the value of the field is `PE_0`"]
120  #[inline(always)]
121  pub fn is_pe_0(&self) -> bool {
122    *self == PE_A::PE_0
123  }
124  #[doc = "Checks if the value of the field is `PE_1`"]
125  #[inline(always)]
126  pub fn is_pe_1(&self) -> bool {
127    *self == PE_A::PE_1
128  }
129}
130#[doc = "Write proxy for field `PE`"]
131pub struct PE_W<'a> {
132  w: &'a mut W,
133}
134impl<'a> PE_W<'a> {
135  #[doc = r"Writes `variant` to the field"]
136  #[inline(always)]
137  pub fn variant(self, variant: PE_A) -> &'a mut W {
138    {
139      self.bit(variant.into())
140    }
141  }
142  #[doc = "no description available"]
143  #[inline(always)]
144  pub fn pe_0(self) -> &'a mut W {
145    self.variant(PE_A::PE_0)
146  }
147  #[doc = "no description available"]
148  #[inline(always)]
149  pub fn pe_1(self) -> &'a mut W {
150    self.variant(PE_A::PE_1)
151  }
152  #[doc = r"Sets the field bit"]
153  #[inline(always)]
154  pub fn set_bit(self) -> &'a mut W {
155    self.bit(true)
156  }
157  #[doc = r"Clears the field bit"]
158  #[inline(always)]
159  pub fn clear_bit(self) -> &'a mut W {
160    self.bit(false)
161  }
162  #[doc = r"Writes raw bits to the field"]
163  #[inline(always)]
164  pub fn bit(self, value: bool) -> &'a mut W {
165    self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
166    self.w
167  }
168}
169#[doc = "Slew Rate Enable\n\nValue on reset: 0"]
170#[derive(Clone, Copy, Debug, PartialEq)]
171pub enum SRE_A {
172  #[doc = "0: Fast slew rate is configured on the corresponding pin, if the pin is configured as a digital output."]
173  SRE_0,
174  #[doc = "1: Slow slew rate is configured on the corresponding pin, if the pin is configured as a digital output."]
175  SRE_1,
176}
177impl From<SRE_A> for bool {
178  #[inline(always)]
179  fn from(variant: SRE_A) -> Self {
180    match variant {
181      SRE_A::SRE_0 => false,
182      SRE_A::SRE_1 => true,
183    }
184  }
185}
186#[doc = "Reader of field `SRE`"]
187pub type SRE_R = crate::R<bool, SRE_A>;
188impl SRE_R {
189  #[doc = r"Get enumerated values variant"]
190  #[inline(always)]
191  pub fn variant(&self) -> SRE_A {
192    match self.bits {
193      false => SRE_A::SRE_0,
194      true => SRE_A::SRE_1,
195    }
196  }
197  #[doc = "Checks if the value of the field is `SRE_0`"]
198  #[inline(always)]
199  pub fn is_sre_0(&self) -> bool {
200    *self == SRE_A::SRE_0
201  }
202  #[doc = "Checks if the value of the field is `SRE_1`"]
203  #[inline(always)]
204  pub fn is_sre_1(&self) -> bool {
205    *self == SRE_A::SRE_1
206  }
207}
208#[doc = "Write proxy for field `SRE`"]
209pub struct SRE_W<'a> {
210  w: &'a mut W,
211}
212impl<'a> SRE_W<'a> {
213  #[doc = r"Writes `variant` to the field"]
214  #[inline(always)]
215  pub fn variant(self, variant: SRE_A) -> &'a mut W {
216    {
217      self.bit(variant.into())
218    }
219  }
220  #[doc = "Fast slew rate is configured on the corresponding pin, if the pin is configured as a digital output."]
221  #[inline(always)]
222  pub fn sre_0(self) -> &'a mut W {
223    self.variant(SRE_A::SRE_0)
224  }
225  #[doc = "Slow slew rate is configured on the corresponding pin, if the pin is configured as a digital output."]
226  #[inline(always)]
227  pub fn sre_1(self) -> &'a mut W {
228    self.variant(SRE_A::SRE_1)
229  }
230  #[doc = r"Sets the field bit"]
231  #[inline(always)]
232  pub fn set_bit(self) -> &'a mut W {
233    self.bit(true)
234  }
235  #[doc = r"Clears the field bit"]
236  #[inline(always)]
237  pub fn clear_bit(self) -> &'a mut W {
238    self.bit(false)
239  }
240  #[doc = r"Writes raw bits to the field"]
241  #[inline(always)]
242  pub fn bit(self, value: bool) -> &'a mut W {
243    self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
244    self.w
245  }
246}
247#[doc = "Open Drain Enable\n\nValue on reset: 0"]
248#[derive(Clone, Copy, Debug, PartialEq)]
249pub enum ODE_A {
250  #[doc = "0: Open drain output is disabled on the corresponding pin."]
251  ODE_0,
252  #[doc = "1: Open drain output is enabled on the corresponding pin, if the pin is configured as a digital output."]
253  ODE_1,
254}
255impl From<ODE_A> for bool {
256  #[inline(always)]
257  fn from(variant: ODE_A) -> Self {
258    match variant {
259      ODE_A::ODE_0 => false,
260      ODE_A::ODE_1 => true,
261    }
262  }
263}
264#[doc = "Reader of field `ODE`"]
265pub type ODE_R = crate::R<bool, ODE_A>;
266impl ODE_R {
267  #[doc = r"Get enumerated values variant"]
268  #[inline(always)]
269  pub fn variant(&self) -> ODE_A {
270    match self.bits {
271      false => ODE_A::ODE_0,
272      true => ODE_A::ODE_1,
273    }
274  }
275  #[doc = "Checks if the value of the field is `ODE_0`"]
276  #[inline(always)]
277  pub fn is_ode_0(&self) -> bool {
278    *self == ODE_A::ODE_0
279  }
280  #[doc = "Checks if the value of the field is `ODE_1`"]
281  #[inline(always)]
282  pub fn is_ode_1(&self) -> bool {
283    *self == ODE_A::ODE_1
284  }
285}
286#[doc = "Write proxy for field `ODE`"]
287pub struct ODE_W<'a> {
288  w: &'a mut W,
289}
290impl<'a> ODE_W<'a> {
291  #[doc = r"Writes `variant` to the field"]
292  #[inline(always)]
293  pub fn variant(self, variant: ODE_A) -> &'a mut W {
294    {
295      self.bit(variant.into())
296    }
297  }
298  #[doc = "Open drain output is disabled on the corresponding pin."]
299  #[inline(always)]
300  pub fn ode_0(self) -> &'a mut W {
301    self.variant(ODE_A::ODE_0)
302  }
303  #[doc = "Open drain output is enabled on the corresponding pin, if the pin is configured as a digital output."]
304  #[inline(always)]
305  pub fn ode_1(self) -> &'a mut W {
306    self.variant(ODE_A::ODE_1)
307  }
308  #[doc = r"Sets the field bit"]
309  #[inline(always)]
310  pub fn set_bit(self) -> &'a mut W {
311    self.bit(true)
312  }
313  #[doc = r"Clears the field bit"]
314  #[inline(always)]
315  pub fn clear_bit(self) -> &'a mut W {
316    self.bit(false)
317  }
318  #[doc = r"Writes raw bits to the field"]
319  #[inline(always)]
320  pub fn bit(self, value: bool) -> &'a mut W {
321    self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5);
322    self.w
323  }
324}
325#[doc = "Pin Mux Control\n\nValue on reset: 0"]
326#[derive(Clone, Copy, Debug, PartialEq)]
327pub enum MUX_A {
328  #[doc = "0: Pin disabled (Alternative 0) (analog)."]
329  MUX_0,
330  #[doc = "1: Alternative 1 (GPIO)."]
331  MUX_1,
332  #[doc = "2: Alternative 2 (chip-specific)."]
333  MUX_2,
334  #[doc = "3: Alternative 3 (chip-specific)."]
335  MUX_3,
336  #[doc = "4: Alternative 4 (chip-specific)."]
337  MUX_4,
338  #[doc = "5: Alternative 5 (chip-specific)."]
339  MUX_5,
340  #[doc = "6: Alternative 6 (chip-specific)."]
341  MUX_6,
342  #[doc = "7: Alternative 7 (chip-specific)."]
343  MUX_7,
344}
345impl From<MUX_A> for u8 {
346  #[inline(always)]
347  fn from(variant: MUX_A) -> Self {
348    match variant {
349      MUX_A::MUX_0 => 0,
350      MUX_A::MUX_1 => 1,
351      MUX_A::MUX_2 => 2,
352      MUX_A::MUX_3 => 3,
353      MUX_A::MUX_4 => 4,
354      MUX_A::MUX_5 => 5,
355      MUX_A::MUX_6 => 6,
356      MUX_A::MUX_7 => 7,
357    }
358  }
359}
360#[doc = "Reader of field `MUX`"]
361pub type MUX_R = crate::R<u8, MUX_A>;
362impl MUX_R {
363  #[doc = r"Get enumerated values variant"]
364  #[inline(always)]
365  pub fn variant(&self) -> MUX_A {
366    match self.bits {
367      0 => MUX_A::MUX_0,
368      1 => MUX_A::MUX_1,
369      2 => MUX_A::MUX_2,
370      3 => MUX_A::MUX_3,
371      4 => MUX_A::MUX_4,
372      5 => MUX_A::MUX_5,
373      6 => MUX_A::MUX_6,
374      7 => MUX_A::MUX_7,
375      _ => unreachable!(),
376    }
377  }
378  #[doc = "Checks if the value of the field is `MUX_0`"]
379  #[inline(always)]
380  pub fn is_mux_0(&self) -> bool {
381    *self == MUX_A::MUX_0
382  }
383  #[doc = "Checks if the value of the field is `MUX_1`"]
384  #[inline(always)]
385  pub fn is_mux_1(&self) -> bool {
386    *self == MUX_A::MUX_1
387  }
388  #[doc = "Checks if the value of the field is `MUX_2`"]
389  #[inline(always)]
390  pub fn is_mux_2(&self) -> bool {
391    *self == MUX_A::MUX_2
392  }
393  #[doc = "Checks if the value of the field is `MUX_3`"]
394  #[inline(always)]
395  pub fn is_mux_3(&self) -> bool {
396    *self == MUX_A::MUX_3
397  }
398  #[doc = "Checks if the value of the field is `MUX_4`"]
399  #[inline(always)]
400  pub fn is_mux_4(&self) -> bool {
401    *self == MUX_A::MUX_4
402  }
403  #[doc = "Checks if the value of the field is `MUX_5`"]
404  #[inline(always)]
405  pub fn is_mux_5(&self) -> bool {
406    *self == MUX_A::MUX_5
407  }
408  #[doc = "Checks if the value of the field is `MUX_6`"]
409  #[inline(always)]
410  pub fn is_mux_6(&self) -> bool {
411    *self == MUX_A::MUX_6
412  }
413  #[doc = "Checks if the value of the field is `MUX_7`"]
414  #[inline(always)]
415  pub fn is_mux_7(&self) -> bool {
416    *self == MUX_A::MUX_7
417  }
418}
419#[doc = "Write proxy for field `MUX`"]
420pub struct MUX_W<'a> {
421  w: &'a mut W,
422}
423impl<'a> MUX_W<'a> {
424  #[doc = r"Writes `variant` to the field"]
425  #[inline(always)]
426  pub fn variant(self, variant: MUX_A) -> &'a mut W {
427    {
428      self.bits(variant.into())
429    }
430  }
431  #[doc = "Pin disabled (Alternative 0) (analog)."]
432  #[inline(always)]
433  pub fn mux_0(self) -> &'a mut W {
434    self.variant(MUX_A::MUX_0)
435  }
436  #[doc = "Alternative 1 (GPIO)."]
437  #[inline(always)]
438  pub fn mux_1(self) -> &'a mut W {
439    self.variant(MUX_A::MUX_1)
440  }
441  #[doc = "Alternative 2 (chip-specific)."]
442  #[inline(always)]
443  pub fn mux_2(self) -> &'a mut W {
444    self.variant(MUX_A::MUX_2)
445  }
446  #[doc = "Alternative 3 (chip-specific)."]
447  #[inline(always)]
448  pub fn mux_3(self) -> &'a mut W {
449    self.variant(MUX_A::MUX_3)
450  }
451  #[doc = "Alternative 4 (chip-specific)."]
452  #[inline(always)]
453  pub fn mux_4(self) -> &'a mut W {
454    self.variant(MUX_A::MUX_4)
455  }
456  #[doc = "Alternative 5 (chip-specific)."]
457  #[inline(always)]
458  pub fn mux_5(self) -> &'a mut W {
459    self.variant(MUX_A::MUX_5)
460  }
461  #[doc = "Alternative 6 (chip-specific)."]
462  #[inline(always)]
463  pub fn mux_6(self) -> &'a mut W {
464    self.variant(MUX_A::MUX_6)
465  }
466  #[doc = "Alternative 7 (chip-specific)."]
467  #[inline(always)]
468  pub fn mux_7(self) -> &'a mut W {
469    self.variant(MUX_A::MUX_7)
470  }
471  #[doc = r"Writes raw bits to the field"]
472  #[inline(always)]
473  pub fn bits(self, value: u8) -> &'a mut W {
474    self.w.bits = (self.w.bits & !(0x07 << 8)) | (((value as u32) & 0x07) << 8);
475    self.w
476  }
477}
478#[doc = "Lock Register\n\nValue on reset: 0"]
479#[derive(Clone, Copy, Debug, PartialEq)]
480pub enum LK_A {
481  #[doc = "0: Pin Control Register is not locked."]
482  LK_0,
483  #[doc = "1: Pin Control Register is locked and cannot be updated until the next system reset."]
484  LK_1,
485}
486impl From<LK_A> for bool {
487  #[inline(always)]
488  fn from(variant: LK_A) -> Self {
489    match variant {
490      LK_A::LK_0 => false,
491      LK_A::LK_1 => true,
492    }
493  }
494}
495#[doc = "Reader of field `LK`"]
496pub type LK_R = crate::R<bool, LK_A>;
497impl LK_R {
498  #[doc = r"Get enumerated values variant"]
499  #[inline(always)]
500  pub fn variant(&self) -> LK_A {
501    match self.bits {
502      false => LK_A::LK_0,
503      true => LK_A::LK_1,
504    }
505  }
506  #[doc = "Checks if the value of the field is `LK_0`"]
507  #[inline(always)]
508  pub fn is_lk_0(&self) -> bool {
509    *self == LK_A::LK_0
510  }
511  #[doc = "Checks if the value of the field is `LK_1`"]
512  #[inline(always)]
513  pub fn is_lk_1(&self) -> bool {
514    *self == LK_A::LK_1
515  }
516}
517#[doc = "Write proxy for field `LK`"]
518pub struct LK_W<'a> {
519  w: &'a mut W,
520}
521impl<'a> LK_W<'a> {
522  #[doc = r"Writes `variant` to the field"]
523  #[inline(always)]
524  pub fn variant(self, variant: LK_A) -> &'a mut W {
525    {
526      self.bit(variant.into())
527    }
528  }
529  #[doc = "Pin Control Register is not locked."]
530  #[inline(always)]
531  pub fn lk_0(self) -> &'a mut W {
532    self.variant(LK_A::LK_0)
533  }
534  #[doc = "Pin Control Register is locked and cannot be updated until the next system reset."]
535  #[inline(always)]
536  pub fn lk_1(self) -> &'a mut W {
537    self.variant(LK_A::LK_1)
538  }
539  #[doc = r"Sets the field bit"]
540  #[inline(always)]
541  pub fn set_bit(self) -> &'a mut W {
542    self.bit(true)
543  }
544  #[doc = r"Clears the field bit"]
545  #[inline(always)]
546  pub fn clear_bit(self) -> &'a mut W {
547    self.bit(false)
548  }
549  #[doc = r"Writes raw bits to the field"]
550  #[inline(always)]
551  pub fn bit(self, value: bool) -> &'a mut W {
552    self.w.bits = (self.w.bits & !(0x01 << 15)) | (((value as u32) & 0x01) << 15);
553    self.w
554  }
555}
556#[doc = "Interrupt Configuration\n\nValue on reset: 0"]
557#[derive(Clone, Copy, Debug, PartialEq)]
558pub enum IRQC_A {
559  #[doc = "0: Interrupt Status Flag (ISF) is disabled."]
560  IRQC_0,
561  #[doc = "1: ISF flag and DMA request on rising edge."]
562  IRQC_1,
563  #[doc = "2: ISF flag and DMA request on falling edge."]
564  IRQC_2,
565  #[doc = "3: ISF flag and DMA request on either edge."]
566  IRQC_3,
567  #[doc = "5: no description available"]
568  IRQC_5,
569  #[doc = "6: no description available"]
570  IRQC_6,
571  #[doc = "7: no description available"]
572  IRQC_7,
573  #[doc = "8: ISF flag and Interrupt when logic 0."]
574  IRQC_8,
575  #[doc = "9: ISF flag and Interrupt on rising-edge."]
576  IRQC_9,
577  #[doc = "10: ISF flag and Interrupt on falling-edge."]
578  IRQC_10,
579  #[doc = "11: ISF flag and Interrupt on either edge."]
580  IRQC_11,
581  #[doc = "12: ISF flag and Interrupt when logic 1."]
582  IRQC_12,
583  #[doc = "13: no description available"]
584  IRQC_13,
585  #[doc = "14: no description available"]
586  IRQC_14,
587}
588impl From<IRQC_A> for u8 {
589  #[inline(always)]
590  fn from(variant: IRQC_A) -> Self {
591    match variant {
592      IRQC_A::IRQC_0 => 0,
593      IRQC_A::IRQC_1 => 1,
594      IRQC_A::IRQC_2 => 2,
595      IRQC_A::IRQC_3 => 3,
596      IRQC_A::IRQC_5 => 5,
597      IRQC_A::IRQC_6 => 6,
598      IRQC_A::IRQC_7 => 7,
599      IRQC_A::IRQC_8 => 8,
600      IRQC_A::IRQC_9 => 9,
601      IRQC_A::IRQC_10 => 10,
602      IRQC_A::IRQC_11 => 11,
603      IRQC_A::IRQC_12 => 12,
604      IRQC_A::IRQC_13 => 13,
605      IRQC_A::IRQC_14 => 14,
606    }
607  }
608}
609#[doc = "Reader of field `IRQC`"]
610pub type IRQC_R = crate::R<u8, IRQC_A>;
611impl IRQC_R {
612  #[doc = r"Get enumerated values variant"]
613  #[inline(always)]
614  pub fn variant(&self) -> crate::Variant<u8, IRQC_A> {
615    use crate::Variant::*;
616    match self.bits {
617      0 => Val(IRQC_A::IRQC_0),
618      1 => Val(IRQC_A::IRQC_1),
619      2 => Val(IRQC_A::IRQC_2),
620      3 => Val(IRQC_A::IRQC_3),
621      5 => Val(IRQC_A::IRQC_5),
622      6 => Val(IRQC_A::IRQC_6),
623      7 => Val(IRQC_A::IRQC_7),
624      8 => Val(IRQC_A::IRQC_8),
625      9 => Val(IRQC_A::IRQC_9),
626      10 => Val(IRQC_A::IRQC_10),
627      11 => Val(IRQC_A::IRQC_11),
628      12 => Val(IRQC_A::IRQC_12),
629      13 => Val(IRQC_A::IRQC_13),
630      14 => Val(IRQC_A::IRQC_14),
631      i => Res(i),
632    }
633  }
634  #[doc = "Checks if the value of the field is `IRQC_0`"]
635  #[inline(always)]
636  pub fn is_irqc_0(&self) -> bool {
637    *self == IRQC_A::IRQC_0
638  }
639  #[doc = "Checks if the value of the field is `IRQC_1`"]
640  #[inline(always)]
641  pub fn is_irqc_1(&self) -> bool {
642    *self == IRQC_A::IRQC_1
643  }
644  #[doc = "Checks if the value of the field is `IRQC_2`"]
645  #[inline(always)]
646  pub fn is_irqc_2(&self) -> bool {
647    *self == IRQC_A::IRQC_2
648  }
649  #[doc = "Checks if the value of the field is `IRQC_3`"]
650  #[inline(always)]
651  pub fn is_irqc_3(&self) -> bool {
652    *self == IRQC_A::IRQC_3
653  }
654  #[doc = "Checks if the value of the field is `IRQC_5`"]
655  #[inline(always)]
656  pub fn is_irqc_5(&self) -> bool {
657    *self == IRQC_A::IRQC_5
658  }
659  #[doc = "Checks if the value of the field is `IRQC_6`"]
660  #[inline(always)]
661  pub fn is_irqc_6(&self) -> bool {
662    *self == IRQC_A::IRQC_6
663  }
664  #[doc = "Checks if the value of the field is `IRQC_7`"]
665  #[inline(always)]
666  pub fn is_irqc_7(&self) -> bool {
667    *self == IRQC_A::IRQC_7
668  }
669  #[doc = "Checks if the value of the field is `IRQC_8`"]
670  #[inline(always)]
671  pub fn is_irqc_8(&self) -> bool {
672    *self == IRQC_A::IRQC_8
673  }
674  #[doc = "Checks if the value of the field is `IRQC_9`"]
675  #[inline(always)]
676  pub fn is_irqc_9(&self) -> bool {
677    *self == IRQC_A::IRQC_9
678  }
679  #[doc = "Checks if the value of the field is `IRQC_10`"]
680  #[inline(always)]
681  pub fn is_irqc_10(&self) -> bool {
682    *self == IRQC_A::IRQC_10
683  }
684  #[doc = "Checks if the value of the field is `IRQC_11`"]
685  #[inline(always)]
686  pub fn is_irqc_11(&self) -> bool {
687    *self == IRQC_A::IRQC_11
688  }
689  #[doc = "Checks if the value of the field is `IRQC_12`"]
690  #[inline(always)]
691  pub fn is_irqc_12(&self) -> bool {
692    *self == IRQC_A::IRQC_12
693  }
694  #[doc = "Checks if the value of the field is `IRQC_13`"]
695  #[inline(always)]
696  pub fn is_irqc_13(&self) -> bool {
697    *self == IRQC_A::IRQC_13
698  }
699  #[doc = "Checks if the value of the field is `IRQC_14`"]
700  #[inline(always)]
701  pub fn is_irqc_14(&self) -> bool {
702    *self == IRQC_A::IRQC_14
703  }
704}
705#[doc = "Write proxy for field `IRQC`"]
706pub struct IRQC_W<'a> {
707  w: &'a mut W,
708}
709impl<'a> IRQC_W<'a> {
710  #[doc = r"Writes `variant` to the field"]
711  #[inline(always)]
712  pub fn variant(self, variant: IRQC_A) -> &'a mut W {
713    unsafe { self.bits(variant.into()) }
714  }
715  #[doc = "Interrupt Status Flag (ISF) is disabled."]
716  #[inline(always)]
717  pub fn irqc_0(self) -> &'a mut W {
718    self.variant(IRQC_A::IRQC_0)
719  }
720  #[doc = "ISF flag and DMA request on rising edge."]
721  #[inline(always)]
722  pub fn irqc_1(self) -> &'a mut W {
723    self.variant(IRQC_A::IRQC_1)
724  }
725  #[doc = "ISF flag and DMA request on falling edge."]
726  #[inline(always)]
727  pub fn irqc_2(self) -> &'a mut W {
728    self.variant(IRQC_A::IRQC_2)
729  }
730  #[doc = "ISF flag and DMA request on either edge."]
731  #[inline(always)]
732  pub fn irqc_3(self) -> &'a mut W {
733    self.variant(IRQC_A::IRQC_3)
734  }
735  #[doc = "no description available"]
736  #[inline(always)]
737  pub fn irqc_5(self) -> &'a mut W {
738    self.variant(IRQC_A::IRQC_5)
739  }
740  #[doc = "no description available"]
741  #[inline(always)]
742  pub fn irqc_6(self) -> &'a mut W {
743    self.variant(IRQC_A::IRQC_6)
744  }
745  #[doc = "no description available"]
746  #[inline(always)]
747  pub fn irqc_7(self) -> &'a mut W {
748    self.variant(IRQC_A::IRQC_7)
749  }
750  #[doc = "ISF flag and Interrupt when logic 0."]
751  #[inline(always)]
752  pub fn irqc_8(self) -> &'a mut W {
753    self.variant(IRQC_A::IRQC_8)
754  }
755  #[doc = "ISF flag and Interrupt on rising-edge."]
756  #[inline(always)]
757  pub fn irqc_9(self) -> &'a mut W {
758    self.variant(IRQC_A::IRQC_9)
759  }
760  #[doc = "ISF flag and Interrupt on falling-edge."]
761  #[inline(always)]
762  pub fn irqc_10(self) -> &'a mut W {
763    self.variant(IRQC_A::IRQC_10)
764  }
765  #[doc = "ISF flag and Interrupt on either edge."]
766  #[inline(always)]
767  pub fn irqc_11(self) -> &'a mut W {
768    self.variant(IRQC_A::IRQC_11)
769  }
770  #[doc = "ISF flag and Interrupt when logic 1."]
771  #[inline(always)]
772  pub fn irqc_12(self) -> &'a mut W {
773    self.variant(IRQC_A::IRQC_12)
774  }
775  #[doc = "no description available"]
776  #[inline(always)]
777  pub fn irqc_13(self) -> &'a mut W {
778    self.variant(IRQC_A::IRQC_13)
779  }
780  #[doc = "no description available"]
781  #[inline(always)]
782  pub fn irqc_14(self) -> &'a mut W {
783    self.variant(IRQC_A::IRQC_14)
784  }
785  #[doc = r"Writes raw bits to the field"]
786  #[inline(always)]
787  pub unsafe fn bits(self, value: u8) -> &'a mut W {
788    self.w.bits = (self.w.bits & !(0x0f << 16)) | (((value as u32) & 0x0f) << 16);
789    self.w
790  }
791}
792#[doc = "Interrupt Status Flag\n\nValue on reset: 0"]
793#[derive(Clone, Copy, Debug, PartialEq)]
794pub enum ISF_A {
795  #[doc = "0: Configured interrupt is not detected."]
796  ISF_0,
797  #[doc = "1: no description available"]
798  ISF_1,
799}
800impl From<ISF_A> for bool {
801  #[inline(always)]
802  fn from(variant: ISF_A) -> Self {
803    match variant {
804      ISF_A::ISF_0 => false,
805      ISF_A::ISF_1 => true,
806    }
807  }
808}
809#[doc = "Reader of field `ISF`"]
810pub type ISF_R = crate::R<bool, ISF_A>;
811impl ISF_R {
812  #[doc = r"Get enumerated values variant"]
813  #[inline(always)]
814  pub fn variant(&self) -> ISF_A {
815    match self.bits {
816      false => ISF_A::ISF_0,
817      true => ISF_A::ISF_1,
818    }
819  }
820  #[doc = "Checks if the value of the field is `ISF_0`"]
821  #[inline(always)]
822  pub fn is_isf_0(&self) -> bool {
823    *self == ISF_A::ISF_0
824  }
825  #[doc = "Checks if the value of the field is `ISF_1`"]
826  #[inline(always)]
827  pub fn is_isf_1(&self) -> bool {
828    *self == ISF_A::ISF_1
829  }
830}
831#[doc = "Write proxy for field `ISF`"]
832pub struct ISF_W<'a> {
833  w: &'a mut W,
834}
835impl<'a> ISF_W<'a> {
836  #[doc = r"Writes `variant` to the field"]
837  #[inline(always)]
838  pub fn variant(self, variant: ISF_A) -> &'a mut W {
839    {
840      self.bit(variant.into())
841    }
842  }
843  #[doc = "Configured interrupt is not detected."]
844  #[inline(always)]
845  pub fn isf_0(self) -> &'a mut W {
846    self.variant(ISF_A::ISF_0)
847  }
848  #[doc = "no description available"]
849  #[inline(always)]
850  pub fn isf_1(self) -> &'a mut W {
851    self.variant(ISF_A::ISF_1)
852  }
853  #[doc = r"Sets the field bit"]
854  #[inline(always)]
855  pub fn set_bit(self) -> &'a mut W {
856    self.bit(true)
857  }
858  #[doc = r"Clears the field bit"]
859  #[inline(always)]
860  pub fn clear_bit(self) -> &'a mut W {
861    self.bit(false)
862  }
863  #[doc = r"Writes raw bits to the field"]
864  #[inline(always)]
865  pub fn bit(self, value: bool) -> &'a mut W {
866    self.w.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24);
867    self.w
868  }
869}
870impl R {
871  #[doc = "Bit 0 - Pull Select"]
872  #[inline(always)]
873  pub fn ps(&self) -> PS_R {
874    PS_R::new((self.bits & 0x01) != 0)
875  }
876  #[doc = "Bit 1 - Pull Enable"]
877  #[inline(always)]
878  pub fn pe(&self) -> PE_R {
879    PE_R::new(((self.bits >> 1) & 0x01) != 0)
880  }
881  #[doc = "Bit 2 - Slew Rate Enable"]
882  #[inline(always)]
883  pub fn sre(&self) -> SRE_R {
884    SRE_R::new(((self.bits >> 2) & 0x01) != 0)
885  }
886  #[doc = "Bit 5 - Open Drain Enable"]
887  #[inline(always)]
888  pub fn ode(&self) -> ODE_R {
889    ODE_R::new(((self.bits >> 5) & 0x01) != 0)
890  }
891  #[doc = "Bits 8:10 - Pin Mux Control"]
892  #[inline(always)]
893  pub fn mux(&self) -> MUX_R {
894    MUX_R::new(((self.bits >> 8) & 0x07) as u8)
895  }
896  #[doc = "Bit 15 - Lock Register"]
897  #[inline(always)]
898  pub fn lk(&self) -> LK_R {
899    LK_R::new(((self.bits >> 15) & 0x01) != 0)
900  }
901  #[doc = "Bits 16:19 - Interrupt Configuration"]
902  #[inline(always)]
903  pub fn irqc(&self) -> IRQC_R {
904    IRQC_R::new(((self.bits >> 16) & 0x0f) as u8)
905  }
906  #[doc = "Bit 24 - Interrupt Status Flag"]
907  #[inline(always)]
908  pub fn isf(&self) -> ISF_R {
909    ISF_R::new(((self.bits >> 24) & 0x01) != 0)
910  }
911}
912impl W {
913  #[doc = "Bit 0 - Pull Select"]
914  #[inline(always)]
915  pub fn ps(&mut self) -> PS_W {
916    PS_W { w: self }
917  }
918  #[doc = "Bit 1 - Pull Enable"]
919  #[inline(always)]
920  pub fn pe(&mut self) -> PE_W {
921    PE_W { w: self }
922  }
923  #[doc = "Bit 2 - Slew Rate Enable"]
924  #[inline(always)]
925  pub fn sre(&mut self) -> SRE_W {
926    SRE_W { w: self }
927  }
928  #[doc = "Bit 5 - Open Drain Enable"]
929  #[inline(always)]
930  pub fn ode(&mut self) -> ODE_W {
931    ODE_W { w: self }
932  }
933  #[doc = "Bits 8:10 - Pin Mux Control"]
934  #[inline(always)]
935  pub fn mux(&mut self) -> MUX_W {
936    MUX_W { w: self }
937  }
938  #[doc = "Bit 15 - Lock Register"]
939  #[inline(always)]
940  pub fn lk(&mut self) -> LK_W {
941    LK_W { w: self }
942  }
943  #[doc = "Bits 16:19 - Interrupt Configuration"]
944  #[inline(always)]
945  pub fn irqc(&mut self) -> IRQC_W {
946    IRQC_W { w: self }
947  }
948  #[doc = "Bit 24 - Interrupt Status Flag"]
949  #[inline(always)]
950  pub fn isf(&mut self) -> ISF_W {
951    ISF_W { w: self }
952  }
953}