d1_pac/gpio/
pe_eint_status.rs

1#[doc = "Register `pe_eint_status` reader"]
2pub type R = crate::R<PE_EINT_STATUS_SPEC>;
3#[doc = "Register `pe_eint_status` writer"]
4pub type W = crate::W<PE_EINT_STATUS_SPEC>;
5#[doc = "Field `eint_status[0-17]` reader - External INT Pending Bit"]
6pub type EINT_STATUS_R = crate::BitReader<EINT_STATUS_A>;
7#[doc = "External INT Pending Bit\n\nValue on reset: 0"]
8#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9pub enum EINT_STATUS_A {
10    #[doc = "0: `0`"]
11    NO_PENDING = 0,
12    #[doc = "1: `1`"]
13    PENDING = 1,
14}
15impl From<EINT_STATUS_A> for bool {
16    #[inline(always)]
17    fn from(variant: EINT_STATUS_A) -> Self {
18        variant as u8 != 0
19    }
20}
21impl EINT_STATUS_R {
22    #[doc = "Get enumerated values variant"]
23    #[inline(always)]
24    pub const fn variant(&self) -> EINT_STATUS_A {
25        match self.bits {
26            false => EINT_STATUS_A::NO_PENDING,
27            true => EINT_STATUS_A::PENDING,
28        }
29    }
30    #[doc = "`0`"]
31    #[inline(always)]
32    pub fn is_no_pending(&self) -> bool {
33        *self == EINT_STATUS_A::NO_PENDING
34    }
35    #[doc = "`1`"]
36    #[inline(always)]
37    pub fn is_pending(&self) -> bool {
38        *self == EINT_STATUS_A::PENDING
39    }
40}
41#[doc = "Field `eint_status[0-17]` writer - External INT Pending Bit"]
42pub type EINT_STATUS_W<'a, REG> = crate::BitWriter<'a, REG, EINT_STATUS_A>;
43impl<'a, REG> EINT_STATUS_W<'a, REG>
44where
45    REG: crate::Writable + crate::RegisterSpec,
46{
47    #[doc = "`0`"]
48    #[inline(always)]
49    pub fn no_pending(self) -> &'a mut crate::W<REG> {
50        self.variant(EINT_STATUS_A::NO_PENDING)
51    }
52    #[doc = "`1`"]
53    #[inline(always)]
54    pub fn pending(self) -> &'a mut crate::W<REG> {
55        self.variant(EINT_STATUS_A::PENDING)
56    }
57}
58impl R {
59    #[doc = "External INT Pending Bit\n\nNOTE: `n` is number of field in register. `n == 0` corresponds to `eint0_status` field"]
60    #[inline(always)]
61    pub fn eint_status(&self, n: u8) -> EINT_STATUS_R {
62        #[allow(clippy::no_effect)]
63        [(); 18][n as usize];
64        EINT_STATUS_R::new(((self.bits >> n) & 1) != 0)
65    }
66    #[doc = "Bit 0 - External INT Pending Bit"]
67    #[inline(always)]
68    pub fn eint0_status(&self) -> EINT_STATUS_R {
69        EINT_STATUS_R::new((self.bits & 1) != 0)
70    }
71    #[doc = "Bit 1 - External INT Pending Bit"]
72    #[inline(always)]
73    pub fn eint1_status(&self) -> EINT_STATUS_R {
74        EINT_STATUS_R::new(((self.bits >> 1) & 1) != 0)
75    }
76    #[doc = "Bit 2 - External INT Pending Bit"]
77    #[inline(always)]
78    pub fn eint2_status(&self) -> EINT_STATUS_R {
79        EINT_STATUS_R::new(((self.bits >> 2) & 1) != 0)
80    }
81    #[doc = "Bit 3 - External INT Pending Bit"]
82    #[inline(always)]
83    pub fn eint3_status(&self) -> EINT_STATUS_R {
84        EINT_STATUS_R::new(((self.bits >> 3) & 1) != 0)
85    }
86    #[doc = "Bit 4 - External INT Pending Bit"]
87    #[inline(always)]
88    pub fn eint4_status(&self) -> EINT_STATUS_R {
89        EINT_STATUS_R::new(((self.bits >> 4) & 1) != 0)
90    }
91    #[doc = "Bit 5 - External INT Pending Bit"]
92    #[inline(always)]
93    pub fn eint5_status(&self) -> EINT_STATUS_R {
94        EINT_STATUS_R::new(((self.bits >> 5) & 1) != 0)
95    }
96    #[doc = "Bit 6 - External INT Pending Bit"]
97    #[inline(always)]
98    pub fn eint6_status(&self) -> EINT_STATUS_R {
99        EINT_STATUS_R::new(((self.bits >> 6) & 1) != 0)
100    }
101    #[doc = "Bit 7 - External INT Pending Bit"]
102    #[inline(always)]
103    pub fn eint7_status(&self) -> EINT_STATUS_R {
104        EINT_STATUS_R::new(((self.bits >> 7) & 1) != 0)
105    }
106    #[doc = "Bit 8 - External INT Pending Bit"]
107    #[inline(always)]
108    pub fn eint8_status(&self) -> EINT_STATUS_R {
109        EINT_STATUS_R::new(((self.bits >> 8) & 1) != 0)
110    }
111    #[doc = "Bit 9 - External INT Pending Bit"]
112    #[inline(always)]
113    pub fn eint9_status(&self) -> EINT_STATUS_R {
114        EINT_STATUS_R::new(((self.bits >> 9) & 1) != 0)
115    }
116    #[doc = "Bit 10 - External INT Pending Bit"]
117    #[inline(always)]
118    pub fn eint10_status(&self) -> EINT_STATUS_R {
119        EINT_STATUS_R::new(((self.bits >> 10) & 1) != 0)
120    }
121    #[doc = "Bit 11 - External INT Pending Bit"]
122    #[inline(always)]
123    pub fn eint11_status(&self) -> EINT_STATUS_R {
124        EINT_STATUS_R::new(((self.bits >> 11) & 1) != 0)
125    }
126    #[doc = "Bit 12 - External INT Pending Bit"]
127    #[inline(always)]
128    pub fn eint12_status(&self) -> EINT_STATUS_R {
129        EINT_STATUS_R::new(((self.bits >> 12) & 1) != 0)
130    }
131    #[doc = "Bit 13 - External INT Pending Bit"]
132    #[inline(always)]
133    pub fn eint13_status(&self) -> EINT_STATUS_R {
134        EINT_STATUS_R::new(((self.bits >> 13) & 1) != 0)
135    }
136    #[doc = "Bit 14 - External INT Pending Bit"]
137    #[inline(always)]
138    pub fn eint14_status(&self) -> EINT_STATUS_R {
139        EINT_STATUS_R::new(((self.bits >> 14) & 1) != 0)
140    }
141    #[doc = "Bit 15 - External INT Pending Bit"]
142    #[inline(always)]
143    pub fn eint15_status(&self) -> EINT_STATUS_R {
144        EINT_STATUS_R::new(((self.bits >> 15) & 1) != 0)
145    }
146    #[doc = "Bit 16 - External INT Pending Bit"]
147    #[inline(always)]
148    pub fn eint16_status(&self) -> EINT_STATUS_R {
149        EINT_STATUS_R::new(((self.bits >> 16) & 1) != 0)
150    }
151    #[doc = "Bit 17 - External INT Pending Bit"]
152    #[inline(always)]
153    pub fn eint17_status(&self) -> EINT_STATUS_R {
154        EINT_STATUS_R::new(((self.bits >> 17) & 1) != 0)
155    }
156}
157impl W {
158    #[doc = "External INT Pending Bit\n\nNOTE: `n` is number of field in register. `n == 0` corresponds to `eint0_status` field"]
159    #[inline(always)]
160    #[must_use]
161    pub fn eint_status(&mut self, n: u8) -> EINT_STATUS_W<PE_EINT_STATUS_SPEC> {
162        #[allow(clippy::no_effect)]
163        [(); 18][n as usize];
164        EINT_STATUS_W::new(self, n)
165    }
166    #[doc = "Bit 0 - External INT Pending Bit"]
167    #[inline(always)]
168    #[must_use]
169    pub fn eint0_status(&mut self) -> EINT_STATUS_W<PE_EINT_STATUS_SPEC> {
170        EINT_STATUS_W::new(self, 0)
171    }
172    #[doc = "Bit 1 - External INT Pending Bit"]
173    #[inline(always)]
174    #[must_use]
175    pub fn eint1_status(&mut self) -> EINT_STATUS_W<PE_EINT_STATUS_SPEC> {
176        EINT_STATUS_W::new(self, 1)
177    }
178    #[doc = "Bit 2 - External INT Pending Bit"]
179    #[inline(always)]
180    #[must_use]
181    pub fn eint2_status(&mut self) -> EINT_STATUS_W<PE_EINT_STATUS_SPEC> {
182        EINT_STATUS_W::new(self, 2)
183    }
184    #[doc = "Bit 3 - External INT Pending Bit"]
185    #[inline(always)]
186    #[must_use]
187    pub fn eint3_status(&mut self) -> EINT_STATUS_W<PE_EINT_STATUS_SPEC> {
188        EINT_STATUS_W::new(self, 3)
189    }
190    #[doc = "Bit 4 - External INT Pending Bit"]
191    #[inline(always)]
192    #[must_use]
193    pub fn eint4_status(&mut self) -> EINT_STATUS_W<PE_EINT_STATUS_SPEC> {
194        EINT_STATUS_W::new(self, 4)
195    }
196    #[doc = "Bit 5 - External INT Pending Bit"]
197    #[inline(always)]
198    #[must_use]
199    pub fn eint5_status(&mut self) -> EINT_STATUS_W<PE_EINT_STATUS_SPEC> {
200        EINT_STATUS_W::new(self, 5)
201    }
202    #[doc = "Bit 6 - External INT Pending Bit"]
203    #[inline(always)]
204    #[must_use]
205    pub fn eint6_status(&mut self) -> EINT_STATUS_W<PE_EINT_STATUS_SPEC> {
206        EINT_STATUS_W::new(self, 6)
207    }
208    #[doc = "Bit 7 - External INT Pending Bit"]
209    #[inline(always)]
210    #[must_use]
211    pub fn eint7_status(&mut self) -> EINT_STATUS_W<PE_EINT_STATUS_SPEC> {
212        EINT_STATUS_W::new(self, 7)
213    }
214    #[doc = "Bit 8 - External INT Pending Bit"]
215    #[inline(always)]
216    #[must_use]
217    pub fn eint8_status(&mut self) -> EINT_STATUS_W<PE_EINT_STATUS_SPEC> {
218        EINT_STATUS_W::new(self, 8)
219    }
220    #[doc = "Bit 9 - External INT Pending Bit"]
221    #[inline(always)]
222    #[must_use]
223    pub fn eint9_status(&mut self) -> EINT_STATUS_W<PE_EINT_STATUS_SPEC> {
224        EINT_STATUS_W::new(self, 9)
225    }
226    #[doc = "Bit 10 - External INT Pending Bit"]
227    #[inline(always)]
228    #[must_use]
229    pub fn eint10_status(&mut self) -> EINT_STATUS_W<PE_EINT_STATUS_SPEC> {
230        EINT_STATUS_W::new(self, 10)
231    }
232    #[doc = "Bit 11 - External INT Pending Bit"]
233    #[inline(always)]
234    #[must_use]
235    pub fn eint11_status(&mut self) -> EINT_STATUS_W<PE_EINT_STATUS_SPEC> {
236        EINT_STATUS_W::new(self, 11)
237    }
238    #[doc = "Bit 12 - External INT Pending Bit"]
239    #[inline(always)]
240    #[must_use]
241    pub fn eint12_status(&mut self) -> EINT_STATUS_W<PE_EINT_STATUS_SPEC> {
242        EINT_STATUS_W::new(self, 12)
243    }
244    #[doc = "Bit 13 - External INT Pending Bit"]
245    #[inline(always)]
246    #[must_use]
247    pub fn eint13_status(&mut self) -> EINT_STATUS_W<PE_EINT_STATUS_SPEC> {
248        EINT_STATUS_W::new(self, 13)
249    }
250    #[doc = "Bit 14 - External INT Pending Bit"]
251    #[inline(always)]
252    #[must_use]
253    pub fn eint14_status(&mut self) -> EINT_STATUS_W<PE_EINT_STATUS_SPEC> {
254        EINT_STATUS_W::new(self, 14)
255    }
256    #[doc = "Bit 15 - External INT Pending Bit"]
257    #[inline(always)]
258    #[must_use]
259    pub fn eint15_status(&mut self) -> EINT_STATUS_W<PE_EINT_STATUS_SPEC> {
260        EINT_STATUS_W::new(self, 15)
261    }
262    #[doc = "Bit 16 - External INT Pending Bit"]
263    #[inline(always)]
264    #[must_use]
265    pub fn eint16_status(&mut self) -> EINT_STATUS_W<PE_EINT_STATUS_SPEC> {
266        EINT_STATUS_W::new(self, 16)
267    }
268    #[doc = "Bit 17 - External INT Pending Bit"]
269    #[inline(always)]
270    #[must_use]
271    pub fn eint17_status(&mut self) -> EINT_STATUS_W<PE_EINT_STATUS_SPEC> {
272        EINT_STATUS_W::new(self, 17)
273    }
274    #[doc = r" Writes raw bits to the register."]
275    #[doc = r""]
276    #[doc = r" # Safety"]
277    #[doc = r""]
278    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
279    #[inline(always)]
280    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
281        self.bits = bits;
282        self
283    }
284}
285#[doc = "PE External Interrupt Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pe_eint_status::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pe_eint_status::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
286pub struct PE_EINT_STATUS_SPEC;
287impl crate::RegisterSpec for PE_EINT_STATUS_SPEC {
288    type Ux = u32;
289}
290#[doc = "`read()` method returns [`pe_eint_status::R`](R) reader structure"]
291impl crate::Readable for PE_EINT_STATUS_SPEC {}
292#[doc = "`write(|w| ..)` method takes [`pe_eint_status::W`](W) writer structure"]
293impl crate::Writable for PE_EINT_STATUS_SPEC {
294    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
295    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
296}
297#[doc = "`reset()` method sets pe_eint_status to value 0"]
298impl crate::Resettable for PE_EINT_STATUS_SPEC {
299    const RESET_VALUE: Self::Ux = 0;
300}