stm32f4_staging/stm32f413/lptim/
ier.rs1pub type R = crate::R<IERrs>;
3pub type W = crate::W<IERrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum CMPMIE {
11 Disabled = 0,
13 Enabled = 1,
15}
16impl From<CMPMIE> for bool {
17 #[inline(always)]
18 fn from(variant: CMPMIE) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type CMPMIE_R = crate::BitReader<CMPMIE>;
24impl CMPMIE_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> CMPMIE {
28 match self.bits {
29 false => CMPMIE::Disabled,
30 true => CMPMIE::Enabled,
31 }
32 }
33 #[inline(always)]
35 pub fn is_disabled(&self) -> bool {
36 *self == CMPMIE::Disabled
37 }
38 #[inline(always)]
40 pub fn is_enabled(&self) -> bool {
41 *self == CMPMIE::Enabled
42 }
43}
44pub type CMPMIE_W<'a, REG> = crate::BitWriter<'a, REG, CMPMIE>;
46impl<'a, REG> CMPMIE_W<'a, REG>
47where
48 REG: crate::Writable + crate::RegisterSpec,
49{
50 #[inline(always)]
52 pub fn disabled(self) -> &'a mut crate::W<REG> {
53 self.variant(CMPMIE::Disabled)
54 }
55 #[inline(always)]
57 pub fn enabled(self) -> &'a mut crate::W<REG> {
58 self.variant(CMPMIE::Enabled)
59 }
60}
61#[cfg_attr(feature = "defmt", derive(defmt::Format))]
65#[derive(Clone, Copy, Debug, PartialEq, Eq)]
66pub enum ARRMIE {
67 Disabled = 0,
69 Enabled = 1,
71}
72impl From<ARRMIE> for bool {
73 #[inline(always)]
74 fn from(variant: ARRMIE) -> Self {
75 variant as u8 != 0
76 }
77}
78pub type ARRMIE_R = crate::BitReader<ARRMIE>;
80impl ARRMIE_R {
81 #[inline(always)]
83 pub const fn variant(&self) -> ARRMIE {
84 match self.bits {
85 false => ARRMIE::Disabled,
86 true => ARRMIE::Enabled,
87 }
88 }
89 #[inline(always)]
91 pub fn is_disabled(&self) -> bool {
92 *self == ARRMIE::Disabled
93 }
94 #[inline(always)]
96 pub fn is_enabled(&self) -> bool {
97 *self == ARRMIE::Enabled
98 }
99}
100pub type ARRMIE_W<'a, REG> = crate::BitWriter<'a, REG, ARRMIE>;
102impl<'a, REG> ARRMIE_W<'a, REG>
103where
104 REG: crate::Writable + crate::RegisterSpec,
105{
106 #[inline(always)]
108 pub fn disabled(self) -> &'a mut crate::W<REG> {
109 self.variant(ARRMIE::Disabled)
110 }
111 #[inline(always)]
113 pub fn enabled(self) -> &'a mut crate::W<REG> {
114 self.variant(ARRMIE::Enabled)
115 }
116}
117#[cfg_attr(feature = "defmt", derive(defmt::Format))]
121#[derive(Clone, Copy, Debug, PartialEq, Eq)]
122pub enum EXTTRIGIE {
123 Disabled = 0,
125 Enabled = 1,
127}
128impl From<EXTTRIGIE> for bool {
129 #[inline(always)]
130 fn from(variant: EXTTRIGIE) -> Self {
131 variant as u8 != 0
132 }
133}
134pub type EXTTRIGIE_R = crate::BitReader<EXTTRIGIE>;
136impl EXTTRIGIE_R {
137 #[inline(always)]
139 pub const fn variant(&self) -> EXTTRIGIE {
140 match self.bits {
141 false => EXTTRIGIE::Disabled,
142 true => EXTTRIGIE::Enabled,
143 }
144 }
145 #[inline(always)]
147 pub fn is_disabled(&self) -> bool {
148 *self == EXTTRIGIE::Disabled
149 }
150 #[inline(always)]
152 pub fn is_enabled(&self) -> bool {
153 *self == EXTTRIGIE::Enabled
154 }
155}
156pub type EXTTRIGIE_W<'a, REG> = crate::BitWriter<'a, REG, EXTTRIGIE>;
158impl<'a, REG> EXTTRIGIE_W<'a, REG>
159where
160 REG: crate::Writable + crate::RegisterSpec,
161{
162 #[inline(always)]
164 pub fn disabled(self) -> &'a mut crate::W<REG> {
165 self.variant(EXTTRIGIE::Disabled)
166 }
167 #[inline(always)]
169 pub fn enabled(self) -> &'a mut crate::W<REG> {
170 self.variant(EXTTRIGIE::Enabled)
171 }
172}
173#[cfg_attr(feature = "defmt", derive(defmt::Format))]
177#[derive(Clone, Copy, Debug, PartialEq, Eq)]
178pub enum CMPOKIE {
179 Disabled = 0,
181 Enabled = 1,
183}
184impl From<CMPOKIE> for bool {
185 #[inline(always)]
186 fn from(variant: CMPOKIE) -> Self {
187 variant as u8 != 0
188 }
189}
190pub type CMPOKIE_R = crate::BitReader<CMPOKIE>;
192impl CMPOKIE_R {
193 #[inline(always)]
195 pub const fn variant(&self) -> CMPOKIE {
196 match self.bits {
197 false => CMPOKIE::Disabled,
198 true => CMPOKIE::Enabled,
199 }
200 }
201 #[inline(always)]
203 pub fn is_disabled(&self) -> bool {
204 *self == CMPOKIE::Disabled
205 }
206 #[inline(always)]
208 pub fn is_enabled(&self) -> bool {
209 *self == CMPOKIE::Enabled
210 }
211}
212pub type CMPOKIE_W<'a, REG> = crate::BitWriter<'a, REG, CMPOKIE>;
214impl<'a, REG> CMPOKIE_W<'a, REG>
215where
216 REG: crate::Writable + crate::RegisterSpec,
217{
218 #[inline(always)]
220 pub fn disabled(self) -> &'a mut crate::W<REG> {
221 self.variant(CMPOKIE::Disabled)
222 }
223 #[inline(always)]
225 pub fn enabled(self) -> &'a mut crate::W<REG> {
226 self.variant(CMPOKIE::Enabled)
227 }
228}
229#[cfg_attr(feature = "defmt", derive(defmt::Format))]
233#[derive(Clone, Copy, Debug, PartialEq, Eq)]
234pub enum ARROKIE {
235 Disabled = 0,
237 Enabled = 1,
239}
240impl From<ARROKIE> for bool {
241 #[inline(always)]
242 fn from(variant: ARROKIE) -> Self {
243 variant as u8 != 0
244 }
245}
246pub type ARROKIE_R = crate::BitReader<ARROKIE>;
248impl ARROKIE_R {
249 #[inline(always)]
251 pub const fn variant(&self) -> ARROKIE {
252 match self.bits {
253 false => ARROKIE::Disabled,
254 true => ARROKIE::Enabled,
255 }
256 }
257 #[inline(always)]
259 pub fn is_disabled(&self) -> bool {
260 *self == ARROKIE::Disabled
261 }
262 #[inline(always)]
264 pub fn is_enabled(&self) -> bool {
265 *self == ARROKIE::Enabled
266 }
267}
268pub type ARROKIE_W<'a, REG> = crate::BitWriter<'a, REG, ARROKIE>;
270impl<'a, REG> ARROKIE_W<'a, REG>
271where
272 REG: crate::Writable + crate::RegisterSpec,
273{
274 #[inline(always)]
276 pub fn disabled(self) -> &'a mut crate::W<REG> {
277 self.variant(ARROKIE::Disabled)
278 }
279 #[inline(always)]
281 pub fn enabled(self) -> &'a mut crate::W<REG> {
282 self.variant(ARROKIE::Enabled)
283 }
284}
285#[cfg_attr(feature = "defmt", derive(defmt::Format))]
289#[derive(Clone, Copy, Debug, PartialEq, Eq)]
290pub enum UPIE {
291 Disabled = 0,
293 Enabled = 1,
295}
296impl From<UPIE> for bool {
297 #[inline(always)]
298 fn from(variant: UPIE) -> Self {
299 variant as u8 != 0
300 }
301}
302pub type UPIE_R = crate::BitReader<UPIE>;
304impl UPIE_R {
305 #[inline(always)]
307 pub const fn variant(&self) -> UPIE {
308 match self.bits {
309 false => UPIE::Disabled,
310 true => UPIE::Enabled,
311 }
312 }
313 #[inline(always)]
315 pub fn is_disabled(&self) -> bool {
316 *self == UPIE::Disabled
317 }
318 #[inline(always)]
320 pub fn is_enabled(&self) -> bool {
321 *self == UPIE::Enabled
322 }
323}
324pub type UPIE_W<'a, REG> = crate::BitWriter<'a, REG, UPIE>;
326impl<'a, REG> UPIE_W<'a, REG>
327where
328 REG: crate::Writable + crate::RegisterSpec,
329{
330 #[inline(always)]
332 pub fn disabled(self) -> &'a mut crate::W<REG> {
333 self.variant(UPIE::Disabled)
334 }
335 #[inline(always)]
337 pub fn enabled(self) -> &'a mut crate::W<REG> {
338 self.variant(UPIE::Enabled)
339 }
340}
341#[cfg_attr(feature = "defmt", derive(defmt::Format))]
345#[derive(Clone, Copy, Debug, PartialEq, Eq)]
346pub enum DOWNIE {
347 Disabled = 0,
349 Enabled = 1,
351}
352impl From<DOWNIE> for bool {
353 #[inline(always)]
354 fn from(variant: DOWNIE) -> Self {
355 variant as u8 != 0
356 }
357}
358pub type DOWNIE_R = crate::BitReader<DOWNIE>;
360impl DOWNIE_R {
361 #[inline(always)]
363 pub const fn variant(&self) -> DOWNIE {
364 match self.bits {
365 false => DOWNIE::Disabled,
366 true => DOWNIE::Enabled,
367 }
368 }
369 #[inline(always)]
371 pub fn is_disabled(&self) -> bool {
372 *self == DOWNIE::Disabled
373 }
374 #[inline(always)]
376 pub fn is_enabled(&self) -> bool {
377 *self == DOWNIE::Enabled
378 }
379}
380pub type DOWNIE_W<'a, REG> = crate::BitWriter<'a, REG, DOWNIE>;
382impl<'a, REG> DOWNIE_W<'a, REG>
383where
384 REG: crate::Writable + crate::RegisterSpec,
385{
386 #[inline(always)]
388 pub fn disabled(self) -> &'a mut crate::W<REG> {
389 self.variant(DOWNIE::Disabled)
390 }
391 #[inline(always)]
393 pub fn enabled(self) -> &'a mut crate::W<REG> {
394 self.variant(DOWNIE::Enabled)
395 }
396}
397impl R {
398 #[inline(always)]
400 pub fn cmpmie(&self) -> CMPMIE_R {
401 CMPMIE_R::new((self.bits & 1) != 0)
402 }
403 #[inline(always)]
405 pub fn arrmie(&self) -> ARRMIE_R {
406 ARRMIE_R::new(((self.bits >> 1) & 1) != 0)
407 }
408 #[inline(always)]
410 pub fn exttrigie(&self) -> EXTTRIGIE_R {
411 EXTTRIGIE_R::new(((self.bits >> 2) & 1) != 0)
412 }
413 #[inline(always)]
415 pub fn cmpokie(&self) -> CMPOKIE_R {
416 CMPOKIE_R::new(((self.bits >> 3) & 1) != 0)
417 }
418 #[inline(always)]
420 pub fn arrokie(&self) -> ARROKIE_R {
421 ARROKIE_R::new(((self.bits >> 4) & 1) != 0)
422 }
423 #[inline(always)]
425 pub fn upie(&self) -> UPIE_R {
426 UPIE_R::new(((self.bits >> 5) & 1) != 0)
427 }
428 #[inline(always)]
430 pub fn downie(&self) -> DOWNIE_R {
431 DOWNIE_R::new(((self.bits >> 6) & 1) != 0)
432 }
433}
434impl core::fmt::Debug for R {
435 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
436 f.debug_struct("IER")
437 .field("downie", &self.downie())
438 .field("upie", &self.upie())
439 .field("arrokie", &self.arrokie())
440 .field("cmpokie", &self.cmpokie())
441 .field("exttrigie", &self.exttrigie())
442 .field("arrmie", &self.arrmie())
443 .field("cmpmie", &self.cmpmie())
444 .finish()
445 }
446}
447impl W {
448 #[inline(always)]
450 pub fn cmpmie(&mut self) -> CMPMIE_W<IERrs> {
451 CMPMIE_W::new(self, 0)
452 }
453 #[inline(always)]
455 pub fn arrmie(&mut self) -> ARRMIE_W<IERrs> {
456 ARRMIE_W::new(self, 1)
457 }
458 #[inline(always)]
460 pub fn exttrigie(&mut self) -> EXTTRIGIE_W<IERrs> {
461 EXTTRIGIE_W::new(self, 2)
462 }
463 #[inline(always)]
465 pub fn cmpokie(&mut self) -> CMPOKIE_W<IERrs> {
466 CMPOKIE_W::new(self, 3)
467 }
468 #[inline(always)]
470 pub fn arrokie(&mut self) -> ARROKIE_W<IERrs> {
471 ARROKIE_W::new(self, 4)
472 }
473 #[inline(always)]
475 pub fn upie(&mut self) -> UPIE_W<IERrs> {
476 UPIE_W::new(self, 5)
477 }
478 #[inline(always)]
480 pub fn downie(&mut self) -> DOWNIE_W<IERrs> {
481 DOWNIE_W::new(self, 6)
482 }
483}
484pub struct IERrs;
490impl crate::RegisterSpec for IERrs {
491 type Ux = u32;
492}
493impl crate::Readable for IERrs {}
495impl crate::Writable for IERrs {
497 type Safety = crate::Unsafe;
498}
499impl crate::Resettable for IERrs {}