1pub const NVIC_PRIO_BITS: u8 = 4;
12#[cfg(feature = "rt")]
13pub use self::Interrupt as interrupt;
14pub use cortex_m::peripheral::Peripherals as CorePeripherals;
15pub use cortex_m::peripheral::{
16 CBP, CPUID, DCB, DWT, FPB, ITM, MPU, NVIC, SCB, SYST, TPIU,
17};
18#[cfg(feature = "rt")]
19pub use cortex_m_rt::interrupt;
20#[cfg(feature = "rt")]
21extern "C" {
22 fn WWDG();
23 fn PVD();
24 fn TAMPER();
25 fn RTC();
26 fn FLASH();
27 fn RCC();
28 fn EXTI0();
29 fn EXTI1();
30 fn EXTI2();
31 fn EXTI3();
32 fn EXTI4();
33 fn DMA1_CHANNEL1();
34 fn DMA1_CHANNEL2();
35 fn DMA1_CHANNEL3();
36 fn DMA1_CHANNEL4();
37 fn DMA1_CHANNEL5();
38 fn DMA1_CHANNEL6();
39 fn DMA1_CHANNEL7();
40 fn ADC1_2();
41 fn USB_HP_CAN_TX();
42 fn USB_LP_CAN_RX0();
43 fn EXTI9_5();
44 fn TIM1_BRK();
45 fn TIM1_UP();
46 fn TIM1_TRG_COM();
47 fn TIM1_CC();
48 fn TIM2();
49 fn TIM3();
50 fn TIM4();
51 fn I2C1_EV();
52 fn I2C1_ER();
53 fn I2C2_EV();
54 fn I2C2_ER();
55 fn SPI1();
56 fn SPI2();
57 fn USART1();
58 fn USART2();
59 fn USART3();
60 fn EXTI15_10();
61 fn RTCALARM();
62 fn USBWAKEUP();
63 fn TIM8_BRK();
64 fn TIM8_UP();
65 fn TIM8_TRG_COM();
66 fn TIM8_CC();
67 fn ADC3();
68 fn FSMC();
69 fn SDIO();
70 fn TIM5();
71 fn SPI3();
72 fn UART4();
73 fn UART5();
74 fn TIM6();
75 fn TIM7();
76 fn DMA2_CHANNEL1();
77 fn DMA2_CHANNEL2();
78 fn DMA2_CHANNEL3();
79 fn DMA2_CHANNEL4_5();
80}
81#[doc(hidden)]
82#[repr(C)]
83pub union Vector {
84 _handler: unsafe extern "C" fn(),
85 _reserved: u32,
86}
87#[cfg(feature = "rt")]
88#[doc(hidden)]
89#[link_section = ".vector_table.interrupts"]
90#[no_mangle]
91pub static __INTERRUPTS: [Vector; 60] = [
92 Vector { _handler: WWDG },
93 Vector { _handler: PVD },
94 Vector { _handler: TAMPER },
95 Vector { _handler: RTC },
96 Vector { _handler: FLASH },
97 Vector { _handler: RCC },
98 Vector { _handler: EXTI0 },
99 Vector { _handler: EXTI1 },
100 Vector { _handler: EXTI2 },
101 Vector { _handler: EXTI3 },
102 Vector { _handler: EXTI4 },
103 Vector { _handler: DMA1_CHANNEL1 },
104 Vector { _handler: DMA1_CHANNEL2 },
105 Vector { _handler: DMA1_CHANNEL3 },
106 Vector { _handler: DMA1_CHANNEL4 },
107 Vector { _handler: DMA1_CHANNEL5 },
108 Vector { _handler: DMA1_CHANNEL6 },
109 Vector { _handler: DMA1_CHANNEL7 },
110 Vector { _handler: ADC1_2 },
111 Vector { _handler: USB_HP_CAN_TX },
112 Vector { _handler: USB_LP_CAN_RX0 },
113 Vector { _reserved: 0 },
114 Vector { _reserved: 0 },
115 Vector { _handler: EXTI9_5 },
116 Vector { _handler: TIM1_BRK },
117 Vector { _handler: TIM1_UP },
118 Vector { _handler: TIM1_TRG_COM },
119 Vector { _handler: TIM1_CC },
120 Vector { _handler: TIM2 },
121 Vector { _handler: TIM3 },
122 Vector { _handler: TIM4 },
123 Vector { _handler: I2C1_EV },
124 Vector { _handler: I2C1_ER },
125 Vector { _handler: I2C2_EV },
126 Vector { _handler: I2C2_ER },
127 Vector { _handler: SPI1 },
128 Vector { _handler: SPI2 },
129 Vector { _handler: USART1 },
130 Vector { _handler: USART2 },
131 Vector { _handler: USART3 },
132 Vector { _handler: EXTI15_10 },
133 Vector { _handler: RTCALARM },
134 Vector { _handler: USBWAKEUP },
135 Vector { _handler: TIM8_BRK },
136 Vector { _handler: TIM8_UP },
137 Vector { _handler: TIM8_TRG_COM },
138 Vector { _handler: TIM8_CC },
139 Vector { _handler: ADC3 },
140 Vector { _handler: FSMC },
141 Vector { _handler: SDIO },
142 Vector { _handler: TIM5 },
143 Vector { _handler: SPI3 },
144 Vector { _handler: UART4 },
145 Vector { _handler: UART5 },
146 Vector { _handler: TIM6 },
147 Vector { _handler: TIM7 },
148 Vector { _handler: DMA2_CHANNEL1 },
149 Vector { _handler: DMA2_CHANNEL2 },
150 Vector { _handler: DMA2_CHANNEL3 },
151 Vector {
152 _handler: DMA2_CHANNEL4_5,
153 },
154];
155#[cfg_attr(feature = "defmt", derive(defmt::Format))]
157#[derive(Copy, Clone, Debug, PartialEq, Eq)]
158#[repr(u16)]
159pub enum Interrupt {
160 WWDG = 0,
162 PVD = 1,
164 TAMPER = 2,
166 RTC = 3,
168 FLASH = 4,
170 RCC = 5,
172 EXTI0 = 6,
174 EXTI1 = 7,
176 EXTI2 = 8,
178 EXTI3 = 9,
180 EXTI4 = 10,
182 DMA1_CHANNEL1 = 11,
184 DMA1_CHANNEL2 = 12,
186 DMA1_CHANNEL3 = 13,
188 DMA1_CHANNEL4 = 14,
190 DMA1_CHANNEL5 = 15,
192 DMA1_CHANNEL6 = 16,
194 DMA1_CHANNEL7 = 17,
196 ADC1_2 = 18,
198 USB_HP_CAN_TX = 19,
200 USB_LP_CAN_RX0 = 20,
202 EXTI9_5 = 23,
204 TIM1_BRK = 24,
206 TIM1_UP = 25,
208 TIM1_TRG_COM = 26,
210 TIM1_CC = 27,
212 TIM2 = 28,
214 TIM3 = 29,
216 TIM4 = 30,
218 I2C1_EV = 31,
220 I2C1_ER = 32,
222 I2C2_EV = 33,
224 I2C2_ER = 34,
226 SPI1 = 35,
228 SPI2 = 36,
230 USART1 = 37,
232 USART2 = 38,
234 USART3 = 39,
236 EXTI15_10 = 40,
238 RTCALARM = 41,
240 USBWAKEUP = 42,
242 TIM8_BRK = 43,
244 TIM8_UP = 44,
246 TIM8_TRG_COM = 45,
248 TIM8_CC = 46,
250 ADC3 = 47,
252 FSMC = 48,
254 SDIO = 49,
256 TIM5 = 50,
258 SPI3 = 51,
260 UART4 = 52,
262 UART5 = 53,
264 TIM6 = 54,
266 TIM7 = 55,
268 DMA2_CHANNEL1 = 56,
270 DMA2_CHANNEL2 = 57,
272 DMA2_CHANNEL3 = 58,
274 DMA2_CHANNEL4_5 = 59,
276}
277unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
278 #[inline(always)]
279 fn number(self) -> u16 {
280 self as u16
281 }
282}
283pub type PWR = crate::Periph<pwr::RegisterBlock, 0x4000_7000>;
287impl core::fmt::Debug for PWR {
288 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
289 f.debug_struct("PWR").finish()
290 }
291}
292pub mod pwr;
294pub type RCC = crate::Periph<rcc::RegisterBlock, 0x4002_1000>;
298impl core::fmt::Debug for RCC {
299 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
300 f.debug_struct("RCC").finish()
301 }
302}
303pub mod rcc;
305pub type GPIOA = crate::Periph<gpioa::RegisterBlock, 0x4001_0800>;
309impl core::fmt::Debug for GPIOA {
310 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
311 f.debug_struct("GPIOA").finish()
312 }
313}
314pub mod gpioa;
316pub type GPIOB = crate::Periph<gpioa::RegisterBlock, 0x4001_0c00>;
320impl core::fmt::Debug for GPIOB {
321 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
322 f.debug_struct("GPIOB").finish()
323 }
324}
325pub use self::gpioa as gpiob;
327pub type GPIOC = crate::Periph<gpioa::RegisterBlock, 0x4001_1000>;
331impl core::fmt::Debug for GPIOC {
332 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
333 f.debug_struct("GPIOC").finish()
334 }
335}
336pub use self::gpioa as gpioc;
338pub type GPIOD = crate::Periph<gpioa::RegisterBlock, 0x4001_1400>;
342impl core::fmt::Debug for GPIOD {
343 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
344 f.debug_struct("GPIOD").finish()
345 }
346}
347pub use self::gpioa as gpiod;
349pub type GPIOE = crate::Periph<gpioa::RegisterBlock, 0x4001_1800>;
353impl core::fmt::Debug for GPIOE {
354 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
355 f.debug_struct("GPIOE").finish()
356 }
357}
358pub use self::gpioa as gpioe;
360pub type GPIOF = crate::Periph<gpioa::RegisterBlock, 0x4001_1c00>;
364impl core::fmt::Debug for GPIOF {
365 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
366 f.debug_struct("GPIOF").finish()
367 }
368}
369pub use self::gpioa as gpiof;
371pub type GPIOG = crate::Periph<gpioa::RegisterBlock, 0x4001_2000>;
375impl core::fmt::Debug for GPIOG {
376 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
377 f.debug_struct("GPIOG").finish()
378 }
379}
380pub use self::gpioa as gpiog;
382pub type AFIO = crate::Periph<afio::RegisterBlock, 0x4001_0000>;
386impl core::fmt::Debug for AFIO {
387 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
388 f.debug_struct("AFIO").finish()
389 }
390}
391pub mod afio;
393pub type EXTI = crate::Periph<exti::RegisterBlock, 0x4001_0400>;
397impl core::fmt::Debug for EXTI {
398 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
399 f.debug_struct("EXTI").finish()
400 }
401}
402pub mod exti;
404pub type DMA1 = crate::Periph<dma1::RegisterBlock, 0x4002_0000>;
408impl core::fmt::Debug for DMA1 {
409 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
410 f.debug_struct("DMA1").finish()
411 }
412}
413pub mod dma1;
415pub type DMA2 = crate::Periph<dma1::RegisterBlock, 0x4002_0400>;
419impl core::fmt::Debug for DMA2 {
420 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
421 f.debug_struct("DMA2").finish()
422 }
423}
424pub use self::dma1 as dma2;
426pub type RTC = crate::Periph<rtc::RegisterBlock, 0x4000_2800>;
430impl core::fmt::Debug for RTC {
431 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
432 f.debug_struct("RTC").finish()
433 }
434}
435pub mod rtc;
437pub type IWDG = crate::Periph<iwdg::RegisterBlock, 0x4000_3000>;
441impl core::fmt::Debug for IWDG {
442 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
443 f.debug_struct("IWDG").finish()
444 }
445}
446pub mod iwdg;
448pub type WWDG = crate::Periph<wwdg::RegisterBlock, 0x4000_2c00>;
452impl core::fmt::Debug for WWDG {
453 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
454 f.debug_struct("WWDG").finish()
455 }
456}
457pub mod wwdg;
459pub type TIM2 = crate::Periph<tim2::RegisterBlock, 0x4000_0000>;
463impl core::fmt::Debug for TIM2 {
464 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
465 f.debug_struct("TIM2").finish()
466 }
467}
468pub mod tim2;
470pub type TIM3 = crate::Periph<tim2::RegisterBlock, 0x4000_0400>;
474impl core::fmt::Debug for TIM3 {
475 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
476 f.debug_struct("TIM3").finish()
477 }
478}
479pub use self::tim2 as tim3;
481pub type I2C1 = crate::Periph<i2c1::RegisterBlock, 0x4000_5400>;
485impl core::fmt::Debug for I2C1 {
486 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
487 f.debug_struct("I2C1").finish()
488 }
489}
490pub mod i2c1;
492pub type I2C2 = crate::Periph<i2c1::RegisterBlock, 0x4000_5800>;
496impl core::fmt::Debug for I2C2 {
497 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
498 f.debug_struct("I2C2").finish()
499 }
500}
501pub use self::i2c1 as i2c2;
503pub type SPI1 = crate::Periph<spi1::RegisterBlock, 0x4001_3000>;
507impl core::fmt::Debug for SPI1 {
508 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
509 f.debug_struct("SPI1").finish()
510 }
511}
512pub mod spi1;
514pub type USART1 = crate::Periph<usart1::RegisterBlock, 0x4001_3800>;
518impl core::fmt::Debug for USART1 {
519 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
520 f.debug_struct("USART1").finish()
521 }
522}
523pub mod usart1;
525pub type USART2 = crate::Periph<usart1::RegisterBlock, 0x4000_4400>;
529impl core::fmt::Debug for USART2 {
530 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
531 f.debug_struct("USART2").finish()
532 }
533}
534pub use self::usart1 as usart2;
536pub type USART3 = crate::Periph<usart1::RegisterBlock, 0x4000_4800>;
540impl core::fmt::Debug for USART3 {
541 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
542 f.debug_struct("USART3").finish()
543 }
544}
545pub use self::usart1 as usart3;
547pub type ADC1 = crate::Periph<adc1::RegisterBlock, 0x4001_2400>;
551impl core::fmt::Debug for ADC1 {
552 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
553 f.debug_struct("ADC1").finish()
554 }
555}
556pub mod adc1;
558pub type ADC3 = crate::Periph<adc3::RegisterBlock, 0x4001_3c00>;
562impl core::fmt::Debug for ADC3 {
563 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
564 f.debug_struct("ADC3").finish()
565 }
566}
567pub mod adc3;
569pub type CRC = crate::Periph<crc::RegisterBlock, 0x4002_3000>;
573impl core::fmt::Debug for CRC {
574 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
575 f.debug_struct("CRC").finish()
576 }
577}
578pub mod crc;
580pub type FLASH = crate::Periph<flash::RegisterBlock, 0x4002_2000>;
584impl core::fmt::Debug for FLASH {
585 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
586 f.debug_struct("FLASH").finish()
587 }
588}
589pub mod flash;
591pub type DBGMCU = crate::Periph<dbgmcu::RegisterBlock, 0xe004_2000>;
595impl core::fmt::Debug for DBGMCU {
596 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
597 f.debug_struct("DBGMCU").finish()
598 }
599}
600pub mod dbgmcu;
602pub type BKP = crate::Periph<bkp::RegisterBlock, 0x4000_6c04>;
606impl core::fmt::Debug for BKP {
607 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
608 f.debug_struct("BKP").finish()
609 }
610}
611pub mod bkp;
613pub type FSMC = crate::Periph<fsmc::RegisterBlock, 0xa000_0000>;
617impl core::fmt::Debug for FSMC {
618 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
619 f.debug_struct("FSMC").finish()
620 }
621}
622pub mod fsmc;
624pub type OTG_FS_DEVICE = crate::Periph<otg_fs_device::RegisterBlock, 0x5000_0800>;
628impl core::fmt::Debug for OTG_FS_DEVICE {
629 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
630 f.debug_struct("OTG_FS_DEVICE").finish()
631 }
632}
633pub mod otg_fs_device;
635pub type OTG_FS_GLOBAL = crate::Periph<otg_fs_global::RegisterBlock, 0x5000_0000>;
639impl core::fmt::Debug for OTG_FS_GLOBAL {
640 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
641 f.debug_struct("OTG_FS_GLOBAL").finish()
642 }
643}
644pub mod otg_fs_global;
646pub type OTG_FS_HOST = crate::Periph<otg_fs_host::RegisterBlock, 0x5000_0400>;
650impl core::fmt::Debug for OTG_FS_HOST {
651 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
652 f.debug_struct("OTG_FS_HOST").finish()
653 }
654}
655pub mod otg_fs_host;
657pub type OTG_FS_PWRCLK = crate::Periph<otg_fs_pwrclk::RegisterBlock, 0x5000_0e00>;
661impl core::fmt::Debug for OTG_FS_PWRCLK {
662 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
663 f.debug_struct("OTG_FS_PWRCLK").finish()
664 }
665}
666pub mod otg_fs_pwrclk;
668pub type SDIO = crate::Periph<sdio::RegisterBlock, 0x4001_8000>;
672impl core::fmt::Debug for SDIO {
673 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
674 f.debug_struct("SDIO").finish()
675 }
676}
677pub mod sdio;
679pub type TIM13 = crate::Periph<tim13::RegisterBlock, 0x4000_1c00>;
683impl core::fmt::Debug for TIM13 {
684 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
685 f.debug_struct("TIM13").finish()
686 }
687}
688pub mod tim13;
690pub type TIM10 = crate::Periph<tim13::RegisterBlock, 0x4001_5000>;
694impl core::fmt::Debug for TIM10 {
695 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
696 f.debug_struct("TIM10").finish()
697 }
698}
699pub use self::tim13 as tim10;
701pub type TIM11 = crate::Periph<tim13::RegisterBlock, 0x4001_5400>;
705impl core::fmt::Debug for TIM11 {
706 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
707 f.debug_struct("TIM11").finish()
708 }
709}
710pub use self::tim13 as tim11;
712pub type TIM9 = crate::Periph<tim9::RegisterBlock, 0x4001_4c00>;
716impl core::fmt::Debug for TIM9 {
717 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
718 f.debug_struct("TIM9").finish()
719 }
720}
721pub mod tim9;
723pub type TIM12 = crate::Periph<tim9::RegisterBlock, 0x4000_1800>;
727impl core::fmt::Debug for TIM12 {
728 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
729 f.debug_struct("TIM12").finish()
730 }
731}
732pub use self::tim9 as tim12;
734pub type TIM8 = crate::Periph<tim8::RegisterBlock, 0x4001_3400>;
738impl core::fmt::Debug for TIM8 {
739 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
740 f.debug_struct("TIM8").finish()
741 }
742}
743pub mod tim8;
745pub type TIM1 = crate::Periph<tim8::RegisterBlock, 0x4001_2c00>;
749impl core::fmt::Debug for TIM1 {
750 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
751 f.debug_struct("TIM1").finish()
752 }
753}
754pub use self::tim8 as tim1;
756pub type ADC2 = crate::Periph<adc2::RegisterBlock, 0x4001_2800>;
760impl core::fmt::Debug for ADC2 {
761 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
762 f.debug_struct("ADC2").finish()
763 }
764}
765pub mod adc2;
767pub type DAC = crate::Periph<dac::RegisterBlock, 0x4000_7400>;
771impl core::fmt::Debug for DAC {
772 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
773 f.debug_struct("DAC").finish()
774 }
775}
776pub mod dac;
778pub type USB = crate::Periph<usb::RegisterBlock, 0x4000_5c00>;
782impl core::fmt::Debug for USB {
783 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
784 f.debug_struct("USB").finish()
785 }
786}
787pub mod usb;
789pub type UART4 = crate::Periph<uart4::RegisterBlock, 0x4000_4c00>;
793impl core::fmt::Debug for UART4 {
794 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
795 f.debug_struct("UART4").finish()
796 }
797}
798pub mod uart4;
800pub type UART5 = crate::Periph<uart4::RegisterBlock, 0x4000_5000>;
804impl core::fmt::Debug for UART5 {
805 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
806 f.debug_struct("UART5").finish()
807 }
808}
809pub use self::uart4 as uart5;
811pub type SPI2 = crate::Periph<spi2::RegisterBlock, 0x4000_3800>;
815impl core::fmt::Debug for SPI2 {
816 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
817 f.debug_struct("SPI2").finish()
818 }
819}
820pub mod spi2;
822pub type SPI3 = crate::Periph<spi2::RegisterBlock, 0x4000_3c00>;
826impl core::fmt::Debug for SPI3 {
827 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
828 f.debug_struct("SPI3").finish()
829 }
830}
831pub use self::spi2 as spi3;
833pub type TIM4 = crate::Periph<tim2::RegisterBlock, 0x4000_0800>;
837impl core::fmt::Debug for TIM4 {
838 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
839 f.debug_struct("TIM4").finish()
840 }
841}
842pub use self::tim2 as tim4;
844pub type TIM5 = crate::Periph<tim2::RegisterBlock, 0x4000_0c00>;
848impl core::fmt::Debug for TIM5 {
849 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
850 f.debug_struct("TIM5").finish()
851 }
852}
853pub use self::tim2 as tim5;
855pub type TIM6 = crate::Periph<tim6::RegisterBlock, 0x4000_1000>;
859impl core::fmt::Debug for TIM6 {
860 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
861 f.debug_struct("TIM6").finish()
862 }
863}
864pub mod tim6;
866pub type TIM7 = crate::Periph<tim6::RegisterBlock, 0x4000_1400>;
870impl core::fmt::Debug for TIM7 {
871 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
872 f.debug_struct("TIM7").finish()
873 }
874}
875pub use self::tim6 as tim7;
877pub type TIM14 = crate::Periph<tim13::RegisterBlock, 0x4000_2000>;
881impl core::fmt::Debug for TIM14 {
882 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
883 f.debug_struct("TIM14").finish()
884 }
885}
886pub use self::tim13 as tim14;
888pub type SCB_ACTRL = crate::Periph<scb_actrl::RegisterBlock, 0xe000_e008>;
892impl core::fmt::Debug for SCB_ACTRL {
893 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
894 f.debug_struct("SCB_ACTRL").finish()
895 }
896}
897pub mod scb_actrl;
899pub type NVIC_STIR = crate::Periph<nvic_stir::RegisterBlock, 0xe000_ef00>;
903impl core::fmt::Debug for NVIC_STIR {
904 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
905 f.debug_struct("NVIC_STIR").finish()
906 }
907}
908pub mod nvic_stir;
910pub type STK = crate::Periph<stk::RegisterBlock, 0xe000_e010>;
914impl core::fmt::Debug for STK {
915 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
916 f.debug_struct("STK").finish()
917 }
918}
919pub mod stk;
921#[no_mangle]
922static mut DEVICE_PERIPHERALS: bool = false;
923#[allow(non_snake_case)]
925pub struct Peripherals {
926 pub PWR: PWR,
928 pub RCC: RCC,
930 pub GPIOA: GPIOA,
932 pub GPIOB: GPIOB,
934 pub GPIOC: GPIOC,
936 pub GPIOD: GPIOD,
938 pub GPIOE: GPIOE,
940 pub GPIOF: GPIOF,
942 pub GPIOG: GPIOG,
944 pub AFIO: AFIO,
946 pub EXTI: EXTI,
948 pub DMA1: DMA1,
950 pub DMA2: DMA2,
952 pub RTC: RTC,
954 pub IWDG: IWDG,
956 pub WWDG: WWDG,
958 pub TIM2: TIM2,
960 pub TIM3: TIM3,
962 pub I2C1: I2C1,
964 pub I2C2: I2C2,
966 pub SPI1: SPI1,
968 pub USART1: USART1,
970 pub USART2: USART2,
972 pub USART3: USART3,
974 pub ADC1: ADC1,
976 pub ADC3: ADC3,
978 pub CRC: CRC,
980 pub FLASH: FLASH,
982 pub DBGMCU: DBGMCU,
984 pub BKP: BKP,
986 pub FSMC: FSMC,
988 pub OTG_FS_DEVICE: OTG_FS_DEVICE,
990 pub OTG_FS_GLOBAL: OTG_FS_GLOBAL,
992 pub OTG_FS_HOST: OTG_FS_HOST,
994 pub OTG_FS_PWRCLK: OTG_FS_PWRCLK,
996 pub SDIO: SDIO,
998 pub TIM13: TIM13,
1000 pub TIM10: TIM10,
1002 pub TIM11: TIM11,
1004 pub TIM9: TIM9,
1006 pub TIM12: TIM12,
1008 pub TIM8: TIM8,
1010 pub TIM1: TIM1,
1012 pub ADC2: ADC2,
1014 pub DAC: DAC,
1016 pub USB: USB,
1018 pub UART4: UART4,
1020 pub UART5: UART5,
1022 pub SPI2: SPI2,
1024 pub SPI3: SPI3,
1026 pub TIM4: TIM4,
1028 pub TIM5: TIM5,
1030 pub TIM6: TIM6,
1032 pub TIM7: TIM7,
1034 pub TIM14: TIM14,
1036 pub SCB_ACTRL: SCB_ACTRL,
1038 pub NVIC_STIR: NVIC_STIR,
1040 pub STK: STK,
1042}
1043impl Peripherals {
1044 #[cfg(feature = "critical-section")]
1046 #[inline]
1047 pub fn take() -> Option<Self> {
1048 critical_section::with(|_| {
1049 if unsafe { DEVICE_PERIPHERALS } {
1050 return None;
1051 }
1052 Some(unsafe { Peripherals::steal() })
1053 })
1054 }
1055 #[inline]
1061 pub unsafe fn steal() -> Self {
1062 DEVICE_PERIPHERALS = true;
1063 Peripherals {
1064 PWR: PWR::steal(),
1065 RCC: RCC::steal(),
1066 GPIOA: GPIOA::steal(),
1067 GPIOB: GPIOB::steal(),
1068 GPIOC: GPIOC::steal(),
1069 GPIOD: GPIOD::steal(),
1070 GPIOE: GPIOE::steal(),
1071 GPIOF: GPIOF::steal(),
1072 GPIOG: GPIOG::steal(),
1073 AFIO: AFIO::steal(),
1074 EXTI: EXTI::steal(),
1075 DMA1: DMA1::steal(),
1076 DMA2: DMA2::steal(),
1077 RTC: RTC::steal(),
1078 IWDG: IWDG::steal(),
1079 WWDG: WWDG::steal(),
1080 TIM2: TIM2::steal(),
1081 TIM3: TIM3::steal(),
1082 I2C1: I2C1::steal(),
1083 I2C2: I2C2::steal(),
1084 SPI1: SPI1::steal(),
1085 USART1: USART1::steal(),
1086 USART2: USART2::steal(),
1087 USART3: USART3::steal(),
1088 ADC1: ADC1::steal(),
1089 ADC3: ADC3::steal(),
1090 CRC: CRC::steal(),
1091 FLASH: FLASH::steal(),
1092 DBGMCU: DBGMCU::steal(),
1093 BKP: BKP::steal(),
1094 FSMC: FSMC::steal(),
1095 OTG_FS_DEVICE: OTG_FS_DEVICE::steal(),
1096 OTG_FS_GLOBAL: OTG_FS_GLOBAL::steal(),
1097 OTG_FS_HOST: OTG_FS_HOST::steal(),
1098 OTG_FS_PWRCLK: OTG_FS_PWRCLK::steal(),
1099 SDIO: SDIO::steal(),
1100 TIM13: TIM13::steal(),
1101 TIM10: TIM10::steal(),
1102 TIM11: TIM11::steal(),
1103 TIM9: TIM9::steal(),
1104 TIM12: TIM12::steal(),
1105 TIM8: TIM8::steal(),
1106 TIM1: TIM1::steal(),
1107 ADC2: ADC2::steal(),
1108 DAC: DAC::steal(),
1109 USB: USB::steal(),
1110 UART4: UART4::steal(),
1111 UART5: UART5::steal(),
1112 SPI2: SPI2::steal(),
1113 SPI3: SPI3::steal(),
1114 TIM4: TIM4::steal(),
1115 TIM5: TIM5::steal(),
1116 TIM6: TIM6::steal(),
1117 TIM7: TIM7::steal(),
1118 TIM14: TIM14::steal(),
1119 SCB_ACTRL: SCB_ACTRL::steal(),
1120 NVIC_STIR: NVIC_STIR::steal(),
1121 STK: STK::steal(),
1122 }
1123 }
1124}