stm32f1_staging/stm32f103/rcc/
apb1rstr.rs1pub type R = crate::R<APB1RSTRrs>;
3pub type W = crate::W<APB1RSTRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum TIM2RST {
11 Reset = 1,
13}
14impl From<TIM2RST> for bool {
15 #[inline(always)]
16 fn from(variant: TIM2RST) -> Self {
17 variant as u8 != 0
18 }
19}
20pub type TIM2RST_R = crate::BitReader<TIM2RST>;
22impl TIM2RST_R {
23 #[inline(always)]
25 pub const fn variant(&self) -> Option<TIM2RST> {
26 match self.bits {
27 true => Some(TIM2RST::Reset),
28 _ => None,
29 }
30 }
31 #[inline(always)]
33 pub fn is_reset(&self) -> bool {
34 *self == TIM2RST::Reset
35 }
36}
37pub type TIM2RST_W<'a, REG> = crate::BitWriter<'a, REG, TIM2RST>;
39impl<'a, REG> TIM2RST_W<'a, REG>
40where
41 REG: crate::Writable + crate::RegisterSpec,
42{
43 #[inline(always)]
45 pub fn reset(self) -> &'a mut crate::W<REG> {
46 self.variant(TIM2RST::Reset)
47 }
48}
49pub use TIM2RST_R as TIM3RST_R;
51pub use TIM2RST_R as TIM4RST_R;
53pub use TIM2RST_R as TIM5RST_R;
55pub use TIM2RST_R as TIM6RST_R;
57pub use TIM2RST_R as TIM7RST_R;
59pub use TIM2RST_R as TIM12RST_R;
61pub use TIM2RST_R as TIM13RST_R;
63pub use TIM2RST_R as TIM14RST_R;
65pub use TIM2RST_R as WWDGRST_R;
67pub use TIM2RST_R as SPI2RST_R;
69pub use TIM2RST_R as SPI3RST_R;
71pub use TIM2RST_R as USART2RST_R;
73pub use TIM2RST_R as USART3RST_R;
75pub use TIM2RST_R as UART4RST_R;
77pub use TIM2RST_R as UART5RST_R;
79pub use TIM2RST_R as I2C1RST_R;
81pub use TIM2RST_R as I2C2RST_R;
83pub use TIM2RST_R as USBRST_R;
85pub use TIM2RST_R as CANRST_R;
87pub use TIM2RST_R as BKPRST_R;
89pub use TIM2RST_R as PWRRST_R;
91pub use TIM2RST_R as DACRST_R;
93pub use TIM2RST_W as TIM3RST_W;
95pub use TIM2RST_W as TIM4RST_W;
97pub use TIM2RST_W as TIM5RST_W;
99pub use TIM2RST_W as TIM6RST_W;
101pub use TIM2RST_W as TIM7RST_W;
103pub use TIM2RST_W as TIM12RST_W;
105pub use TIM2RST_W as TIM13RST_W;
107pub use TIM2RST_W as TIM14RST_W;
109pub use TIM2RST_W as WWDGRST_W;
111pub use TIM2RST_W as SPI2RST_W;
113pub use TIM2RST_W as SPI3RST_W;
115pub use TIM2RST_W as USART2RST_W;
117pub use TIM2RST_W as USART3RST_W;
119pub use TIM2RST_W as UART4RST_W;
121pub use TIM2RST_W as UART5RST_W;
123pub use TIM2RST_W as I2C1RST_W;
125pub use TIM2RST_W as I2C2RST_W;
127pub use TIM2RST_W as USBRST_W;
129pub use TIM2RST_W as CANRST_W;
131pub use TIM2RST_W as BKPRST_W;
133pub use TIM2RST_W as PWRRST_W;
135pub use TIM2RST_W as DACRST_W;
137impl R {
138 #[inline(always)]
140 pub fn tim2rst(&self) -> TIM2RST_R {
141 TIM2RST_R::new((self.bits & 1) != 0)
142 }
143 #[inline(always)]
145 pub fn tim3rst(&self) -> TIM3RST_R {
146 TIM3RST_R::new(((self.bits >> 1) & 1) != 0)
147 }
148 #[inline(always)]
150 pub fn tim4rst(&self) -> TIM4RST_R {
151 TIM4RST_R::new(((self.bits >> 2) & 1) != 0)
152 }
153 #[inline(always)]
155 pub fn tim5rst(&self) -> TIM5RST_R {
156 TIM5RST_R::new(((self.bits >> 3) & 1) != 0)
157 }
158 #[inline(always)]
160 pub fn tim6rst(&self) -> TIM6RST_R {
161 TIM6RST_R::new(((self.bits >> 4) & 1) != 0)
162 }
163 #[inline(always)]
165 pub fn tim7rst(&self) -> TIM7RST_R {
166 TIM7RST_R::new(((self.bits >> 5) & 1) != 0)
167 }
168 #[inline(always)]
170 pub fn tim12rst(&self) -> TIM12RST_R {
171 TIM12RST_R::new(((self.bits >> 6) & 1) != 0)
172 }
173 #[inline(always)]
175 pub fn tim13rst(&self) -> TIM13RST_R {
176 TIM13RST_R::new(((self.bits >> 7) & 1) != 0)
177 }
178 #[inline(always)]
180 pub fn tim14rst(&self) -> TIM14RST_R {
181 TIM14RST_R::new(((self.bits >> 8) & 1) != 0)
182 }
183 #[inline(always)]
185 pub fn wwdgrst(&self) -> WWDGRST_R {
186 WWDGRST_R::new(((self.bits >> 11) & 1) != 0)
187 }
188 #[inline(always)]
190 pub fn spi2rst(&self) -> SPI2RST_R {
191 SPI2RST_R::new(((self.bits >> 14) & 1) != 0)
192 }
193 #[inline(always)]
195 pub fn spi3rst(&self) -> SPI3RST_R {
196 SPI3RST_R::new(((self.bits >> 15) & 1) != 0)
197 }
198 #[inline(always)]
200 pub fn usart2rst(&self) -> USART2RST_R {
201 USART2RST_R::new(((self.bits >> 17) & 1) != 0)
202 }
203 #[inline(always)]
205 pub fn usart3rst(&self) -> USART3RST_R {
206 USART3RST_R::new(((self.bits >> 18) & 1) != 0)
207 }
208 #[inline(always)]
210 pub fn uart4rst(&self) -> UART4RST_R {
211 UART4RST_R::new(((self.bits >> 19) & 1) != 0)
212 }
213 #[inline(always)]
215 pub fn uart5rst(&self) -> UART5RST_R {
216 UART5RST_R::new(((self.bits >> 20) & 1) != 0)
217 }
218 #[inline(always)]
220 pub fn i2c1rst(&self) -> I2C1RST_R {
221 I2C1RST_R::new(((self.bits >> 21) & 1) != 0)
222 }
223 #[inline(always)]
225 pub fn i2c2rst(&self) -> I2C2RST_R {
226 I2C2RST_R::new(((self.bits >> 22) & 1) != 0)
227 }
228 #[inline(always)]
230 pub fn usbrst(&self) -> USBRST_R {
231 USBRST_R::new(((self.bits >> 23) & 1) != 0)
232 }
233 #[inline(always)]
235 pub fn canrst(&self) -> CANRST_R {
236 CANRST_R::new(((self.bits >> 25) & 1) != 0)
237 }
238 #[inline(always)]
240 pub fn bkprst(&self) -> BKPRST_R {
241 BKPRST_R::new(((self.bits >> 27) & 1) != 0)
242 }
243 #[inline(always)]
245 pub fn pwrrst(&self) -> PWRRST_R {
246 PWRRST_R::new(((self.bits >> 28) & 1) != 0)
247 }
248 #[inline(always)]
250 pub fn dacrst(&self) -> DACRST_R {
251 DACRST_R::new(((self.bits >> 29) & 1) != 0)
252 }
253}
254impl core::fmt::Debug for R {
255 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
256 f.debug_struct("APB1RSTR")
257 .field("tim2rst", &self.tim2rst())
258 .field("tim3rst", &self.tim3rst())
259 .field("tim4rst", &self.tim4rst())
260 .field("tim5rst", &self.tim5rst())
261 .field("tim6rst", &self.tim6rst())
262 .field("tim7rst", &self.tim7rst())
263 .field("tim12rst", &self.tim12rst())
264 .field("tim13rst", &self.tim13rst())
265 .field("tim14rst", &self.tim14rst())
266 .field("wwdgrst", &self.wwdgrst())
267 .field("spi2rst", &self.spi2rst())
268 .field("spi3rst", &self.spi3rst())
269 .field("usart2rst", &self.usart2rst())
270 .field("usart3rst", &self.usart3rst())
271 .field("uart4rst", &self.uart4rst())
272 .field("uart5rst", &self.uart5rst())
273 .field("i2c1rst", &self.i2c1rst())
274 .field("i2c2rst", &self.i2c2rst())
275 .field("usbrst", &self.usbrst())
276 .field("canrst", &self.canrst())
277 .field("bkprst", &self.bkprst())
278 .field("pwrrst", &self.pwrrst())
279 .field("dacrst", &self.dacrst())
280 .finish()
281 }
282}
283impl W {
284 #[inline(always)]
286 pub fn tim2rst(&mut self) -> TIM2RST_W<APB1RSTRrs> {
287 TIM2RST_W::new(self, 0)
288 }
289 #[inline(always)]
291 pub fn tim3rst(&mut self) -> TIM3RST_W<APB1RSTRrs> {
292 TIM3RST_W::new(self, 1)
293 }
294 #[inline(always)]
296 pub fn tim4rst(&mut self) -> TIM4RST_W<APB1RSTRrs> {
297 TIM4RST_W::new(self, 2)
298 }
299 #[inline(always)]
301 pub fn tim5rst(&mut self) -> TIM5RST_W<APB1RSTRrs> {
302 TIM5RST_W::new(self, 3)
303 }
304 #[inline(always)]
306 pub fn tim6rst(&mut self) -> TIM6RST_W<APB1RSTRrs> {
307 TIM6RST_W::new(self, 4)
308 }
309 #[inline(always)]
311 pub fn tim7rst(&mut self) -> TIM7RST_W<APB1RSTRrs> {
312 TIM7RST_W::new(self, 5)
313 }
314 #[inline(always)]
316 pub fn tim12rst(&mut self) -> TIM12RST_W<APB1RSTRrs> {
317 TIM12RST_W::new(self, 6)
318 }
319 #[inline(always)]
321 pub fn tim13rst(&mut self) -> TIM13RST_W<APB1RSTRrs> {
322 TIM13RST_W::new(self, 7)
323 }
324 #[inline(always)]
326 pub fn tim14rst(&mut self) -> TIM14RST_W<APB1RSTRrs> {
327 TIM14RST_W::new(self, 8)
328 }
329 #[inline(always)]
331 pub fn wwdgrst(&mut self) -> WWDGRST_W<APB1RSTRrs> {
332 WWDGRST_W::new(self, 11)
333 }
334 #[inline(always)]
336 pub fn spi2rst(&mut self) -> SPI2RST_W<APB1RSTRrs> {
337 SPI2RST_W::new(self, 14)
338 }
339 #[inline(always)]
341 pub fn spi3rst(&mut self) -> SPI3RST_W<APB1RSTRrs> {
342 SPI3RST_W::new(self, 15)
343 }
344 #[inline(always)]
346 pub fn usart2rst(&mut self) -> USART2RST_W<APB1RSTRrs> {
347 USART2RST_W::new(self, 17)
348 }
349 #[inline(always)]
351 pub fn usart3rst(&mut self) -> USART3RST_W<APB1RSTRrs> {
352 USART3RST_W::new(self, 18)
353 }
354 #[inline(always)]
356 pub fn uart4rst(&mut self) -> UART4RST_W<APB1RSTRrs> {
357 UART4RST_W::new(self, 19)
358 }
359 #[inline(always)]
361 pub fn uart5rst(&mut self) -> UART5RST_W<APB1RSTRrs> {
362 UART5RST_W::new(self, 20)
363 }
364 #[inline(always)]
366 pub fn i2c1rst(&mut self) -> I2C1RST_W<APB1RSTRrs> {
367 I2C1RST_W::new(self, 21)
368 }
369 #[inline(always)]
371 pub fn i2c2rst(&mut self) -> I2C2RST_W<APB1RSTRrs> {
372 I2C2RST_W::new(self, 22)
373 }
374 #[inline(always)]
376 pub fn usbrst(&mut self) -> USBRST_W<APB1RSTRrs> {
377 USBRST_W::new(self, 23)
378 }
379 #[inline(always)]
381 pub fn canrst(&mut self) -> CANRST_W<APB1RSTRrs> {
382 CANRST_W::new(self, 25)
383 }
384 #[inline(always)]
386 pub fn bkprst(&mut self) -> BKPRST_W<APB1RSTRrs> {
387 BKPRST_W::new(self, 27)
388 }
389 #[inline(always)]
391 pub fn pwrrst(&mut self) -> PWRRST_W<APB1RSTRrs> {
392 PWRRST_W::new(self, 28)
393 }
394 #[inline(always)]
396 pub fn dacrst(&mut self) -> DACRST_W<APB1RSTRrs> {
397 DACRST_W::new(self, 29)
398 }
399}
400pub struct APB1RSTRrs;
406impl crate::RegisterSpec for APB1RSTRrs {
407 type Ux = u32;
408}
409impl crate::Readable for APB1RSTRrs {}
411impl crate::Writable for APB1RSTRrs {
413 type Safety = crate::Unsafe;
414}
415impl crate::Resettable for APB1RSTRrs {}