stm32f2/stm32f215/exti/
pr.rs1pub type R = crate::R<PRrs>;
3pub type W = crate::W<PRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum PR0R {
11 NotPending = 0,
13 Pending = 1,
15}
16impl From<PR0R> for bool {
17 #[inline(always)]
18 fn from(variant: PR0R) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type PR_R = crate::BitReader<PR0R>;
24impl PR_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> PR0R {
28 match self.bits {
29 false => PR0R::NotPending,
30 true => PR0R::Pending,
31 }
32 }
33 #[inline(always)]
35 pub fn is_not_pending(&self) -> bool {
36 *self == PR0R::NotPending
37 }
38 #[inline(always)]
40 pub fn is_pending(&self) -> bool {
41 *self == PR0R::Pending
42 }
43}
44#[cfg_attr(feature = "defmt", derive(defmt::Format))]
48#[derive(Clone, Copy, Debug, PartialEq, Eq)]
49pub enum PR0W {
50 Clear = 1,
52}
53impl From<PR0W> for bool {
54 #[inline(always)]
55 fn from(variant: PR0W) -> Self {
56 variant as u8 != 0
57 }
58}
59pub type PR_W<'a, REG> = crate::BitWriter1C<'a, REG, PR0W>;
61impl<'a, REG> PR_W<'a, REG>
62where
63 REG: crate::Writable + crate::RegisterSpec,
64{
65 #[inline(always)]
67 pub fn clear(self) -> &'a mut crate::W<REG> {
68 self.variant(PR0W::Clear)
69 }
70}
71impl R {
72 #[inline(always)]
76 pub fn pr(&self, n: u8) -> PR_R {
77 #[allow(clippy::no_effect)]
78 [(); 23][n as usize];
79 PR_R::new(((self.bits >> n) & 1) != 0)
80 }
81 #[inline(always)]
84 pub fn pr_iter(&self) -> impl Iterator<Item = PR_R> + '_ {
85 (0..23).map(move |n| PR_R::new(((self.bits >> n) & 1) != 0))
86 }
87 #[inline(always)]
89 pub fn pr0(&self) -> PR_R {
90 PR_R::new((self.bits & 1) != 0)
91 }
92 #[inline(always)]
94 pub fn pr1(&self) -> PR_R {
95 PR_R::new(((self.bits >> 1) & 1) != 0)
96 }
97 #[inline(always)]
99 pub fn pr2(&self) -> PR_R {
100 PR_R::new(((self.bits >> 2) & 1) != 0)
101 }
102 #[inline(always)]
104 pub fn pr3(&self) -> PR_R {
105 PR_R::new(((self.bits >> 3) & 1) != 0)
106 }
107 #[inline(always)]
109 pub fn pr4(&self) -> PR_R {
110 PR_R::new(((self.bits >> 4) & 1) != 0)
111 }
112 #[inline(always)]
114 pub fn pr5(&self) -> PR_R {
115 PR_R::new(((self.bits >> 5) & 1) != 0)
116 }
117 #[inline(always)]
119 pub fn pr6(&self) -> PR_R {
120 PR_R::new(((self.bits >> 6) & 1) != 0)
121 }
122 #[inline(always)]
124 pub fn pr7(&self) -> PR_R {
125 PR_R::new(((self.bits >> 7) & 1) != 0)
126 }
127 #[inline(always)]
129 pub fn pr8(&self) -> PR_R {
130 PR_R::new(((self.bits >> 8) & 1) != 0)
131 }
132 #[inline(always)]
134 pub fn pr9(&self) -> PR_R {
135 PR_R::new(((self.bits >> 9) & 1) != 0)
136 }
137 #[inline(always)]
139 pub fn pr10(&self) -> PR_R {
140 PR_R::new(((self.bits >> 10) & 1) != 0)
141 }
142 #[inline(always)]
144 pub fn pr11(&self) -> PR_R {
145 PR_R::new(((self.bits >> 11) & 1) != 0)
146 }
147 #[inline(always)]
149 pub fn pr12(&self) -> PR_R {
150 PR_R::new(((self.bits >> 12) & 1) != 0)
151 }
152 #[inline(always)]
154 pub fn pr13(&self) -> PR_R {
155 PR_R::new(((self.bits >> 13) & 1) != 0)
156 }
157 #[inline(always)]
159 pub fn pr14(&self) -> PR_R {
160 PR_R::new(((self.bits >> 14) & 1) != 0)
161 }
162 #[inline(always)]
164 pub fn pr15(&self) -> PR_R {
165 PR_R::new(((self.bits >> 15) & 1) != 0)
166 }
167 #[inline(always)]
169 pub fn pr16(&self) -> PR_R {
170 PR_R::new(((self.bits >> 16) & 1) != 0)
171 }
172 #[inline(always)]
174 pub fn pr17(&self) -> PR_R {
175 PR_R::new(((self.bits >> 17) & 1) != 0)
176 }
177 #[inline(always)]
179 pub fn pr18(&self) -> PR_R {
180 PR_R::new(((self.bits >> 18) & 1) != 0)
181 }
182 #[inline(always)]
184 pub fn pr19(&self) -> PR_R {
185 PR_R::new(((self.bits >> 19) & 1) != 0)
186 }
187 #[inline(always)]
189 pub fn pr20(&self) -> PR_R {
190 PR_R::new(((self.bits >> 20) & 1) != 0)
191 }
192 #[inline(always)]
194 pub fn pr21(&self) -> PR_R {
195 PR_R::new(((self.bits >> 21) & 1) != 0)
196 }
197 #[inline(always)]
199 pub fn pr22(&self) -> PR_R {
200 PR_R::new(((self.bits >> 22) & 1) != 0)
201 }
202}
203impl core::fmt::Debug for R {
204 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
205 f.debug_struct("PR")
206 .field("pr0", &self.pr0())
207 .field("pr1", &self.pr1())
208 .field("pr2", &self.pr2())
209 .field("pr3", &self.pr3())
210 .field("pr4", &self.pr4())
211 .field("pr5", &self.pr5())
212 .field("pr6", &self.pr6())
213 .field("pr7", &self.pr7())
214 .field("pr8", &self.pr8())
215 .field("pr9", &self.pr9())
216 .field("pr10", &self.pr10())
217 .field("pr11", &self.pr11())
218 .field("pr12", &self.pr12())
219 .field("pr13", &self.pr13())
220 .field("pr14", &self.pr14())
221 .field("pr15", &self.pr15())
222 .field("pr16", &self.pr16())
223 .field("pr17", &self.pr17())
224 .field("pr18", &self.pr18())
225 .field("pr19", &self.pr19())
226 .field("pr20", &self.pr20())
227 .field("pr21", &self.pr21())
228 .field("pr22", &self.pr22())
229 .finish()
230 }
231}
232impl W {
233 #[inline(always)]
237 pub fn pr(&mut self, n: u8) -> PR_W<PRrs> {
238 #[allow(clippy::no_effect)]
239 [(); 23][n as usize];
240 PR_W::new(self, n)
241 }
242 #[inline(always)]
244 pub fn pr0(&mut self) -> PR_W<PRrs> {
245 PR_W::new(self, 0)
246 }
247 #[inline(always)]
249 pub fn pr1(&mut self) -> PR_W<PRrs> {
250 PR_W::new(self, 1)
251 }
252 #[inline(always)]
254 pub fn pr2(&mut self) -> PR_W<PRrs> {
255 PR_W::new(self, 2)
256 }
257 #[inline(always)]
259 pub fn pr3(&mut self) -> PR_W<PRrs> {
260 PR_W::new(self, 3)
261 }
262 #[inline(always)]
264 pub fn pr4(&mut self) -> PR_W<PRrs> {
265 PR_W::new(self, 4)
266 }
267 #[inline(always)]
269 pub fn pr5(&mut self) -> PR_W<PRrs> {
270 PR_W::new(self, 5)
271 }
272 #[inline(always)]
274 pub fn pr6(&mut self) -> PR_W<PRrs> {
275 PR_W::new(self, 6)
276 }
277 #[inline(always)]
279 pub fn pr7(&mut self) -> PR_W<PRrs> {
280 PR_W::new(self, 7)
281 }
282 #[inline(always)]
284 pub fn pr8(&mut self) -> PR_W<PRrs> {
285 PR_W::new(self, 8)
286 }
287 #[inline(always)]
289 pub fn pr9(&mut self) -> PR_W<PRrs> {
290 PR_W::new(self, 9)
291 }
292 #[inline(always)]
294 pub fn pr10(&mut self) -> PR_W<PRrs> {
295 PR_W::new(self, 10)
296 }
297 #[inline(always)]
299 pub fn pr11(&mut self) -> PR_W<PRrs> {
300 PR_W::new(self, 11)
301 }
302 #[inline(always)]
304 pub fn pr12(&mut self) -> PR_W<PRrs> {
305 PR_W::new(self, 12)
306 }
307 #[inline(always)]
309 pub fn pr13(&mut self) -> PR_W<PRrs> {
310 PR_W::new(self, 13)
311 }
312 #[inline(always)]
314 pub fn pr14(&mut self) -> PR_W<PRrs> {
315 PR_W::new(self, 14)
316 }
317 #[inline(always)]
319 pub fn pr15(&mut self) -> PR_W<PRrs> {
320 PR_W::new(self, 15)
321 }
322 #[inline(always)]
324 pub fn pr16(&mut self) -> PR_W<PRrs> {
325 PR_W::new(self, 16)
326 }
327 #[inline(always)]
329 pub fn pr17(&mut self) -> PR_W<PRrs> {
330 PR_W::new(self, 17)
331 }
332 #[inline(always)]
334 pub fn pr18(&mut self) -> PR_W<PRrs> {
335 PR_W::new(self, 18)
336 }
337 #[inline(always)]
339 pub fn pr19(&mut self) -> PR_W<PRrs> {
340 PR_W::new(self, 19)
341 }
342 #[inline(always)]
344 pub fn pr20(&mut self) -> PR_W<PRrs> {
345 PR_W::new(self, 20)
346 }
347 #[inline(always)]
349 pub fn pr21(&mut self) -> PR_W<PRrs> {
350 PR_W::new(self, 21)
351 }
352 #[inline(always)]
354 pub fn pr22(&mut self) -> PR_W<PRrs> {
355 PR_W::new(self, 22)
356 }
357}
358pub struct PRrs;
364impl crate::RegisterSpec for PRrs {
365 type Ux = u32;
366}
367impl crate::Readable for PRrs {}
369impl crate::Writable for PRrs {
371 type Safety = crate::Unsafe;
372 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0x007f_ffff;
373}
374impl crate::Resettable for PRrs {}