stm32f4_staging/stm32f413/fmpi2c1/
timeoutr.rs1pub type R = crate::R<TIMEOUTRrs>;
3pub type W = crate::W<TIMEOUTRrs>;
5pub type TIMEOUTA_R = crate::FieldReader<u16>;
7pub type TIMEOUTA_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16, crate::Safe>;
9#[cfg_attr(feature = "defmt", derive(defmt::Format))]
13#[derive(Clone, Copy, Debug, PartialEq, Eq)]
14pub enum TIDLE {
15 Disabled = 0,
17 Enabled = 1,
19}
20impl From<TIDLE> for bool {
21 #[inline(always)]
22 fn from(variant: TIDLE) -> Self {
23 variant as u8 != 0
24 }
25}
26pub type TIDLE_R = crate::BitReader<TIDLE>;
28impl TIDLE_R {
29 #[inline(always)]
31 pub const fn variant(&self) -> TIDLE {
32 match self.bits {
33 false => TIDLE::Disabled,
34 true => TIDLE::Enabled,
35 }
36 }
37 #[inline(always)]
39 pub fn is_disabled(&self) -> bool {
40 *self == TIDLE::Disabled
41 }
42 #[inline(always)]
44 pub fn is_enabled(&self) -> bool {
45 *self == TIDLE::Enabled
46 }
47}
48pub type TIDLE_W<'a, REG> = crate::BitWriter<'a, REG, TIDLE>;
50impl<'a, REG> TIDLE_W<'a, REG>
51where
52 REG: crate::Writable + crate::RegisterSpec,
53{
54 #[inline(always)]
56 pub fn disabled(self) -> &'a mut crate::W<REG> {
57 self.variant(TIDLE::Disabled)
58 }
59 #[inline(always)]
61 pub fn enabled(self) -> &'a mut crate::W<REG> {
62 self.variant(TIDLE::Enabled)
63 }
64}
65#[cfg_attr(feature = "defmt", derive(defmt::Format))]
69#[derive(Clone, Copy, Debug, PartialEq, Eq)]
70pub enum TIMOUTEN {
71 Disabled = 0,
73 Enabled = 1,
75}
76impl From<TIMOUTEN> for bool {
77 #[inline(always)]
78 fn from(variant: TIMOUTEN) -> Self {
79 variant as u8 != 0
80 }
81}
82pub type TIMOUTEN_R = crate::BitReader<TIMOUTEN>;
84impl TIMOUTEN_R {
85 #[inline(always)]
87 pub const fn variant(&self) -> TIMOUTEN {
88 match self.bits {
89 false => TIMOUTEN::Disabled,
90 true => TIMOUTEN::Enabled,
91 }
92 }
93 #[inline(always)]
95 pub fn is_disabled(&self) -> bool {
96 *self == TIMOUTEN::Disabled
97 }
98 #[inline(always)]
100 pub fn is_enabled(&self) -> bool {
101 *self == TIMOUTEN::Enabled
102 }
103}
104pub type TIMOUTEN_W<'a, REG> = crate::BitWriter<'a, REG, TIMOUTEN>;
106impl<'a, REG> TIMOUTEN_W<'a, REG>
107where
108 REG: crate::Writable + crate::RegisterSpec,
109{
110 #[inline(always)]
112 pub fn disabled(self) -> &'a mut crate::W<REG> {
113 self.variant(TIMOUTEN::Disabled)
114 }
115 #[inline(always)]
117 pub fn enabled(self) -> &'a mut crate::W<REG> {
118 self.variant(TIMOUTEN::Enabled)
119 }
120}
121pub type TIMEOUTB_R = crate::FieldReader<u16>;
123pub type TIMEOUTB_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16, crate::Safe>;
125#[cfg_attr(feature = "defmt", derive(defmt::Format))]
129#[derive(Clone, Copy, Debug, PartialEq, Eq)]
130pub enum TEXTEN {
131 Disabled = 0,
133 Enabled = 1,
135}
136impl From<TEXTEN> for bool {
137 #[inline(always)]
138 fn from(variant: TEXTEN) -> Self {
139 variant as u8 != 0
140 }
141}
142pub type TEXTEN_R = crate::BitReader<TEXTEN>;
144impl TEXTEN_R {
145 #[inline(always)]
147 pub const fn variant(&self) -> TEXTEN {
148 match self.bits {
149 false => TEXTEN::Disabled,
150 true => TEXTEN::Enabled,
151 }
152 }
153 #[inline(always)]
155 pub fn is_disabled(&self) -> bool {
156 *self == TEXTEN::Disabled
157 }
158 #[inline(always)]
160 pub fn is_enabled(&self) -> bool {
161 *self == TEXTEN::Enabled
162 }
163}
164pub type TEXTEN_W<'a, REG> = crate::BitWriter<'a, REG, TEXTEN>;
166impl<'a, REG> TEXTEN_W<'a, REG>
167where
168 REG: crate::Writable + crate::RegisterSpec,
169{
170 #[inline(always)]
172 pub fn disabled(self) -> &'a mut crate::W<REG> {
173 self.variant(TEXTEN::Disabled)
174 }
175 #[inline(always)]
177 pub fn enabled(self) -> &'a mut crate::W<REG> {
178 self.variant(TEXTEN::Enabled)
179 }
180}
181impl R {
182 #[inline(always)]
184 pub fn timeouta(&self) -> TIMEOUTA_R {
185 TIMEOUTA_R::new((self.bits & 0x0fff) as u16)
186 }
187 #[inline(always)]
189 pub fn tidle(&self) -> TIDLE_R {
190 TIDLE_R::new(((self.bits >> 12) & 1) != 0)
191 }
192 #[inline(always)]
194 pub fn timouten(&self) -> TIMOUTEN_R {
195 TIMOUTEN_R::new(((self.bits >> 15) & 1) != 0)
196 }
197 #[inline(always)]
199 pub fn timeoutb(&self) -> TIMEOUTB_R {
200 TIMEOUTB_R::new(((self.bits >> 16) & 0x0fff) as u16)
201 }
202 #[inline(always)]
204 pub fn texten(&self) -> TEXTEN_R {
205 TEXTEN_R::new(((self.bits >> 31) & 1) != 0)
206 }
207}
208impl core::fmt::Debug for R {
209 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
210 f.debug_struct("TIMEOUTR")
211 .field("timeouta", &self.timeouta())
212 .field("tidle", &self.tidle())
213 .field("timouten", &self.timouten())
214 .field("timeoutb", &self.timeoutb())
215 .field("texten", &self.texten())
216 .finish()
217 }
218}
219impl W {
220 #[inline(always)]
222 pub fn timeouta(&mut self) -> TIMEOUTA_W<TIMEOUTRrs> {
223 TIMEOUTA_W::new(self, 0)
224 }
225 #[inline(always)]
227 pub fn tidle(&mut self) -> TIDLE_W<TIMEOUTRrs> {
228 TIDLE_W::new(self, 12)
229 }
230 #[inline(always)]
232 pub fn timouten(&mut self) -> TIMOUTEN_W<TIMEOUTRrs> {
233 TIMOUTEN_W::new(self, 15)
234 }
235 #[inline(always)]
237 pub fn timeoutb(&mut self) -> TIMEOUTB_W<TIMEOUTRrs> {
238 TIMEOUTB_W::new(self, 16)
239 }
240 #[inline(always)]
242 pub fn texten(&mut self) -> TEXTEN_W<TIMEOUTRrs> {
243 TEXTEN_W::new(self, 31)
244 }
245}
246pub struct TIMEOUTRrs;
252impl crate::RegisterSpec for TIMEOUTRrs {
253 type Ux = u32;
254}
255impl crate::Readable for TIMEOUTRrs {}
257impl crate::Writable for TIMEOUTRrs {
259 type Safety = crate::Unsafe;
260}
261impl crate::Resettable for TIMEOUTRrs {}