1#![doc = "Peripheral access API for STM32F103XX microcontrollers (generated using svd2rust v0.14.0)\n\nYou can find an overview of the API [here].\n\n[here]: https://docs.rs/svd2rust/0.14.0/svd2rust/#peripheral-api"]
2#![deny(missing_docs)]
3#![deny(warnings)]
4#![allow(non_camel_case_types)]
5#![no_std]
6extern crate bare_metal;
7extern crate cortex_m;
8#[cfg(feature = "rt")]
9extern crate cortex_m_rt;
10extern crate vcell;
11use core::marker::PhantomData;
12use core::ops::Deref;
13#[doc = r" Number available in the NVIC for configuring priority"]
14pub const NVIC_PRIO_BITS: u8 = 4;
15#[cfg(feature = "rt")]
16extern "C" {
17 fn WWDG();
18 fn PVD();
19 fn TAMPER();
20 fn RTC();
21 fn FLASH();
22 fn RCC();
23 fn EXTI0();
24 fn EXTI1();
25 fn EXTI2();
26 fn EXTI3();
27 fn EXTI4();
28 fn DMA1_CHANNEL1();
29 fn DMA1_CHANNEL2();
30 fn DMA1_CHANNEL3();
31 fn DMA1_CHANNEL4();
32 fn DMA1_CHANNEL5();
33 fn DMA1_CHANNEL6();
34 fn DMA1_CHANNEL7();
35 fn ADC();
36 fn CAN1_TX();
37 fn CAN1_RX0();
38 fn CAN1_RX1();
39 fn CAN1_SCE();
40 fn EXTI9_5();
41 fn TIM1_BRK_TIM9();
42 fn TIM1_UP_TIM10();
43 fn TIM1_TRG_COM_TIM11();
44 fn TIM1_CC();
45 fn TIM2();
46 fn TIM3();
47 fn TIM4();
48 fn I2C1_EV();
49 fn I2C1_ER();
50 fn I2C2_EV();
51 fn I2C2_ER();
52 fn SPI1();
53 fn SPI2();
54 fn USART1();
55 fn USART2();
56 fn USART3();
57 fn EXTI15_10();
58 fn RTCALARM();
59 fn USB_FS_WKUP();
60 fn TIM8_BRK_TIM12();
61 fn TIM8_UP_TIM13();
62 fn TIM8_TRG_COM_TIM14();
63 fn TIM8_CC();
64 fn ADC3();
65 fn FSMC();
66 fn SDIO();
67 fn TIM5();
68 fn SPI3();
69 fn UART4();
70 fn UART5();
71 fn TIM6();
72 fn TIM7();
73 fn DMA2_CHANNEL1();
74 fn DMA2_CHANNEL2();
75 fn DMA2_CHANNEL3();
76 fn DMA2_CHANNEL4_5();
77}
78#[doc(hidden)]
79pub union Vector {
80 _handler: unsafe extern "C" fn(),
81 _reserved: u32,
82}
83#[cfg(feature = "rt")]
84#[doc(hidden)]
85#[link_section = ".vector_table.interrupts"]
86#[no_mangle]
87pub static __INTERRUPTS: [Vector; 60] = [
88 Vector { _handler: WWDG },
89 Vector { _handler: PVD },
90 Vector { _handler: TAMPER },
91 Vector { _handler: RTC },
92 Vector { _handler: FLASH },
93 Vector { _handler: RCC },
94 Vector { _handler: EXTI0 },
95 Vector { _handler: EXTI1 },
96 Vector { _handler: EXTI2 },
97 Vector { _handler: EXTI3 },
98 Vector { _handler: EXTI4 },
99 Vector {
100 _handler: DMA1_CHANNEL1,
101 },
102 Vector {
103 _handler: DMA1_CHANNEL2,
104 },
105 Vector {
106 _handler: DMA1_CHANNEL3,
107 },
108 Vector {
109 _handler: DMA1_CHANNEL4,
110 },
111 Vector {
112 _handler: DMA1_CHANNEL5,
113 },
114 Vector {
115 _handler: DMA1_CHANNEL6,
116 },
117 Vector {
118 _handler: DMA1_CHANNEL7,
119 },
120 Vector { _handler: ADC },
121 Vector { _handler: CAN1_TX },
122 Vector { _handler: CAN1_RX0 },
123 Vector { _handler: CAN1_RX1 },
124 Vector { _handler: CAN1_SCE },
125 Vector { _handler: EXTI9_5 },
126 Vector {
127 _handler: TIM1_BRK_TIM9,
128 },
129 Vector {
130 _handler: TIM1_UP_TIM10,
131 },
132 Vector {
133 _handler: TIM1_TRG_COM_TIM11,
134 },
135 Vector { _handler: TIM1_CC },
136 Vector { _handler: TIM2 },
137 Vector { _handler: TIM3 },
138 Vector { _handler: TIM4 },
139 Vector { _handler: I2C1_EV },
140 Vector { _handler: I2C1_ER },
141 Vector { _handler: I2C2_EV },
142 Vector { _handler: I2C2_ER },
143 Vector { _handler: SPI1 },
144 Vector { _handler: SPI2 },
145 Vector { _handler: USART1 },
146 Vector { _handler: USART2 },
147 Vector { _handler: USART3 },
148 Vector {
149 _handler: EXTI15_10,
150 },
151 Vector { _handler: RTCALARM },
152 Vector {
153 _handler: USB_FS_WKUP,
154 },
155 Vector {
156 _handler: TIM8_BRK_TIM12,
157 },
158 Vector {
159 _handler: TIM8_UP_TIM13,
160 },
161 Vector {
162 _handler: TIM8_TRG_COM_TIM14,
163 },
164 Vector { _handler: TIM8_CC },
165 Vector { _handler: ADC3 },
166 Vector { _handler: FSMC },
167 Vector { _handler: SDIO },
168 Vector { _handler: TIM5 },
169 Vector { _handler: SPI3 },
170 Vector { _handler: UART4 },
171 Vector { _handler: UART5 },
172 Vector { _handler: TIM6 },
173 Vector { _handler: TIM7 },
174 Vector {
175 _handler: DMA2_CHANNEL1,
176 },
177 Vector {
178 _handler: DMA2_CHANNEL2,
179 },
180 Vector {
181 _handler: DMA2_CHANNEL3,
182 },
183 Vector {
184 _handler: DMA2_CHANNEL4_5,
185 },
186];
187#[doc = r" Enumeration of all the interrupts"]
188pub enum Interrupt {
189 #[doc = "0 - Window Watchdog interrupt"]
190 WWDG,
191 #[doc = "1 - PVD through EXTI line detection interrupt"]
192 PVD,
193 #[doc = "2 - Tamper interrupt"]
194 TAMPER,
195 #[doc = "3 - RTC global interrupt"]
196 RTC,
197 #[doc = "4 - Flash global interrupt"]
198 FLASH,
199 #[doc = "5 - RCC global interrupt"]
200 RCC,
201 #[doc = "6 - EXTI Line0 interrupt"]
202 EXTI0,
203 #[doc = "7 - EXTI Line1 interrupt"]
204 EXTI1,
205 #[doc = "8 - EXTI Line2 interrupt"]
206 EXTI2,
207 #[doc = "9 - EXTI Line3 interrupt"]
208 EXTI3,
209 #[doc = "10 - EXTI Line4 interrupt"]
210 EXTI4,
211 #[doc = "11 - DMA1 Channel1 global interrupt"]
212 DMA1_CHANNEL1,
213 #[doc = "12 - DMA1 Channel2 global interrupt"]
214 DMA1_CHANNEL2,
215 #[doc = "13 - DMA1 Channel3 global interrupt"]
216 DMA1_CHANNEL3,
217 #[doc = "14 - DMA1 Channel4 global interrupt"]
218 DMA1_CHANNEL4,
219 #[doc = "15 - DMA1 Channel5 global interrupt"]
220 DMA1_CHANNEL5,
221 #[doc = "16 - DMA1 Channel6 global interrupt"]
222 DMA1_CHANNEL6,
223 #[doc = "17 - DMA1 Channel7 global interrupt"]
224 DMA1_CHANNEL7,
225 #[doc = "18 - ADC2 global interrupt"]
226 ADC,
227 #[doc = "19 - CAN1 TX interrupts"]
228 CAN1_TX,
229 #[doc = "20 - CAN1 RX0 interrupts"]
230 CAN1_RX0,
231 #[doc = "21 - CAN1 RX1 interrupt"]
232 CAN1_RX1,
233 #[doc = "22 - CAN1 SCE interrupt"]
234 CAN1_SCE,
235 #[doc = "23 - EXTI Line\\[9:5\\] interrupts"]
236 EXTI9_5,
237 #[doc = "24 - TIM1 Break interrupt and TIM9 global interrupt"]
238 TIM1_BRK_TIM9,
239 #[doc = "25 - TIM1 Update interrupt and TIM10 global interrupt"]
240 TIM1_UP_TIM10,
241 #[doc = "26 - TIM1 Trigger and Commutation interrupts and TIM11 global interrupt"]
242 TIM1_TRG_COM_TIM11,
243 #[doc = "27 - TIM1 Capture Compare interrupt"]
244 TIM1_CC,
245 #[doc = "28 - TIM2 global interrupt"]
246 TIM2,
247 #[doc = "29 - TIM3 global interrupt"]
248 TIM3,
249 #[doc = "30 - TIM4 global interrupt"]
250 TIM4,
251 #[doc = "31 - I2C1 event interrupt"]
252 I2C1_EV,
253 #[doc = "32 - I2C1 error interrupt"]
254 I2C1_ER,
255 #[doc = "33 - I2C2 event interrupt"]
256 I2C2_EV,
257 #[doc = "34 - I2C2 error interrupt"]
258 I2C2_ER,
259 #[doc = "35 - SPI1 global interrupt"]
260 SPI1,
261 #[doc = "36 - SPI2 global interrupt"]
262 SPI2,
263 #[doc = "37 - USART1 global interrupt"]
264 USART1,
265 #[doc = "38 - USART2 global interrupt"]
266 USART2,
267 #[doc = "39 - USART3 global interrupt"]
268 USART3,
269 #[doc = "40 - EXTI Line\\[15:10\\] interrupts"]
270 EXTI15_10,
271 #[doc = "41 - RTC Alarms through EXTI line interrupt"]
272 RTCALARM,
273 #[doc = "42 - USB Device FS Wakeup through EXTI line interrupt"]
274 USB_FS_WKUP,
275 #[doc = "43 - TIM8 Break interrupt and TIM12 global interrupt"]
276 TIM8_BRK_TIM12,
277 #[doc = "44 - TIM8 Update interrupt and TIM13 global interrupt"]
278 TIM8_UP_TIM13,
279 #[doc = "45 - TIM8 Trigger and Commutation interrupts and TIM14 global interrupt"]
280 TIM8_TRG_COM_TIM14,
281 #[doc = "46 - TIM8 Capture Compare interrupt"]
282 TIM8_CC,
283 #[doc = "47 - ADC3 global interrupt"]
284 ADC3,
285 #[doc = "48 - FSMC global interrupt"]
286 FSMC,
287 #[doc = "49 - SDIO global interrupt"]
288 SDIO,
289 #[doc = "50 - TIM5 global interrupt"]
290 TIM5,
291 #[doc = "51 - SPI3 global interrupt"]
292 SPI3,
293 #[doc = "52 - UART4 global interrupt"]
294 UART4,
295 #[doc = "53 - UART5 global interrupt"]
296 UART5,
297 #[doc = "54 - TIM6 global interrupt"]
298 TIM6,
299 #[doc = "55 - TIM7 global interrupt"]
300 TIM7,
301 #[doc = "56 - DMA2 Channel1 global interrupt"]
302 DMA2_CHANNEL1,
303 #[doc = "57 - DMA2 Channel2 global interrupt"]
304 DMA2_CHANNEL2,
305 #[doc = "58 - DMA2 Channel3 global interrupt"]
306 DMA2_CHANNEL3,
307 #[doc = "59 - DMA2 Channel4 and DMA2 Channel5 global interrupt"]
308 DMA2_CHANNEL4_5,
309}
310unsafe impl ::bare_metal::Nr for Interrupt {
311 #[inline]
312 fn nr(&self) -> u8 {
313 match *self {
314 Interrupt::WWDG => 0,
315 Interrupt::PVD => 1,
316 Interrupt::TAMPER => 2,
317 Interrupt::RTC => 3,
318 Interrupt::FLASH => 4,
319 Interrupt::RCC => 5,
320 Interrupt::EXTI0 => 6,
321 Interrupt::EXTI1 => 7,
322 Interrupt::EXTI2 => 8,
323 Interrupt::EXTI3 => 9,
324 Interrupt::EXTI4 => 10,
325 Interrupt::DMA1_CHANNEL1 => 11,
326 Interrupt::DMA1_CHANNEL2 => 12,
327 Interrupt::DMA1_CHANNEL3 => 13,
328 Interrupt::DMA1_CHANNEL4 => 14,
329 Interrupt::DMA1_CHANNEL5 => 15,
330 Interrupt::DMA1_CHANNEL6 => 16,
331 Interrupt::DMA1_CHANNEL7 => 17,
332 Interrupt::ADC => 18,
333 Interrupt::CAN1_TX => 19,
334 Interrupt::CAN1_RX0 => 20,
335 Interrupt::CAN1_RX1 => 21,
336 Interrupt::CAN1_SCE => 22,
337 Interrupt::EXTI9_5 => 23,
338 Interrupt::TIM1_BRK_TIM9 => 24,
339 Interrupt::TIM1_UP_TIM10 => 25,
340 Interrupt::TIM1_TRG_COM_TIM11 => 26,
341 Interrupt::TIM1_CC => 27,
342 Interrupt::TIM2 => 28,
343 Interrupt::TIM3 => 29,
344 Interrupt::TIM4 => 30,
345 Interrupt::I2C1_EV => 31,
346 Interrupt::I2C1_ER => 32,
347 Interrupt::I2C2_EV => 33,
348 Interrupt::I2C2_ER => 34,
349 Interrupt::SPI1 => 35,
350 Interrupt::SPI2 => 36,
351 Interrupt::USART1 => 37,
352 Interrupt::USART2 => 38,
353 Interrupt::USART3 => 39,
354 Interrupt::EXTI15_10 => 40,
355 Interrupt::RTCALARM => 41,
356 Interrupt::USB_FS_WKUP => 42,
357 Interrupt::TIM8_BRK_TIM12 => 43,
358 Interrupt::TIM8_UP_TIM13 => 44,
359 Interrupt::TIM8_TRG_COM_TIM14 => 45,
360 Interrupt::TIM8_CC => 46,
361 Interrupt::ADC3 => 47,
362 Interrupt::FSMC => 48,
363 Interrupt::SDIO => 49,
364 Interrupt::TIM5 => 50,
365 Interrupt::SPI3 => 51,
366 Interrupt::UART4 => 52,
367 Interrupt::UART5 => 53,
368 Interrupt::TIM6 => 54,
369 Interrupt::TIM7 => 55,
370 Interrupt::DMA2_CHANNEL1 => 56,
371 Interrupt::DMA2_CHANNEL2 => 57,
372 Interrupt::DMA2_CHANNEL3 => 58,
373 Interrupt::DMA2_CHANNEL4_5 => 59,
374 }
375 }
376}
377#[cfg(feature = "rt")]
378pub use self::Interrupt as interrupt;
379pub use cortex_m::peripheral::Peripherals as CorePeripherals;
380pub use cortex_m::peripheral::{CBP, CPUID, DCB, DWT, FPB, ITM, MPU, NVIC, SCB, SYST, TPIU};
381#[cfg(feature = "rt")]
382pub use cortex_m_rt::interrupt;
383#[doc = "Flexible static memory controller"]
384pub struct FSMC {
385 _marker: PhantomData<*const ()>,
386}
387unsafe impl Send for FSMC {}
388impl FSMC {
389 #[doc = r" Returns a pointer to the register block"]
390 pub fn ptr() -> *const fsmc::RegisterBlock {
391 2684354560 as *const _
392 }
393}
394impl Deref for FSMC {
395 type Target = fsmc::RegisterBlock;
396 fn deref(&self) -> &fsmc::RegisterBlock {
397 unsafe { &*FSMC::ptr() }
398 }
399}
400#[doc = "Flexible static memory controller"]
401pub mod fsmc;
402#[doc = "Power control"]
403pub struct PWR {
404 _marker: PhantomData<*const ()>,
405}
406unsafe impl Send for PWR {}
407impl PWR {
408 #[doc = r" Returns a pointer to the register block"]
409 pub fn ptr() -> *const pwr::RegisterBlock {
410 1073770496 as *const _
411 }
412}
413impl Deref for PWR {
414 type Target = pwr::RegisterBlock;
415 fn deref(&self) -> &pwr::RegisterBlock {
416 unsafe { &*PWR::ptr() }
417 }
418}
419#[doc = "Power control"]
420pub mod pwr;
421#[doc = "Reset and clock control"]
422pub struct RCC {
423 _marker: PhantomData<*const ()>,
424}
425unsafe impl Send for RCC {}
426impl RCC {
427 #[doc = r" Returns a pointer to the register block"]
428 pub fn ptr() -> *const rcc::RegisterBlock {
429 1073876992 as *const _
430 }
431}
432impl Deref for RCC {
433 type Target = rcc::RegisterBlock;
434 fn deref(&self) -> &rcc::RegisterBlock {
435 unsafe { &*RCC::ptr() }
436 }
437}
438#[doc = "Reset and clock control"]
439pub mod rcc;
440#[doc = "General purpose I/O"]
441pub struct GPIOA {
442 _marker: PhantomData<*const ()>,
443}
444unsafe impl Send for GPIOA {}
445impl GPIOA {
446 #[doc = r" Returns a pointer to the register block"]
447 pub fn ptr() -> *const gpioa::RegisterBlock {
448 1073809408 as *const _
449 }
450}
451impl Deref for GPIOA {
452 type Target = gpioa::RegisterBlock;
453 fn deref(&self) -> &gpioa::RegisterBlock {
454 unsafe { &*GPIOA::ptr() }
455 }
456}
457#[doc = "General purpose I/O"]
458pub mod gpioa;
459#[doc = "GPIOB"]
460pub struct GPIOB {
461 _marker: PhantomData<*const ()>,
462}
463unsafe impl Send for GPIOB {}
464impl GPIOB {
465 #[doc = r" Returns a pointer to the register block"]
466 pub fn ptr() -> *const gpioa::RegisterBlock {
467 1073810432 as *const _
468 }
469}
470impl Deref for GPIOB {
471 type Target = gpioa::RegisterBlock;
472 fn deref(&self) -> &gpioa::RegisterBlock {
473 unsafe { &*GPIOB::ptr() }
474 }
475}
476#[doc = "GPIOC"]
477pub struct GPIOC {
478 _marker: PhantomData<*const ()>,
479}
480unsafe impl Send for GPIOC {}
481impl GPIOC {
482 #[doc = r" Returns a pointer to the register block"]
483 pub fn ptr() -> *const gpioa::RegisterBlock {
484 1073811456 as *const _
485 }
486}
487impl Deref for GPIOC {
488 type Target = gpioa::RegisterBlock;
489 fn deref(&self) -> &gpioa::RegisterBlock {
490 unsafe { &*GPIOC::ptr() }
491 }
492}
493#[doc = "GPIOD"]
494pub struct GPIOD {
495 _marker: PhantomData<*const ()>,
496}
497unsafe impl Send for GPIOD {}
498impl GPIOD {
499 #[doc = r" Returns a pointer to the register block"]
500 pub fn ptr() -> *const gpioa::RegisterBlock {
501 1073812480 as *const _
502 }
503}
504impl Deref for GPIOD {
505 type Target = gpioa::RegisterBlock;
506 fn deref(&self) -> &gpioa::RegisterBlock {
507 unsafe { &*GPIOD::ptr() }
508 }
509}
510#[doc = "GPIOE"]
511pub struct GPIOE {
512 _marker: PhantomData<*const ()>,
513}
514unsafe impl Send for GPIOE {}
515impl GPIOE {
516 #[doc = r" Returns a pointer to the register block"]
517 pub fn ptr() -> *const gpioa::RegisterBlock {
518 1073813504 as *const _
519 }
520}
521impl Deref for GPIOE {
522 type Target = gpioa::RegisterBlock;
523 fn deref(&self) -> &gpioa::RegisterBlock {
524 unsafe { &*GPIOE::ptr() }
525 }
526}
527#[doc = "GPIOF"]
528pub struct GPIOF {
529 _marker: PhantomData<*const ()>,
530}
531unsafe impl Send for GPIOF {}
532impl GPIOF {
533 #[doc = r" Returns a pointer to the register block"]
534 pub fn ptr() -> *const gpioa::RegisterBlock {
535 1073814528 as *const _
536 }
537}
538impl Deref for GPIOF {
539 type Target = gpioa::RegisterBlock;
540 fn deref(&self) -> &gpioa::RegisterBlock {
541 unsafe { &*GPIOF::ptr() }
542 }
543}
544#[doc = "GPIOG"]
545pub struct GPIOG {
546 _marker: PhantomData<*const ()>,
547}
548unsafe impl Send for GPIOG {}
549impl GPIOG {
550 #[doc = r" Returns a pointer to the register block"]
551 pub fn ptr() -> *const gpioa::RegisterBlock {
552 1073815552 as *const _
553 }
554}
555impl Deref for GPIOG {
556 type Target = gpioa::RegisterBlock;
557 fn deref(&self) -> &gpioa::RegisterBlock {
558 unsafe { &*GPIOG::ptr() }
559 }
560}
561#[doc = "Alternate function I/O"]
562pub struct AFIO {
563 _marker: PhantomData<*const ()>,
564}
565unsafe impl Send for AFIO {}
566impl AFIO {
567 #[doc = r" Returns a pointer to the register block"]
568 pub fn ptr() -> *const afio::RegisterBlock {
569 1073807360 as *const _
570 }
571}
572impl Deref for AFIO {
573 type Target = afio::RegisterBlock;
574 fn deref(&self) -> &afio::RegisterBlock {
575 unsafe { &*AFIO::ptr() }
576 }
577}
578#[doc = "Alternate function I/O"]
579pub mod afio;
580#[doc = "EXTI"]
581pub struct EXTI {
582 _marker: PhantomData<*const ()>,
583}
584unsafe impl Send for EXTI {}
585impl EXTI {
586 #[doc = r" Returns a pointer to the register block"]
587 pub fn ptr() -> *const exti::RegisterBlock {
588 1073808384 as *const _
589 }
590}
591impl Deref for EXTI {
592 type Target = exti::RegisterBlock;
593 fn deref(&self) -> &exti::RegisterBlock {
594 unsafe { &*EXTI::ptr() }
595 }
596}
597#[doc = "EXTI"]
598pub mod exti;
599#[doc = "DMA controller"]
600pub struct DMA1 {
601 _marker: PhantomData<*const ()>,
602}
603unsafe impl Send for DMA1 {}
604impl DMA1 {
605 #[doc = r" Returns a pointer to the register block"]
606 pub fn ptr() -> *const dma1::RegisterBlock {
607 1073872896 as *const _
608 }
609}
610impl Deref for DMA1 {
611 type Target = dma1::RegisterBlock;
612 fn deref(&self) -> &dma1::RegisterBlock {
613 unsafe { &*DMA1::ptr() }
614 }
615}
616#[doc = "DMA controller"]
617pub mod dma1;
618#[doc = "DMA2"]
619pub struct DMA2 {
620 _marker: PhantomData<*const ()>,
621}
622unsafe impl Send for DMA2 {}
623impl DMA2 {
624 #[doc = r" Returns a pointer to the register block"]
625 pub fn ptr() -> *const dma1::RegisterBlock {
626 1073873920 as *const _
627 }
628}
629impl Deref for DMA2 {
630 type Target = dma1::RegisterBlock;
631 fn deref(&self) -> &dma1::RegisterBlock {
632 unsafe { &*DMA2::ptr() }
633 }
634}
635#[doc = "Secure digital input/output interface"]
636pub struct SDIO {
637 _marker: PhantomData<*const ()>,
638}
639unsafe impl Send for SDIO {}
640impl SDIO {
641 #[doc = r" Returns a pointer to the register block"]
642 pub fn ptr() -> *const sdio::RegisterBlock {
643 1073840128 as *const _
644 }
645}
646impl Deref for SDIO {
647 type Target = sdio::RegisterBlock;
648 fn deref(&self) -> &sdio::RegisterBlock {
649 unsafe { &*SDIO::ptr() }
650 }
651}
652#[doc = "Secure digital input/output interface"]
653pub mod sdio;
654#[doc = "Real time clock"]
655pub struct RTC {
656 _marker: PhantomData<*const ()>,
657}
658unsafe impl Send for RTC {}
659impl RTC {
660 #[doc = r" Returns a pointer to the register block"]
661 pub fn ptr() -> *const rtc::RegisterBlock {
662 1073752064 as *const _
663 }
664}
665impl Deref for RTC {
666 type Target = rtc::RegisterBlock;
667 fn deref(&self) -> &rtc::RegisterBlock {
668 unsafe { &*RTC::ptr() }
669 }
670}
671#[doc = "Real time clock"]
672pub mod rtc;
673#[doc = "Backup registers"]
674pub struct BKP {
675 _marker: PhantomData<*const ()>,
676}
677unsafe impl Send for BKP {}
678impl BKP {
679 #[doc = r" Returns a pointer to the register block"]
680 pub fn ptr() -> *const bkp::RegisterBlock {
681 1073769476 as *const _
682 }
683}
684impl Deref for BKP {
685 type Target = bkp::RegisterBlock;
686 fn deref(&self) -> &bkp::RegisterBlock {
687 unsafe { &*BKP::ptr() }
688 }
689}
690#[doc = "Backup registers"]
691pub mod bkp;
692#[doc = "Independent watchdog"]
693pub struct IWDG {
694 _marker: PhantomData<*const ()>,
695}
696unsafe impl Send for IWDG {}
697impl IWDG {
698 #[doc = r" Returns a pointer to the register block"]
699 pub fn ptr() -> *const iwdg::RegisterBlock {
700 1073754112 as *const _
701 }
702}
703impl Deref for IWDG {
704 type Target = iwdg::RegisterBlock;
705 fn deref(&self) -> &iwdg::RegisterBlock {
706 unsafe { &*IWDG::ptr() }
707 }
708}
709#[doc = "Independent watchdog"]
710pub mod iwdg;
711#[doc = "Window watchdog"]
712pub struct WWDG {
713 _marker: PhantomData<*const ()>,
714}
715unsafe impl Send for WWDG {}
716impl WWDG {
717 #[doc = r" Returns a pointer to the register block"]
718 pub fn ptr() -> *const wwdg::RegisterBlock {
719 1073753088 as *const _
720 }
721}
722impl Deref for WWDG {
723 type Target = wwdg::RegisterBlock;
724 fn deref(&self) -> &wwdg::RegisterBlock {
725 unsafe { &*WWDG::ptr() }
726 }
727}
728#[doc = "Window watchdog"]
729pub mod wwdg;
730#[doc = "Advanced timer"]
731pub struct TIM1 {
732 _marker: PhantomData<*const ()>,
733}
734unsafe impl Send for TIM1 {}
735impl TIM1 {
736 #[doc = r" Returns a pointer to the register block"]
737 pub fn ptr() -> *const tim1::RegisterBlock {
738 1073818624 as *const _
739 }
740}
741impl Deref for TIM1 {
742 type Target = tim1::RegisterBlock;
743 fn deref(&self) -> &tim1::RegisterBlock {
744 unsafe { &*TIM1::ptr() }
745 }
746}
747#[doc = "Advanced timer"]
748pub mod tim1;
749#[doc = "TIM8"]
750pub struct TIM8 {
751 _marker: PhantomData<*const ()>,
752}
753unsafe impl Send for TIM8 {}
754impl TIM8 {
755 #[doc = r" Returns a pointer to the register block"]
756 pub fn ptr() -> *const tim1::RegisterBlock {
757 1073820672 as *const _
758 }
759}
760impl Deref for TIM8 {
761 type Target = tim1::RegisterBlock;
762 fn deref(&self) -> &tim1::RegisterBlock {
763 unsafe { &*TIM8::ptr() }
764 }
765}
766#[doc = "General purpose timer"]
767pub struct TIM2 {
768 _marker: PhantomData<*const ()>,
769}
770unsafe impl Send for TIM2 {}
771impl TIM2 {
772 #[doc = r" Returns a pointer to the register block"]
773 pub fn ptr() -> *const tim2::RegisterBlock {
774 1073741824 as *const _
775 }
776}
777impl Deref for TIM2 {
778 type Target = tim2::RegisterBlock;
779 fn deref(&self) -> &tim2::RegisterBlock {
780 unsafe { &*TIM2::ptr() }
781 }
782}
783#[doc = "General purpose timer"]
784pub mod tim2;
785#[doc = "TIM3"]
786pub struct TIM3 {
787 _marker: PhantomData<*const ()>,
788}
789unsafe impl Send for TIM3 {}
790impl TIM3 {
791 #[doc = r" Returns a pointer to the register block"]
792 pub fn ptr() -> *const tim2::RegisterBlock {
793 1073742848 as *const _
794 }
795}
796impl Deref for TIM3 {
797 type Target = tim2::RegisterBlock;
798 fn deref(&self) -> &tim2::RegisterBlock {
799 unsafe { &*TIM3::ptr() }
800 }
801}
802#[doc = "TIM4"]
803pub struct TIM4 {
804 _marker: PhantomData<*const ()>,
805}
806unsafe impl Send for TIM4 {}
807impl TIM4 {
808 #[doc = r" Returns a pointer to the register block"]
809 pub fn ptr() -> *const tim2::RegisterBlock {
810 1073743872 as *const _
811 }
812}
813impl Deref for TIM4 {
814 type Target = tim2::RegisterBlock;
815 fn deref(&self) -> &tim2::RegisterBlock {
816 unsafe { &*TIM4::ptr() }
817 }
818}
819#[doc = "TIM5"]
820pub struct TIM5 {
821 _marker: PhantomData<*const ()>,
822}
823unsafe impl Send for TIM5 {}
824impl TIM5 {
825 #[doc = r" Returns a pointer to the register block"]
826 pub fn ptr() -> *const tim2::RegisterBlock {
827 1073744896 as *const _
828 }
829}
830impl Deref for TIM5 {
831 type Target = tim2::RegisterBlock;
832 fn deref(&self) -> &tim2::RegisterBlock {
833 unsafe { &*TIM5::ptr() }
834 }
835}
836#[doc = "General purpose timer"]
837pub struct TIM9 {
838 _marker: PhantomData<*const ()>,
839}
840unsafe impl Send for TIM9 {}
841impl TIM9 {
842 #[doc = r" Returns a pointer to the register block"]
843 pub fn ptr() -> *const tim9::RegisterBlock {
844 1073826816 as *const _
845 }
846}
847impl Deref for TIM9 {
848 type Target = tim9::RegisterBlock;
849 fn deref(&self) -> &tim9::RegisterBlock {
850 unsafe { &*TIM9::ptr() }
851 }
852}
853#[doc = "General purpose timer"]
854pub mod tim9;
855#[doc = "TIM12"]
856pub struct TIM12 {
857 _marker: PhantomData<*const ()>,
858}
859unsafe impl Send for TIM12 {}
860impl TIM12 {
861 #[doc = r" Returns a pointer to the register block"]
862 pub fn ptr() -> *const tim9::RegisterBlock {
863 1073747968 as *const _
864 }
865}
866impl Deref for TIM12 {
867 type Target = tim9::RegisterBlock;
868 fn deref(&self) -> &tim9::RegisterBlock {
869 unsafe { &*TIM12::ptr() }
870 }
871}
872#[doc = "General purpose timer"]
873pub struct TIM10 {
874 _marker: PhantomData<*const ()>,
875}
876unsafe impl Send for TIM10 {}
877impl TIM10 {
878 #[doc = r" Returns a pointer to the register block"]
879 pub fn ptr() -> *const tim10::RegisterBlock {
880 1073827840 as *const _
881 }
882}
883impl Deref for TIM10 {
884 type Target = tim10::RegisterBlock;
885 fn deref(&self) -> &tim10::RegisterBlock {
886 unsafe { &*TIM10::ptr() }
887 }
888}
889#[doc = "General purpose timer"]
890pub mod tim10;
891#[doc = "TIM11"]
892pub struct TIM11 {
893 _marker: PhantomData<*const ()>,
894}
895unsafe impl Send for TIM11 {}
896impl TIM11 {
897 #[doc = r" Returns a pointer to the register block"]
898 pub fn ptr() -> *const tim10::RegisterBlock {
899 1073828864 as *const _
900 }
901}
902impl Deref for TIM11 {
903 type Target = tim10::RegisterBlock;
904 fn deref(&self) -> &tim10::RegisterBlock {
905 unsafe { &*TIM11::ptr() }
906 }
907}
908#[doc = "TIM13"]
909pub struct TIM13 {
910 _marker: PhantomData<*const ()>,
911}
912unsafe impl Send for TIM13 {}
913impl TIM13 {
914 #[doc = r" Returns a pointer to the register block"]
915 pub fn ptr() -> *const tim10::RegisterBlock {
916 1073748992 as *const _
917 }
918}
919impl Deref for TIM13 {
920 type Target = tim10::RegisterBlock;
921 fn deref(&self) -> &tim10::RegisterBlock {
922 unsafe { &*TIM13::ptr() }
923 }
924}
925#[doc = "TIM14"]
926pub struct TIM14 {
927 _marker: PhantomData<*const ()>,
928}
929unsafe impl Send for TIM14 {}
930impl TIM14 {
931 #[doc = r" Returns a pointer to the register block"]
932 pub fn ptr() -> *const tim10::RegisterBlock {
933 1073750016 as *const _
934 }
935}
936impl Deref for TIM14 {
937 type Target = tim10::RegisterBlock;
938 fn deref(&self) -> &tim10::RegisterBlock {
939 unsafe { &*TIM14::ptr() }
940 }
941}
942#[doc = "Basic timer"]
943pub struct TIM6 {
944 _marker: PhantomData<*const ()>,
945}
946unsafe impl Send for TIM6 {}
947impl TIM6 {
948 #[doc = r" Returns a pointer to the register block"]
949 pub fn ptr() -> *const tim6::RegisterBlock {
950 1073745920 as *const _
951 }
952}
953impl Deref for TIM6 {
954 type Target = tim6::RegisterBlock;
955 fn deref(&self) -> &tim6::RegisterBlock {
956 unsafe { &*TIM6::ptr() }
957 }
958}
959#[doc = "Basic timer"]
960pub mod tim6;
961#[doc = "TIM7"]
962pub struct TIM7 {
963 _marker: PhantomData<*const ()>,
964}
965unsafe impl Send for TIM7 {}
966impl TIM7 {
967 #[doc = r" Returns a pointer to the register block"]
968 pub fn ptr() -> *const tim6::RegisterBlock {
969 1073746944 as *const _
970 }
971}
972impl Deref for TIM7 {
973 type Target = tim6::RegisterBlock;
974 fn deref(&self) -> &tim6::RegisterBlock {
975 unsafe { &*TIM7::ptr() }
976 }
977}
978#[doc = "Inter integrated circuit"]
979pub struct I2C1 {
980 _marker: PhantomData<*const ()>,
981}
982unsafe impl Send for I2C1 {}
983impl I2C1 {
984 #[doc = r" Returns a pointer to the register block"]
985 pub fn ptr() -> *const i2c1::RegisterBlock {
986 1073763328 as *const _
987 }
988}
989impl Deref for I2C1 {
990 type Target = i2c1::RegisterBlock;
991 fn deref(&self) -> &i2c1::RegisterBlock {
992 unsafe { &*I2C1::ptr() }
993 }
994}
995#[doc = "Inter integrated circuit"]
996pub mod i2c1;
997#[doc = "I2C2"]
998pub struct I2C2 {
999 _marker: PhantomData<*const ()>,
1000}
1001unsafe impl Send for I2C2 {}
1002impl I2C2 {
1003 #[doc = r" Returns a pointer to the register block"]
1004 pub fn ptr() -> *const i2c1::RegisterBlock {
1005 1073764352 as *const _
1006 }
1007}
1008impl Deref for I2C2 {
1009 type Target = i2c1::RegisterBlock;
1010 fn deref(&self) -> &i2c1::RegisterBlock {
1011 unsafe { &*I2C2::ptr() }
1012 }
1013}
1014#[doc = "Serial peripheral interface"]
1015pub struct SPI1 {
1016 _marker: PhantomData<*const ()>,
1017}
1018unsafe impl Send for SPI1 {}
1019impl SPI1 {
1020 #[doc = r" Returns a pointer to the register block"]
1021 pub fn ptr() -> *const spi1::RegisterBlock {
1022 1073819648 as *const _
1023 }
1024}
1025impl Deref for SPI1 {
1026 type Target = spi1::RegisterBlock;
1027 fn deref(&self) -> &spi1::RegisterBlock {
1028 unsafe { &*SPI1::ptr() }
1029 }
1030}
1031#[doc = "Serial peripheral interface"]
1032pub mod spi1;
1033#[doc = "SPI2"]
1034pub struct SPI2 {
1035 _marker: PhantomData<*const ()>,
1036}
1037unsafe impl Send for SPI2 {}
1038impl SPI2 {
1039 #[doc = r" Returns a pointer to the register block"]
1040 pub fn ptr() -> *const spi1::RegisterBlock {
1041 1073756160 as *const _
1042 }
1043}
1044impl Deref for SPI2 {
1045 type Target = spi1::RegisterBlock;
1046 fn deref(&self) -> &spi1::RegisterBlock {
1047 unsafe { &*SPI2::ptr() }
1048 }
1049}
1050#[doc = "SPI3"]
1051pub struct SPI3 {
1052 _marker: PhantomData<*const ()>,
1053}
1054unsafe impl Send for SPI3 {}
1055impl SPI3 {
1056 #[doc = r" Returns a pointer to the register block"]
1057 pub fn ptr() -> *const spi1::RegisterBlock {
1058 1073757184 as *const _
1059 }
1060}
1061impl Deref for SPI3 {
1062 type Target = spi1::RegisterBlock;
1063 fn deref(&self) -> &spi1::RegisterBlock {
1064 unsafe { &*SPI3::ptr() }
1065 }
1066}
1067#[doc = "Universal synchronous asynchronous receiver transmitter"]
1068pub struct USART1 {
1069 _marker: PhantomData<*const ()>,
1070}
1071unsafe impl Send for USART1 {}
1072impl USART1 {
1073 #[doc = r" Returns a pointer to the register block"]
1074 pub fn ptr() -> *const usart1::RegisterBlock {
1075 1073821696 as *const _
1076 }
1077}
1078impl Deref for USART1 {
1079 type Target = usart1::RegisterBlock;
1080 fn deref(&self) -> &usart1::RegisterBlock {
1081 unsafe { &*USART1::ptr() }
1082 }
1083}
1084#[doc = "Universal synchronous asynchronous receiver transmitter"]
1085pub mod usart1;
1086#[doc = "USART2"]
1087pub struct USART2 {
1088 _marker: PhantomData<*const ()>,
1089}
1090unsafe impl Send for USART2 {}
1091impl USART2 {
1092 #[doc = r" Returns a pointer to the register block"]
1093 pub fn ptr() -> *const usart1::RegisterBlock {
1094 1073759232 as *const _
1095 }
1096}
1097impl Deref for USART2 {
1098 type Target = usart1::RegisterBlock;
1099 fn deref(&self) -> &usart1::RegisterBlock {
1100 unsafe { &*USART2::ptr() }
1101 }
1102}
1103#[doc = "USART3"]
1104pub struct USART3 {
1105 _marker: PhantomData<*const ()>,
1106}
1107unsafe impl Send for USART3 {}
1108impl USART3 {
1109 #[doc = r" Returns a pointer to the register block"]
1110 pub fn ptr() -> *const usart1::RegisterBlock {
1111 1073760256 as *const _
1112 }
1113}
1114impl Deref for USART3 {
1115 type Target = usart1::RegisterBlock;
1116 fn deref(&self) -> &usart1::RegisterBlock {
1117 unsafe { &*USART3::ptr() }
1118 }
1119}
1120#[doc = "Analog to digital converter"]
1121pub struct ADC1 {
1122 _marker: PhantomData<*const ()>,
1123}
1124unsafe impl Send for ADC1 {}
1125impl ADC1 {
1126 #[doc = r" Returns a pointer to the register block"]
1127 pub fn ptr() -> *const adc1::RegisterBlock {
1128 1073816576 as *const _
1129 }
1130}
1131impl Deref for ADC1 {
1132 type Target = adc1::RegisterBlock;
1133 fn deref(&self) -> &adc1::RegisterBlock {
1134 unsafe { &*ADC1::ptr() }
1135 }
1136}
1137#[doc = "Analog to digital converter"]
1138pub mod adc1;
1139#[doc = "Analog to digital converter"]
1140pub struct ADC2 {
1141 _marker: PhantomData<*const ()>,
1142}
1143unsafe impl Send for ADC2 {}
1144impl ADC2 {
1145 #[doc = r" Returns a pointer to the register block"]
1146 pub fn ptr() -> *const adc2::RegisterBlock {
1147 1073817600 as *const _
1148 }
1149}
1150impl Deref for ADC2 {
1151 type Target = adc2::RegisterBlock;
1152 fn deref(&self) -> &adc2::RegisterBlock {
1153 unsafe { &*ADC2::ptr() }
1154 }
1155}
1156#[doc = "Analog to digital converter"]
1157pub mod adc2;
1158#[doc = "ADC3"]
1159pub struct ADC3 {
1160 _marker: PhantomData<*const ()>,
1161}
1162unsafe impl Send for ADC3 {}
1163impl ADC3 {
1164 #[doc = r" Returns a pointer to the register block"]
1165 pub fn ptr() -> *const adc2::RegisterBlock {
1166 1073822720 as *const _
1167 }
1168}
1169impl Deref for ADC3 {
1170 type Target = adc2::RegisterBlock;
1171 fn deref(&self) -> &adc2::RegisterBlock {
1172 unsafe { &*ADC3::ptr() }
1173 }
1174}
1175#[doc = "Controller area network"]
1176pub struct CAN {
1177 _marker: PhantomData<*const ()>,
1178}
1179unsafe impl Send for CAN {}
1180impl CAN {
1181 #[doc = r" Returns a pointer to the register block"]
1182 pub fn ptr() -> *const can::RegisterBlock {
1183 1073767424 as *const _
1184 }
1185}
1186impl Deref for CAN {
1187 type Target = can::RegisterBlock;
1188 fn deref(&self) -> &can::RegisterBlock {
1189 unsafe { &*CAN::ptr() }
1190 }
1191}
1192#[doc = "Controller area network"]
1193pub mod can;
1194#[doc = "Digital to analog converter"]
1195pub struct DAC {
1196 _marker: PhantomData<*const ()>,
1197}
1198unsafe impl Send for DAC {}
1199impl DAC {
1200 #[doc = r" Returns a pointer to the register block"]
1201 pub fn ptr() -> *const dac::RegisterBlock {
1202 1073771520 as *const _
1203 }
1204}
1205impl Deref for DAC {
1206 type Target = dac::RegisterBlock;
1207 fn deref(&self) -> &dac::RegisterBlock {
1208 unsafe { &*DAC::ptr() }
1209 }
1210}
1211#[doc = "Digital to analog converter"]
1212pub mod dac;
1213#[doc = "Debug support"]
1214pub struct DBG {
1215 _marker: PhantomData<*const ()>,
1216}
1217unsafe impl Send for DBG {}
1218impl DBG {
1219 #[doc = r" Returns a pointer to the register block"]
1220 pub fn ptr() -> *const dbg::RegisterBlock {
1221 3758366720 as *const _
1222 }
1223}
1224impl Deref for DBG {
1225 type Target = dbg::RegisterBlock;
1226 fn deref(&self) -> &dbg::RegisterBlock {
1227 unsafe { &*DBG::ptr() }
1228 }
1229}
1230#[doc = "Debug support"]
1231pub mod dbg;
1232#[doc = "Universal asynchronous receiver transmitter"]
1233pub struct UART4 {
1234 _marker: PhantomData<*const ()>,
1235}
1236unsafe impl Send for UART4 {}
1237impl UART4 {
1238 #[doc = r" Returns a pointer to the register block"]
1239 pub fn ptr() -> *const uart4::RegisterBlock {
1240 1073761280 as *const _
1241 }
1242}
1243impl Deref for UART4 {
1244 type Target = uart4::RegisterBlock;
1245 fn deref(&self) -> &uart4::RegisterBlock {
1246 unsafe { &*UART4::ptr() }
1247 }
1248}
1249#[doc = "Universal asynchronous receiver transmitter"]
1250pub mod uart4;
1251#[doc = "Universal asynchronous receiver transmitter"]
1252pub struct UART5 {
1253 _marker: PhantomData<*const ()>,
1254}
1255unsafe impl Send for UART5 {}
1256impl UART5 {
1257 #[doc = r" Returns a pointer to the register block"]
1258 pub fn ptr() -> *const uart5::RegisterBlock {
1259 1073762304 as *const _
1260 }
1261}
1262impl Deref for UART5 {
1263 type Target = uart5::RegisterBlock;
1264 fn deref(&self) -> &uart5::RegisterBlock {
1265 unsafe { &*UART5::ptr() }
1266 }
1267}
1268#[doc = "Universal asynchronous receiver transmitter"]
1269pub mod uart5;
1270#[doc = "CRC calculation unit"]
1271pub struct CRC {
1272 _marker: PhantomData<*const ()>,
1273}
1274unsafe impl Send for CRC {}
1275impl CRC {
1276 #[doc = r" Returns a pointer to the register block"]
1277 pub fn ptr() -> *const crc::RegisterBlock {
1278 1073885184 as *const _
1279 }
1280}
1281impl Deref for CRC {
1282 type Target = crc::RegisterBlock;
1283 fn deref(&self) -> &crc::RegisterBlock {
1284 unsafe { &*CRC::ptr() }
1285 }
1286}
1287#[doc = "CRC calculation unit"]
1288pub mod crc;
1289#[doc = "FLASH"]
1290pub struct FLASH {
1291 _marker: PhantomData<*const ()>,
1292}
1293unsafe impl Send for FLASH {}
1294impl FLASH {
1295 #[doc = r" Returns a pointer to the register block"]
1296 pub fn ptr() -> *const flash::RegisterBlock {
1297 1073881088 as *const _
1298 }
1299}
1300impl Deref for FLASH {
1301 type Target = flash::RegisterBlock;
1302 fn deref(&self) -> &flash::RegisterBlock {
1303 unsafe { &*FLASH::ptr() }
1304 }
1305}
1306#[doc = "FLASH"]
1307pub mod flash;
1308#[doc = "Universal serial bus full-speed device interface"]
1309pub struct USB {
1310 _marker: PhantomData<*const ()>,
1311}
1312unsafe impl Send for USB {}
1313impl USB {
1314 #[doc = r" Returns a pointer to the register block"]
1315 pub fn ptr() -> *const usb::RegisterBlock {
1316 1073765376 as *const _
1317 }
1318}
1319impl Deref for USB {
1320 type Target = usb::RegisterBlock;
1321 fn deref(&self) -> &usb::RegisterBlock {
1322 unsafe { &*USB::ptr() }
1323 }
1324}
1325#[doc = "Universal serial bus full-speed device interface"]
1326pub mod usb;
1327#[allow(renamed_and_removed_lints)]
1328#[allow(private_no_mangle_statics)]
1329#[no_mangle]
1330static mut DEVICE_PERIPHERALS: bool = false;
1331#[doc = r" All the peripherals"]
1332#[allow(non_snake_case)]
1333pub struct Peripherals {
1334 #[doc = "FSMC"]
1335 pub FSMC: FSMC,
1336 #[doc = "PWR"]
1337 pub PWR: PWR,
1338 #[doc = "RCC"]
1339 pub RCC: RCC,
1340 #[doc = "GPIOA"]
1341 pub GPIOA: GPIOA,
1342 #[doc = "GPIOB"]
1343 pub GPIOB: GPIOB,
1344 #[doc = "GPIOC"]
1345 pub GPIOC: GPIOC,
1346 #[doc = "GPIOD"]
1347 pub GPIOD: GPIOD,
1348 #[doc = "GPIOE"]
1349 pub GPIOE: GPIOE,
1350 #[doc = "GPIOF"]
1351 pub GPIOF: GPIOF,
1352 #[doc = "GPIOG"]
1353 pub GPIOG: GPIOG,
1354 #[doc = "AFIO"]
1355 pub AFIO: AFIO,
1356 #[doc = "EXTI"]
1357 pub EXTI: EXTI,
1358 #[doc = "DMA1"]
1359 pub DMA1: DMA1,
1360 #[doc = "DMA2"]
1361 pub DMA2: DMA2,
1362 #[doc = "SDIO"]
1363 pub SDIO: SDIO,
1364 #[doc = "RTC"]
1365 pub RTC: RTC,
1366 #[doc = "BKP"]
1367 pub BKP: BKP,
1368 #[doc = "IWDG"]
1369 pub IWDG: IWDG,
1370 #[doc = "WWDG"]
1371 pub WWDG: WWDG,
1372 #[doc = "TIM1"]
1373 pub TIM1: TIM1,
1374 #[doc = "TIM8"]
1375 pub TIM8: TIM8,
1376 #[doc = "TIM2"]
1377 pub TIM2: TIM2,
1378 #[doc = "TIM3"]
1379 pub TIM3: TIM3,
1380 #[doc = "TIM4"]
1381 pub TIM4: TIM4,
1382 #[doc = "TIM5"]
1383 pub TIM5: TIM5,
1384 #[doc = "TIM9"]
1385 pub TIM9: TIM9,
1386 #[doc = "TIM12"]
1387 pub TIM12: TIM12,
1388 #[doc = "TIM10"]
1389 pub TIM10: TIM10,
1390 #[doc = "TIM11"]
1391 pub TIM11: TIM11,
1392 #[doc = "TIM13"]
1393 pub TIM13: TIM13,
1394 #[doc = "TIM14"]
1395 pub TIM14: TIM14,
1396 #[doc = "TIM6"]
1397 pub TIM6: TIM6,
1398 #[doc = "TIM7"]
1399 pub TIM7: TIM7,
1400 #[doc = "I2C1"]
1401 pub I2C1: I2C1,
1402 #[doc = "I2C2"]
1403 pub I2C2: I2C2,
1404 #[doc = "SPI1"]
1405 pub SPI1: SPI1,
1406 #[doc = "SPI2"]
1407 pub SPI2: SPI2,
1408 #[doc = "SPI3"]
1409 pub SPI3: SPI3,
1410 #[doc = "USART1"]
1411 pub USART1: USART1,
1412 #[doc = "USART2"]
1413 pub USART2: USART2,
1414 #[doc = "USART3"]
1415 pub USART3: USART3,
1416 #[doc = "ADC1"]
1417 pub ADC1: ADC1,
1418 #[doc = "ADC2"]
1419 pub ADC2: ADC2,
1420 #[doc = "ADC3"]
1421 pub ADC3: ADC3,
1422 #[doc = "CAN"]
1423 pub CAN: CAN,
1424 #[doc = "DAC"]
1425 pub DAC: DAC,
1426 #[doc = "DBG"]
1427 pub DBG: DBG,
1428 #[doc = "UART4"]
1429 pub UART4: UART4,
1430 #[doc = "UART5"]
1431 pub UART5: UART5,
1432 #[doc = "CRC"]
1433 pub CRC: CRC,
1434 #[doc = "FLASH"]
1435 pub FLASH: FLASH,
1436 #[doc = "USB"]
1437 pub USB: USB,
1438}
1439impl Peripherals {
1440 #[doc = r" Returns all the peripherals *once*"]
1441 #[inline]
1442 pub fn take() -> Option<Self> {
1443 cortex_m::interrupt::free(|_| {
1444 if unsafe { DEVICE_PERIPHERALS } {
1445 None
1446 } else {
1447 Some(unsafe { Peripherals::steal() })
1448 }
1449 })
1450 }
1451 #[doc = r" Unchecked version of `Peripherals::take`"]
1452 pub unsafe fn steal() -> Self {
1453 debug_assert!(!DEVICE_PERIPHERALS);
1454 DEVICE_PERIPHERALS = true;
1455 Peripherals {
1456 FSMC: FSMC {
1457 _marker: PhantomData,
1458 },
1459 PWR: PWR {
1460 _marker: PhantomData,
1461 },
1462 RCC: RCC {
1463 _marker: PhantomData,
1464 },
1465 GPIOA: GPIOA {
1466 _marker: PhantomData,
1467 },
1468 GPIOB: GPIOB {
1469 _marker: PhantomData,
1470 },
1471 GPIOC: GPIOC {
1472 _marker: PhantomData,
1473 },
1474 GPIOD: GPIOD {
1475 _marker: PhantomData,
1476 },
1477 GPIOE: GPIOE {
1478 _marker: PhantomData,
1479 },
1480 GPIOF: GPIOF {
1481 _marker: PhantomData,
1482 },
1483 GPIOG: GPIOG {
1484 _marker: PhantomData,
1485 },
1486 AFIO: AFIO {
1487 _marker: PhantomData,
1488 },
1489 EXTI: EXTI {
1490 _marker: PhantomData,
1491 },
1492 DMA1: DMA1 {
1493 _marker: PhantomData,
1494 },
1495 DMA2: DMA2 {
1496 _marker: PhantomData,
1497 },
1498 SDIO: SDIO {
1499 _marker: PhantomData,
1500 },
1501 RTC: RTC {
1502 _marker: PhantomData,
1503 },
1504 BKP: BKP {
1505 _marker: PhantomData,
1506 },
1507 IWDG: IWDG {
1508 _marker: PhantomData,
1509 },
1510 WWDG: WWDG {
1511 _marker: PhantomData,
1512 },
1513 TIM1: TIM1 {
1514 _marker: PhantomData,
1515 },
1516 TIM8: TIM8 {
1517 _marker: PhantomData,
1518 },
1519 TIM2: TIM2 {
1520 _marker: PhantomData,
1521 },
1522 TIM3: TIM3 {
1523 _marker: PhantomData,
1524 },
1525 TIM4: TIM4 {
1526 _marker: PhantomData,
1527 },
1528 TIM5: TIM5 {
1529 _marker: PhantomData,
1530 },
1531 TIM9: TIM9 {
1532 _marker: PhantomData,
1533 },
1534 TIM12: TIM12 {
1535 _marker: PhantomData,
1536 },
1537 TIM10: TIM10 {
1538 _marker: PhantomData,
1539 },
1540 TIM11: TIM11 {
1541 _marker: PhantomData,
1542 },
1543 TIM13: TIM13 {
1544 _marker: PhantomData,
1545 },
1546 TIM14: TIM14 {
1547 _marker: PhantomData,
1548 },
1549 TIM6: TIM6 {
1550 _marker: PhantomData,
1551 },
1552 TIM7: TIM7 {
1553 _marker: PhantomData,
1554 },
1555 I2C1: I2C1 {
1556 _marker: PhantomData,
1557 },
1558 I2C2: I2C2 {
1559 _marker: PhantomData,
1560 },
1561 SPI1: SPI1 {
1562 _marker: PhantomData,
1563 },
1564 SPI2: SPI2 {
1565 _marker: PhantomData,
1566 },
1567 SPI3: SPI3 {
1568 _marker: PhantomData,
1569 },
1570 USART1: USART1 {
1571 _marker: PhantomData,
1572 },
1573 USART2: USART2 {
1574 _marker: PhantomData,
1575 },
1576 USART3: USART3 {
1577 _marker: PhantomData,
1578 },
1579 ADC1: ADC1 {
1580 _marker: PhantomData,
1581 },
1582 ADC2: ADC2 {
1583 _marker: PhantomData,
1584 },
1585 ADC3: ADC3 {
1586 _marker: PhantomData,
1587 },
1588 CAN: CAN {
1589 _marker: PhantomData,
1590 },
1591 DAC: DAC {
1592 _marker: PhantomData,
1593 },
1594 DBG: DBG {
1595 _marker: PhantomData,
1596 },
1597 UART4: UART4 {
1598 _marker: PhantomData,
1599 },
1600 UART5: UART5 {
1601 _marker: PhantomData,
1602 },
1603 CRC: CRC {
1604 _marker: PhantomData,
1605 },
1606 FLASH: FLASH {
1607 _marker: PhantomData,
1608 },
1609 USB: USB {
1610 _marker: PhantomData,
1611 },
1612 }
1613 }
1614}