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, 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();
22 fn 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_STREAM0();
32 fn DMA1_STREAM1();
33 fn DMA1_STREAM2();
34 fn DMA1_STREAM3();
35 fn DMA1_STREAM4();
36 fn DMA1_STREAM5();
37 fn DMA1_STREAM6();
38 fn ADC();
39 fn CAN1_TX();
40 fn CAN1_RX0();
41 fn CAN1_RX1();
42 fn CAN1_SCE();
43 fn EXTI9_5();
44 fn TIM1_BRK_TIM9();
45 fn TIM1_UP_TIM10();
46 fn TIM1_TRG_COM_TIM11();
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 OTG_FS_WKUP();
63 fn TIM8_BRK_TIM12();
64 fn TIM8_UP_TIM13();
65 fn TIM8_TRG_COM_TIM14();
66 fn TIM8_CC();
67 fn DMA1_STREAM7();
68 fn FSMC();
69 fn SDIO();
70 fn TIM5();
71 fn SPI3();
72 fn UART4();
73 fn UART5();
74 fn TIM6_DAC();
75 fn TIM7();
76 fn DMA2_STREAM0();
77 fn DMA2_STREAM1();
78 fn DMA2_STREAM2();
79 fn DMA2_STREAM3();
80 fn DMA2_STREAM4();
81 fn ETH();
82 fn ETH_WKUP();
83 fn CAN2_TX();
84 fn CAN2_RX0();
85 fn CAN2_RX1();
86 fn CAN2_SCE();
87 fn OTG_FS();
88 fn DMA2_STREAM5();
89 fn DMA2_STREAM6();
90 fn DMA2_STREAM7();
91 fn USART6();
92 fn I2C3_EV();
93 fn I2C3_ER();
94 fn OTG_HS_EP1_OUT();
95 fn OTG_HS_EP1_IN();
96 fn OTG_HS_WKUP();
97 fn OTG_HS();
98 fn DCMI();
99 fn CRYP();
100 fn HASH_RNG();
101}
102#[doc(hidden)]
103#[repr(C)]
104pub union Vector {
105 _handler: unsafe extern "C" fn(),
106 _reserved: u32,
107}
108#[cfg(feature = "rt")]
109#[doc(hidden)]
110#[link_section = ".vector_table.interrupts"]
111#[no_mangle]
112pub static __INTERRUPTS: [Vector; 81] = [
113 Vector { _handler: WWDG },
114 Vector { _handler: PVD },
115 Vector {
116 _handler: TAMP_STAMP,
117 },
118 Vector { _handler: RTC_WKUP },
119 Vector { _handler: FLASH },
120 Vector { _handler: RCC },
121 Vector { _handler: EXTI0 },
122 Vector { _handler: EXTI1 },
123 Vector { _handler: EXTI2 },
124 Vector { _handler: EXTI3 },
125 Vector { _handler: EXTI4 },
126 Vector {
127 _handler: DMA1_STREAM0,
128 },
129 Vector {
130 _handler: DMA1_STREAM1,
131 },
132 Vector {
133 _handler: DMA1_STREAM2,
134 },
135 Vector {
136 _handler: DMA1_STREAM3,
137 },
138 Vector {
139 _handler: DMA1_STREAM4,
140 },
141 Vector {
142 _handler: DMA1_STREAM5,
143 },
144 Vector {
145 _handler: DMA1_STREAM6,
146 },
147 Vector { _handler: ADC },
148 Vector { _handler: CAN1_TX },
149 Vector { _handler: CAN1_RX0 },
150 Vector { _handler: CAN1_RX1 },
151 Vector { _handler: CAN1_SCE },
152 Vector { _handler: EXTI9_5 },
153 Vector {
154 _handler: TIM1_BRK_TIM9,
155 },
156 Vector {
157 _handler: TIM1_UP_TIM10,
158 },
159 Vector {
160 _handler: TIM1_TRG_COM_TIM11,
161 },
162 Vector { _handler: TIM1_CC },
163 Vector { _handler: TIM2 },
164 Vector { _handler: TIM3 },
165 Vector { _handler: TIM4 },
166 Vector { _handler: I2C1_EV },
167 Vector { _handler: I2C1_ER },
168 Vector { _handler: I2C2_EV },
169 Vector { _handler: I2C2_ER },
170 Vector { _handler: SPI1 },
171 Vector { _handler: SPI2 },
172 Vector { _handler: USART1 },
173 Vector { _handler: USART2 },
174 Vector { _handler: USART3 },
175 Vector {
176 _handler: EXTI15_10,
177 },
178 Vector {
179 _handler: RTC_ALARM,
180 },
181 Vector {
182 _handler: OTG_FS_WKUP,
183 },
184 Vector {
185 _handler: TIM8_BRK_TIM12,
186 },
187 Vector {
188 _handler: TIM8_UP_TIM13,
189 },
190 Vector {
191 _handler: TIM8_TRG_COM_TIM14,
192 },
193 Vector { _handler: TIM8_CC },
194 Vector {
195 _handler: DMA1_STREAM7,
196 },
197 Vector { _handler: FSMC },
198 Vector { _handler: SDIO },
199 Vector { _handler: TIM5 },
200 Vector { _handler: SPI3 },
201 Vector { _handler: UART4 },
202 Vector { _handler: UART5 },
203 Vector { _handler: TIM6_DAC },
204 Vector { _handler: TIM7 },
205 Vector {
206 _handler: DMA2_STREAM0,
207 },
208 Vector {
209 _handler: DMA2_STREAM1,
210 },
211 Vector {
212 _handler: DMA2_STREAM2,
213 },
214 Vector {
215 _handler: DMA2_STREAM3,
216 },
217 Vector {
218 _handler: DMA2_STREAM4,
219 },
220 Vector { _handler: ETH },
221 Vector { _handler: ETH_WKUP },
222 Vector { _handler: CAN2_TX },
223 Vector { _handler: CAN2_RX0 },
224 Vector { _handler: CAN2_RX1 },
225 Vector { _handler: CAN2_SCE },
226 Vector { _handler: OTG_FS },
227 Vector {
228 _handler: DMA2_STREAM5,
229 },
230 Vector {
231 _handler: DMA2_STREAM6,
232 },
233 Vector {
234 _handler: DMA2_STREAM7,
235 },
236 Vector { _handler: USART6 },
237 Vector { _handler: I2C3_EV },
238 Vector { _handler: I2C3_ER },
239 Vector {
240 _handler: OTG_HS_EP1_OUT,
241 },
242 Vector {
243 _handler: OTG_HS_EP1_IN,
244 },
245 Vector {
246 _handler: OTG_HS_WKUP,
247 },
248 Vector { _handler: OTG_HS },
249 Vector { _handler: DCMI },
250 Vector { _handler: CRYP },
251 Vector { _handler: HASH_RNG },
252];
253#[cfg_attr(feature = "defmt", derive(defmt::Format))]
255#[derive(Copy, Clone, Debug, PartialEq, Eq)]
256#[repr(u16)]
257pub enum Interrupt {
258 WWDG = 0,
260 PVD = 1,
262 TAMP_STAMP = 2,
264 RTC_WKUP = 3,
266 FLASH = 4,
268 RCC = 5,
270 EXTI0 = 6,
272 EXTI1 = 7,
274 EXTI2 = 8,
276 EXTI3 = 9,
278 EXTI4 = 10,
280 DMA1_STREAM0 = 11,
282 DMA1_STREAM1 = 12,
284 DMA1_STREAM2 = 13,
286 DMA1_STREAM3 = 14,
288 DMA1_STREAM4 = 15,
290 DMA1_STREAM5 = 16,
292 DMA1_STREAM6 = 17,
294 ADC = 18,
296 CAN1_TX = 19,
298 CAN1_RX0 = 20,
300 CAN1_RX1 = 21,
302 CAN1_SCE = 22,
304 EXTI9_5 = 23,
306 TIM1_BRK_TIM9 = 24,
308 TIM1_UP_TIM10 = 25,
310 TIM1_TRG_COM_TIM11 = 26,
312 TIM1_CC = 27,
314 TIM2 = 28,
316 TIM3 = 29,
318 TIM4 = 30,
320 I2C1_EV = 31,
322 I2C1_ER = 32,
324 I2C2_EV = 33,
326 I2C2_ER = 34,
328 SPI1 = 35,
330 SPI2 = 36,
332 USART1 = 37,
334 USART2 = 38,
336 USART3 = 39,
338 EXTI15_10 = 40,
340 RTC_ALARM = 41,
342 OTG_FS_WKUP = 42,
344 TIM8_BRK_TIM12 = 43,
346 TIM8_UP_TIM13 = 44,
348 TIM8_TRG_COM_TIM14 = 45,
350 TIM8_CC = 46,
352 DMA1_STREAM7 = 47,
354 FSMC = 48,
356 SDIO = 49,
358 TIM5 = 50,
360 SPI3 = 51,
362 UART4 = 52,
364 UART5 = 53,
366 TIM6_DAC = 54,
368 TIM7 = 55,
370 DMA2_STREAM0 = 56,
372 DMA2_STREAM1 = 57,
374 DMA2_STREAM2 = 58,
376 DMA2_STREAM3 = 59,
378 DMA2_STREAM4 = 60,
380 ETH = 61,
382 ETH_WKUP = 62,
384 CAN2_TX = 63,
386 CAN2_RX0 = 64,
388 CAN2_RX1 = 65,
390 CAN2_SCE = 66,
392 OTG_FS = 67,
394 DMA2_STREAM5 = 68,
396 DMA2_STREAM6 = 69,
398 DMA2_STREAM7 = 70,
400 USART6 = 71,
402 I2C3_EV = 72,
404 I2C3_ER = 73,
406 OTG_HS_EP1_OUT = 74,
408 OTG_HS_EP1_IN = 75,
410 OTG_HS_WKUP = 76,
412 OTG_HS = 77,
414 DCMI = 78,
416 CRYP = 79,
418 HASH_RNG = 80,
420}
421unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
422 #[inline(always)]
423 fn number(self) -> u16 {
424 self as u16
425 }
426}
427pub type RNG = crate::Periph<rng::RegisterBlock, 0x5006_0800>;
431impl core::fmt::Debug for RNG {
432 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
433 f.debug_struct("RNG").finish()
434 }
435}
436pub mod rng;
438pub type CRC = crate::Periph<crc::RegisterBlock, 0x4002_3000>;
442impl core::fmt::Debug for CRC {
443 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
444 f.debug_struct("CRC").finish()
445 }
446}
447pub mod crc;
449pub type DCMI = crate::Periph<dcmi::RegisterBlock, 0x5005_0000>;
453impl core::fmt::Debug for DCMI {
454 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
455 f.debug_struct("DCMI").finish()
456 }
457}
458pub mod dcmi;
460pub type FSMC = crate::Periph<fsmc::RegisterBlock, 0xa000_0000>;
464impl core::fmt::Debug for FSMC {
465 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
466 f.debug_struct("FSMC").finish()
467 }
468}
469pub mod fsmc;
471pub type DBGMCU = crate::Periph<dbgmcu::RegisterBlock, 0xe004_2000>;
475impl core::fmt::Debug for DBGMCU {
476 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
477 f.debug_struct("DBGMCU").finish()
478 }
479}
480pub mod dbgmcu;
482pub type DMA2 = crate::Periph<dma2::RegisterBlock, 0x4002_6400>;
486impl core::fmt::Debug for DMA2 {
487 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
488 f.debug_struct("DMA2").finish()
489 }
490}
491pub mod dma2;
493pub type DMA1 = crate::Periph<dma2::RegisterBlock, 0x4002_6000>;
497impl core::fmt::Debug for DMA1 {
498 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
499 f.debug_struct("DMA1").finish()
500 }
501}
502pub use self::dma2 as dma1;
504pub type RCC = crate::Periph<rcc::RegisterBlock, 0x4002_3800>;
508impl core::fmt::Debug for RCC {
509 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
510 f.debug_struct("RCC").finish()
511 }
512}
513pub mod rcc;
515pub type GPIOI = crate::Periph<gpioi::RegisterBlock, 0x4002_2000>;
519impl core::fmt::Debug for GPIOI {
520 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
521 f.debug_struct("GPIOI").finish()
522 }
523}
524pub mod gpioi;
526pub type GPIOH = crate::Periph<gpioi::RegisterBlock, 0x4002_1c00>;
530impl core::fmt::Debug for GPIOH {
531 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
532 f.debug_struct("GPIOH").finish()
533 }
534}
535pub use self::gpioi as gpioh;
537pub type GPIOG = crate::Periph<gpioi::RegisterBlock, 0x4002_1800>;
541impl core::fmt::Debug for GPIOG {
542 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
543 f.debug_struct("GPIOG").finish()
544 }
545}
546pub use self::gpioi as gpiog;
548pub type GPIOF = crate::Periph<gpioi::RegisterBlock, 0x4002_1400>;
552impl core::fmt::Debug for GPIOF {
553 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
554 f.debug_struct("GPIOF").finish()
555 }
556}
557pub use self::gpioi as gpiof;
559pub type GPIOE = crate::Periph<gpioi::RegisterBlock, 0x4002_1000>;
563impl core::fmt::Debug for GPIOE {
564 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
565 f.debug_struct("GPIOE").finish()
566 }
567}
568pub use self::gpioi as gpioe;
570pub type GPIOD = crate::Periph<gpioi::RegisterBlock, 0x4002_0c00>;
574impl core::fmt::Debug for GPIOD {
575 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
576 f.debug_struct("GPIOD").finish()
577 }
578}
579pub use self::gpioi as gpiod;
581pub type GPIOC = crate::Periph<gpioi::RegisterBlock, 0x4002_0800>;
585impl core::fmt::Debug for GPIOC {
586 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
587 f.debug_struct("GPIOC").finish()
588 }
589}
590pub use self::gpioi as gpioc;
592pub type GPIOB = crate::Periph<gpiob::RegisterBlock, 0x4002_0400>;
596impl core::fmt::Debug for GPIOB {
597 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
598 f.debug_struct("GPIOB").finish()
599 }
600}
601pub mod gpiob;
603pub type GPIOA = crate::Periph<gpioa::RegisterBlock, 0x4002_0000>;
607impl core::fmt::Debug for GPIOA {
608 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
609 f.debug_struct("GPIOA").finish()
610 }
611}
612pub mod gpioa;
614pub type SYSCFG = crate::Periph<syscfg::RegisterBlock, 0x4001_3800>;
618impl core::fmt::Debug for SYSCFG {
619 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
620 f.debug_struct("SYSCFG").finish()
621 }
622}
623pub mod syscfg;
625pub type SPI1 = crate::Periph<spi1::RegisterBlock, 0x4001_3000>;
629impl core::fmt::Debug for SPI1 {
630 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
631 f.debug_struct("SPI1").finish()
632 }
633}
634pub mod spi1;
636pub type SPI3 = crate::Periph<spi1::RegisterBlock, 0x4000_3c00>;
640impl core::fmt::Debug for SPI3 {
641 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
642 f.debug_struct("SPI3").finish()
643 }
644}
645pub use self::spi1 as spi3;
647pub type SPI2 = crate::Periph<spi1::RegisterBlock, 0x4000_3800>;
651impl core::fmt::Debug for SPI2 {
652 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
653 f.debug_struct("SPI2").finish()
654 }
655}
656pub use self::spi1 as spi2;
658pub type SDIO = crate::Periph<sdio::RegisterBlock, 0x4001_2c00>;
662impl core::fmt::Debug for SDIO {
663 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
664 f.debug_struct("SDIO").finish()
665 }
666}
667pub mod sdio;
669pub type ADC1 = crate::Periph<adc1::RegisterBlock, 0x4001_2000>;
673impl core::fmt::Debug for ADC1 {
674 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
675 f.debug_struct("ADC1").finish()
676 }
677}
678pub mod adc1;
680pub type ADC2 = crate::Periph<adc1::RegisterBlock, 0x4001_2100>;
684impl core::fmt::Debug for ADC2 {
685 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
686 f.debug_struct("ADC2").finish()
687 }
688}
689pub use self::adc1 as adc2;
691pub type ADC3 = crate::Periph<adc1::RegisterBlock, 0x4001_2200>;
695impl core::fmt::Debug for ADC3 {
696 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
697 f.debug_struct("ADC3").finish()
698 }
699}
700pub use self::adc1 as adc3;
702pub type USART1 = crate::Periph<usart1::RegisterBlock, 0x4001_1000>;
706impl core::fmt::Debug for USART1 {
707 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
708 f.debug_struct("USART1").finish()
709 }
710}
711pub mod usart1;
713pub type USART6 = crate::Periph<usart1::RegisterBlock, 0x4001_1400>;
717impl core::fmt::Debug for USART6 {
718 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
719 f.debug_struct("USART6").finish()
720 }
721}
722pub use self::usart1 as usart6;
724pub type USART2 = crate::Periph<usart1::RegisterBlock, 0x4000_4400>;
728impl core::fmt::Debug for USART2 {
729 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
730 f.debug_struct("USART2").finish()
731 }
732}
733pub use self::usart1 as usart2;
735pub type USART3 = crate::Periph<usart1::RegisterBlock, 0x4000_4800>;
739impl core::fmt::Debug for USART3 {
740 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
741 f.debug_struct("USART3").finish()
742 }
743}
744pub use self::usart1 as usart3;
746pub type DAC = crate::Periph<dac::RegisterBlock, 0x4000_7400>;
750impl core::fmt::Debug for DAC {
751 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
752 f.debug_struct("DAC").finish()
753 }
754}
755pub mod dac;
757pub type PWR = crate::Periph<pwr::RegisterBlock, 0x4000_7000>;
761impl core::fmt::Debug for PWR {
762 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
763 f.debug_struct("PWR").finish()
764 }
765}
766pub mod pwr;
768pub type CAN2 = crate::Periph<can2::RegisterBlock, 0x4000_6800>;
772impl core::fmt::Debug for CAN2 {
773 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
774 f.debug_struct("CAN2").finish()
775 }
776}
777pub mod can2;
779pub type CAN1 = crate::Periph<can2::RegisterBlock, 0x4000_6400>;
783impl core::fmt::Debug for CAN1 {
784 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
785 f.debug_struct("CAN1").finish()
786 }
787}
788pub use self::can2 as can1;
790pub type I2C1 = crate::Periph<i2c1::RegisterBlock, 0x4000_5400>;
794impl core::fmt::Debug for I2C1 {
795 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
796 f.debug_struct("I2C1").finish()
797 }
798}
799pub mod i2c1;
801pub type I2C3 = crate::Periph<i2c1::RegisterBlock, 0x4000_5c00>;
805impl core::fmt::Debug for I2C3 {
806 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
807 f.debug_struct("I2C3").finish()
808 }
809}
810pub use self::i2c1 as i2c3;
812pub type I2C2 = crate::Periph<i2c1::RegisterBlock, 0x4000_5800>;
816impl core::fmt::Debug for I2C2 {
817 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
818 f.debug_struct("I2C2").finish()
819 }
820}
821pub use self::i2c1 as i2c2;
823pub type IWDG = crate::Periph<iwdg::RegisterBlock, 0x4000_3000>;
827impl core::fmt::Debug for IWDG {
828 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
829 f.debug_struct("IWDG").finish()
830 }
831}
832pub mod iwdg;
834pub type WWDG = crate::Periph<wwdg::RegisterBlock, 0x4000_2c00>;
838impl core::fmt::Debug for WWDG {
839 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
840 f.debug_struct("WWDG").finish()
841 }
842}
843pub mod wwdg;
845pub type RTC = crate::Periph<rtc::RegisterBlock, 0x4000_2800>;
849impl core::fmt::Debug for RTC {
850 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
851 f.debug_struct("RTC").finish()
852 }
853}
854pub mod rtc;
856pub type UART4 = crate::Periph<uart4::RegisterBlock, 0x4000_4c00>;
860impl core::fmt::Debug for UART4 {
861 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
862 f.debug_struct("UART4").finish()
863 }
864}
865pub mod uart4;
867pub type UART5 = crate::Periph<uart4::RegisterBlock, 0x4000_5000>;
871impl core::fmt::Debug for UART5 {
872 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
873 f.debug_struct("UART5").finish()
874 }
875}
876pub use self::uart4 as uart5;
878pub type ADC_COMMON = crate::Periph<adc_common::RegisterBlock, 0x4001_2300>;
882impl core::fmt::Debug for ADC_COMMON {
883 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
884 f.debug_struct("ADC_COMMON").finish()
885 }
886}
887pub mod adc_common;
889pub type TIM1 = crate::Periph<tim1::RegisterBlock, 0x4001_0000>;
893impl core::fmt::Debug for TIM1 {
894 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
895 f.debug_struct("TIM1").finish()
896 }
897}
898pub mod tim1;
900pub type TIM8 = crate::Periph<tim1::RegisterBlock, 0x4001_0400>;
904impl core::fmt::Debug for TIM8 {
905 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
906 f.debug_struct("TIM8").finish()
907 }
908}
909pub use self::tim1 as tim8;
911pub type TIM2 = crate::Periph<tim2::RegisterBlock, 0x4000_0000>;
915impl core::fmt::Debug for TIM2 {
916 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
917 f.debug_struct("TIM2").finish()
918 }
919}
920pub mod tim2;
922pub type TIM3 = crate::Periph<tim3::RegisterBlock, 0x4000_0400>;
926impl core::fmt::Debug for TIM3 {
927 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
928 f.debug_struct("TIM3").finish()
929 }
930}
931pub mod tim3;
933pub type TIM4 = crate::Periph<tim3::RegisterBlock, 0x4000_0800>;
937impl core::fmt::Debug for TIM4 {
938 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
939 f.debug_struct("TIM4").finish()
940 }
941}
942pub use self::tim3 as tim4;
944pub type TIM5 = crate::Periph<tim5::RegisterBlock, 0x4000_0c00>;
948impl core::fmt::Debug for TIM5 {
949 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
950 f.debug_struct("TIM5").finish()
951 }
952}
953pub mod tim5;
955pub type TIM9 = crate::Periph<tim9::RegisterBlock, 0x4001_4000>;
959impl core::fmt::Debug for TIM9 {
960 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
961 f.debug_struct("TIM9").finish()
962 }
963}
964pub mod tim9;
966pub type TIM12 = crate::Periph<tim9::RegisterBlock, 0x4000_1800>;
970impl core::fmt::Debug for TIM12 {
971 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
972 f.debug_struct("TIM12").finish()
973 }
974}
975pub use self::tim9 as tim12;
977pub type TIM10 = crate::Periph<tim10::RegisterBlock, 0x4001_4400>;
981impl core::fmt::Debug for TIM10 {
982 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
983 f.debug_struct("TIM10").finish()
984 }
985}
986pub mod tim10;
988pub type TIM11 = crate::Periph<tim10::RegisterBlock, 0x4001_4800>;
992impl core::fmt::Debug for TIM11 {
993 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
994 f.debug_struct("TIM11").finish()
995 }
996}
997pub use self::tim10 as tim11;
999pub type TIM13 = crate::Periph<tim10::RegisterBlock, 0x4000_1c00>;
1003impl core::fmt::Debug for TIM13 {
1004 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1005 f.debug_struct("TIM13").finish()
1006 }
1007}
1008pub use self::tim10 as tim13;
1010pub type TIM14 = crate::Periph<tim10::RegisterBlock, 0x4000_2000>;
1014impl core::fmt::Debug for TIM14 {
1015 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1016 f.debug_struct("TIM14").finish()
1017 }
1018}
1019pub use self::tim10 as tim14;
1021pub type TIM6 = crate::Periph<tim6::RegisterBlock, 0x4000_1000>;
1025impl core::fmt::Debug for TIM6 {
1026 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1027 f.debug_struct("TIM6").finish()
1028 }
1029}
1030pub mod tim6;
1032pub type TIM7 = crate::Periph<tim6::RegisterBlock, 0x4000_1400>;
1036impl core::fmt::Debug for TIM7 {
1037 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1038 f.debug_struct("TIM7").finish()
1039 }
1040}
1041pub use self::tim6 as tim7;
1043pub type ETHERNET_MAC = crate::Periph<ethernet_mac::RegisterBlock, 0x4002_8000>;
1047impl core::fmt::Debug for ETHERNET_MAC {
1048 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1049 f.debug_struct("ETHERNET_MAC").finish()
1050 }
1051}
1052pub mod ethernet_mac;
1054pub type ETHERNET_MMC = crate::Periph<ethernet_mmc::RegisterBlock, 0x4002_8100>;
1058impl core::fmt::Debug for ETHERNET_MMC {
1059 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1060 f.debug_struct("ETHERNET_MMC").finish()
1061 }
1062}
1063pub mod ethernet_mmc;
1065pub type ETHERNET_PTP = crate::Periph<ethernet_ptp::RegisterBlock, 0x4002_8700>;
1069impl core::fmt::Debug for ETHERNET_PTP {
1070 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1071 f.debug_struct("ETHERNET_PTP").finish()
1072 }
1073}
1074pub mod ethernet_ptp;
1076pub type ETHERNET_DMA = crate::Periph<ethernet_dma::RegisterBlock, 0x4002_9000>;
1080impl core::fmt::Debug for ETHERNET_DMA {
1081 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1082 f.debug_struct("ETHERNET_DMA").finish()
1083 }
1084}
1085pub mod ethernet_dma;
1087pub type OTG_FS_GLOBAL = crate::Periph<otg_fs_global::RegisterBlock, 0x5000_0000>;
1091impl core::fmt::Debug for OTG_FS_GLOBAL {
1092 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1093 f.debug_struct("OTG_FS_GLOBAL").finish()
1094 }
1095}
1096pub mod otg_fs_global;
1098pub type OTG_FS_HOST = crate::Periph<otg_fs_host::RegisterBlock, 0x5000_0400>;
1102impl core::fmt::Debug for OTG_FS_HOST {
1103 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1104 f.debug_struct("OTG_FS_HOST").finish()
1105 }
1106}
1107pub mod otg_fs_host;
1109pub type OTG_FS_DEVICE = crate::Periph<otg_fs_device::RegisterBlock, 0x5000_0800>;
1113impl core::fmt::Debug for OTG_FS_DEVICE {
1114 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1115 f.debug_struct("OTG_FS_DEVICE").finish()
1116 }
1117}
1118pub mod otg_fs_device;
1120pub type OTG_FS_PWRCLK = crate::Periph<otg_fs_pwrclk::RegisterBlock, 0x5000_0e00>;
1124impl core::fmt::Debug for OTG_FS_PWRCLK {
1125 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1126 f.debug_struct("OTG_FS_PWRCLK").finish()
1127 }
1128}
1129pub mod otg_fs_pwrclk;
1131pub type EXTI = crate::Periph<exti::RegisterBlock, 0x4001_3c00>;
1135impl core::fmt::Debug for EXTI {
1136 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1137 f.debug_struct("EXTI").finish()
1138 }
1139}
1140pub mod exti;
1142pub type FLASH = crate::Periph<flash::RegisterBlock, 0x4002_3c00>;
1146impl core::fmt::Debug for FLASH {
1147 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1148 f.debug_struct("FLASH").finish()
1149 }
1150}
1151pub mod flash;
1153pub type HASH = crate::Periph<hash::RegisterBlock, 0x5006_0400>;
1157impl core::fmt::Debug for HASH {
1158 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1159 f.debug_struct("HASH").finish()
1160 }
1161}
1162pub mod hash;
1164pub type CRYP = crate::Periph<cryp::RegisterBlock, 0x5006_0000>;
1168impl core::fmt::Debug for CRYP {
1169 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1170 f.debug_struct("CRYP").finish()
1171 }
1172}
1173pub mod cryp;
1175pub type OTG_HS_GLOBAL = crate::Periph<otg_hs_global::RegisterBlock, 0x4004_0000>;
1179impl core::fmt::Debug for OTG_HS_GLOBAL {
1180 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1181 f.debug_struct("OTG_HS_GLOBAL").finish()
1182 }
1183}
1184pub mod otg_hs_global;
1186pub type OTG_HS_HOST = crate::Periph<otg_hs_host::RegisterBlock, 0x4004_0400>;
1190impl core::fmt::Debug for OTG_HS_HOST {
1191 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1192 f.debug_struct("OTG_HS_HOST").finish()
1193 }
1194}
1195pub mod otg_hs_host;
1197pub type OTG_HS_DEVICE = crate::Periph<otg_hs_device::RegisterBlock, 0x4004_0800>;
1201impl core::fmt::Debug for OTG_HS_DEVICE {
1202 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1203 f.debug_struct("OTG_HS_DEVICE").finish()
1204 }
1205}
1206pub mod otg_hs_device;
1208pub type OTG_HS_PWRCLK = crate::Periph<otg_hs_pwrclk::RegisterBlock, 0x4004_0e00>;
1212impl core::fmt::Debug for OTG_HS_PWRCLK {
1213 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1214 f.debug_struct("OTG_HS_PWRCLK").finish()
1215 }
1216}
1217pub mod otg_hs_pwrclk;
1219pub type SCB_ACTRL = crate::Periph<scb_actrl::RegisterBlock, 0xe000_e008>;
1223impl core::fmt::Debug for SCB_ACTRL {
1224 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1225 f.debug_struct("SCB_ACTRL").finish()
1226 }
1227}
1228pub mod scb_actrl;
1230pub type NVIC_STIR = crate::Periph<nvic_stir::RegisterBlock, 0xe000_ef00>;
1234impl core::fmt::Debug for NVIC_STIR {
1235 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1236 f.debug_struct("NVIC_STIR").finish()
1237 }
1238}
1239pub mod nvic_stir;
1241pub type STK = crate::Periph<stk::RegisterBlock, 0xe000_e010>;
1245impl core::fmt::Debug for STK {
1246 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1247 f.debug_struct("STK").finish()
1248 }
1249}
1250pub mod stk;
1252#[no_mangle]
1253static mut DEVICE_PERIPHERALS: bool = false;
1254#[allow(non_snake_case)]
1256pub struct Peripherals {
1257 pub RNG: RNG,
1259 pub CRC: CRC,
1261 pub DCMI: DCMI,
1263 pub FSMC: FSMC,
1265 pub DBGMCU: DBGMCU,
1267 pub DMA2: DMA2,
1269 pub DMA1: DMA1,
1271 pub RCC: RCC,
1273 pub GPIOI: GPIOI,
1275 pub GPIOH: GPIOH,
1277 pub GPIOG: GPIOG,
1279 pub GPIOF: GPIOF,
1281 pub GPIOE: GPIOE,
1283 pub GPIOD: GPIOD,
1285 pub GPIOC: GPIOC,
1287 pub GPIOB: GPIOB,
1289 pub GPIOA: GPIOA,
1291 pub SYSCFG: SYSCFG,
1293 pub SPI1: SPI1,
1295 pub SPI3: SPI3,
1297 pub SPI2: SPI2,
1299 pub SDIO: SDIO,
1301 pub ADC1: ADC1,
1303 pub ADC2: ADC2,
1305 pub ADC3: ADC3,
1307 pub USART1: USART1,
1309 pub USART6: USART6,
1311 pub USART2: USART2,
1313 pub USART3: USART3,
1315 pub DAC: DAC,
1317 pub PWR: PWR,
1319 pub CAN2: CAN2,
1321 pub CAN1: CAN1,
1323 pub I2C1: I2C1,
1325 pub I2C3: I2C3,
1327 pub I2C2: I2C2,
1329 pub IWDG: IWDG,
1331 pub WWDG: WWDG,
1333 pub RTC: RTC,
1335 pub UART4: UART4,
1337 pub UART5: UART5,
1339 pub ADC_COMMON: ADC_COMMON,
1341 pub TIM1: TIM1,
1343 pub TIM8: TIM8,
1345 pub TIM2: TIM2,
1347 pub TIM3: TIM3,
1349 pub TIM4: TIM4,
1351 pub TIM5: TIM5,
1353 pub TIM9: TIM9,
1355 pub TIM12: TIM12,
1357 pub TIM10: TIM10,
1359 pub TIM11: TIM11,
1361 pub TIM13: TIM13,
1363 pub TIM14: TIM14,
1365 pub TIM6: TIM6,
1367 pub TIM7: TIM7,
1369 pub ETHERNET_MAC: ETHERNET_MAC,
1371 pub ETHERNET_MMC: ETHERNET_MMC,
1373 pub ETHERNET_PTP: ETHERNET_PTP,
1375 pub ETHERNET_DMA: ETHERNET_DMA,
1377 pub OTG_FS_GLOBAL: OTG_FS_GLOBAL,
1379 pub OTG_FS_HOST: OTG_FS_HOST,
1381 pub OTG_FS_DEVICE: OTG_FS_DEVICE,
1383 pub OTG_FS_PWRCLK: OTG_FS_PWRCLK,
1385 pub EXTI: EXTI,
1387 pub FLASH: FLASH,
1389 pub HASH: HASH,
1391 pub CRYP: CRYP,
1393 pub OTG_HS_GLOBAL: OTG_HS_GLOBAL,
1395 pub OTG_HS_HOST: OTG_HS_HOST,
1397 pub OTG_HS_DEVICE: OTG_HS_DEVICE,
1399 pub OTG_HS_PWRCLK: OTG_HS_PWRCLK,
1401 pub SCB_ACTRL: SCB_ACTRL,
1403 pub NVIC_STIR: NVIC_STIR,
1405 pub STK: STK,
1407}
1408impl Peripherals {
1409 #[cfg(feature = "critical-section")]
1411 #[inline]
1412 pub fn take() -> Option<Self> {
1413 critical_section::with(|_| {
1414 if unsafe { DEVICE_PERIPHERALS } {
1415 return None;
1416 }
1417 Some(unsafe { Peripherals::steal() })
1418 })
1419 }
1420 #[inline]
1426 pub unsafe fn steal() -> Self {
1427 DEVICE_PERIPHERALS = true;
1428 Peripherals {
1429 RNG: RNG::steal(),
1430 CRC: CRC::steal(),
1431 DCMI: DCMI::steal(),
1432 FSMC: FSMC::steal(),
1433 DBGMCU: DBGMCU::steal(),
1434 DMA2: DMA2::steal(),
1435 DMA1: DMA1::steal(),
1436 RCC: RCC::steal(),
1437 GPIOI: GPIOI::steal(),
1438 GPIOH: GPIOH::steal(),
1439 GPIOG: GPIOG::steal(),
1440 GPIOF: GPIOF::steal(),
1441 GPIOE: GPIOE::steal(),
1442 GPIOD: GPIOD::steal(),
1443 GPIOC: GPIOC::steal(),
1444 GPIOB: GPIOB::steal(),
1445 GPIOA: GPIOA::steal(),
1446 SYSCFG: SYSCFG::steal(),
1447 SPI1: SPI1::steal(),
1448 SPI3: SPI3::steal(),
1449 SPI2: SPI2::steal(),
1450 SDIO: SDIO::steal(),
1451 ADC1: ADC1::steal(),
1452 ADC2: ADC2::steal(),
1453 ADC3: ADC3::steal(),
1454 USART1: USART1::steal(),
1455 USART6: USART6::steal(),
1456 USART2: USART2::steal(),
1457 USART3: USART3::steal(),
1458 DAC: DAC::steal(),
1459 PWR: PWR::steal(),
1460 CAN2: CAN2::steal(),
1461 CAN1: CAN1::steal(),
1462 I2C1: I2C1::steal(),
1463 I2C3: I2C3::steal(),
1464 I2C2: I2C2::steal(),
1465 IWDG: IWDG::steal(),
1466 WWDG: WWDG::steal(),
1467 RTC: RTC::steal(),
1468 UART4: UART4::steal(),
1469 UART5: UART5::steal(),
1470 ADC_COMMON: ADC_COMMON::steal(),
1471 TIM1: TIM1::steal(),
1472 TIM8: TIM8::steal(),
1473 TIM2: TIM2::steal(),
1474 TIM3: TIM3::steal(),
1475 TIM4: TIM4::steal(),
1476 TIM5: TIM5::steal(),
1477 TIM9: TIM9::steal(),
1478 TIM12: TIM12::steal(),
1479 TIM10: TIM10::steal(),
1480 TIM11: TIM11::steal(),
1481 TIM13: TIM13::steal(),
1482 TIM14: TIM14::steal(),
1483 TIM6: TIM6::steal(),
1484 TIM7: TIM7::steal(),
1485 ETHERNET_MAC: ETHERNET_MAC::steal(),
1486 ETHERNET_MMC: ETHERNET_MMC::steal(),
1487 ETHERNET_PTP: ETHERNET_PTP::steal(),
1488 ETHERNET_DMA: ETHERNET_DMA::steal(),
1489 OTG_FS_GLOBAL: OTG_FS_GLOBAL::steal(),
1490 OTG_FS_HOST: OTG_FS_HOST::steal(),
1491 OTG_FS_DEVICE: OTG_FS_DEVICE::steal(),
1492 OTG_FS_PWRCLK: OTG_FS_PWRCLK::steal(),
1493 EXTI: EXTI::steal(),
1494 FLASH: FLASH::steal(),
1495 HASH: HASH::steal(),
1496 CRYP: CRYP::steal(),
1497 OTG_HS_GLOBAL: OTG_HS_GLOBAL::steal(),
1498 OTG_HS_HOST: OTG_HS_HOST::steal(),
1499 OTG_HS_DEVICE: OTG_HS_DEVICE::steal(),
1500 OTG_HS_PWRCLK: OTG_HS_PWRCLK::steal(),
1501 SCB_ACTRL: SCB_ACTRL::steal(),
1502 NVIC_STIR: NVIC_STIR::steal(),
1503 STK: STK::steal(),
1504 }
1505 }
1506}