stm32f1/stm32f101/tim6/
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 UDE {
67 Disabled = 0,
69 Enabled = 1,
71}
72impl From<UDE> for bool {
73 #[inline(always)]
74 fn from(variant: UDE) -> Self {
75 variant as u8 != 0
76 }
77}
78pub type UDE_R = crate::BitReader<UDE>;
80impl UDE_R {
81 #[inline(always)]
83 pub const fn variant(&self) -> UDE {
84 match self.bits {
85 false => UDE::Disabled,
86 true => UDE::Enabled,
87 }
88 }
89 #[inline(always)]
91 pub fn is_disabled(&self) -> bool {
92 *self == UDE::Disabled
93 }
94 #[inline(always)]
96 pub fn is_enabled(&self) -> bool {
97 *self == UDE::Enabled
98 }
99}
100pub type UDE_W<'a, REG> = crate::BitWriter<'a, REG, UDE>;
102impl<'a, REG> UDE_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(UDE::Disabled)
110 }
111 #[inline(always)]
113 pub fn enabled(self) -> &'a mut crate::W<REG> {
114 self.variant(UDE::Enabled)
115 }
116}
117impl R {
118 #[inline(always)]
120 pub fn uie(&self) -> UIE_R {
121 UIE_R::new((self.bits & 1) != 0)
122 }
123 #[inline(always)]
125 pub fn ude(&self) -> UDE_R {
126 UDE_R::new(((self.bits >> 8) & 1) != 0)
127 }
128}
129impl core::fmt::Debug for R {
130 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
131 f.debug_struct("DIER")
132 .field("ude", &self.ude())
133 .field("uie", &self.uie())
134 .finish()
135 }
136}
137impl W {
138 #[inline(always)]
140 pub fn uie(&mut self) -> UIE_W<DIERrs> {
141 UIE_W::new(self, 0)
142 }
143 #[inline(always)]
145 pub fn ude(&mut self) -> UDE_W<DIERrs> {
146 UDE_W::new(self, 8)
147 }
148}
149pub struct DIERrs;
155impl crate::RegisterSpec for DIERrs {
156 type Ux = u32;
157}
158impl crate::Readable for DIERrs {}
160impl crate::Writable for DIERrs {
162 type Safety = crate::Unsafe;
163}
164impl crate::Resettable for DIERrs {}