stm32f7_staging/stm32f733/exti/
emr.rs1pub type R = crate::R<EMRrs>;
3pub type W = crate::W<EMRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum EVENT_MASK {
11 Masked = 0,
13 Unmasked = 1,
15}
16impl From<EVENT_MASK> for bool {
17 #[inline(always)]
18 fn from(variant: EVENT_MASK) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type EM_R = crate::BitReader<EVENT_MASK>;
24impl EM_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> EVENT_MASK {
28 match self.bits {
29 false => EVENT_MASK::Masked,
30 true => EVENT_MASK::Unmasked,
31 }
32 }
33 #[inline(always)]
35 pub fn is_masked(&self) -> bool {
36 *self == EVENT_MASK::Masked
37 }
38 #[inline(always)]
40 pub fn is_unmasked(&self) -> bool {
41 *self == EVENT_MASK::Unmasked
42 }
43}
44pub type EM_W<'a, REG> = crate::BitWriter<'a, REG, EVENT_MASK>;
46impl<'a, REG> EM_W<'a, REG>
47where
48 REG: crate::Writable + crate::RegisterSpec,
49{
50 #[inline(always)]
52 pub fn masked(self) -> &'a mut crate::W<REG> {
53 self.variant(EVENT_MASK::Masked)
54 }
55 #[inline(always)]
57 pub fn unmasked(self) -> &'a mut crate::W<REG> {
58 self.variant(EVENT_MASK::Unmasked)
59 }
60}
61impl R {
62 #[inline(always)]
66 pub fn em(&self, n: u8) -> EM_R {
67 #[allow(clippy::no_effect)]
68 [(); 24][n as usize];
69 EM_R::new(((self.bits >> n) & 1) != 0)
70 }
71 #[inline(always)]
74 pub fn em_iter(&self) -> impl Iterator<Item = EM_R> + '_ {
75 (0..24).map(move |n| EM_R::new(((self.bits >> n) & 1) != 0))
76 }
77 #[inline(always)]
79 pub fn em0(&self) -> EM_R {
80 EM_R::new((self.bits & 1) != 0)
81 }
82 #[inline(always)]
84 pub fn em1(&self) -> EM_R {
85 EM_R::new(((self.bits >> 1) & 1) != 0)
86 }
87 #[inline(always)]
89 pub fn em2(&self) -> EM_R {
90 EM_R::new(((self.bits >> 2) & 1) != 0)
91 }
92 #[inline(always)]
94 pub fn em3(&self) -> EM_R {
95 EM_R::new(((self.bits >> 3) & 1) != 0)
96 }
97 #[inline(always)]
99 pub fn em4(&self) -> EM_R {
100 EM_R::new(((self.bits >> 4) & 1) != 0)
101 }
102 #[inline(always)]
104 pub fn em5(&self) -> EM_R {
105 EM_R::new(((self.bits >> 5) & 1) != 0)
106 }
107 #[inline(always)]
109 pub fn em6(&self) -> EM_R {
110 EM_R::new(((self.bits >> 6) & 1) != 0)
111 }
112 #[inline(always)]
114 pub fn em7(&self) -> EM_R {
115 EM_R::new(((self.bits >> 7) & 1) != 0)
116 }
117 #[inline(always)]
119 pub fn em8(&self) -> EM_R {
120 EM_R::new(((self.bits >> 8) & 1) != 0)
121 }
122 #[inline(always)]
124 pub fn em9(&self) -> EM_R {
125 EM_R::new(((self.bits >> 9) & 1) != 0)
126 }
127 #[inline(always)]
129 pub fn em10(&self) -> EM_R {
130 EM_R::new(((self.bits >> 10) & 1) != 0)
131 }
132 #[inline(always)]
134 pub fn em11(&self) -> EM_R {
135 EM_R::new(((self.bits >> 11) & 1) != 0)
136 }
137 #[inline(always)]
139 pub fn em12(&self) -> EM_R {
140 EM_R::new(((self.bits >> 12) & 1) != 0)
141 }
142 #[inline(always)]
144 pub fn em13(&self) -> EM_R {
145 EM_R::new(((self.bits >> 13) & 1) != 0)
146 }
147 #[inline(always)]
149 pub fn em14(&self) -> EM_R {
150 EM_R::new(((self.bits >> 14) & 1) != 0)
151 }
152 #[inline(always)]
154 pub fn em15(&self) -> EM_R {
155 EM_R::new(((self.bits >> 15) & 1) != 0)
156 }
157 #[inline(always)]
159 pub fn em16(&self) -> EM_R {
160 EM_R::new(((self.bits >> 16) & 1) != 0)
161 }
162 #[inline(always)]
164 pub fn em17(&self) -> EM_R {
165 EM_R::new(((self.bits >> 17) & 1) != 0)
166 }
167 #[inline(always)]
169 pub fn em18(&self) -> EM_R {
170 EM_R::new(((self.bits >> 18) & 1) != 0)
171 }
172 #[inline(always)]
174 pub fn em19(&self) -> EM_R {
175 EM_R::new(((self.bits >> 19) & 1) != 0)
176 }
177 #[inline(always)]
179 pub fn em20(&self) -> EM_R {
180 EM_R::new(((self.bits >> 20) & 1) != 0)
181 }
182 #[inline(always)]
184 pub fn em21(&self) -> EM_R {
185 EM_R::new(((self.bits >> 21) & 1) != 0)
186 }
187 #[inline(always)]
189 pub fn em22(&self) -> EM_R {
190 EM_R::new(((self.bits >> 22) & 1) != 0)
191 }
192 #[inline(always)]
194 pub fn em23(&self) -> EM_R {
195 EM_R::new(((self.bits >> 23) & 1) != 0)
196 }
197}
198impl core::fmt::Debug for R {
199 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
200 f.debug_struct("EMR")
201 .field("em0", &self.em0())
202 .field("em1", &self.em1())
203 .field("em2", &self.em2())
204 .field("em3", &self.em3())
205 .field("em4", &self.em4())
206 .field("em5", &self.em5())
207 .field("em6", &self.em6())
208 .field("em7", &self.em7())
209 .field("em8", &self.em8())
210 .field("em9", &self.em9())
211 .field("em10", &self.em10())
212 .field("em11", &self.em11())
213 .field("em12", &self.em12())
214 .field("em13", &self.em13())
215 .field("em14", &self.em14())
216 .field("em15", &self.em15())
217 .field("em16", &self.em16())
218 .field("em17", &self.em17())
219 .field("em18", &self.em18())
220 .field("em19", &self.em19())
221 .field("em20", &self.em20())
222 .field("em21", &self.em21())
223 .field("em22", &self.em22())
224 .field("em23", &self.em23())
225 .finish()
226 }
227}
228impl W {
229 #[inline(always)]
233 pub fn em(&mut self, n: u8) -> EM_W<EMRrs> {
234 #[allow(clippy::no_effect)]
235 [(); 24][n as usize];
236 EM_W::new(self, n)
237 }
238 #[inline(always)]
240 pub fn em0(&mut self) -> EM_W<EMRrs> {
241 EM_W::new(self, 0)
242 }
243 #[inline(always)]
245 pub fn em1(&mut self) -> EM_W<EMRrs> {
246 EM_W::new(self, 1)
247 }
248 #[inline(always)]
250 pub fn em2(&mut self) -> EM_W<EMRrs> {
251 EM_W::new(self, 2)
252 }
253 #[inline(always)]
255 pub fn em3(&mut self) -> EM_W<EMRrs> {
256 EM_W::new(self, 3)
257 }
258 #[inline(always)]
260 pub fn em4(&mut self) -> EM_W<EMRrs> {
261 EM_W::new(self, 4)
262 }
263 #[inline(always)]
265 pub fn em5(&mut self) -> EM_W<EMRrs> {
266 EM_W::new(self, 5)
267 }
268 #[inline(always)]
270 pub fn em6(&mut self) -> EM_W<EMRrs> {
271 EM_W::new(self, 6)
272 }
273 #[inline(always)]
275 pub fn em7(&mut self) -> EM_W<EMRrs> {
276 EM_W::new(self, 7)
277 }
278 #[inline(always)]
280 pub fn em8(&mut self) -> EM_W<EMRrs> {
281 EM_W::new(self, 8)
282 }
283 #[inline(always)]
285 pub fn em9(&mut self) -> EM_W<EMRrs> {
286 EM_W::new(self, 9)
287 }
288 #[inline(always)]
290 pub fn em10(&mut self) -> EM_W<EMRrs> {
291 EM_W::new(self, 10)
292 }
293 #[inline(always)]
295 pub fn em11(&mut self) -> EM_W<EMRrs> {
296 EM_W::new(self, 11)
297 }
298 #[inline(always)]
300 pub fn em12(&mut self) -> EM_W<EMRrs> {
301 EM_W::new(self, 12)
302 }
303 #[inline(always)]
305 pub fn em13(&mut self) -> EM_W<EMRrs> {
306 EM_W::new(self, 13)
307 }
308 #[inline(always)]
310 pub fn em14(&mut self) -> EM_W<EMRrs> {
311 EM_W::new(self, 14)
312 }
313 #[inline(always)]
315 pub fn em15(&mut self) -> EM_W<EMRrs> {
316 EM_W::new(self, 15)
317 }
318 #[inline(always)]
320 pub fn em16(&mut self) -> EM_W<EMRrs> {
321 EM_W::new(self, 16)
322 }
323 #[inline(always)]
325 pub fn em17(&mut self) -> EM_W<EMRrs> {
326 EM_W::new(self, 17)
327 }
328 #[inline(always)]
330 pub fn em18(&mut self) -> EM_W<EMRrs> {
331 EM_W::new(self, 18)
332 }
333 #[inline(always)]
335 pub fn em19(&mut self) -> EM_W<EMRrs> {
336 EM_W::new(self, 19)
337 }
338 #[inline(always)]
340 pub fn em20(&mut self) -> EM_W<EMRrs> {
341 EM_W::new(self, 20)
342 }
343 #[inline(always)]
345 pub fn em21(&mut self) -> EM_W<EMRrs> {
346 EM_W::new(self, 21)
347 }
348 #[inline(always)]
350 pub fn em22(&mut self) -> EM_W<EMRrs> {
351 EM_W::new(self, 22)
352 }
353 #[inline(always)]
355 pub fn em23(&mut self) -> EM_W<EMRrs> {
356 EM_W::new(self, 23)
357 }
358}
359pub struct EMRrs;
365impl crate::RegisterSpec for EMRrs {
366 type Ux = u32;
367}
368impl crate::Readable for EMRrs {}
370impl crate::Writable for EMRrs {
372 type Safety = crate::Unsafe;
373}
374impl crate::Resettable for EMRrs {}