max32660/dma/
int_fl.rs

1#[doc = "Register `INT_FL` reader"]
2pub type R = crate::R<INT_FL_SPEC>;
3#[doc = "Field `IPEND0` reader - Channel 0 Interrupt Pending."]
4pub type IPEND0_R = crate::BitReader<IPEND0_A>;
5#[doc = "Channel 0 Interrupt Pending.\n\nValue on reset: 0"]
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7pub enum IPEND0_A {
8    #[doc = "0: No interrupt is pending."]
9    INACTIVE = 0,
10    #[doc = "1: An interrupt is pending."]
11    PENDING = 1,
12}
13impl From<IPEND0_A> for bool {
14    #[inline(always)]
15    fn from(variant: IPEND0_A) -> Self {
16        variant as u8 != 0
17    }
18}
19impl IPEND0_R {
20    #[doc = "Get enumerated values variant"]
21    #[inline(always)]
22    pub fn variant(&self) -> IPEND0_A {
23        match self.bits {
24            false => IPEND0_A::INACTIVE,
25            true => IPEND0_A::PENDING,
26        }
27    }
28    #[doc = "No interrupt is pending."]
29    #[inline(always)]
30    pub fn is_inactive(&self) -> bool {
31        *self == IPEND0_A::INACTIVE
32    }
33    #[doc = "An interrupt is pending."]
34    #[inline(always)]
35    pub fn is_pending(&self) -> bool {
36        *self == IPEND0_A::PENDING
37    }
38}
39#[doc = "Field `IPEND1` reader - Channel 1 Interrupt Pending."]
40pub type IPEND1_R = crate::BitReader<IPEND1_A>;
41#[doc = "Channel 1 Interrupt Pending.\n\nValue on reset: 0"]
42#[derive(Clone, Copy, Debug, PartialEq, Eq)]
43pub enum IPEND1_A {
44    #[doc = "0: No interrupt is pending."]
45    INACTIVE = 0,
46    #[doc = "1: An interrupt is pending."]
47    PENDING = 1,
48}
49impl From<IPEND1_A> for bool {
50    #[inline(always)]
51    fn from(variant: IPEND1_A) -> Self {
52        variant as u8 != 0
53    }
54}
55impl IPEND1_R {
56    #[doc = "Get enumerated values variant"]
57    #[inline(always)]
58    pub fn variant(&self) -> IPEND1_A {
59        match self.bits {
60            false => IPEND1_A::INACTIVE,
61            true => IPEND1_A::PENDING,
62        }
63    }
64    #[doc = "No interrupt is pending."]
65    #[inline(always)]
66    pub fn is_inactive(&self) -> bool {
67        *self == IPEND1_A::INACTIVE
68    }
69    #[doc = "An interrupt is pending."]
70    #[inline(always)]
71    pub fn is_pending(&self) -> bool {
72        *self == IPEND1_A::PENDING
73    }
74}
75#[doc = "Field `IPEND2` reader - Channel 2 Interrupt Pending."]
76pub type IPEND2_R = crate::BitReader<IPEND2_A>;
77#[doc = "Channel 2 Interrupt Pending.\n\nValue on reset: 0"]
78#[derive(Clone, Copy, Debug, PartialEq, Eq)]
79pub enum IPEND2_A {
80    #[doc = "0: No interrupt is pending."]
81    INACTIVE = 0,
82    #[doc = "1: An interrupt is pending."]
83    PENDING = 1,
84}
85impl From<IPEND2_A> for bool {
86    #[inline(always)]
87    fn from(variant: IPEND2_A) -> Self {
88        variant as u8 != 0
89    }
90}
91impl IPEND2_R {
92    #[doc = "Get enumerated values variant"]
93    #[inline(always)]
94    pub fn variant(&self) -> IPEND2_A {
95        match self.bits {
96            false => IPEND2_A::INACTIVE,
97            true => IPEND2_A::PENDING,
98        }
99    }
100    #[doc = "No interrupt is pending."]
101    #[inline(always)]
102    pub fn is_inactive(&self) -> bool {
103        *self == IPEND2_A::INACTIVE
104    }
105    #[doc = "An interrupt is pending."]
106    #[inline(always)]
107    pub fn is_pending(&self) -> bool {
108        *self == IPEND2_A::PENDING
109    }
110}
111#[doc = "Field `IPEND3` reader - Channel 3 Interrupt Pending."]
112pub type IPEND3_R = crate::BitReader<IPEND3_A>;
113#[doc = "Channel 3 Interrupt Pending.\n\nValue on reset: 0"]
114#[derive(Clone, Copy, Debug, PartialEq, Eq)]
115pub enum IPEND3_A {
116    #[doc = "0: No interrupt is pending."]
117    INACTIVE = 0,
118    #[doc = "1: An interrupt is pending."]
119    PENDING = 1,
120}
121impl From<IPEND3_A> for bool {
122    #[inline(always)]
123    fn from(variant: IPEND3_A) -> Self {
124        variant as u8 != 0
125    }
126}
127impl IPEND3_R {
128    #[doc = "Get enumerated values variant"]
129    #[inline(always)]
130    pub fn variant(&self) -> IPEND3_A {
131        match self.bits {
132            false => IPEND3_A::INACTIVE,
133            true => IPEND3_A::PENDING,
134        }
135    }
136    #[doc = "No interrupt is pending."]
137    #[inline(always)]
138    pub fn is_inactive(&self) -> bool {
139        *self == IPEND3_A::INACTIVE
140    }
141    #[doc = "An interrupt is pending."]
142    #[inline(always)]
143    pub fn is_pending(&self) -> bool {
144        *self == IPEND3_A::PENDING
145    }
146}
147impl R {
148    #[doc = "Bit 0 - Channel 0 Interrupt Pending."]
149    #[inline(always)]
150    pub fn ipend0(&self) -> IPEND0_R {
151        IPEND0_R::new((self.bits & 1) != 0)
152    }
153    #[doc = "Bit 1 - Channel 1 Interrupt Pending."]
154    #[inline(always)]
155    pub fn ipend1(&self) -> IPEND1_R {
156        IPEND1_R::new(((self.bits >> 1) & 1) != 0)
157    }
158    #[doc = "Bit 2 - Channel 2 Interrupt Pending."]
159    #[inline(always)]
160    pub fn ipend2(&self) -> IPEND2_R {
161        IPEND2_R::new(((self.bits >> 2) & 1) != 0)
162    }
163    #[doc = "Bit 3 - Channel 3 Interrupt Pending."]
164    #[inline(always)]
165    pub fn ipend3(&self) -> IPEND3_R {
166        IPEND3_R::new(((self.bits >> 3) & 1) != 0)
167    }
168}
169#[doc = "DMA Interrupt.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`int_fl::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
170pub struct INT_FL_SPEC;
171impl crate::RegisterSpec for INT_FL_SPEC {
172    type Ux = u32;
173}
174#[doc = "`read()` method returns [`int_fl::R`](R) reader structure"]
175impl crate::Readable for INT_FL_SPEC {}
176#[doc = "`reset()` method sets INT_FL to value 0"]
177impl crate::Resettable for INT_FL_SPEC {
178    const RESET_VALUE: Self::Ux = 0;
179}