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::{CBP, CPUID, DCB, DWT, FPB, FPU, ITM, MPU, NVIC, SCB, SYST, TPIU};
16#[cfg(feature = "rt")]
17pub use cortex_m_rt::interrupt;
18#[cfg(feature = "rt")]
19extern "C" {
20 fn WWDG();
21 fn PVD_PVM();
22 fn RTC_TAMP_STAMP();
23 fn RTC_WKUP();
24 fn FLASH();
25 fn RCC();
26 fn EXTI0();
27 fn EXTI1();
28 fn EXTI2();
29 fn EXTI3();
30 fn EXTI4();
31 fn DMA1_CH1();
32 fn DMA1_CH2();
33 fn DMA1_CH3();
34 fn DMA1_CH4();
35 fn DMA1_CH5();
36 fn DMA1_CH6();
37 fn DMA1_CH7();
38 fn ADC1_2();
39 fn CAN1_TX();
40 fn CAN1_RX0();
41 fn CAN1_RX1();
42 fn CAN1_SCE();
43 fn EXTI9_5();
44 fn TIM1_BRK_TIM15();
45 fn TIM1_UP_TIM16();
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 RTC_ALARM();
62 fn DFSDM1_FLT3();
63 fn TIM8_BRK();
64 fn TIM8_UP();
65 fn TIM8_TRG_COM();
66 fn TIM8_CC();
67 fn ADC3();
68 fn SDMMC1();
69 fn TIM5();
70 fn SPI3();
71 fn UART4();
72 fn TIM6_DACUNDER();
73 fn TIM7();
74 fn DMA2_CH1();
75 fn DMA2_CH2();
76 fn DMA2_CH3();
77 fn DMA2_CH4();
78 fn DMA2_CH5();
79 fn DFSDM1_FLT0();
80 fn DFSDM1_FLT1();
81 fn DFSDM1_FLT2();
82 fn COMP();
83 fn LPTIM1();
84 fn LPTIM2();
85 fn USB_FS();
86 fn DMA2_CH6();
87 fn DMA2_CH7();
88 fn LPUART1();
89 fn QUADSPI();
90 fn I2C3_EV();
91 fn I2C3_ER();
92 fn SAI1();
93 fn SWPMI1();
94 fn TSC();
95 fn LCD();
96 fn AES();
97 fn RNG();
98 fn FPU();
99 fn CRS();
100}
101#[doc(hidden)]
102#[repr(C)]
103pub union Vector {
104 _handler: unsafe extern "C" fn(),
105 _reserved: u32,
106}
107#[cfg(feature = "rt")]
108#[doc(hidden)]
109#[link_section = ".vector_table.interrupts"]
110#[no_mangle]
111pub static __INTERRUPTS: [Vector; 83] = [
112 Vector { _handler: WWDG },
113 Vector { _handler: PVD_PVM },
114 Vector {
115 _handler: RTC_TAMP_STAMP,
116 },
117 Vector { _handler: RTC_WKUP },
118 Vector { _handler: FLASH },
119 Vector { _handler: RCC },
120 Vector { _handler: EXTI0 },
121 Vector { _handler: EXTI1 },
122 Vector { _handler: EXTI2 },
123 Vector { _handler: EXTI3 },
124 Vector { _handler: EXTI4 },
125 Vector { _handler: DMA1_CH1 },
126 Vector { _handler: DMA1_CH2 },
127 Vector { _handler: DMA1_CH3 },
128 Vector { _handler: DMA1_CH4 },
129 Vector { _handler: DMA1_CH5 },
130 Vector { _handler: DMA1_CH6 },
131 Vector { _handler: DMA1_CH7 },
132 Vector { _handler: ADC1_2 },
133 Vector { _handler: CAN1_TX },
134 Vector { _handler: CAN1_RX0 },
135 Vector { _handler: CAN1_RX1 },
136 Vector { _handler: CAN1_SCE },
137 Vector { _handler: EXTI9_5 },
138 Vector {
139 _handler: TIM1_BRK_TIM15,
140 },
141 Vector {
142 _handler: TIM1_UP_TIM16,
143 },
144 Vector {
145 _handler: TIM1_TRG_COM,
146 },
147 Vector { _handler: TIM1_CC },
148 Vector { _handler: TIM2 },
149 Vector { _handler: TIM3 },
150 Vector { _handler: TIM4 },
151 Vector { _handler: I2C1_EV },
152 Vector { _handler: I2C1_ER },
153 Vector { _handler: I2C2_EV },
154 Vector { _handler: I2C2_ER },
155 Vector { _handler: SPI1 },
156 Vector { _handler: SPI2 },
157 Vector { _handler: USART1 },
158 Vector { _handler: USART2 },
159 Vector { _handler: USART3 },
160 Vector {
161 _handler: EXTI15_10,
162 },
163 Vector {
164 _handler: RTC_ALARM,
165 },
166 Vector {
167 _handler: DFSDM1_FLT3,
168 },
169 Vector { _handler: TIM8_BRK },
170 Vector { _handler: TIM8_UP },
171 Vector {
172 _handler: TIM8_TRG_COM,
173 },
174 Vector { _handler: TIM8_CC },
175 Vector { _handler: ADC3 },
176 Vector { _reserved: 0 },
177 Vector { _handler: SDMMC1 },
178 Vector { _handler: TIM5 },
179 Vector { _handler: SPI3 },
180 Vector { _handler: UART4 },
181 Vector { _reserved: 0 },
182 Vector {
183 _handler: TIM6_DACUNDER,
184 },
185 Vector { _handler: TIM7 },
186 Vector { _handler: DMA2_CH1 },
187 Vector { _handler: DMA2_CH2 },
188 Vector { _handler: DMA2_CH3 },
189 Vector { _handler: DMA2_CH4 },
190 Vector { _handler: DMA2_CH5 },
191 Vector {
192 _handler: DFSDM1_FLT0,
193 },
194 Vector {
195 _handler: DFSDM1_FLT1,
196 },
197 Vector {
198 _handler: DFSDM1_FLT2,
199 },
200 Vector { _handler: COMP },
201 Vector { _handler: LPTIM1 },
202 Vector { _handler: LPTIM2 },
203 Vector { _handler: USB_FS },
204 Vector { _handler: DMA2_CH6 },
205 Vector { _handler: DMA2_CH7 },
206 Vector { _handler: LPUART1 },
207 Vector { _handler: QUADSPI },
208 Vector { _handler: I2C3_EV },
209 Vector { _handler: I2C3_ER },
210 Vector { _handler: SAI1 },
211 Vector { _reserved: 0 },
212 Vector { _handler: SWPMI1 },
213 Vector { _handler: TSC },
214 Vector { _handler: LCD },
215 Vector { _handler: AES },
216 Vector { _handler: RNG },
217 Vector { _handler: FPU },
218 Vector { _handler: CRS },
219];
220#[cfg_attr(feature = "defmt", derive(defmt::Format))]
222#[derive(Copy, Clone, Debug, PartialEq, Eq)]
223#[repr(u16)]
224pub enum Interrupt {
225 WWDG = 0,
227 PVD_PVM = 1,
229 RTC_TAMP_STAMP = 2,
231 RTC_WKUP = 3,
233 FLASH = 4,
235 RCC = 5,
237 EXTI0 = 6,
239 EXTI1 = 7,
241 EXTI2 = 8,
243 EXTI3 = 9,
245 EXTI4 = 10,
247 DMA1_CH1 = 11,
249 DMA1_CH2 = 12,
251 DMA1_CH3 = 13,
253 DMA1_CH4 = 14,
255 DMA1_CH5 = 15,
257 DMA1_CH6 = 16,
259 DMA1_CH7 = 17,
261 ADC1_2 = 18,
263 CAN1_TX = 19,
265 CAN1_RX0 = 20,
267 CAN1_RX1 = 21,
269 CAN1_SCE = 22,
271 EXTI9_5 = 23,
273 TIM1_BRK_TIM15 = 24,
275 TIM1_UP_TIM16 = 25,
277 TIM1_TRG_COM = 26,
279 TIM1_CC = 27,
281 TIM2 = 28,
283 TIM3 = 29,
285 TIM4 = 30,
287 I2C1_EV = 31,
289 I2C1_ER = 32,
291 I2C2_EV = 33,
293 I2C2_ER = 34,
295 SPI1 = 35,
297 SPI2 = 36,
299 USART1 = 37,
301 USART2 = 38,
303 USART3 = 39,
305 EXTI15_10 = 40,
307 RTC_ALARM = 41,
309 DFSDM1_FLT3 = 42,
311 TIM8_BRK = 43,
313 TIM8_UP = 44,
315 TIM8_TRG_COM = 45,
317 TIM8_CC = 46,
319 ADC3 = 47,
321 SDMMC1 = 49,
323 TIM5 = 50,
325 SPI3 = 51,
327 UART4 = 52,
329 TIM6_DACUNDER = 54,
331 TIM7 = 55,
333 DMA2_CH1 = 56,
335 DMA2_CH2 = 57,
337 DMA2_CH3 = 58,
339 DMA2_CH4 = 59,
341 DMA2_CH5 = 60,
343 DFSDM1_FLT0 = 61,
345 DFSDM1_FLT1 = 62,
347 DFSDM1_FLT2 = 63,
349 COMP = 64,
351 LPTIM1 = 65,
353 LPTIM2 = 66,
355 USB_FS = 67,
357 DMA2_CH6 = 68,
359 DMA2_CH7 = 69,
361 LPUART1 = 70,
363 QUADSPI = 71,
365 I2C3_EV = 72,
367 I2C3_ER = 73,
369 SAI1 = 74,
371 SWPMI1 = 76,
373 TSC = 77,
375 LCD = 78,
377 AES = 79,
379 RNG = 80,
381 FPU = 81,
383 CRS = 82,
385}
386unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
387 #[inline(always)]
388 fn number(self) -> u16 {
389 self as u16
390 }
391}
392pub type DAC = crate::Periph<dac::RegisterBlock, 0x4000_7400>;
396impl core::fmt::Debug for DAC {
397 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
398 f.debug_struct("DAC").finish()
399 }
400}
401pub mod dac;
403pub type DMA1 = crate::Periph<dma1::RegisterBlock, 0x4002_0000>;
407impl core::fmt::Debug for DMA1 {
408 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
409 f.debug_struct("DMA1").finish()
410 }
411}
412pub mod dma1;
414pub type DMA2 = crate::Periph<dma1::RegisterBlock, 0x4002_0400>;
418impl core::fmt::Debug for DMA2 {
419 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
420 f.debug_struct("DMA2").finish()
421 }
422}
423pub use self::dma1 as dma2;
425pub type CRC = crate::Periph<crc::RegisterBlock, 0x4002_3000>;
429impl core::fmt::Debug for CRC {
430 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
431 f.debug_struct("CRC").finish()
432 }
433}
434pub mod crc;
436pub type LCD = crate::Periph<lcd::RegisterBlock, 0x4000_2400>;
440impl core::fmt::Debug for LCD {
441 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
442 f.debug_struct("LCD").finish()
443 }
444}
445pub mod lcd;
447pub type TSC = crate::Periph<tsc::RegisterBlock, 0x4002_4000>;
451impl core::fmt::Debug for TSC {
452 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
453 f.debug_struct("TSC").finish()
454 }
455}
456pub mod tsc;
458pub type IWDG = crate::Periph<iwdg::RegisterBlock, 0x4000_3000>;
462impl core::fmt::Debug for IWDG {
463 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
464 f.debug_struct("IWDG").finish()
465 }
466}
467pub mod iwdg;
469pub type WWDG = crate::Periph<wwdg::RegisterBlock, 0x4000_2c00>;
473impl core::fmt::Debug for WWDG {
474 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
475 f.debug_struct("WWDG").finish()
476 }
477}
478pub mod wwdg;
480pub type COMP = crate::Periph<comp::RegisterBlock, 0x4001_0200>;
484impl core::fmt::Debug for COMP {
485 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
486 f.debug_struct("COMP").finish()
487 }
488}
489pub mod comp;
491pub type FIREWALL = crate::Periph<firewall::RegisterBlock, 0x4001_1c00>;
495impl core::fmt::Debug for FIREWALL {
496 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
497 f.debug_struct("FIREWALL").finish()
498 }
499}
500pub mod firewall;
502pub type I2C1 = crate::Periph<i2c1::RegisterBlock, 0x4000_5400>;
506impl core::fmt::Debug for I2C1 {
507 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
508 f.debug_struct("I2C1").finish()
509 }
510}
511pub mod i2c1;
513pub type I2C3 = crate::Periph<i2c1::RegisterBlock, 0x4000_5c00>;
517impl core::fmt::Debug for I2C3 {
518 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
519 f.debug_struct("I2C3").finish()
520 }
521}
522pub use self::i2c1 as i2c3;
524pub type I2C2 = crate::Periph<i2c1::RegisterBlock, 0x4000_5800>;
528impl core::fmt::Debug for I2C2 {
529 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
530 f.debug_struct("I2C2").finish()
531 }
532}
533pub use self::i2c1 as i2c2;
535pub type FLASH = crate::Periph<flash::RegisterBlock, 0x4002_2000>;
539impl core::fmt::Debug for FLASH {
540 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
541 f.debug_struct("FLASH").finish()
542 }
543}
544pub mod flash;
546pub type RCC = crate::Periph<rcc::RegisterBlock, 0x4002_1000>;
550impl core::fmt::Debug for RCC {
551 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
552 f.debug_struct("RCC").finish()
553 }
554}
555pub mod rcc;
557pub type PWR = crate::Periph<pwr::RegisterBlock, 0x4000_7000>;
561impl core::fmt::Debug for PWR {
562 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
563 f.debug_struct("PWR").finish()
564 }
565}
566pub mod pwr;
568pub type SYSCFG = crate::Periph<syscfg::RegisterBlock, 0x4001_0000>;
572impl core::fmt::Debug for SYSCFG {
573 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
574 f.debug_struct("SYSCFG").finish()
575 }
576}
577pub mod syscfg;
579pub type RNG = crate::Periph<rng::RegisterBlock, 0x5006_0800>;
583impl core::fmt::Debug for RNG {
584 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
585 f.debug_struct("RNG").finish()
586 }
587}
588pub mod rng;
590pub type AES = crate::Periph<aes::RegisterBlock, 0x5006_0000>;
594impl core::fmt::Debug for AES {
595 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
596 f.debug_struct("AES").finish()
597 }
598}
599pub mod aes;
601pub type ADC1 = crate::Periph<adc1::RegisterBlock, 0x5004_0000>;
605impl core::fmt::Debug for ADC1 {
606 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
607 f.debug_struct("ADC1").finish()
608 }
609}
610pub mod adc1;
612pub type ADC2 = crate::Periph<adc1::RegisterBlock, 0x5004_0100>;
616impl core::fmt::Debug for ADC2 {
617 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
618 f.debug_struct("ADC2").finish()
619 }
620}
621pub use self::adc1 as adc2;
623pub type ADC3 = crate::Periph<adc1::RegisterBlock, 0x5004_0200>;
627impl core::fmt::Debug for ADC3 {
628 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
629 f.debug_struct("ADC3").finish()
630 }
631}
632pub use self::adc1 as adc3;
634pub type ADC123_COMMON = crate::Periph<adc123_common::RegisterBlock, 0x5004_0300>;
638impl core::fmt::Debug for ADC123_COMMON {
639 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
640 f.debug_struct("ADC123_COMMON").finish()
641 }
642}
643pub mod adc123_common;
645pub type ADC_COMMON = crate::Periph<adc_common::RegisterBlock, 0x5004_0300>;
649impl core::fmt::Debug for ADC_COMMON {
650 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
651 f.debug_struct("ADC_COMMON").finish()
652 }
653}
654pub mod adc_common;
656pub type GPIOA = crate::Periph<gpioa::RegisterBlock, 0x4800_0000>;
660impl core::fmt::Debug for GPIOA {
661 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
662 f.debug_struct("GPIOA").finish()
663 }
664}
665pub mod gpioa;
667pub type GPIOB = crate::Periph<gpiob::RegisterBlock, 0x4800_0400>;
671impl core::fmt::Debug for GPIOB {
672 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
673 f.debug_struct("GPIOB").finish()
674 }
675}
676pub mod gpiob;
678pub type GPIOC = crate::Periph<gpioc::RegisterBlock, 0x4800_0800>;
682impl core::fmt::Debug for GPIOC {
683 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
684 f.debug_struct("GPIOC").finish()
685 }
686}
687pub mod gpioc;
689pub type GPIOD = crate::Periph<gpioc::RegisterBlock, 0x4800_0c00>;
693impl core::fmt::Debug for GPIOD {
694 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
695 f.debug_struct("GPIOD").finish()
696 }
697}
698pub use self::gpioc as gpiod;
700pub type GPIOE = crate::Periph<gpioc::RegisterBlock, 0x4800_1000>;
704impl core::fmt::Debug for GPIOE {
705 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
706 f.debug_struct("GPIOE").finish()
707 }
708}
709pub use self::gpioc as gpioe;
711pub type GPIOF = crate::Periph<gpioc::RegisterBlock, 0x4800_1400>;
715impl core::fmt::Debug for GPIOF {
716 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
717 f.debug_struct("GPIOF").finish()
718 }
719}
720pub use self::gpioc as gpiof;
722pub type GPIOG = crate::Periph<gpioc::RegisterBlock, 0x4800_1800>;
726impl core::fmt::Debug for GPIOG {
727 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
728 f.debug_struct("GPIOG").finish()
729 }
730}
731pub use self::gpioc as gpiog;
733pub type GPIOH = crate::Periph<gpioc::RegisterBlock, 0x4800_1c00>;
737impl core::fmt::Debug for GPIOH {
738 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
739 f.debug_struct("GPIOH").finish()
740 }
741}
742pub use self::gpioc as gpioh;
744pub type SAI1 = crate::Periph<sai1::RegisterBlock, 0x4001_5400>;
748impl core::fmt::Debug for SAI1 {
749 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
750 f.debug_struct("SAI1").finish()
751 }
752}
753pub mod sai1;
755pub type TIM2 = crate::Periph<tim2::RegisterBlock, 0x4000_0000>;
759impl core::fmt::Debug for TIM2 {
760 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
761 f.debug_struct("TIM2").finish()
762 }
763}
764pub mod tim2;
766pub type TIM3 = crate::Periph<tim3::RegisterBlock, 0x4000_0400>;
770impl core::fmt::Debug for TIM3 {
771 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
772 f.debug_struct("TIM3").finish()
773 }
774}
775pub mod tim3;
777pub type TIM4 = crate::Periph<tim3::RegisterBlock, 0x4000_0800>;
781impl core::fmt::Debug for TIM4 {
782 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
783 f.debug_struct("TIM4").finish()
784 }
785}
786pub use self::tim3 as tim4;
788pub type TIM5 = crate::Periph<tim3::RegisterBlock, 0x4000_0c00>;
792impl core::fmt::Debug for TIM5 {
793 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
794 f.debug_struct("TIM5").finish()
795 }
796}
797pub use self::tim3 as tim5;
799pub type TIM15 = crate::Periph<tim15::RegisterBlock, 0x4001_4000>;
803impl core::fmt::Debug for TIM15 {
804 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
805 f.debug_struct("TIM15").finish()
806 }
807}
808pub mod tim15;
810pub type TIM16 = crate::Periph<tim16::RegisterBlock, 0x4001_4400>;
814impl core::fmt::Debug for TIM16 {
815 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
816 f.debug_struct("TIM16").finish()
817 }
818}
819pub mod tim16;
821pub type TIM17 = crate::Periph<tim16::RegisterBlock, 0x4001_4800>;
825impl core::fmt::Debug for TIM17 {
826 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
827 f.debug_struct("TIM17").finish()
828 }
829}
830pub use self::tim16 as tim17;
832pub type TIM1 = crate::Periph<tim1::RegisterBlock, 0x4001_2c00>;
836impl core::fmt::Debug for TIM1 {
837 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
838 f.debug_struct("TIM1").finish()
839 }
840}
841pub mod tim1;
843pub type TIM8 = crate::Periph<tim8::RegisterBlock, 0x4001_3400>;
847impl core::fmt::Debug for TIM8 {
848 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
849 f.debug_struct("TIM8").finish()
850 }
851}
852pub mod tim8;
854pub type TIM6 = crate::Periph<tim6::RegisterBlock, 0x4000_1000>;
858impl core::fmt::Debug for TIM6 {
859 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
860 f.debug_struct("TIM6").finish()
861 }
862}
863pub mod tim6;
865pub type TIM7 = crate::Periph<tim6::RegisterBlock, 0x4000_1400>;
869impl core::fmt::Debug for TIM7 {
870 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
871 f.debug_struct("TIM7").finish()
872 }
873}
874pub use self::tim6 as tim7;
876pub type LPTIM1 = crate::Periph<lptim1::RegisterBlock, 0x4000_7c00>;
880impl core::fmt::Debug for LPTIM1 {
881 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
882 f.debug_struct("LPTIM1").finish()
883 }
884}
885pub mod lptim1;
887pub type LPTIM2 = crate::Periph<lptim1::RegisterBlock, 0x4000_9400>;
891impl core::fmt::Debug for LPTIM2 {
892 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
893 f.debug_struct("LPTIM2").finish()
894 }
895}
896pub use self::lptim1 as lptim2;
898pub type USART1 = crate::Periph<usart1::RegisterBlock, 0x4001_3800>;
902impl core::fmt::Debug for USART1 {
903 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
904 f.debug_struct("USART1").finish()
905 }
906}
907pub mod usart1;
909pub type USART2 = crate::Periph<usart1::RegisterBlock, 0x4000_4400>;
913impl core::fmt::Debug for USART2 {
914 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
915 f.debug_struct("USART2").finish()
916 }
917}
918pub use self::usart1 as usart2;
920pub type UART4 = crate::Periph<usart1::RegisterBlock, 0x4000_4c00>;
924impl core::fmt::Debug for UART4 {
925 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
926 f.debug_struct("UART4").finish()
927 }
928}
929pub use self::usart1 as uart4;
931pub type USART3 = crate::Periph<usart1::RegisterBlock, 0x4000_4800>;
935impl core::fmt::Debug for USART3 {
936 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
937 f.debug_struct("USART3").finish()
938 }
939}
940pub use self::usart1 as usart3;
942pub type LPUART1 = crate::Periph<lpuart1::RegisterBlock, 0x4000_8000>;
946impl core::fmt::Debug for LPUART1 {
947 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
948 f.debug_struct("LPUART1").finish()
949 }
950}
951pub mod lpuart1;
953pub type SPI1 = crate::Periph<spi1::RegisterBlock, 0x4001_3000>;
957impl core::fmt::Debug for SPI1 {
958 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
959 f.debug_struct("SPI1").finish()
960 }
961}
962pub mod spi1;
964pub type SPI3 = crate::Periph<spi1::RegisterBlock, 0x4000_3c00>;
968impl core::fmt::Debug for SPI3 {
969 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
970 f.debug_struct("SPI3").finish()
971 }
972}
973pub use self::spi1 as spi3;
975pub type SPI2 = crate::Periph<spi1::RegisterBlock, 0x4000_3800>;
979impl core::fmt::Debug for SPI2 {
980 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
981 f.debug_struct("SPI2").finish()
982 }
983}
984pub use self::spi1 as spi2;
986pub type SDMMC = crate::Periph<sdmmc::RegisterBlock, 0x4001_2800>;
990impl core::fmt::Debug for SDMMC {
991 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
992 f.debug_struct("SDMMC").finish()
993 }
994}
995pub mod sdmmc;
997pub type EXTI = crate::Periph<exti::RegisterBlock, 0x4001_0400>;
1001impl core::fmt::Debug for EXTI {
1002 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1003 f.debug_struct("EXTI").finish()
1004 }
1005}
1006pub mod exti;
1008pub type VREFBUF = crate::Periph<vrefbuf::RegisterBlock, 0x4001_0030>;
1012impl core::fmt::Debug for VREFBUF {
1013 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1014 f.debug_struct("VREFBUF").finish()
1015 }
1016}
1017pub mod vrefbuf;
1019pub type CAN1 = crate::Periph<can1::RegisterBlock, 0x4000_6400>;
1023impl core::fmt::Debug for CAN1 {
1024 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1025 f.debug_struct("CAN1").finish()
1026 }
1027}
1028pub mod can1;
1030pub type RTC = crate::Periph<rtc::RegisterBlock, 0x4000_2800>;
1034impl core::fmt::Debug for RTC {
1035 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1036 f.debug_struct("RTC").finish()
1037 }
1038}
1039pub mod rtc;
1041pub type SWPMI1 = crate::Periph<swpmi1::RegisterBlock, 0x4000_8800>;
1045impl core::fmt::Debug for SWPMI1 {
1046 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1047 f.debug_struct("SWPMI1").finish()
1048 }
1049}
1050pub mod swpmi1;
1052pub type OPAMP = crate::Periph<opamp::RegisterBlock, 0x4000_7800>;
1056impl core::fmt::Debug for OPAMP {
1057 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1058 f.debug_struct("OPAMP").finish()
1059 }
1060}
1061pub mod opamp;
1063pub type CRS = crate::Periph<crs::RegisterBlock, 0x4000_6000>;
1067impl core::fmt::Debug for CRS {
1068 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1069 f.debug_struct("CRS").finish()
1070 }
1071}
1072pub mod crs;
1074pub type USB_SRAM = crate::Periph<usb_sram::RegisterBlock, 0x4000_6c00>;
1078impl core::fmt::Debug for USB_SRAM {
1079 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1080 f.debug_struct("USB_SRAM").finish()
1081 }
1082}
1083pub mod usb_sram;
1085pub type USB_FS = crate::Periph<usb_sram::RegisterBlock, 0x4000_6800>;
1089impl core::fmt::Debug for USB_FS {
1090 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1091 f.debug_struct("USB_FS").finish()
1092 }
1093}
1094pub use self::usb_sram as usb_fs;
1096pub type DFSDM = crate::Periph<dfsdm::RegisterBlock, 0x4001_6000>;
1100impl core::fmt::Debug for DFSDM {
1101 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1102 f.debug_struct("DFSDM").finish()
1103 }
1104}
1105pub mod dfsdm;
1107pub type QUADSPI = crate::Periph<quadspi::RegisterBlock, 0xa000_1000>;
1111impl core::fmt::Debug for QUADSPI {
1112 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1113 f.debug_struct("QUADSPI").finish()
1114 }
1115}
1116pub mod quadspi;
1118pub type DBGMCU = crate::Periph<dbgmcu::RegisterBlock, 0xe004_2000>;
1122impl core::fmt::Debug for DBGMCU {
1123 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1124 f.debug_struct("DBGMCU").finish()
1125 }
1126}
1127pub mod dbgmcu;
1129#[no_mangle]
1130static mut DEVICE_PERIPHERALS: bool = false;
1131#[allow(non_snake_case)]
1133pub struct Peripherals {
1134 pub DAC: DAC,
1136 pub DMA1: DMA1,
1138 pub DMA2: DMA2,
1140 pub CRC: CRC,
1142 pub LCD: LCD,
1144 pub TSC: TSC,
1146 pub IWDG: IWDG,
1148 pub WWDG: WWDG,
1150 pub COMP: COMP,
1152 pub FIREWALL: FIREWALL,
1154 pub I2C1: I2C1,
1156 pub I2C3: I2C3,
1158 pub I2C2: I2C2,
1160 pub FLASH: FLASH,
1162 pub RCC: RCC,
1164 pub PWR: PWR,
1166 pub SYSCFG: SYSCFG,
1168 pub RNG: RNG,
1170 pub AES: AES,
1172 pub ADC1: ADC1,
1174 pub ADC2: ADC2,
1176 pub ADC3: ADC3,
1178 pub ADC123_COMMON: ADC123_COMMON,
1180 pub ADC_COMMON: ADC_COMMON,
1182 pub GPIOA: GPIOA,
1184 pub GPIOB: GPIOB,
1186 pub GPIOC: GPIOC,
1188 pub GPIOD: GPIOD,
1190 pub GPIOE: GPIOE,
1192 pub GPIOF: GPIOF,
1194 pub GPIOG: GPIOG,
1196 pub GPIOH: GPIOH,
1198 pub SAI1: SAI1,
1200 pub TIM2: TIM2,
1202 pub TIM3: TIM3,
1204 pub TIM4: TIM4,
1206 pub TIM5: TIM5,
1208 pub TIM15: TIM15,
1210 pub TIM16: TIM16,
1212 pub TIM17: TIM17,
1214 pub TIM1: TIM1,
1216 pub TIM8: TIM8,
1218 pub TIM6: TIM6,
1220 pub TIM7: TIM7,
1222 pub LPTIM1: LPTIM1,
1224 pub LPTIM2: LPTIM2,
1226 pub USART1: USART1,
1228 pub USART2: USART2,
1230 pub UART4: UART4,
1232 pub USART3: USART3,
1234 pub LPUART1: LPUART1,
1236 pub SPI1: SPI1,
1238 pub SPI3: SPI3,
1240 pub SPI2: SPI2,
1242 pub SDMMC: SDMMC,
1244 pub EXTI: EXTI,
1246 pub VREFBUF: VREFBUF,
1248 pub CAN1: CAN1,
1250 pub RTC: RTC,
1252 pub SWPMI1: SWPMI1,
1254 pub OPAMP: OPAMP,
1256 pub CRS: CRS,
1258 pub USB_SRAM: USB_SRAM,
1260 pub USB_FS: USB_FS,
1262 pub DFSDM: DFSDM,
1264 pub QUADSPI: QUADSPI,
1266 pub DBGMCU: DBGMCU,
1268}
1269impl Peripherals {
1270 #[cfg(feature = "critical-section")]
1272 #[inline]
1273 pub fn take() -> Option<Self> {
1274 critical_section::with(|_| {
1275 if unsafe { DEVICE_PERIPHERALS } {
1276 return None;
1277 }
1278 Some(unsafe { Peripherals::steal() })
1279 })
1280 }
1281 #[inline]
1287 pub unsafe fn steal() -> Self {
1288 DEVICE_PERIPHERALS = true;
1289 Peripherals {
1290 DAC: DAC::steal(),
1291 DMA1: DMA1::steal(),
1292 DMA2: DMA2::steal(),
1293 CRC: CRC::steal(),
1294 LCD: LCD::steal(),
1295 TSC: TSC::steal(),
1296 IWDG: IWDG::steal(),
1297 WWDG: WWDG::steal(),
1298 COMP: COMP::steal(),
1299 FIREWALL: FIREWALL::steal(),
1300 I2C1: I2C1::steal(),
1301 I2C3: I2C3::steal(),
1302 I2C2: I2C2::steal(),
1303 FLASH: FLASH::steal(),
1304 RCC: RCC::steal(),
1305 PWR: PWR::steal(),
1306 SYSCFG: SYSCFG::steal(),
1307 RNG: RNG::steal(),
1308 AES: AES::steal(),
1309 ADC1: ADC1::steal(),
1310 ADC2: ADC2::steal(),
1311 ADC3: ADC3::steal(),
1312 ADC123_COMMON: ADC123_COMMON::steal(),
1313 ADC_COMMON: ADC_COMMON::steal(),
1314 GPIOA: GPIOA::steal(),
1315 GPIOB: GPIOB::steal(),
1316 GPIOC: GPIOC::steal(),
1317 GPIOD: GPIOD::steal(),
1318 GPIOE: GPIOE::steal(),
1319 GPIOF: GPIOF::steal(),
1320 GPIOG: GPIOG::steal(),
1321 GPIOH: GPIOH::steal(),
1322 SAI1: SAI1::steal(),
1323 TIM2: TIM2::steal(),
1324 TIM3: TIM3::steal(),
1325 TIM4: TIM4::steal(),
1326 TIM5: TIM5::steal(),
1327 TIM15: TIM15::steal(),
1328 TIM16: TIM16::steal(),
1329 TIM17: TIM17::steal(),
1330 TIM1: TIM1::steal(),
1331 TIM8: TIM8::steal(),
1332 TIM6: TIM6::steal(),
1333 TIM7: TIM7::steal(),
1334 LPTIM1: LPTIM1::steal(),
1335 LPTIM2: LPTIM2::steal(),
1336 USART1: USART1::steal(),
1337 USART2: USART2::steal(),
1338 UART4: UART4::steal(),
1339 USART3: USART3::steal(),
1340 LPUART1: LPUART1::steal(),
1341 SPI1: SPI1::steal(),
1342 SPI3: SPI3::steal(),
1343 SPI2: SPI2::steal(),
1344 SDMMC: SDMMC::steal(),
1345 EXTI: EXTI::steal(),
1346 VREFBUF: VREFBUF::steal(),
1347 CAN1: CAN1::steal(),
1348 RTC: RTC::steal(),
1349 SWPMI1: SWPMI1::steal(),
1350 OPAMP: OPAMP::steal(),
1351 CRS: CRS::steal(),
1352 USB_SRAM: USB_SRAM::steal(),
1353 USB_FS: USB_FS::steal(),
1354 DFSDM: DFSDM::steal(),
1355 QUADSPI: QUADSPI::steal(),
1356 DBGMCU: DBGMCU::steal(),
1357 }
1358 }
1359}