stm32f1_staging/stm32f100/tim16/
dier.rs1pub type R = crate::R<DIERrs>;
3pub type W = crate::W<DIERrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum UIE {
11 Disabled = 0,
13 Enabled = 1,
15}
16impl From<UIE> for bool {
17 #[inline(always)]
18 fn from(variant: UIE) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type UIE_R = crate::BitReader<UIE>;
24impl UIE_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> UIE {
28 match self.bits {
29 false => UIE::Disabled,
30 true => UIE::Enabled,
31 }
32 }
33 #[inline(always)]
35 pub fn is_disabled(&self) -> bool {
36 *self == UIE::Disabled
37 }
38 #[inline(always)]
40 pub fn is_enabled(&self) -> bool {
41 *self == UIE::Enabled
42 }
43}
44pub type UIE_W<'a, REG> = crate::BitWriter<'a, REG, UIE>;
46impl<'a, REG> UIE_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(UIE::Disabled)
54 }
55 #[inline(always)]
57 pub fn enabled(self) -> &'a mut crate::W<REG> {
58 self.variant(UIE::Enabled)
59 }
60}
61#[cfg_attr(feature = "defmt", derive(defmt::Format))]
65#[derive(Clone, Copy, Debug, PartialEq, Eq)]
66pub enum CC1IE {
67 Disabled = 0,
69 Enabled = 1,
71}
72impl From<CC1IE> for bool {
73 #[inline(always)]
74 fn from(variant: CC1IE) -> Self {
75 variant as u8 != 0
76 }
77}
78pub type CCIE_R = crate::BitReader<CC1IE>;
80impl CCIE_R {
81 #[inline(always)]
83 pub const fn variant(&self) -> CC1IE {
84 match self.bits {
85 false => CC1IE::Disabled,
86 true => CC1IE::Enabled,
87 }
88 }
89 #[inline(always)]
91 pub fn is_disabled(&self) -> bool {
92 *self == CC1IE::Disabled
93 }
94 #[inline(always)]
96 pub fn is_enabled(&self) -> bool {
97 *self == CC1IE::Enabled
98 }
99}
100pub type CCIE_W<'a, REG> = crate::BitWriter<'a, REG, CC1IE>;
102impl<'a, REG> CCIE_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(CC1IE::Disabled)
110 }
111 #[inline(always)]
113 pub fn enabled(self) -> &'a mut crate::W<REG> {
114 self.variant(CC1IE::Enabled)
115 }
116}
117#[cfg_attr(feature = "defmt", derive(defmt::Format))]
121#[derive(Clone, Copy, Debug, PartialEq, Eq)]
122pub enum COMIE {
123 Disabled = 0,
125 Enabled = 1,
127}
128impl From<COMIE> for bool {
129 #[inline(always)]
130 fn from(variant: COMIE) -> Self {
131 variant as u8 != 0
132 }
133}
134pub type COMIE_R = crate::BitReader<COMIE>;
136impl COMIE_R {
137 #[inline(always)]
139 pub const fn variant(&self) -> COMIE {
140 match self.bits {
141 false => COMIE::Disabled,
142 true => COMIE::Enabled,
143 }
144 }
145 #[inline(always)]
147 pub fn is_disabled(&self) -> bool {
148 *self == COMIE::Disabled
149 }
150 #[inline(always)]
152 pub fn is_enabled(&self) -> bool {
153 *self == COMIE::Enabled
154 }
155}
156pub type COMIE_W<'a, REG> = crate::BitWriter<'a, REG, COMIE>;
158impl<'a, REG> COMIE_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(COMIE::Disabled)
166 }
167 #[inline(always)]
169 pub fn enabled(self) -> &'a mut crate::W<REG> {
170 self.variant(COMIE::Enabled)
171 }
172}
173pub type TIE_R = crate::BitReader;
175pub type TIE_W<'a, REG> = crate::BitWriter<'a, REG>;
177#[cfg_attr(feature = "defmt", derive(defmt::Format))]
181#[derive(Clone, Copy, Debug, PartialEq, Eq)]
182pub enum BIE {
183 Disabled = 0,
185 Enabled = 1,
187}
188impl From<BIE> for bool {
189 #[inline(always)]
190 fn from(variant: BIE) -> Self {
191 variant as u8 != 0
192 }
193}
194pub type BIE_R = crate::BitReader<BIE>;
196impl BIE_R {
197 #[inline(always)]
199 pub const fn variant(&self) -> BIE {
200 match self.bits {
201 false => BIE::Disabled,
202 true => BIE::Enabled,
203 }
204 }
205 #[inline(always)]
207 pub fn is_disabled(&self) -> bool {
208 *self == BIE::Disabled
209 }
210 #[inline(always)]
212 pub fn is_enabled(&self) -> bool {
213 *self == BIE::Enabled
214 }
215}
216pub type BIE_W<'a, REG> = crate::BitWriter<'a, REG, BIE>;
218impl<'a, REG> BIE_W<'a, REG>
219where
220 REG: crate::Writable + crate::RegisterSpec,
221{
222 #[inline(always)]
224 pub fn disabled(self) -> &'a mut crate::W<REG> {
225 self.variant(BIE::Disabled)
226 }
227 #[inline(always)]
229 pub fn enabled(self) -> &'a mut crate::W<REG> {
230 self.variant(BIE::Enabled)
231 }
232}
233#[cfg_attr(feature = "defmt", derive(defmt::Format))]
237#[derive(Clone, Copy, Debug, PartialEq, Eq)]
238pub enum UDE {
239 Disabled = 0,
241 Enabled = 1,
243}
244impl From<UDE> for bool {
245 #[inline(always)]
246 fn from(variant: UDE) -> Self {
247 variant as u8 != 0
248 }
249}
250pub type UDE_R = crate::BitReader<UDE>;
252impl UDE_R {
253 #[inline(always)]
255 pub const fn variant(&self) -> UDE {
256 match self.bits {
257 false => UDE::Disabled,
258 true => UDE::Enabled,
259 }
260 }
261 #[inline(always)]
263 pub fn is_disabled(&self) -> bool {
264 *self == UDE::Disabled
265 }
266 #[inline(always)]
268 pub fn is_enabled(&self) -> bool {
269 *self == UDE::Enabled
270 }
271}
272pub type UDE_W<'a, REG> = crate::BitWriter<'a, REG, UDE>;
274impl<'a, REG> UDE_W<'a, REG>
275where
276 REG: crate::Writable + crate::RegisterSpec,
277{
278 #[inline(always)]
280 pub fn disabled(self) -> &'a mut crate::W<REG> {
281 self.variant(UDE::Disabled)
282 }
283 #[inline(always)]
285 pub fn enabled(self) -> &'a mut crate::W<REG> {
286 self.variant(UDE::Enabled)
287 }
288}
289#[cfg_attr(feature = "defmt", derive(defmt::Format))]
293#[derive(Clone, Copy, Debug, PartialEq, Eq)]
294pub enum CC1DE {
295 Disabled = 0,
297 Enabled = 1,
299}
300impl From<CC1DE> for bool {
301 #[inline(always)]
302 fn from(variant: CC1DE) -> Self {
303 variant as u8 != 0
304 }
305}
306pub type CCDE_R = crate::BitReader<CC1DE>;
308impl CCDE_R {
309 #[inline(always)]
311 pub const fn variant(&self) -> CC1DE {
312 match self.bits {
313 false => CC1DE::Disabled,
314 true => CC1DE::Enabled,
315 }
316 }
317 #[inline(always)]
319 pub fn is_disabled(&self) -> bool {
320 *self == CC1DE::Disabled
321 }
322 #[inline(always)]
324 pub fn is_enabled(&self) -> bool {
325 *self == CC1DE::Enabled
326 }
327}
328pub type CCDE_W<'a, REG> = crate::BitWriter<'a, REG, CC1DE>;
330impl<'a, REG> CCDE_W<'a, REG>
331where
332 REG: crate::Writable + crate::RegisterSpec,
333{
334 #[inline(always)]
336 pub fn disabled(self) -> &'a mut crate::W<REG> {
337 self.variant(CC1DE::Disabled)
338 }
339 #[inline(always)]
341 pub fn enabled(self) -> &'a mut crate::W<REG> {
342 self.variant(CC1DE::Enabled)
343 }
344}
345pub type TDE_R = crate::BitReader;
347pub type TDE_W<'a, REG> = crate::BitWriter<'a, REG>;
349impl R {
350 #[inline(always)]
352 pub fn uie(&self) -> UIE_R {
353 UIE_R::new((self.bits & 1) != 0)
354 }
355 #[inline(always)]
359 pub fn ccie(&self, n: u8) -> CCIE_R {
360 #[allow(clippy::no_effect)] [(); 1][n as usize];
361 CCIE_R::new(((self.bits >> (n * 0 + 1)) & 1) != 0)
362 }
363 #[inline(always)]
366 pub fn ccie_iter(&self) -> impl Iterator<Item = CCIE_R> + '_ {
367 (0..1).map(move |n| CCIE_R::new(((self.bits >> (n * 0 + 1)) & 1) != 0))
368 }
369 #[inline(always)]
371 pub fn cc1ie(&self) -> CCIE_R {
372 CCIE_R::new(((self.bits >> 1) & 1) != 0)
373 }
374 #[inline(always)]
376 pub fn comie(&self) -> COMIE_R {
377 COMIE_R::new(((self.bits >> 5) & 1) != 0)
378 }
379 #[inline(always)]
381 pub fn tie(&self) -> TIE_R {
382 TIE_R::new(((self.bits >> 6) & 1) != 0)
383 }
384 #[inline(always)]
386 pub fn bie(&self) -> BIE_R {
387 BIE_R::new(((self.bits >> 7) & 1) != 0)
388 }
389 #[inline(always)]
391 pub fn ude(&self) -> UDE_R {
392 UDE_R::new(((self.bits >> 8) & 1) != 0)
393 }
394 #[inline(always)]
398 pub fn ccde(&self, n: u8) -> CCDE_R {
399 #[allow(clippy::no_effect)] [(); 1][n as usize];
400 CCDE_R::new(((self.bits >> (n * 0 + 9)) & 1) != 0)
401 }
402 #[inline(always)]
405 pub fn ccde_iter(&self) -> impl Iterator<Item = CCDE_R> + '_ {
406 (0..1).map(move |n| CCDE_R::new(((self.bits >> (n * 0 + 9)) & 1) != 0))
407 }
408 #[inline(always)]
410 pub fn cc1de(&self) -> CCDE_R {
411 CCDE_R::new(((self.bits >> 9) & 1) != 0)
412 }
413 #[inline(always)]
415 pub fn tde(&self) -> TDE_R {
416 TDE_R::new(((self.bits >> 14) & 1) != 0)
417 }
418}
419impl core::fmt::Debug for R {
420 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
421 f.debug_struct("DIER")
422 .field("tde", &self.tde())
423 .field("cc1de", &self.cc1de())
424 .field("ude", &self.ude())
425 .field("bie", &self.bie())
426 .field("tie", &self.tie())
427 .field("comie", &self.comie())
428 .field("cc1ie", &self.cc1ie())
429 .field("uie", &self.uie())
430 .finish()
431 }
432}
433impl W {
434 #[inline(always)]
436 pub fn uie(&mut self) -> UIE_W<DIERrs> {
437 UIE_W::new(self, 0)
438 }
439 #[inline(always)]
443 pub fn ccie(&mut self, n: u8) -> CCIE_W<DIERrs> {
444 #[allow(clippy::no_effect)] [(); 1][n as usize];
445 CCIE_W::new(self, n * 0 + 1)
446 }
447 #[inline(always)]
449 pub fn cc1ie(&mut self) -> CCIE_W<DIERrs> {
450 CCIE_W::new(self, 1)
451 }
452 #[inline(always)]
454 pub fn comie(&mut self) -> COMIE_W<DIERrs> {
455 COMIE_W::new(self, 5)
456 }
457 #[inline(always)]
459 pub fn tie(&mut self) -> TIE_W<DIERrs> {
460 TIE_W::new(self, 6)
461 }
462 #[inline(always)]
464 pub fn bie(&mut self) -> BIE_W<DIERrs> {
465 BIE_W::new(self, 7)
466 }
467 #[inline(always)]
469 pub fn ude(&mut self) -> UDE_W<DIERrs> {
470 UDE_W::new(self, 8)
471 }
472 #[inline(always)]
476 pub fn ccde(&mut self, n: u8) -> CCDE_W<DIERrs> {
477 #[allow(clippy::no_effect)] [(); 1][n as usize];
478 CCDE_W::new(self, n * 0 + 9)
479 }
480 #[inline(always)]
482 pub fn cc1de(&mut self) -> CCDE_W<DIERrs> {
483 CCDE_W::new(self, 9)
484 }
485 #[inline(always)]
487 pub fn tde(&mut self) -> TDE_W<DIERrs> {
488 TDE_W::new(self, 14)
489 }
490}
491pub struct DIERrs;
497impl crate::RegisterSpec for DIERrs {
498 type Ux = u32;
499}
500impl crate::Readable for DIERrs {}
502impl crate::Writable for DIERrs {
504 type Safety = crate::Unsafe;
505}
506impl crate::Resettable for DIERrs {}