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, FPU, 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_PVM();
24 fn RTC_TAMP_CSS_LSE();
25 fn RTC_WKUP();
26 fn FLASH();
27 fn RCC();
28 fn EXTI0();
29 fn EXTI1();
30 fn EXTI2();
31 fn EXTI3();
32 fn EXTI4();
33 fn DMA1_CH1();
34 fn DMA1_CH2();
35 fn DMA1_CH3();
36 fn DMA1_CH4();
37 fn DMA1_CH5();
38 fn DMA1_CH6();
39 fn ADC1_2();
40 fn USB_HP();
41 fn USB_LP();
42 fn FDCAN1_IT0();
43 fn FDCAN1_IT1();
44 fn EXTI9_5();
45 fn TIM1_BRK_TIM15();
46 fn TIM1_UP_TIM16();
47 fn TIM1_TRG_COM();
48 fn TIM1_CC();
49 fn TIM2();
50 fn TIM3();
51 fn TIM4();
52 fn I2C1_EV();
53 fn I2C1_ER();
54 fn I2C2_EV();
55 fn I2C2_ER();
56 fn SPI1();
57 fn SPI2();
58 fn USART1();
59 fn USART2();
60 fn USART3();
61 fn EXTI15_10();
62 fn RTC_ALARM();
63 fn USBWAKE_UP();
64 fn TIM8_BRK();
65 fn TIM8_UP();
66 fn TIM8_TRG_COM();
67 fn TIM8_CC();
68 fn LPTIM1();
69 fn SPI3();
70 fn UART4();
71 fn TIM6_DACUNDER();
72 fn TIM7();
73 fn DMA2_CH1();
74 fn DMA2_CH2();
75 fn DMA2_CH3();
76 fn DMA2_CH4();
77 fn DMA2_CH5();
78 fn UCPD1();
79 fn COMP1_2_3();
80 fn COMP4_5_6();
81 fn COMP7();
82 fn CRS();
83 fn SAI();
84 fn TIM20_BRK();
85 fn TIM20_UP();
86 fn TIM20_TRG_COM();
87 fn TIM20_CC();
88 fn FPU();
89 fn AES();
90 fn RNG();
91 fn LPUART();
92 fn I2C3_EV();
93 fn I2C3_ER();
94 fn DMAMUX_OVR();
95 fn DMA2_CH6();
96 fn CORDIC();
97 fn FMAC();
98}
99#[doc(hidden)]
100#[repr(C)]
101pub union Vector {
102 _handler: unsafe extern "C" fn(),
103 _reserved: u32,
104}
105#[cfg(feature = "rt")]
106#[doc(hidden)]
107#[link_section = ".vector_table.interrupts"]
108#[no_mangle]
109pub static __INTERRUPTS: [Vector; 102] = [
110 Vector { _handler: WWDG },
111 Vector { _handler: PVD_PVM },
112 Vector {
113 _handler: RTC_TAMP_CSS_LSE,
114 },
115 Vector { _handler: RTC_WKUP },
116 Vector { _handler: FLASH },
117 Vector { _handler: RCC },
118 Vector { _handler: EXTI0 },
119 Vector { _handler: EXTI1 },
120 Vector { _handler: EXTI2 },
121 Vector { _handler: EXTI3 },
122 Vector { _handler: EXTI4 },
123 Vector { _handler: DMA1_CH1 },
124 Vector { _handler: DMA1_CH2 },
125 Vector { _handler: DMA1_CH3 },
126 Vector { _handler: DMA1_CH4 },
127 Vector { _handler: DMA1_CH5 },
128 Vector { _handler: DMA1_CH6 },
129 Vector { _reserved: 0 },
130 Vector { _handler: ADC1_2 },
131 Vector { _handler: USB_HP },
132 Vector { _handler: USB_LP },
133 Vector { _handler: FDCAN1_IT0 },
134 Vector { _handler: FDCAN1_IT1 },
135 Vector { _handler: EXTI9_5 },
136 Vector { _handler: TIM1_BRK_TIM15 },
137 Vector { _handler: TIM1_UP_TIM16 },
138 Vector { _handler: TIM1_TRG_COM },
139 Vector { _handler: TIM1_CC },
140 Vector { _handler: TIM2 },
141 Vector { _handler: TIM3 },
142 Vector { _handler: TIM4 },
143 Vector { _handler: I2C1_EV },
144 Vector { _handler: I2C1_ER },
145 Vector { _handler: I2C2_EV },
146 Vector { _handler: I2C2_ER },
147 Vector { _handler: SPI1 },
148 Vector { _handler: SPI2 },
149 Vector { _handler: USART1 },
150 Vector { _handler: USART2 },
151 Vector { _handler: USART3 },
152 Vector { _handler: EXTI15_10 },
153 Vector { _handler: RTC_ALARM },
154 Vector { _handler: USBWAKE_UP },
155 Vector { _handler: TIM8_BRK },
156 Vector { _handler: TIM8_UP },
157 Vector { _handler: TIM8_TRG_COM },
158 Vector { _handler: TIM8_CC },
159 Vector { _reserved: 0 },
160 Vector { _reserved: 0 },
161 Vector { _handler: LPTIM1 },
162 Vector { _reserved: 0 },
163 Vector { _handler: SPI3 },
164 Vector { _handler: UART4 },
165 Vector { _reserved: 0 },
166 Vector { _handler: TIM6_DACUNDER },
167 Vector { _handler: TIM7 },
168 Vector { _handler: DMA2_CH1 },
169 Vector { _handler: DMA2_CH2 },
170 Vector { _handler: DMA2_CH3 },
171 Vector { _handler: DMA2_CH4 },
172 Vector { _handler: DMA2_CH5 },
173 Vector { _reserved: 0 },
174 Vector { _reserved: 0 },
175 Vector { _handler: UCPD1 },
176 Vector { _handler: COMP1_2_3 },
177 Vector { _handler: COMP4_5_6 },
178 Vector { _handler: COMP7 },
179 Vector { _reserved: 0 },
180 Vector { _reserved: 0 },
181 Vector { _reserved: 0 },
182 Vector { _reserved: 0 },
183 Vector { _reserved: 0 },
184 Vector { _reserved: 0 },
185 Vector { _reserved: 0 },
186 Vector { _reserved: 0 },
187 Vector { _handler: CRS },
188 Vector { _handler: SAI },
189 Vector { _handler: TIM20_BRK },
190 Vector { _handler: TIM20_UP },
191 Vector { _handler: TIM20_TRG_COM },
192 Vector { _handler: TIM20_CC },
193 Vector { _handler: FPU },
194 Vector { _reserved: 0 },
195 Vector { _reserved: 0 },
196 Vector { _reserved: 0 },
197 Vector { _handler: AES },
198 Vector { _reserved: 0 },
199 Vector { _reserved: 0 },
200 Vector { _reserved: 0 },
201 Vector { _reserved: 0 },
202 Vector { _handler: RNG },
203 Vector { _handler: LPUART },
204 Vector { _handler: I2C3_EV },
205 Vector { _handler: I2C3_ER },
206 Vector { _handler: DMAMUX_OVR },
207 Vector { _reserved: 0 },
208 Vector { _reserved: 0 },
209 Vector { _handler: DMA2_CH6 },
210 Vector { _reserved: 0 },
211 Vector { _reserved: 0 },
212 Vector { _handler: CORDIC },
213 Vector { _handler: FMAC },
214];
215#[cfg_attr(feature = "defmt", derive(defmt::Format))]
217#[derive(Copy, Clone, Debug, PartialEq, Eq)]
218#[repr(u16)]
219pub enum Interrupt {
220 WWDG = 0,
222 PVD_PVM = 1,
224 RTC_TAMP_CSS_LSE = 2,
226 RTC_WKUP = 3,
228 FLASH = 4,
230 RCC = 5,
232 EXTI0 = 6,
234 EXTI1 = 7,
236 EXTI2 = 8,
238 EXTI3 = 9,
240 EXTI4 = 10,
242 DMA1_CH1 = 11,
244 DMA1_CH2 = 12,
246 DMA1_CH3 = 13,
248 DMA1_CH4 = 14,
250 DMA1_CH5 = 15,
252 DMA1_CH6 = 16,
254 ADC1_2 = 18,
256 USB_HP = 19,
258 USB_LP = 20,
260 FDCAN1_IT0 = 21,
262 FDCAN1_IT1 = 22,
264 EXTI9_5 = 23,
266 TIM1_BRK_TIM15 = 24,
268 TIM1_UP_TIM16 = 25,
270 TIM1_TRG_COM = 26,
272 TIM1_CC = 27,
274 TIM2 = 28,
276 TIM3 = 29,
278 TIM4 = 30,
280 I2C1_EV = 31,
282 I2C1_ER = 32,
284 I2C2_EV = 33,
286 I2C2_ER = 34,
288 SPI1 = 35,
290 SPI2 = 36,
292 USART1 = 37,
294 USART2 = 38,
296 USART3 = 39,
298 EXTI15_10 = 40,
300 RTC_ALARM = 41,
302 USBWAKE_UP = 42,
304 TIM8_BRK = 43,
306 TIM8_UP = 44,
308 TIM8_TRG_COM = 45,
310 TIM8_CC = 46,
312 LPTIM1 = 49,
314 SPI3 = 51,
316 UART4 = 52,
318 TIM6_DACUNDER = 54,
320 TIM7 = 55,
322 DMA2_CH1 = 56,
324 DMA2_CH2 = 57,
326 DMA2_CH3 = 58,
328 DMA2_CH4 = 59,
330 DMA2_CH5 = 60,
332 UCPD1 = 63,
334 COMP1_2_3 = 64,
336 COMP4_5_6 = 65,
338 COMP7 = 66,
340 CRS = 75,
342 SAI = 76,
344 TIM20_BRK = 77,
346 TIM20_UP = 78,
348 TIM20_TRG_COM = 79,
350 TIM20_CC = 80,
352 FPU = 81,
354 AES = 85,
356 RNG = 90,
358 LPUART = 91,
360 I2C3_EV = 92,
362 I2C3_ER = 93,
364 DMAMUX_OVR = 94,
366 DMA2_CH6 = 97,
368 CORDIC = 100,
370 FMAC = 101,
372}
373unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
374 #[inline(always)]
375 fn number(self) -> u16 {
376 self as u16
377 }
378}
379pub type CRC = crate::Periph<crc::RegisterBlock, 0x4002_3000>;
383impl core::fmt::Debug for CRC {
384 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
385 f.debug_struct("CRC").finish()
386 }
387}
388pub mod crc;
390pub type IWDG = crate::Periph<iwdg::RegisterBlock, 0x4000_3000>;
394impl core::fmt::Debug for IWDG {
395 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
396 f.debug_struct("IWDG").finish()
397 }
398}
399pub mod iwdg;
401pub type WWDG = crate::Periph<wwdg::RegisterBlock, 0x4000_2c00>;
405impl core::fmt::Debug for WWDG {
406 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
407 f.debug_struct("WWDG").finish()
408 }
409}
410pub mod wwdg;
412pub type I2C1 = crate::Periph<i2c1::RegisterBlock, 0x4000_5400>;
416impl core::fmt::Debug for I2C1 {
417 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
418 f.debug_struct("I2C1").finish()
419 }
420}
421pub mod i2c1;
423pub type I2C2 = crate::Periph<i2c1::RegisterBlock, 0x4000_5800>;
427impl core::fmt::Debug for I2C2 {
428 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
429 f.debug_struct("I2C2").finish()
430 }
431}
432pub use self::i2c1 as i2c2;
434pub type I2C3 = crate::Periph<i2c1::RegisterBlock, 0x4000_7800>;
438impl core::fmt::Debug for I2C3 {
439 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
440 f.debug_struct("I2C3").finish()
441 }
442}
443pub use self::i2c1 as i2c3;
445pub type FLASH = crate::Periph<flash::RegisterBlock, 0x4002_2000>;
449impl core::fmt::Debug for FLASH {
450 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
451 f.debug_struct("FLASH").finish()
452 }
453}
454pub mod flash;
456pub type DBGMCU = crate::Periph<dbgmcu::RegisterBlock, 0xe004_2000>;
460impl core::fmt::Debug for DBGMCU {
461 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
462 f.debug_struct("DBGMCU").finish()
463 }
464}
465pub mod dbgmcu;
467pub type RCC = crate::Periph<rcc::RegisterBlock, 0x4002_1000>;
471impl core::fmt::Debug for RCC {
472 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
473 f.debug_struct("RCC").finish()
474 }
475}
476pub mod rcc;
478pub type PWR = crate::Periph<pwr::RegisterBlock, 0x4000_7000>;
482impl core::fmt::Debug for PWR {
483 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
484 f.debug_struct("PWR").finish()
485 }
486}
487pub mod pwr;
489pub type RNG = crate::Periph<rng::RegisterBlock, 0x5006_0800>;
493impl core::fmt::Debug for RNG {
494 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
495 f.debug_struct("RNG").finish()
496 }
497}
498pub mod rng;
500pub type AES = crate::Periph<aes::RegisterBlock, 0x5006_0000>;
504impl core::fmt::Debug for AES {
505 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
506 f.debug_struct("AES").finish()
507 }
508}
509pub mod aes;
511pub type GPIOA = crate::Periph<gpioa::RegisterBlock, 0x4800_0000>;
515impl core::fmt::Debug for GPIOA {
516 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
517 f.debug_struct("GPIOA").finish()
518 }
519}
520pub mod gpioa;
522pub type GPIOB = crate::Periph<gpiob::RegisterBlock, 0x4800_0400>;
526impl core::fmt::Debug for GPIOB {
527 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
528 f.debug_struct("GPIOB").finish()
529 }
530}
531pub mod gpiob;
533pub type GPIOC = crate::Periph<gpioc::RegisterBlock, 0x4800_0800>;
537impl core::fmt::Debug for GPIOC {
538 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
539 f.debug_struct("GPIOC").finish()
540 }
541}
542pub mod gpioc;
544pub type GPIOD = crate::Periph<gpioc::RegisterBlock, 0x4800_0c00>;
548impl core::fmt::Debug for GPIOD {
549 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
550 f.debug_struct("GPIOD").finish()
551 }
552}
553pub use self::gpioc as gpiod;
555pub type GPIOE = crate::Periph<gpioc::RegisterBlock, 0x4800_1000>;
559impl core::fmt::Debug for GPIOE {
560 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
561 f.debug_struct("GPIOE").finish()
562 }
563}
564pub use self::gpioc as gpioe;
566pub type GPIOF = crate::Periph<gpioc::RegisterBlock, 0x4800_1400>;
570impl core::fmt::Debug for GPIOF {
571 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
572 f.debug_struct("GPIOF").finish()
573 }
574}
575pub use self::gpioc as gpiof;
577pub type GPIOG = crate::Periph<gpioc::RegisterBlock, 0x4800_1800>;
581impl core::fmt::Debug for GPIOG {
582 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
583 f.debug_struct("GPIOG").finish()
584 }
585}
586pub use self::gpioc as gpiog;
588pub type TIM15 = crate::Periph<tim15::RegisterBlock, 0x4001_4000>;
592impl core::fmt::Debug for TIM15 {
593 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
594 f.debug_struct("TIM15").finish()
595 }
596}
597pub mod tim15;
599pub type TIM16 = crate::Periph<tim16::RegisterBlock, 0x4001_4400>;
603impl core::fmt::Debug for TIM16 {
604 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
605 f.debug_struct("TIM16").finish()
606 }
607}
608pub mod tim16;
610pub type TIM17 = crate::Periph<tim16::RegisterBlock, 0x4001_4800>;
614impl core::fmt::Debug for TIM17 {
615 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
616 f.debug_struct("TIM17").finish()
617 }
618}
619pub use self::tim16 as tim17;
621pub type TIM1 = crate::Periph<tim1::RegisterBlock, 0x4001_2c00>;
625impl core::fmt::Debug for TIM1 {
626 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
627 f.debug_struct("TIM1").finish()
628 }
629}
630pub mod tim1;
632pub type TIM8 = crate::Periph<tim1::RegisterBlock, 0x4001_3400>;
636impl core::fmt::Debug for TIM8 {
637 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
638 f.debug_struct("TIM8").finish()
639 }
640}
641pub use self::tim1 as tim8;
643pub type TIM20 = crate::Periph<tim1::RegisterBlock, 0x4001_5000>;
647impl core::fmt::Debug for TIM20 {
648 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
649 f.debug_struct("TIM20").finish()
650 }
651}
652pub use self::tim1 as tim20;
654pub type TIM2 = crate::Periph<tim2::RegisterBlock, 0x4000_0000>;
658impl core::fmt::Debug for TIM2 {
659 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
660 f.debug_struct("TIM2").finish()
661 }
662}
663pub mod tim2;
665pub type TIM3 = crate::Periph<tim3::RegisterBlock, 0x4000_0400>;
669impl core::fmt::Debug for TIM3 {
670 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
671 f.debug_struct("TIM3").finish()
672 }
673}
674pub mod tim3;
676pub type TIM4 = crate::Periph<tim3::RegisterBlock, 0x4000_0800>;
680impl core::fmt::Debug for TIM4 {
681 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
682 f.debug_struct("TIM4").finish()
683 }
684}
685pub use self::tim3 as tim4;
687pub type TIM6 = crate::Periph<tim6::RegisterBlock, 0x4000_1000>;
691impl core::fmt::Debug for TIM6 {
692 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
693 f.debug_struct("TIM6").finish()
694 }
695}
696pub mod tim6;
698pub type TIM7 = crate::Periph<tim6::RegisterBlock, 0x4000_1400>;
702impl core::fmt::Debug for TIM7 {
703 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
704 f.debug_struct("TIM7").finish()
705 }
706}
707pub use self::tim6 as tim7;
709pub type LPTIMER1 = crate::Periph<lptimer1::RegisterBlock, 0x4000_7c00>;
713impl core::fmt::Debug for LPTIMER1 {
714 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
715 f.debug_struct("LPTIMER1").finish()
716 }
717}
718pub mod lptimer1;
720pub type USART1 = crate::Periph<usart1::RegisterBlock, 0x4001_3800>;
724impl core::fmt::Debug for USART1 {
725 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
726 f.debug_struct("USART1").finish()
727 }
728}
729pub mod usart1;
731pub type USART2 = crate::Periph<usart1::RegisterBlock, 0x4000_4400>;
735impl core::fmt::Debug for USART2 {
736 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
737 f.debug_struct("USART2").finish()
738 }
739}
740pub use self::usart1 as usart2;
742pub type USART3 = crate::Periph<usart1::RegisterBlock, 0x4000_4800>;
746impl core::fmt::Debug for USART3 {
747 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
748 f.debug_struct("USART3").finish()
749 }
750}
751pub use self::usart1 as usart3;
753pub type UART4 = crate::Periph<uart4::RegisterBlock, 0x4000_4c00>;
757impl core::fmt::Debug for UART4 {
758 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
759 f.debug_struct("UART4").finish()
760 }
761}
762pub mod uart4;
764pub type LPUART1 = crate::Periph<lpuart1::RegisterBlock, 0x4000_8000>;
768impl core::fmt::Debug for LPUART1 {
769 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
770 f.debug_struct("LPUART1").finish()
771 }
772}
773pub mod lpuart1;
775pub type SPI1 = crate::Periph<spi1::RegisterBlock, 0x4001_3000>;
779impl core::fmt::Debug for SPI1 {
780 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
781 f.debug_struct("SPI1").finish()
782 }
783}
784pub mod spi1;
786pub type SPI3 = crate::Periph<spi1::RegisterBlock, 0x4000_3c00>;
790impl core::fmt::Debug for SPI3 {
791 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
792 f.debug_struct("SPI3").finish()
793 }
794}
795pub use self::spi1 as spi3;
797pub type SPI2 = crate::Periph<spi1::RegisterBlock, 0x4000_3800>;
801impl core::fmt::Debug for SPI2 {
802 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
803 f.debug_struct("SPI2").finish()
804 }
805}
806pub use self::spi1 as spi2;
808pub type EXTI = crate::Periph<exti::RegisterBlock, 0x4001_0400>;
812impl core::fmt::Debug for EXTI {
813 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
814 f.debug_struct("EXTI").finish()
815 }
816}
817pub mod exti;
819pub type RTC = crate::Periph<rtc::RegisterBlock, 0x4000_2800>;
823impl core::fmt::Debug for RTC {
824 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
825 f.debug_struct("RTC").finish()
826 }
827}
828pub mod rtc;
830pub type DMA1 = crate::Periph<dma1::RegisterBlock, 0x4002_0000>;
834impl core::fmt::Debug for DMA1 {
835 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
836 f.debug_struct("DMA1").finish()
837 }
838}
839pub mod dma1;
841pub type DMA2 = crate::Periph<dma1::RegisterBlock, 0x4002_0400>;
845impl core::fmt::Debug for DMA2 {
846 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
847 f.debug_struct("DMA2").finish()
848 }
849}
850pub use self::dma1 as dma2;
852pub type DMAMUX = crate::Periph<dmamux::RegisterBlock, 0x4002_0800>;
856impl core::fmt::Debug for DMAMUX {
857 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
858 f.debug_struct("DMAMUX").finish()
859 }
860}
861pub mod dmamux;
863pub type SYSCFG = crate::Periph<syscfg::RegisterBlock, 0x4001_0000>;
867impl core::fmt::Debug for SYSCFG {
868 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
869 f.debug_struct("SYSCFG").finish()
870 }
871}
872pub mod syscfg;
874pub type VREFBUF = crate::Periph<vrefbuf::RegisterBlock, 0x4001_0030>;
878impl core::fmt::Debug for VREFBUF {
879 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
880 f.debug_struct("VREFBUF").finish()
881 }
882}
883pub mod vrefbuf;
885pub type COMP = crate::Periph<comp::RegisterBlock, 0x4001_0200>;
889impl core::fmt::Debug for COMP {
890 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
891 f.debug_struct("COMP").finish()
892 }
893}
894pub mod comp;
896pub type OPAMP = crate::Periph<opamp::RegisterBlock, 0x4001_0300>;
900impl core::fmt::Debug for OPAMP {
901 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
902 f.debug_struct("OPAMP").finish()
903 }
904}
905pub mod opamp;
907pub type DAC1 = crate::Periph<dac1::RegisterBlock, 0x5000_0800>;
911impl core::fmt::Debug for DAC1 {
912 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
913 f.debug_struct("DAC1").finish()
914 }
915}
916pub mod dac1;
918pub type DAC2 = crate::Periph<dac1::RegisterBlock, 0x5000_0c00>;
922impl core::fmt::Debug for DAC2 {
923 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
924 f.debug_struct("DAC2").finish()
925 }
926}
927pub use self::dac1 as dac2;
929pub type DAC3 = crate::Periph<dac1::RegisterBlock, 0x5000_1000>;
933impl core::fmt::Debug for DAC3 {
934 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
935 f.debug_struct("DAC3").finish()
936 }
937}
938pub use self::dac1 as dac3;
940pub type DAC4 = crate::Periph<dac1::RegisterBlock, 0x5000_1400>;
944impl core::fmt::Debug for DAC4 {
945 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
946 f.debug_struct("DAC4").finish()
947 }
948}
949pub use self::dac1 as dac4;
951pub type ADC1 = crate::Periph<adc1::RegisterBlock, 0x5000_0000>;
955impl core::fmt::Debug for ADC1 {
956 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
957 f.debug_struct("ADC1").finish()
958 }
959}
960pub mod adc1;
962pub type ADC2 = crate::Periph<adc1::RegisterBlock, 0x5000_0100>;
966impl core::fmt::Debug for ADC2 {
967 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
968 f.debug_struct("ADC2").finish()
969 }
970}
971pub use self::adc1 as adc2;
973pub type ADC12_COMMON = crate::Periph<adc12_common::RegisterBlock, 0x5000_0300>;
977impl core::fmt::Debug for ADC12_COMMON {
978 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
979 f.debug_struct("ADC12_COMMON").finish()
980 }
981}
982pub mod adc12_common;
984pub type ADC345_COMMON = crate::Periph<adc12_common::RegisterBlock, 0x5000_0700>;
988impl core::fmt::Debug for ADC345_COMMON {
989 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
990 f.debug_struct("ADC345_COMMON").finish()
991 }
992}
993pub use self::adc12_common as adc345_common;
995pub type FMAC = crate::Periph<fmac::RegisterBlock, 0x4002_1400>;
999impl core::fmt::Debug for FMAC {
1000 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1001 f.debug_struct("FMAC").finish()
1002 }
1003}
1004pub mod fmac;
1006pub type CORDIC = crate::Periph<cordic::RegisterBlock, 0x4002_0c00>;
1010impl core::fmt::Debug for CORDIC {
1011 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1012 f.debug_struct("CORDIC").finish()
1013 }
1014}
1015pub mod cordic;
1017pub type SAI = crate::Periph<sai::RegisterBlock, 0x4001_5400>;
1021impl core::fmt::Debug for SAI {
1022 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1023 f.debug_struct("SAI").finish()
1024 }
1025}
1026pub mod sai;
1028pub type TAMP = crate::Periph<tamp::RegisterBlock, 0x4000_2400>;
1032impl core::fmt::Debug for TAMP {
1033 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1034 f.debug_struct("TAMP").finish()
1035 }
1036}
1037pub mod tamp;
1039pub type FDCAN = crate::Periph<fdcan::RegisterBlock, 0x4000_a400>;
1043impl core::fmt::Debug for FDCAN {
1044 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1045 f.debug_struct("FDCAN").finish()
1046 }
1047}
1048pub mod fdcan;
1050pub type FDCAN1 = crate::Periph<fdcan::RegisterBlock, 0x4000_6400>;
1054impl core::fmt::Debug for FDCAN1 {
1055 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1056 f.debug_struct("FDCAN1").finish()
1057 }
1058}
1059pub use self::fdcan as fdcan1;
1061pub type UCPD1 = crate::Periph<ucpd1::RegisterBlock, 0x4000_a000>;
1065impl core::fmt::Debug for UCPD1 {
1066 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1067 f.debug_struct("UCPD1").finish()
1068 }
1069}
1070pub mod ucpd1;
1072pub type USB = crate::Periph<usb::RegisterBlock, 0x4000_5c00>;
1076impl core::fmt::Debug for USB {
1077 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1078 f.debug_struct("USB").finish()
1079 }
1080}
1081pub mod usb;
1083pub type CRS = crate::Periph<crs::RegisterBlock, 0x4000_2000>;
1087impl core::fmt::Debug for CRS {
1088 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1089 f.debug_struct("CRS").finish()
1090 }
1091}
1092pub mod crs;
1094#[no_mangle]
1095static mut DEVICE_PERIPHERALS: bool = false;
1096#[allow(non_snake_case)]
1098pub struct Peripherals {
1099 pub CRC: CRC,
1101 pub IWDG: IWDG,
1103 pub WWDG: WWDG,
1105 pub I2C1: I2C1,
1107 pub I2C2: I2C2,
1109 pub I2C3: I2C3,
1111 pub FLASH: FLASH,
1113 pub DBGMCU: DBGMCU,
1115 pub RCC: RCC,
1117 pub PWR: PWR,
1119 pub RNG: RNG,
1121 pub AES: AES,
1123 pub GPIOA: GPIOA,
1125 pub GPIOB: GPIOB,
1127 pub GPIOC: GPIOC,
1129 pub GPIOD: GPIOD,
1131 pub GPIOE: GPIOE,
1133 pub GPIOF: GPIOF,
1135 pub GPIOG: GPIOG,
1137 pub TIM15: TIM15,
1139 pub TIM16: TIM16,
1141 pub TIM17: TIM17,
1143 pub TIM1: TIM1,
1145 pub TIM8: TIM8,
1147 pub TIM20: TIM20,
1149 pub TIM2: TIM2,
1151 pub TIM3: TIM3,
1153 pub TIM4: TIM4,
1155 pub TIM6: TIM6,
1157 pub TIM7: TIM7,
1159 pub LPTIMER1: LPTIMER1,
1161 pub USART1: USART1,
1163 pub USART2: USART2,
1165 pub USART3: USART3,
1167 pub UART4: UART4,
1169 pub LPUART1: LPUART1,
1171 pub SPI1: SPI1,
1173 pub SPI3: SPI3,
1175 pub SPI2: SPI2,
1177 pub EXTI: EXTI,
1179 pub RTC: RTC,
1181 pub DMA1: DMA1,
1183 pub DMA2: DMA2,
1185 pub DMAMUX: DMAMUX,
1187 pub SYSCFG: SYSCFG,
1189 pub VREFBUF: VREFBUF,
1191 pub COMP: COMP,
1193 pub OPAMP: OPAMP,
1195 pub DAC1: DAC1,
1197 pub DAC2: DAC2,
1199 pub DAC3: DAC3,
1201 pub DAC4: DAC4,
1203 pub ADC1: ADC1,
1205 pub ADC2: ADC2,
1207 pub ADC12_COMMON: ADC12_COMMON,
1209 pub ADC345_COMMON: ADC345_COMMON,
1211 pub FMAC: FMAC,
1213 pub CORDIC: CORDIC,
1215 pub SAI: SAI,
1217 pub TAMP: TAMP,
1219 pub FDCAN: FDCAN,
1221 pub FDCAN1: FDCAN1,
1223 pub UCPD1: UCPD1,
1225 pub USB: USB,
1227 pub CRS: CRS,
1229}
1230impl Peripherals {
1231 #[cfg(feature = "critical-section")]
1233 #[inline]
1234 pub fn take() -> Option<Self> {
1235 critical_section::with(|_| {
1236 if unsafe { DEVICE_PERIPHERALS } {
1237 return None;
1238 }
1239 Some(unsafe { Peripherals::steal() })
1240 })
1241 }
1242 #[inline]
1248 pub unsafe fn steal() -> Self {
1249 DEVICE_PERIPHERALS = true;
1250 Peripherals {
1251 CRC: CRC::steal(),
1252 IWDG: IWDG::steal(),
1253 WWDG: WWDG::steal(),
1254 I2C1: I2C1::steal(),
1255 I2C2: I2C2::steal(),
1256 I2C3: I2C3::steal(),
1257 FLASH: FLASH::steal(),
1258 DBGMCU: DBGMCU::steal(),
1259 RCC: RCC::steal(),
1260 PWR: PWR::steal(),
1261 RNG: RNG::steal(),
1262 AES: AES::steal(),
1263 GPIOA: GPIOA::steal(),
1264 GPIOB: GPIOB::steal(),
1265 GPIOC: GPIOC::steal(),
1266 GPIOD: GPIOD::steal(),
1267 GPIOE: GPIOE::steal(),
1268 GPIOF: GPIOF::steal(),
1269 GPIOG: GPIOG::steal(),
1270 TIM15: TIM15::steal(),
1271 TIM16: TIM16::steal(),
1272 TIM17: TIM17::steal(),
1273 TIM1: TIM1::steal(),
1274 TIM8: TIM8::steal(),
1275 TIM20: TIM20::steal(),
1276 TIM2: TIM2::steal(),
1277 TIM3: TIM3::steal(),
1278 TIM4: TIM4::steal(),
1279 TIM6: TIM6::steal(),
1280 TIM7: TIM7::steal(),
1281 LPTIMER1: LPTIMER1::steal(),
1282 USART1: USART1::steal(),
1283 USART2: USART2::steal(),
1284 USART3: USART3::steal(),
1285 UART4: UART4::steal(),
1286 LPUART1: LPUART1::steal(),
1287 SPI1: SPI1::steal(),
1288 SPI3: SPI3::steal(),
1289 SPI2: SPI2::steal(),
1290 EXTI: EXTI::steal(),
1291 RTC: RTC::steal(),
1292 DMA1: DMA1::steal(),
1293 DMA2: DMA2::steal(),
1294 DMAMUX: DMAMUX::steal(),
1295 SYSCFG: SYSCFG::steal(),
1296 VREFBUF: VREFBUF::steal(),
1297 COMP: COMP::steal(),
1298 OPAMP: OPAMP::steal(),
1299 DAC1: DAC1::steal(),
1300 DAC2: DAC2::steal(),
1301 DAC3: DAC3::steal(),
1302 DAC4: DAC4::steal(),
1303 ADC1: ADC1::steal(),
1304 ADC2: ADC2::steal(),
1305 ADC12_COMMON: ADC12_COMMON::steal(),
1306 ADC345_COMMON: ADC345_COMMON::steal(),
1307 FMAC: FMAC::steal(),
1308 CORDIC: CORDIC::steal(),
1309 SAI: SAI::steal(),
1310 TAMP: TAMP::steal(),
1311 FDCAN: FDCAN::steal(),
1312 FDCAN1: FDCAN1::steal(),
1313 UCPD1: UCPD1::steal(),
1314 USB: USB::steal(),
1315 CRS: CRS::steal(),
1316 }
1317 }
1318}