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();
22 fn TAMP_STAMP();
23 fn RTC_WKUP();
24 fn RCC();
25 fn EXTI0();
26 fn EXTI1();
27 fn EXTI2();
28 fn EXTI3();
29 fn EXTI4();
30 fn DMA1_STREAM0();
31 fn DMA1_STREAM1();
32 fn DMA1_STREAM2();
33 fn DMA1_STREAM3();
34 fn DMA1_STREAM4();
35 fn DMA1_STREAM5();
36 fn DMA1_STREAM6();
37 fn ADC();
38 fn CAN1_TX();
39 fn CAN1_RX0();
40 fn CAN1_RX1();
41 fn CAN1_SCE();
42 fn EXTI9_5();
43 fn TIM1_BRK_TIM9();
44 fn TIM1_UP_TIM10();
45 fn TIM1_TRG_COM_TIM11();
46 fn TIM1_CC();
47 fn TIM2();
48 fn TIM3();
49 fn TIM4();
50 fn I2C1_EV();
51 fn I2C1_ER();
52 fn I2C2_EV();
53 fn I2C2_ER();
54 fn SPI1();
55 fn SPI2();
56 fn USART1();
57 fn USART2();
58 fn USART3();
59 fn EXTI15_10();
60 fn RTC_ALARM();
61 fn OTG_FS_WKUP();
62 fn TIM8_BRK_TIM12();
63 fn TIM8_UP_TIM13();
64 fn TIM8_TRG_COM_TIM14();
65 fn TIM8_CC();
66 fn DMA1_STREAM7();
67 fn FSMC();
68 fn SDIO();
69 fn TIM5();
70 fn SPI3();
71 fn UART4();
72 fn UART5();
73 fn TIM6_DAC();
74 fn TIM7();
75 fn DMA2_STREAM0();
76 fn DMA2_STREAM1();
77 fn DMA2_STREAM2();
78 fn DMA2_STREAM3();
79 fn DMA2_STREAM4();
80 fn ETH();
81 fn ETH_WKUP();
82 fn CAN2_TX();
83 fn CAN2_RX0();
84 fn CAN2_RX1();
85 fn CAN2_SCE();
86 fn OTG_FS();
87 fn DMA2_STREAM5();
88 fn DMA2_STREAM6();
89 fn DMA2_STREAM7();
90 fn USART6();
91 fn I2C3_EV();
92 fn I2C3_ER();
93 fn OTG_HS_EP1_OUT();
94 fn OTG_HS_EP1_IN();
95 fn OTG_HS_WKUP();
96 fn OTG_HS();
97 fn DCMI();
98 fn CRYP();
99 fn HASH_RNG();
100 fn FPU();
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; 82] = [
113 Vector { _handler: WWDG },
114 Vector { _handler: PVD },
115 Vector {
116 _handler: TAMP_STAMP,
117 },
118 Vector { _handler: RTC_WKUP },
119 Vector { _reserved: 0 },
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 Vector { _handler: FPU },
253];
254#[cfg_attr(feature = "defmt", derive(defmt::Format))]
256#[derive(Copy, Clone, Debug, PartialEq, Eq)]
257#[repr(u16)]
258pub enum Interrupt {
259 WWDG = 0,
261 PVD = 1,
263 TAMP_STAMP = 2,
265 RTC_WKUP = 3,
267 RCC = 5,
269 EXTI0 = 6,
271 EXTI1 = 7,
273 EXTI2 = 8,
275 EXTI3 = 9,
277 EXTI4 = 10,
279 DMA1_STREAM0 = 11,
281 DMA1_STREAM1 = 12,
283 DMA1_STREAM2 = 13,
285 DMA1_STREAM3 = 14,
287 DMA1_STREAM4 = 15,
289 DMA1_STREAM5 = 16,
291 DMA1_STREAM6 = 17,
293 ADC = 18,
295 CAN1_TX = 19,
297 CAN1_RX0 = 20,
299 CAN1_RX1 = 21,
301 CAN1_SCE = 22,
303 EXTI9_5 = 23,
305 TIM1_BRK_TIM9 = 24,
307 TIM1_UP_TIM10 = 25,
309 TIM1_TRG_COM_TIM11 = 26,
311 TIM1_CC = 27,
313 TIM2 = 28,
315 TIM3 = 29,
317 TIM4 = 30,
319 I2C1_EV = 31,
321 I2C1_ER = 32,
323 I2C2_EV = 33,
325 I2C2_ER = 34,
327 SPI1 = 35,
329 SPI2 = 36,
331 USART1 = 37,
333 USART2 = 38,
335 USART3 = 39,
337 EXTI15_10 = 40,
339 RTC_ALARM = 41,
341 OTG_FS_WKUP = 42,
343 TIM8_BRK_TIM12 = 43,
345 TIM8_UP_TIM13 = 44,
347 TIM8_TRG_COM_TIM14 = 45,
349 TIM8_CC = 46,
351 DMA1_STREAM7 = 47,
353 FSMC = 48,
355 SDIO = 49,
357 TIM5 = 50,
359 SPI3 = 51,
361 UART4 = 52,
363 UART5 = 53,
365 TIM6_DAC = 54,
367 TIM7 = 55,
369 DMA2_STREAM0 = 56,
371 DMA2_STREAM1 = 57,
373 DMA2_STREAM2 = 58,
375 DMA2_STREAM3 = 59,
377 DMA2_STREAM4 = 60,
379 ETH = 61,
381 ETH_WKUP = 62,
383 CAN2_TX = 63,
385 CAN2_RX0 = 64,
387 CAN2_RX1 = 65,
389 CAN2_SCE = 66,
391 OTG_FS = 67,
393 DMA2_STREAM5 = 68,
395 DMA2_STREAM6 = 69,
397 DMA2_STREAM7 = 70,
399 USART6 = 71,
401 I2C3_EV = 72,
403 I2C3_ER = 73,
405 OTG_HS_EP1_OUT = 74,
407 OTG_HS_EP1_IN = 75,
409 OTG_HS_WKUP = 76,
411 OTG_HS = 77,
413 DCMI = 78,
415 CRYP = 79,
417 HASH_RNG = 80,
419 FPU = 81,
421}
422unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
423 #[inline(always)]
424 fn number(self) -> u16 {
425 self as u16
426 }
427}
428pub type RNG = crate::Periph<rng::RegisterBlock, 0x5006_0800>;
432impl core::fmt::Debug for RNG {
433 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
434 f.debug_struct("RNG").finish()
435 }
436}
437pub mod rng;
439pub type DCMI = crate::Periph<dcmi::RegisterBlock, 0x5005_0000>;
443impl core::fmt::Debug for DCMI {
444 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
445 f.debug_struct("DCMI").finish()
446 }
447}
448pub mod dcmi;
450pub type FSMC = crate::Periph<fsmc::RegisterBlock, 0xa000_0000>;
454impl core::fmt::Debug for FSMC {
455 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
456 f.debug_struct("FSMC").finish()
457 }
458}
459pub mod fsmc;
461pub type DBGMCU = crate::Periph<dbgmcu::RegisterBlock, 0xe004_2000>;
465impl core::fmt::Debug for DBGMCU {
466 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
467 f.debug_struct("DBGMCU").finish()
468 }
469}
470pub mod dbgmcu;
472pub type DMA2 = crate::Periph<dma2::RegisterBlock, 0x4002_6400>;
476impl core::fmt::Debug for DMA2 {
477 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
478 f.debug_struct("DMA2").finish()
479 }
480}
481pub mod dma2;
483pub type DMA1 = crate::Periph<dma2::RegisterBlock, 0x4002_6000>;
487impl core::fmt::Debug for DMA1 {
488 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
489 f.debug_struct("DMA1").finish()
490 }
491}
492pub use self::dma2 as dma1;
494pub type RCC = crate::Periph<rcc::RegisterBlock, 0x4002_3800>;
498impl core::fmt::Debug for RCC {
499 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
500 f.debug_struct("RCC").finish()
501 }
502}
503pub mod rcc;
505pub type GPIOI = crate::Periph<gpioi::RegisterBlock, 0x4002_2000>;
509impl core::fmt::Debug for GPIOI {
510 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
511 f.debug_struct("GPIOI").finish()
512 }
513}
514pub mod gpioi;
516pub type GPIOH = crate::Periph<gpioi::RegisterBlock, 0x4002_1c00>;
520impl core::fmt::Debug for GPIOH {
521 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
522 f.debug_struct("GPIOH").finish()
523 }
524}
525pub use self::gpioi as gpioh;
527pub type GPIOG = crate::Periph<gpioi::RegisterBlock, 0x4002_1800>;
531impl core::fmt::Debug for GPIOG {
532 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
533 f.debug_struct("GPIOG").finish()
534 }
535}
536pub use self::gpioi as gpiog;
538pub type GPIOF = crate::Periph<gpioi::RegisterBlock, 0x4002_1400>;
542impl core::fmt::Debug for GPIOF {
543 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
544 f.debug_struct("GPIOF").finish()
545 }
546}
547pub use self::gpioi as gpiof;
549pub type GPIOE = crate::Periph<gpioi::RegisterBlock, 0x4002_1000>;
553impl core::fmt::Debug for GPIOE {
554 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
555 f.debug_struct("GPIOE").finish()
556 }
557}
558pub use self::gpioi as gpioe;
560pub type GPIOD = crate::Periph<gpioi::RegisterBlock, 0x4002_0c00>;
564impl core::fmt::Debug for GPIOD {
565 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
566 f.debug_struct("GPIOD").finish()
567 }
568}
569pub use self::gpioi as gpiod;
571pub type GPIOC = crate::Periph<gpioi::RegisterBlock, 0x4002_0800>;
575impl core::fmt::Debug for GPIOC {
576 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
577 f.debug_struct("GPIOC").finish()
578 }
579}
580pub use self::gpioi as gpioc;
582pub type GPIOJ = crate::Periph<gpioi::RegisterBlock, 0x4002_2400>;
586impl core::fmt::Debug for GPIOJ {
587 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
588 f.debug_struct("GPIOJ").finish()
589 }
590}
591pub use self::gpioi as gpioj;
593pub type GPIOK = crate::Periph<gpioi::RegisterBlock, 0x4002_2800>;
597impl core::fmt::Debug for GPIOK {
598 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
599 f.debug_struct("GPIOK").finish()
600 }
601}
602pub use self::gpioi as gpiok;
604pub type GPIOB = crate::Periph<gpiob::RegisterBlock, 0x4002_0400>;
608impl core::fmt::Debug for GPIOB {
609 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
610 f.debug_struct("GPIOB").finish()
611 }
612}
613pub mod gpiob;
615pub type GPIOA = crate::Periph<gpioa::RegisterBlock, 0x4002_0000>;
619impl core::fmt::Debug for GPIOA {
620 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
621 f.debug_struct("GPIOA").finish()
622 }
623}
624pub mod gpioa;
626pub type SYSCFG = crate::Periph<syscfg::RegisterBlock, 0x4001_3800>;
630impl core::fmt::Debug for SYSCFG {
631 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
632 f.debug_struct("SYSCFG").finish()
633 }
634}
635pub mod syscfg;
637pub type SPI1 = crate::Periph<spi1::RegisterBlock, 0x4001_3000>;
641impl core::fmt::Debug for SPI1 {
642 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
643 f.debug_struct("SPI1").finish()
644 }
645}
646pub mod spi1;
648pub type SPI2 = crate::Periph<spi1::RegisterBlock, 0x4000_3800>;
652impl core::fmt::Debug for SPI2 {
653 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
654 f.debug_struct("SPI2").finish()
655 }
656}
657pub use self::spi1 as spi2;
659pub type SPI3 = crate::Periph<spi1::RegisterBlock, 0x4000_3c00>;
663impl core::fmt::Debug for SPI3 {
664 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
665 f.debug_struct("SPI3").finish()
666 }
667}
668pub use self::spi1 as spi3;
670pub type I2S2EXT = crate::Periph<spi1::RegisterBlock, 0x4000_3400>;
674impl core::fmt::Debug for I2S2EXT {
675 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
676 f.debug_struct("I2S2EXT").finish()
677 }
678}
679pub use self::spi1 as i2s2ext;
681pub type I2S3EXT = crate::Periph<spi1::RegisterBlock, 0x4000_4000>;
685impl core::fmt::Debug for I2S3EXT {
686 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
687 f.debug_struct("I2S3EXT").finish()
688 }
689}
690pub use self::spi1 as i2s3ext;
692pub type SDIO = crate::Periph<sdio::RegisterBlock, 0x4001_2c00>;
696impl core::fmt::Debug for SDIO {
697 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
698 f.debug_struct("SDIO").finish()
699 }
700}
701pub mod sdio;
703pub type ADC1 = crate::Periph<adc1::RegisterBlock, 0x4001_2000>;
707impl core::fmt::Debug for ADC1 {
708 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
709 f.debug_struct("ADC1").finish()
710 }
711}
712pub mod adc1;
714pub type ADC2 = crate::Periph<adc1::RegisterBlock, 0x4001_2100>;
718impl core::fmt::Debug for ADC2 {
719 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
720 f.debug_struct("ADC2").finish()
721 }
722}
723pub use self::adc1 as adc2;
725pub type ADC3 = crate::Periph<adc1::RegisterBlock, 0x4001_2200>;
729impl core::fmt::Debug for ADC3 {
730 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
731 f.debug_struct("ADC3").finish()
732 }
733}
734pub use self::adc1 as adc3;
736pub type USART1 = crate::Periph<usart1::RegisterBlock, 0x4001_1000>;
740impl core::fmt::Debug for USART1 {
741 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
742 f.debug_struct("USART1").finish()
743 }
744}
745pub mod usart1;
747pub type USART6 = crate::Periph<usart1::RegisterBlock, 0x4001_1400>;
751impl core::fmt::Debug for USART6 {
752 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
753 f.debug_struct("USART6").finish()
754 }
755}
756pub use self::usart1 as usart6;
758pub type USART2 = crate::Periph<usart1::RegisterBlock, 0x4000_4400>;
762impl core::fmt::Debug for USART2 {
763 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
764 f.debug_struct("USART2").finish()
765 }
766}
767pub use self::usart1 as usart2;
769pub type USART3 = crate::Periph<usart1::RegisterBlock, 0x4000_4800>;
773impl core::fmt::Debug for USART3 {
774 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
775 f.debug_struct("USART3").finish()
776 }
777}
778pub use self::usart1 as usart3;
780pub type DAC = crate::Periph<dac::RegisterBlock, 0x4000_7400>;
784impl core::fmt::Debug for DAC {
785 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
786 f.debug_struct("DAC").finish()
787 }
788}
789pub mod dac;
791pub type PWR = crate::Periph<pwr::RegisterBlock, 0x4000_7000>;
795impl core::fmt::Debug for PWR {
796 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
797 f.debug_struct("PWR").finish()
798 }
799}
800pub mod pwr;
802pub type I2C1 = crate::Periph<i2c1::RegisterBlock, 0x4000_5400>;
806impl core::fmt::Debug for I2C1 {
807 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
808 f.debug_struct("I2C1").finish()
809 }
810}
811pub mod i2c1;
813pub type I2C3 = crate::Periph<i2c1::RegisterBlock, 0x4000_5c00>;
817impl core::fmt::Debug for I2C3 {
818 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
819 f.debug_struct("I2C3").finish()
820 }
821}
822pub use self::i2c1 as i2c3;
824pub type I2C2 = crate::Periph<i2c1::RegisterBlock, 0x4000_5800>;
828impl core::fmt::Debug for I2C2 {
829 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
830 f.debug_struct("I2C2").finish()
831 }
832}
833pub use self::i2c1 as i2c2;
835pub type IWDG = crate::Periph<iwdg::RegisterBlock, 0x4000_3000>;
839impl core::fmt::Debug for IWDG {
840 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
841 f.debug_struct("IWDG").finish()
842 }
843}
844pub mod iwdg;
846pub type WWDG = crate::Periph<wwdg::RegisterBlock, 0x4000_2c00>;
850impl core::fmt::Debug for WWDG {
851 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
852 f.debug_struct("WWDG").finish()
853 }
854}
855pub mod wwdg;
857pub type RTC = crate::Periph<rtc::RegisterBlock, 0x4000_2800>;
861impl core::fmt::Debug for RTC {
862 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
863 f.debug_struct("RTC").finish()
864 }
865}
866pub mod rtc;
868pub type UART4 = crate::Periph<uart4::RegisterBlock, 0x4000_4c00>;
872impl core::fmt::Debug for UART4 {
873 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
874 f.debug_struct("UART4").finish()
875 }
876}
877pub mod uart4;
879pub type UART5 = crate::Periph<uart4::RegisterBlock, 0x4000_5000>;
883impl core::fmt::Debug for UART5 {
884 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
885 f.debug_struct("UART5").finish()
886 }
887}
888pub use self::uart4 as uart5;
890pub type ADC_COMMON = crate::Periph<adc_common::RegisterBlock, 0x4001_2300>;
894impl core::fmt::Debug for ADC_COMMON {
895 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
896 f.debug_struct("ADC_COMMON").finish()
897 }
898}
899pub mod adc_common;
901pub type TIM1 = crate::Periph<tim1::RegisterBlock, 0x4001_0000>;
905impl core::fmt::Debug for TIM1 {
906 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
907 f.debug_struct("TIM1").finish()
908 }
909}
910pub mod tim1;
912pub type TIM8 = crate::Periph<tim1::RegisterBlock, 0x4001_0400>;
916impl core::fmt::Debug for TIM8 {
917 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
918 f.debug_struct("TIM8").finish()
919 }
920}
921pub use self::tim1 as tim8;
923pub type TIM2 = crate::Periph<tim2::RegisterBlock, 0x4000_0000>;
927impl core::fmt::Debug for TIM2 {
928 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
929 f.debug_struct("TIM2").finish()
930 }
931}
932pub mod tim2;
934pub type TIM3 = crate::Periph<tim3::RegisterBlock, 0x4000_0400>;
938impl core::fmt::Debug for TIM3 {
939 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
940 f.debug_struct("TIM3").finish()
941 }
942}
943pub mod tim3;
945pub type TIM4 = crate::Periph<tim3::RegisterBlock, 0x4000_0800>;
949impl core::fmt::Debug for TIM4 {
950 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
951 f.debug_struct("TIM4").finish()
952 }
953}
954pub use self::tim3 as tim4;
956pub type TIM5 = crate::Periph<tim5::RegisterBlock, 0x4000_0c00>;
960impl core::fmt::Debug for TIM5 {
961 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
962 f.debug_struct("TIM5").finish()
963 }
964}
965pub mod tim5;
967pub type TIM9 = crate::Periph<tim9::RegisterBlock, 0x4001_4000>;
971impl core::fmt::Debug for TIM9 {
972 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
973 f.debug_struct("TIM9").finish()
974 }
975}
976pub mod tim9;
978pub type TIM12 = crate::Periph<tim9::RegisterBlock, 0x4000_1800>;
982impl core::fmt::Debug for TIM12 {
983 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
984 f.debug_struct("TIM12").finish()
985 }
986}
987pub use self::tim9 as tim12;
989pub type TIM10 = crate::Periph<tim10::RegisterBlock, 0x4001_4400>;
993impl core::fmt::Debug for TIM10 {
994 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
995 f.debug_struct("TIM10").finish()
996 }
997}
998pub mod tim10;
1000pub type TIM13 = crate::Periph<tim10::RegisterBlock, 0x4000_1c00>;
1004impl core::fmt::Debug for TIM13 {
1005 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1006 f.debug_struct("TIM13").finish()
1007 }
1008}
1009pub use self::tim10 as tim13;
1011pub type TIM14 = crate::Periph<tim10::RegisterBlock, 0x4000_2000>;
1015impl core::fmt::Debug for TIM14 {
1016 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1017 f.debug_struct("TIM14").finish()
1018 }
1019}
1020pub use self::tim10 as tim14;
1022pub type TIM11 = crate::Periph<tim11::RegisterBlock, 0x4001_4800>;
1026impl core::fmt::Debug for TIM11 {
1027 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1028 f.debug_struct("TIM11").finish()
1029 }
1030}
1031pub mod tim11;
1033pub type TIM6 = crate::Periph<tim6::RegisterBlock, 0x4000_1000>;
1037impl core::fmt::Debug for TIM6 {
1038 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1039 f.debug_struct("TIM6").finish()
1040 }
1041}
1042pub mod tim6;
1044pub type TIM7 = crate::Periph<tim6::RegisterBlock, 0x4000_1400>;
1048impl core::fmt::Debug for TIM7 {
1049 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1050 f.debug_struct("TIM7").finish()
1051 }
1052}
1053pub use self::tim6 as tim7;
1055pub type ETHERNET_MAC = crate::Periph<ethernet_mac::RegisterBlock, 0x4002_8000>;
1059impl core::fmt::Debug for ETHERNET_MAC {
1060 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1061 f.debug_struct("ETHERNET_MAC").finish()
1062 }
1063}
1064pub mod ethernet_mac;
1066pub type ETHERNET_MMC = crate::Periph<ethernet_mmc::RegisterBlock, 0x4002_8100>;
1070impl core::fmt::Debug for ETHERNET_MMC {
1071 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1072 f.debug_struct("ETHERNET_MMC").finish()
1073 }
1074}
1075pub mod ethernet_mmc;
1077pub type ETHERNET_PTP = crate::Periph<ethernet_ptp::RegisterBlock, 0x4002_8700>;
1081impl core::fmt::Debug for ETHERNET_PTP {
1082 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1083 f.debug_struct("ETHERNET_PTP").finish()
1084 }
1085}
1086pub mod ethernet_ptp;
1088pub type ETHERNET_DMA = crate::Periph<ethernet_dma::RegisterBlock, 0x4002_9000>;
1092impl core::fmt::Debug for ETHERNET_DMA {
1093 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1094 f.debug_struct("ETHERNET_DMA").finish()
1095 }
1096}
1097pub mod ethernet_dma;
1099pub type CRC = crate::Periph<crc::RegisterBlock, 0x4002_3000>;
1103impl core::fmt::Debug for CRC {
1104 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1105 f.debug_struct("CRC").finish()
1106 }
1107}
1108pub mod crc;
1110pub type OTG_FS_GLOBAL = crate::Periph<otg_fs_global::RegisterBlock, 0x5000_0000>;
1114impl core::fmt::Debug for OTG_FS_GLOBAL {
1115 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1116 f.debug_struct("OTG_FS_GLOBAL").finish()
1117 }
1118}
1119pub mod otg_fs_global;
1121pub type OTG_FS_HOST = crate::Periph<otg_fs_host::RegisterBlock, 0x5000_0400>;
1125impl core::fmt::Debug for OTG_FS_HOST {
1126 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1127 f.debug_struct("OTG_FS_HOST").finish()
1128 }
1129}
1130pub mod otg_fs_host;
1132pub type OTG_FS_DEVICE = crate::Periph<otg_fs_device::RegisterBlock, 0x5000_0800>;
1136impl core::fmt::Debug for OTG_FS_DEVICE {
1137 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1138 f.debug_struct("OTG_FS_DEVICE").finish()
1139 }
1140}
1141pub mod otg_fs_device;
1143pub type OTG_FS_PWRCLK = crate::Periph<otg_fs_pwrclk::RegisterBlock, 0x5000_0e00>;
1147impl core::fmt::Debug for OTG_FS_PWRCLK {
1148 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1149 f.debug_struct("OTG_FS_PWRCLK").finish()
1150 }
1151}
1152pub mod otg_fs_pwrclk;
1154pub type CAN1 = crate::Periph<can1::RegisterBlock, 0x4000_6400>;
1158impl core::fmt::Debug for CAN1 {
1159 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1160 f.debug_struct("CAN1").finish()
1161 }
1162}
1163pub mod can1;
1165pub type CAN2 = crate::Periph<can1::RegisterBlock, 0x4000_6800>;
1169impl core::fmt::Debug for CAN2 {
1170 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1171 f.debug_struct("CAN2").finish()
1172 }
1173}
1174pub use self::can1 as can2;
1176pub type FLASH = crate::Periph<flash::RegisterBlock, 0x4002_3c00>;
1180impl core::fmt::Debug for FLASH {
1181 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1182 f.debug_struct("FLASH").finish()
1183 }
1184}
1185pub mod flash;
1187pub type EXTI = crate::Periph<exti::RegisterBlock, 0x4001_3c00>;
1191impl core::fmt::Debug for EXTI {
1192 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1193 f.debug_struct("EXTI").finish()
1194 }
1195}
1196pub mod exti;
1198pub type OTG_HS_GLOBAL = crate::Periph<otg_hs_global::RegisterBlock, 0x4004_0000>;
1202impl core::fmt::Debug for OTG_HS_GLOBAL {
1203 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1204 f.debug_struct("OTG_HS_GLOBAL").finish()
1205 }
1206}
1207pub mod otg_hs_global;
1209pub type OTG_HS_HOST = crate::Periph<otg_hs_host::RegisterBlock, 0x4004_0400>;
1213impl core::fmt::Debug for OTG_HS_HOST {
1214 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1215 f.debug_struct("OTG_HS_HOST").finish()
1216 }
1217}
1218pub mod otg_hs_host;
1220pub type OTG_HS_DEVICE = crate::Periph<otg_hs_device::RegisterBlock, 0x4004_0800>;
1224impl core::fmt::Debug for OTG_HS_DEVICE {
1225 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1226 f.debug_struct("OTG_HS_DEVICE").finish()
1227 }
1228}
1229pub mod otg_hs_device;
1231pub type OTG_HS_PWRCLK = crate::Periph<otg_hs_pwrclk::RegisterBlock, 0x4004_0e00>;
1235impl core::fmt::Debug for OTG_HS_PWRCLK {
1236 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1237 f.debug_struct("OTG_HS_PWRCLK").finish()
1238 }
1239}
1240pub mod otg_hs_pwrclk;
1242pub type HASH = crate::Periph<hash::RegisterBlock, 0x5006_0400>;
1246impl core::fmt::Debug for HASH {
1247 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1248 f.debug_struct("HASH").finish()
1249 }
1250}
1251pub mod hash;
1253pub type CRYP = crate::Periph<cryp::RegisterBlock, 0x5006_0000>;
1257impl core::fmt::Debug for CRYP {
1258 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1259 f.debug_struct("CRYP").finish()
1260 }
1261}
1262pub mod cryp;
1264#[no_mangle]
1265static mut DEVICE_PERIPHERALS: bool = false;
1266#[allow(non_snake_case)]
1268pub struct Peripherals {
1269 pub RNG: RNG,
1271 pub DCMI: DCMI,
1273 pub FSMC: FSMC,
1275 pub DBGMCU: DBGMCU,
1277 pub DMA2: DMA2,
1279 pub DMA1: DMA1,
1281 pub RCC: RCC,
1283 pub GPIOI: GPIOI,
1285 pub GPIOH: GPIOH,
1287 pub GPIOG: GPIOG,
1289 pub GPIOF: GPIOF,
1291 pub GPIOE: GPIOE,
1293 pub GPIOD: GPIOD,
1295 pub GPIOC: GPIOC,
1297 pub GPIOJ: GPIOJ,
1299 pub GPIOK: GPIOK,
1301 pub GPIOB: GPIOB,
1303 pub GPIOA: GPIOA,
1305 pub SYSCFG: SYSCFG,
1307 pub SPI1: SPI1,
1309 pub SPI2: SPI2,
1311 pub SPI3: SPI3,
1313 pub I2S2EXT: I2S2EXT,
1315 pub I2S3EXT: I2S3EXT,
1317 pub SDIO: SDIO,
1319 pub ADC1: ADC1,
1321 pub ADC2: ADC2,
1323 pub ADC3: ADC3,
1325 pub USART1: USART1,
1327 pub USART6: USART6,
1329 pub USART2: USART2,
1331 pub USART3: USART3,
1333 pub DAC: DAC,
1335 pub PWR: PWR,
1337 pub I2C1: I2C1,
1339 pub I2C3: I2C3,
1341 pub I2C2: I2C2,
1343 pub IWDG: IWDG,
1345 pub WWDG: WWDG,
1347 pub RTC: RTC,
1349 pub UART4: UART4,
1351 pub UART5: UART5,
1353 pub ADC_COMMON: ADC_COMMON,
1355 pub TIM1: TIM1,
1357 pub TIM8: TIM8,
1359 pub TIM2: TIM2,
1361 pub TIM3: TIM3,
1363 pub TIM4: TIM4,
1365 pub TIM5: TIM5,
1367 pub TIM9: TIM9,
1369 pub TIM12: TIM12,
1371 pub TIM10: TIM10,
1373 pub TIM13: TIM13,
1375 pub TIM14: TIM14,
1377 pub TIM11: TIM11,
1379 pub TIM6: TIM6,
1381 pub TIM7: TIM7,
1383 pub ETHERNET_MAC: ETHERNET_MAC,
1385 pub ETHERNET_MMC: ETHERNET_MMC,
1387 pub ETHERNET_PTP: ETHERNET_PTP,
1389 pub ETHERNET_DMA: ETHERNET_DMA,
1391 pub CRC: CRC,
1393 pub OTG_FS_GLOBAL: OTG_FS_GLOBAL,
1395 pub OTG_FS_HOST: OTG_FS_HOST,
1397 pub OTG_FS_DEVICE: OTG_FS_DEVICE,
1399 pub OTG_FS_PWRCLK: OTG_FS_PWRCLK,
1401 pub CAN1: CAN1,
1403 pub CAN2: CAN2,
1405 pub FLASH: FLASH,
1407 pub EXTI: EXTI,
1409 pub OTG_HS_GLOBAL: OTG_HS_GLOBAL,
1411 pub OTG_HS_HOST: OTG_HS_HOST,
1413 pub OTG_HS_DEVICE: OTG_HS_DEVICE,
1415 pub OTG_HS_PWRCLK: OTG_HS_PWRCLK,
1417 pub HASH: HASH,
1419 pub CRYP: CRYP,
1421}
1422impl Peripherals {
1423 #[cfg(feature = "critical-section")]
1425 #[inline]
1426 pub fn take() -> Option<Self> {
1427 critical_section::with(|_| {
1428 if unsafe { DEVICE_PERIPHERALS } {
1429 return None;
1430 }
1431 Some(unsafe { Peripherals::steal() })
1432 })
1433 }
1434 #[inline]
1440 pub unsafe fn steal() -> Self {
1441 DEVICE_PERIPHERALS = true;
1442 Peripherals {
1443 RNG: RNG::steal(),
1444 DCMI: DCMI::steal(),
1445 FSMC: FSMC::steal(),
1446 DBGMCU: DBGMCU::steal(),
1447 DMA2: DMA2::steal(),
1448 DMA1: DMA1::steal(),
1449 RCC: RCC::steal(),
1450 GPIOI: GPIOI::steal(),
1451 GPIOH: GPIOH::steal(),
1452 GPIOG: GPIOG::steal(),
1453 GPIOF: GPIOF::steal(),
1454 GPIOE: GPIOE::steal(),
1455 GPIOD: GPIOD::steal(),
1456 GPIOC: GPIOC::steal(),
1457 GPIOJ: GPIOJ::steal(),
1458 GPIOK: GPIOK::steal(),
1459 GPIOB: GPIOB::steal(),
1460 GPIOA: GPIOA::steal(),
1461 SYSCFG: SYSCFG::steal(),
1462 SPI1: SPI1::steal(),
1463 SPI2: SPI2::steal(),
1464 SPI3: SPI3::steal(),
1465 I2S2EXT: I2S2EXT::steal(),
1466 I2S3EXT: I2S3EXT::steal(),
1467 SDIO: SDIO::steal(),
1468 ADC1: ADC1::steal(),
1469 ADC2: ADC2::steal(),
1470 ADC3: ADC3::steal(),
1471 USART1: USART1::steal(),
1472 USART6: USART6::steal(),
1473 USART2: USART2::steal(),
1474 USART3: USART3::steal(),
1475 DAC: DAC::steal(),
1476 PWR: PWR::steal(),
1477 I2C1: I2C1::steal(),
1478 I2C3: I2C3::steal(),
1479 I2C2: I2C2::steal(),
1480 IWDG: IWDG::steal(),
1481 WWDG: WWDG::steal(),
1482 RTC: RTC::steal(),
1483 UART4: UART4::steal(),
1484 UART5: UART5::steal(),
1485 ADC_COMMON: ADC_COMMON::steal(),
1486 TIM1: TIM1::steal(),
1487 TIM8: TIM8::steal(),
1488 TIM2: TIM2::steal(),
1489 TIM3: TIM3::steal(),
1490 TIM4: TIM4::steal(),
1491 TIM5: TIM5::steal(),
1492 TIM9: TIM9::steal(),
1493 TIM12: TIM12::steal(),
1494 TIM10: TIM10::steal(),
1495 TIM13: TIM13::steal(),
1496 TIM14: TIM14::steal(),
1497 TIM11: TIM11::steal(),
1498 TIM6: TIM6::steal(),
1499 TIM7: TIM7::steal(),
1500 ETHERNET_MAC: ETHERNET_MAC::steal(),
1501 ETHERNET_MMC: ETHERNET_MMC::steal(),
1502 ETHERNET_PTP: ETHERNET_PTP::steal(),
1503 ETHERNET_DMA: ETHERNET_DMA::steal(),
1504 CRC: CRC::steal(),
1505 OTG_FS_GLOBAL: OTG_FS_GLOBAL::steal(),
1506 OTG_FS_HOST: OTG_FS_HOST::steal(),
1507 OTG_FS_DEVICE: OTG_FS_DEVICE::steal(),
1508 OTG_FS_PWRCLK: OTG_FS_PWRCLK::steal(),
1509 CAN1: CAN1::steal(),
1510 CAN2: CAN2::steal(),
1511 FLASH: FLASH::steal(),
1512 EXTI: EXTI::steal(),
1513 OTG_HS_GLOBAL: OTG_HS_GLOBAL::steal(),
1514 OTG_HS_HOST: OTG_HS_HOST::steal(),
1515 OTG_HS_DEVICE: OTG_HS_DEVICE::steal(),
1516 OTG_HS_PWRCLK: OTG_HS_PWRCLK::steal(),
1517 HASH: HASH::steal(),
1518 CRYP: CRYP::steal(),
1519 }
1520 }
1521}