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 PVD();
21 fn TAMP_STAMP();
22 fn RTC_WKUP();
23 fn FLASH();
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_EVT();
51 fn I2C1_ERR();
52 fn I2C2_EVT();
53 fn I2C2_ERR();
54 fn SPI1();
55 fn SPI2();
56 fn USART1();
57 fn USART2();
58 fn USART3();
59 fn EXTI15_10();
60 fn EXTI17_RTC_ALARM();
61 fn TIM8_BRK_TIM12();
62 fn TIM8_UP_TIM13();
63 fn TIM8_TRG_COM_TIM14();
64 fn TIM8_CC();
65 fn DMA1_STREAM7();
66 fn FSMC();
67 fn SDIO();
68 fn TIM5();
69 fn UART4();
70 fn UART5();
71 fn TIM6_GLB_IT_DAC1_DAC2();
72 fn TIM7();
73 fn DMA2_STREAM0();
74 fn DMA2_STREAM1();
75 fn DMA2_STREAM2();
76 fn DMA2_STREAM3();
77 fn DMA2_STREAM4();
78 fn DFSDM1_FLT0();
79 fn DFSDM1_FLT1();
80 fn CAN2_TX();
81 fn CAN2_RX0();
82 fn CAN2_RX1();
83 fn CAN2_SCE();
84 fn OTG_FS();
85 fn DMA2_STREAM5();
86 fn DMA2_STREAM6();
87 fn DMA2_STREAM7();
88 fn USART6();
89 fn I2C3_EV();
90 fn I2C3_ER();
91 fn CAN3_TX();
92 fn CAN3_RX0();
93 fn CAN3_RX1();
94 fn CAN3_SCE();
95 fn CRYPTO();
96 fn RNG();
97 fn FPU();
98 fn UART7();
99 fn UART8();
100 fn SPI4();
101 fn SPI5();
102 fn SAI1();
103 fn UART9();
104 fn UART10();
105 fn QUAD_SPI();
106 fn I2CFMP1EVENT();
107 fn I2CFMP1ERROR();
108 fn LPTIM1_OR_IT_EIT_23();
109 fn DFSDM2_FILTER1();
110 fn DFSDM2_FILTER2();
111 fn DFSDM2_FILTER3();
112 fn DFSDM2_FILTER4();
113}
114#[doc(hidden)]
115#[repr(C)]
116pub union Vector {
117 _handler: unsafe extern "C" fn(),
118 _reserved: u32,
119}
120#[cfg(feature = "rt")]
121#[doc(hidden)]
122#[link_section = ".vector_table.interrupts"]
123#[no_mangle]
124pub static __INTERRUPTS: [Vector; 102] = [
125 Vector { _reserved: 0 },
126 Vector { _handler: PVD },
127 Vector {
128 _handler: TAMP_STAMP,
129 },
130 Vector { _handler: RTC_WKUP },
131 Vector { _handler: FLASH },
132 Vector { _handler: RCC },
133 Vector { _handler: EXTI0 },
134 Vector { _handler: EXTI1 },
135 Vector { _handler: EXTI2 },
136 Vector { _handler: EXTI3 },
137 Vector { _handler: EXTI4 },
138 Vector {
139 _handler: DMA1_STREAM0,
140 },
141 Vector {
142 _handler: DMA1_STREAM1,
143 },
144 Vector {
145 _handler: DMA1_STREAM2,
146 },
147 Vector {
148 _handler: DMA1_STREAM3,
149 },
150 Vector {
151 _handler: DMA1_STREAM4,
152 },
153 Vector {
154 _handler: DMA1_STREAM5,
155 },
156 Vector {
157 _handler: DMA1_STREAM6,
158 },
159 Vector { _handler: ADC },
160 Vector { _handler: CAN1_TX },
161 Vector { _handler: CAN1_RX0 },
162 Vector { _handler: CAN1_RX1 },
163 Vector { _handler: CAN1_SCE },
164 Vector { _handler: EXTI9_5 },
165 Vector {
166 _handler: TIM1_BRK_TIM9,
167 },
168 Vector {
169 _handler: TIM1_UP_TIM10,
170 },
171 Vector {
172 _handler: TIM1_TRG_COM_TIM11,
173 },
174 Vector { _handler: TIM1_CC },
175 Vector { _handler: TIM2 },
176 Vector { _handler: TIM3 },
177 Vector { _handler: TIM4 },
178 Vector { _handler: I2C1_EVT },
179 Vector { _handler: I2C1_ERR },
180 Vector { _handler: I2C2_EVT },
181 Vector { _handler: I2C2_ERR },
182 Vector { _handler: SPI1 },
183 Vector { _handler: SPI2 },
184 Vector { _handler: USART1 },
185 Vector { _handler: USART2 },
186 Vector { _handler: USART3 },
187 Vector {
188 _handler: EXTI15_10,
189 },
190 Vector {
191 _handler: EXTI17_RTC_ALARM,
192 },
193 Vector { _reserved: 0 },
194 Vector {
195 _handler: TIM8_BRK_TIM12,
196 },
197 Vector {
198 _handler: TIM8_UP_TIM13,
199 },
200 Vector {
201 _handler: TIM8_TRG_COM_TIM14,
202 },
203 Vector { _handler: TIM8_CC },
204 Vector {
205 _handler: DMA1_STREAM7,
206 },
207 Vector { _handler: FSMC },
208 Vector { _handler: SDIO },
209 Vector { _handler: TIM5 },
210 Vector { _reserved: 0 },
211 Vector { _handler: UART4 },
212 Vector { _handler: UART5 },
213 Vector {
214 _handler: TIM6_GLB_IT_DAC1_DAC2,
215 },
216 Vector { _handler: TIM7 },
217 Vector {
218 _handler: DMA2_STREAM0,
219 },
220 Vector {
221 _handler: DMA2_STREAM1,
222 },
223 Vector {
224 _handler: DMA2_STREAM2,
225 },
226 Vector {
227 _handler: DMA2_STREAM3,
228 },
229 Vector {
230 _handler: DMA2_STREAM4,
231 },
232 Vector {
233 _handler: DFSDM1_FLT0,
234 },
235 Vector {
236 _handler: DFSDM1_FLT1,
237 },
238 Vector { _handler: CAN2_TX },
239 Vector { _handler: CAN2_RX0 },
240 Vector { _handler: CAN2_RX1 },
241 Vector { _handler: CAN2_SCE },
242 Vector { _handler: OTG_FS },
243 Vector {
244 _handler: DMA2_STREAM5,
245 },
246 Vector {
247 _handler: DMA2_STREAM6,
248 },
249 Vector {
250 _handler: DMA2_STREAM7,
251 },
252 Vector { _handler: USART6 },
253 Vector { _handler: I2C3_EV },
254 Vector { _handler: I2C3_ER },
255 Vector { _handler: CAN3_TX },
256 Vector { _handler: CAN3_RX0 },
257 Vector { _handler: CAN3_RX1 },
258 Vector { _handler: CAN3_SCE },
259 Vector { _reserved: 0 },
260 Vector { _handler: CRYPTO },
261 Vector { _handler: RNG },
262 Vector { _handler: FPU },
263 Vector { _handler: UART7 },
264 Vector { _handler: UART8 },
265 Vector { _handler: SPI4 },
266 Vector { _handler: SPI5 },
267 Vector { _reserved: 0 },
268 Vector { _handler: SAI1 },
269 Vector { _handler: UART9 },
270 Vector { _handler: UART10 },
271 Vector { _reserved: 0 },
272 Vector { _reserved: 0 },
273 Vector { _handler: QUAD_SPI },
274 Vector { _reserved: 0 },
275 Vector { _reserved: 0 },
276 Vector {
277 _handler: I2CFMP1EVENT,
278 },
279 Vector {
280 _handler: I2CFMP1ERROR,
281 },
282 Vector {
283 _handler: LPTIM1_OR_IT_EIT_23,
284 },
285 Vector {
286 _handler: DFSDM2_FILTER1,
287 },
288 Vector {
289 _handler: DFSDM2_FILTER2,
290 },
291 Vector {
292 _handler: DFSDM2_FILTER3,
293 },
294 Vector {
295 _handler: DFSDM2_FILTER4,
296 },
297];
298#[cfg_attr(feature = "defmt", derive(defmt::Format))]
300#[derive(Copy, Clone, Debug, PartialEq, Eq)]
301#[repr(u16)]
302pub enum Interrupt {
303 PVD = 1,
305 TAMP_STAMP = 2,
307 RTC_WKUP = 3,
309 FLASH = 4,
311 RCC = 5,
313 EXTI0 = 6,
315 EXTI1 = 7,
317 EXTI2 = 8,
319 EXTI3 = 9,
321 EXTI4 = 10,
323 DMA1_STREAM0 = 11,
325 DMA1_STREAM1 = 12,
327 DMA1_STREAM2 = 13,
329 DMA1_STREAM3 = 14,
331 DMA1_STREAM4 = 15,
333 DMA1_STREAM5 = 16,
335 DMA1_STREAM6 = 17,
337 ADC = 18,
339 CAN1_TX = 19,
341 CAN1_RX0 = 20,
343 CAN1_RX1 = 21,
345 CAN1_SCE = 22,
347 EXTI9_5 = 23,
349 TIM1_BRK_TIM9 = 24,
351 TIM1_UP_TIM10 = 25,
353 TIM1_TRG_COM_TIM11 = 26,
355 TIM1_CC = 27,
357 TIM2 = 28,
359 TIM3 = 29,
361 TIM4 = 30,
363 I2C1_EVT = 31,
365 I2C1_ERR = 32,
367 I2C2_EVT = 33,
369 I2C2_ERR = 34,
371 SPI1 = 35,
373 SPI2 = 36,
375 USART1 = 37,
377 USART2 = 38,
379 USART3 = 39,
381 EXTI15_10 = 40,
383 EXTI17_RTC_ALARM = 41,
385 TIM8_BRK_TIM12 = 43,
387 TIM8_UP_TIM13 = 44,
389 TIM8_TRG_COM_TIM14 = 45,
391 TIM8_CC = 46,
393 DMA1_STREAM7 = 47,
395 FSMC = 48,
397 SDIO = 49,
399 TIM5 = 50,
401 UART4 = 52,
403 UART5 = 53,
405 TIM6_GLB_IT_DAC1_DAC2 = 54,
407 TIM7 = 55,
409 DMA2_STREAM0 = 56,
411 DMA2_STREAM1 = 57,
413 DMA2_STREAM2 = 58,
415 DMA2_STREAM3 = 59,
417 DMA2_STREAM4 = 60,
419 DFSDM1_FLT0 = 61,
421 DFSDM1_FLT1 = 62,
423 CAN2_TX = 63,
425 CAN2_RX0 = 64,
427 CAN2_RX1 = 65,
429 CAN2_SCE = 66,
431 OTG_FS = 67,
433 DMA2_STREAM5 = 68,
435 DMA2_STREAM6 = 69,
437 DMA2_STREAM7 = 70,
439 USART6 = 71,
441 I2C3_EV = 72,
443 I2C3_ER = 73,
445 CAN3_TX = 74,
447 CAN3_RX0 = 75,
449 CAN3_RX1 = 76,
451 CAN3_SCE = 77,
453 CRYPTO = 79,
455 RNG = 80,
457 FPU = 81,
459 UART7 = 82,
461 UART8 = 83,
463 SPI4 = 84,
465 SPI5 = 85,
467 SAI1 = 87,
469 UART9 = 88,
471 UART10 = 89,
473 QUAD_SPI = 92,
475 I2CFMP1EVENT = 95,
477 I2CFMP1ERROR = 96,
479 LPTIM1_OR_IT_EIT_23 = 97,
481 DFSDM2_FILTER1 = 98,
483 DFSDM2_FILTER2 = 99,
485 DFSDM2_FILTER3 = 100,
487 DFSDM2_FILTER4 = 101,
489}
490unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
491 #[inline(always)]
492 fn number(self) -> u16 {
493 self as u16
494 }
495}
496pub type AES = crate::Periph<aes::RegisterBlock, 0x5006_0000>;
500impl core::fmt::Debug for AES {
501 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
502 f.debug_struct("AES").finish()
503 }
504}
505pub mod aes;
507pub type TIM1 = crate::Periph<tim1::RegisterBlock, 0x4001_0000>;
511impl core::fmt::Debug for TIM1 {
512 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
513 f.debug_struct("TIM1").finish()
514 }
515}
516pub mod tim1;
518pub type TIM8 = crate::Periph<tim1::RegisterBlock, 0x4001_0400>;
522impl core::fmt::Debug for TIM8 {
523 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
524 f.debug_struct("TIM8").finish()
525 }
526}
527pub use self::tim1 as tim8;
529pub type ADC1 = crate::Periph<adc1::RegisterBlock, 0x4001_2000>;
533impl core::fmt::Debug for ADC1 {
534 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
535 f.debug_struct("ADC1").finish()
536 }
537}
538pub mod adc1;
540pub type TIM7 = crate::Periph<tim7::RegisterBlock, 0x4000_1400>;
544impl core::fmt::Debug for TIM7 {
545 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
546 f.debug_struct("TIM7").finish()
547 }
548}
549pub mod tim7;
551pub type TIM6 = crate::Periph<tim7::RegisterBlock, 0x4000_1000>;
555impl core::fmt::Debug for TIM6 {
556 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
557 f.debug_struct("TIM6").finish()
558 }
559}
560pub use self::tim7 as tim6;
562pub type CAN1 = crate::Periph<can1::RegisterBlock, 0x4000_6400>;
566impl core::fmt::Debug for CAN1 {
567 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
568 f.debug_struct("CAN1").finish()
569 }
570}
571pub mod can1;
573pub type CAN2 = crate::Periph<can1::RegisterBlock, 0x4000_6800>;
577impl core::fmt::Debug for CAN2 {
578 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
579 f.debug_struct("CAN2").finish()
580 }
581}
582pub use self::can1 as can2;
584pub type CAN3 = crate::Periph<can1::RegisterBlock, 0x4000_6c00>;
588impl core::fmt::Debug for CAN3 {
589 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
590 f.debug_struct("CAN3").finish()
591 }
592}
593pub use self::can1 as can3;
595pub type CRC = crate::Periph<crc::RegisterBlock, 0x4002_3000>;
599impl core::fmt::Debug for CRC {
600 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
601 f.debug_struct("CRC").finish()
602 }
603}
604pub mod crc;
606pub type DBGMCU = crate::Periph<dbgmcu::RegisterBlock, 0xe004_2000>;
610impl core::fmt::Debug for DBGMCU {
611 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
612 f.debug_struct("DBGMCU").finish()
613 }
614}
615pub mod dbgmcu;
617pub type DFSDM2 = crate::Periph<dfsdm2::RegisterBlock, 0x4001_6400>;
621impl core::fmt::Debug for DFSDM2 {
622 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
623 f.debug_struct("DFSDM2").finish()
624 }
625}
626pub mod dfsdm2;
628pub type DFSDM1 = crate::Periph<dfsdm2::RegisterBlock, 0x4001_6000>;
632impl core::fmt::Debug for DFSDM1 {
633 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
634 f.debug_struct("DFSDM1").finish()
635 }
636}
637pub use self::dfsdm2 as dfsdm1;
639pub type DAC = crate::Periph<dac::RegisterBlock, 0x4000_7400>;
643impl core::fmt::Debug for DAC {
644 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
645 f.debug_struct("DAC").finish()
646 }
647}
648pub mod dac;
650pub type DMA1 = crate::Periph<dma1::RegisterBlock, 0x4002_6000>;
654impl core::fmt::Debug for DMA1 {
655 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
656 f.debug_struct("DMA1").finish()
657 }
658}
659pub mod dma1;
661pub type DMA2 = crate::Periph<dma1::RegisterBlock, 0x4002_6400>;
665impl core::fmt::Debug for DMA2 {
666 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
667 f.debug_struct("DMA2").finish()
668 }
669}
670pub use self::dma1 as dma2;
672pub type EXTI = crate::Periph<exti::RegisterBlock, 0x4001_3c00>;
676impl core::fmt::Debug for EXTI {
677 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
678 f.debug_struct("EXTI").finish()
679 }
680}
681pub mod exti;
683pub type FMPI2C1 = crate::Periph<fmpi2c1::RegisterBlock, 0x4000_6000>;
687impl core::fmt::Debug for FMPI2C1 {
688 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
689 f.debug_struct("FMPI2C1").finish()
690 }
691}
692pub mod fmpi2c1;
694pub type FLASH = crate::Periph<flash::RegisterBlock, 0x4002_3c00>;
698impl core::fmt::Debug for FLASH {
699 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
700 f.debug_struct("FLASH").finish()
701 }
702}
703pub mod flash;
705pub type TIM12 = crate::Periph<tim12::RegisterBlock, 0x4000_1800>;
709impl core::fmt::Debug for TIM12 {
710 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
711 f.debug_struct("TIM12").finish()
712 }
713}
714pub mod tim12;
716pub type TIM10 = crate::Periph<tim10::RegisterBlock, 0x4001_4400>;
720impl core::fmt::Debug for TIM10 {
721 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
722 f.debug_struct("TIM10").finish()
723 }
724}
725pub mod tim10;
727pub type TIM13 = crate::Periph<tim10::RegisterBlock, 0x4000_1c00>;
731impl core::fmt::Debug for TIM13 {
732 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
733 f.debug_struct("TIM13").finish()
734 }
735}
736pub use self::tim10 as tim13;
738pub type TIM14 = crate::Periph<tim10::RegisterBlock, 0x4000_2000>;
742impl core::fmt::Debug for TIM14 {
743 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
744 f.debug_struct("TIM14").finish()
745 }
746}
747pub use self::tim10 as tim14;
749pub type TIM9 = crate::Periph<tim12::RegisterBlock, 0x4001_4000>;
753impl core::fmt::Debug for TIM9 {
754 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
755 f.debug_struct("TIM9").finish()
756 }
757}
758pub use self::tim12 as tim9;
760pub type TIM3 = crate::Periph<tim3::RegisterBlock, 0x4000_0400>;
764impl core::fmt::Debug for TIM3 {
765 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
766 f.debug_struct("TIM3").finish()
767 }
768}
769pub mod tim3;
771pub type TIM4 = crate::Periph<tim3::RegisterBlock, 0x4000_0800>;
775impl core::fmt::Debug for TIM4 {
776 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
777 f.debug_struct("TIM4").finish()
778 }
779}
780pub use self::tim3 as tim4;
782pub type TIM2 = crate::Periph<tim2::RegisterBlock, 0x4000_0000>;
786impl core::fmt::Debug for TIM2 {
787 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
788 f.debug_struct("TIM2").finish()
789 }
790}
791pub mod tim2;
793pub type GPIOF = crate::Periph<gpiof::RegisterBlock, 0x4002_1400>;
797impl core::fmt::Debug for GPIOF {
798 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
799 f.debug_struct("GPIOF").finish()
800 }
801}
802pub mod gpiof;
804pub type GPIOH = crate::Periph<gpiof::RegisterBlock, 0x4002_1c00>;
808impl core::fmt::Debug for GPIOH {
809 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
810 f.debug_struct("GPIOH").finish()
811 }
812}
813pub use self::gpiof as gpioh;
815pub type GPIOE = crate::Periph<gpiof::RegisterBlock, 0x4002_1000>;
819impl core::fmt::Debug for GPIOE {
820 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
821 f.debug_struct("GPIOE").finish()
822 }
823}
824pub use self::gpiof as gpioe;
826pub type GPIOC = crate::Periph<gpiof::RegisterBlock, 0x4002_0800>;
830impl core::fmt::Debug for GPIOC {
831 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
832 f.debug_struct("GPIOC").finish()
833 }
834}
835pub use self::gpiof as gpioc;
837pub type GPIOG = crate::Periph<gpiof::RegisterBlock, 0x4002_1800>;
841impl core::fmt::Debug for GPIOG {
842 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
843 f.debug_struct("GPIOG").finish()
844 }
845}
846pub use self::gpiof as gpiog;
848pub type GPIOD = crate::Periph<gpiof::RegisterBlock, 0x4002_0c00>;
852impl core::fmt::Debug for GPIOD {
853 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
854 f.debug_struct("GPIOD").finish()
855 }
856}
857pub use self::gpiof as gpiod;
859pub type GPIOB = crate::Periph<gpiob::RegisterBlock, 0x4002_0400>;
863impl core::fmt::Debug for GPIOB {
864 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
865 f.debug_struct("GPIOB").finish()
866 }
867}
868pub mod gpiob;
870pub type GPIOA = crate::Periph<gpioa::RegisterBlock, 0x4002_0000>;
874impl core::fmt::Debug for GPIOA {
875 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
876 f.debug_struct("GPIOA").finish()
877 }
878}
879pub mod gpioa;
881pub type TIM11 = crate::Periph<tim11::RegisterBlock, 0x4001_4800>;
885impl core::fmt::Debug for TIM11 {
886 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
887 f.debug_struct("TIM11").finish()
888 }
889}
890pub mod tim11;
892pub type TIM5 = crate::Periph<tim5::RegisterBlock, 0x4000_0c00>;
896impl core::fmt::Debug for TIM5 {
897 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
898 f.debug_struct("TIM5").finish()
899 }
900}
901pub mod tim5;
903pub type IWDG = crate::Periph<iwdg::RegisterBlock, 0x4000_3000>;
907impl core::fmt::Debug for IWDG {
908 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
909 f.debug_struct("IWDG").finish()
910 }
911}
912pub mod iwdg;
914pub type I2S2EXT = crate::Periph<spi1::RegisterBlock, 0x4000_3400>;
918impl core::fmt::Debug for I2S2EXT {
919 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
920 f.debug_struct("I2S2EXT").finish()
921 }
922}
923pub use self::spi1 as i2s2ext;
925pub type I2C1 = crate::Periph<i2c1::RegisterBlock, 0x4000_5400>;
929impl core::fmt::Debug for I2C1 {
930 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
931 f.debug_struct("I2C1").finish()
932 }
933}
934pub mod i2c1;
936pub type I2C2 = crate::Periph<i2c1::RegisterBlock, 0x4000_5800>;
940impl core::fmt::Debug for I2C2 {
941 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
942 f.debug_struct("I2C2").finish()
943 }
944}
945pub use self::i2c1 as i2c2;
947pub type I2C3 = crate::Periph<i2c1::RegisterBlock, 0x4000_5c00>;
951impl core::fmt::Debug for I2C3 {
952 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
953 f.debug_struct("I2C3").finish()
954 }
955}
956pub use self::i2c1 as i2c3;
958pub type LPTIM = crate::Periph<lptim::RegisterBlock, 0x4000_2400>;
962impl core::fmt::Debug for LPTIM {
963 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
964 f.debug_struct("LPTIM").finish()
965 }
966}
967pub mod lptim;
969pub type PWR = crate::Periph<pwr::RegisterBlock, 0x4000_7000>;
973impl core::fmt::Debug for PWR {
974 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
975 f.debug_struct("PWR").finish()
976 }
977}
978pub mod pwr;
980pub type QUADSPI = crate::Periph<quadspi::RegisterBlock, 0xa000_1000>;
984impl core::fmt::Debug for QUADSPI {
985 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
986 f.debug_struct("QUADSPI").finish()
987 }
988}
989pub mod quadspi;
991pub type RNG = crate::Periph<rng::RegisterBlock, 0x5006_0800>;
995impl core::fmt::Debug for RNG {
996 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
997 f.debug_struct("RNG").finish()
998 }
999}
1000pub mod rng;
1002pub type RTC = crate::Periph<rtc::RegisterBlock, 0x4000_2800>;
1006impl core::fmt::Debug for RTC {
1007 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1008 f.debug_struct("RTC").finish()
1009 }
1010}
1011pub mod rtc;
1013pub type RCC = crate::Periph<rcc::RegisterBlock, 0x4002_3800>;
1017impl core::fmt::Debug for RCC {
1018 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1019 f.debug_struct("RCC").finish()
1020 }
1021}
1022pub mod rcc;
1024pub type SDIO = crate::Periph<sdio::RegisterBlock, 0x4001_2c00>;
1028impl core::fmt::Debug for SDIO {
1029 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1030 f.debug_struct("SDIO").finish()
1031 }
1032}
1033pub mod sdio;
1035pub type SAI = crate::Periph<sai::RegisterBlock, 0x4001_5800>;
1039impl core::fmt::Debug for SAI {
1040 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1041 f.debug_struct("SAI").finish()
1042 }
1043}
1044pub mod sai;
1046pub type SPI1 = crate::Periph<spi1::RegisterBlock, 0x4001_3000>;
1050impl core::fmt::Debug for SPI1 {
1051 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1052 f.debug_struct("SPI1").finish()
1053 }
1054}
1055pub mod spi1;
1057pub type SPI5 = crate::Periph<spi1::RegisterBlock, 0x4001_5000>;
1061impl core::fmt::Debug for SPI5 {
1062 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1063 f.debug_struct("SPI5").finish()
1064 }
1065}
1066pub use self::spi1 as spi5;
1068pub type SPI4 = crate::Periph<spi1::RegisterBlock, 0x4001_3400>;
1072impl core::fmt::Debug for SPI4 {
1073 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1074 f.debug_struct("SPI4").finish()
1075 }
1076}
1077pub use self::spi1 as spi4;
1079pub type SPI2 = crate::Periph<spi1::RegisterBlock, 0x4000_3800>;
1083impl core::fmt::Debug for SPI2 {
1084 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1085 f.debug_struct("SPI2").finish()
1086 }
1087}
1088pub use self::spi1 as spi2;
1090pub type SPI6 = crate::Periph<spi1::RegisterBlock, 0x4001_5400>;
1094impl core::fmt::Debug for SPI6 {
1095 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1096 f.debug_struct("SPI6").finish()
1097 }
1098}
1099pub use self::spi1 as spi6;
1101pub type SPI3 = crate::Periph<spi1::RegisterBlock, 0x4000_3c00>;
1105impl core::fmt::Debug for SPI3 {
1106 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1107 f.debug_struct("SPI3").finish()
1108 }
1109}
1110pub use self::spi1 as spi3;
1112pub type I2S3EXT = crate::Periph<spi1::RegisterBlock, 0x4000_4000>;
1116impl core::fmt::Debug for I2S3EXT {
1117 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1118 f.debug_struct("I2S3EXT").finish()
1119 }
1120}
1121pub use self::spi1 as i2s3ext;
1123pub type SYSCFG = crate::Periph<syscfg::RegisterBlock, 0x4001_3800>;
1127impl core::fmt::Debug for SYSCFG {
1128 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1129 f.debug_struct("SYSCFG").finish()
1130 }
1131}
1132pub mod syscfg;
1134pub type USART1 = crate::Periph<usart1::RegisterBlock, 0x4001_1000>;
1138impl core::fmt::Debug for USART1 {
1139 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1140 f.debug_struct("USART1").finish()
1141 }
1142}
1143pub mod usart1;
1145pub type USART3 = crate::Periph<usart1::RegisterBlock, 0x4000_4800>;
1149impl core::fmt::Debug for USART3 {
1150 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1151 f.debug_struct("USART3").finish()
1152 }
1153}
1154pub use self::usart1 as usart3;
1156pub type USART6 = crate::Periph<usart1::RegisterBlock, 0x4001_1400>;
1160impl core::fmt::Debug for USART6 {
1161 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1162 f.debug_struct("USART6").finish()
1163 }
1164}
1165pub use self::usart1 as usart6;
1167pub type USART2 = crate::Periph<usart1::RegisterBlock, 0x4000_4400>;
1171impl core::fmt::Debug for USART2 {
1172 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1173 f.debug_struct("USART2").finish()
1174 }
1175}
1176pub use self::usart1 as usart2;
1178pub type UART4 = crate::Periph<uart4::RegisterBlock, 0x4000_4c00>;
1182impl core::fmt::Debug for UART4 {
1183 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1184 f.debug_struct("UART4").finish()
1185 }
1186}
1187pub mod uart4;
1189pub type UART10 = crate::Periph<uart4::RegisterBlock, 0x4001_1c00>;
1193impl core::fmt::Debug for UART10 {
1194 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1195 f.debug_struct("UART10").finish()
1196 }
1197}
1198pub use self::uart4 as uart10;
1200pub type UART9 = crate::Periph<uart4::RegisterBlock, 0x4001_1800>;
1204impl core::fmt::Debug for UART9 {
1205 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1206 f.debug_struct("UART9").finish()
1207 }
1208}
1209pub use self::uart4 as uart9;
1211pub type OTG_FS_DEVICE = crate::Periph<otg_fs_device::RegisterBlock, 0x5000_0800>;
1215impl core::fmt::Debug for OTG_FS_DEVICE {
1216 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1217 f.debug_struct("OTG_FS_DEVICE").finish()
1218 }
1219}
1220pub mod otg_fs_device;
1222pub type OTG_FS_HOST = crate::Periph<otg_fs_host::RegisterBlock, 0x5000_0400>;
1226impl core::fmt::Debug for OTG_FS_HOST {
1227 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1228 f.debug_struct("OTG_FS_HOST").finish()
1229 }
1230}
1231pub mod otg_fs_host;
1233pub type OTG_FS_PWRCLK = crate::Periph<otg_fs_pwrclk::RegisterBlock, 0x5000_0e00>;
1237impl core::fmt::Debug for OTG_FS_PWRCLK {
1238 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1239 f.debug_struct("OTG_FS_PWRCLK").finish()
1240 }
1241}
1242pub mod otg_fs_pwrclk;
1244pub type OTG_FS_GLOBAL = crate::Periph<otg_fs_global::RegisterBlock, 0x5000_0000>;
1248impl core::fmt::Debug for OTG_FS_GLOBAL {
1249 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1250 f.debug_struct("OTG_FS_GLOBAL").finish()
1251 }
1252}
1253pub mod otg_fs_global;
1255pub type WWDG = crate::Periph<wwdg::RegisterBlock, 0x4000_2c00>;
1259impl core::fmt::Debug for WWDG {
1260 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1261 f.debug_struct("WWDG").finish()
1262 }
1263}
1264pub mod wwdg;
1266pub type FSMC = crate::Periph<fsmc::RegisterBlock, 0xa000_0000>;
1270impl core::fmt::Debug for FSMC {
1271 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1272 f.debug_struct("FSMC").finish()
1273 }
1274}
1275pub mod fsmc;
1277pub type ADC_COMMON = crate::Periph<adc_common::RegisterBlock, 0x4001_2300>;
1281impl core::fmt::Debug for ADC_COMMON {
1282 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1283 f.debug_struct("ADC_COMMON").finish()
1284 }
1285}
1286pub mod adc_common;
1288pub type UART5 = crate::Periph<uart4::RegisterBlock, 0x4000_5000>;
1292impl core::fmt::Debug for UART5 {
1293 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1294 f.debug_struct("UART5").finish()
1295 }
1296}
1297pub use self::uart4 as uart5;
1299pub type UART7 = crate::Periph<uart4::RegisterBlock, 0x4000_7800>;
1303impl core::fmt::Debug for UART7 {
1304 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1305 f.debug_struct("UART7").finish()
1306 }
1307}
1308pub use self::uart4 as uart7;
1310pub type UART8 = crate::Periph<uart4::RegisterBlock, 0x4000_7c00>;
1314impl core::fmt::Debug for UART8 {
1315 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1316 f.debug_struct("UART8").finish()
1317 }
1318}
1319pub use self::uart4 as uart8;
1321#[no_mangle]
1322static mut DEVICE_PERIPHERALS: bool = false;
1323#[allow(non_snake_case)]
1325pub struct Peripherals {
1326 pub AES: AES,
1328 pub TIM1: TIM1,
1330 pub TIM8: TIM8,
1332 pub ADC1: ADC1,
1334 pub TIM7: TIM7,
1336 pub TIM6: TIM6,
1338 pub CAN1: CAN1,
1340 pub CAN2: CAN2,
1342 pub CAN3: CAN3,
1344 pub CRC: CRC,
1346 pub DBGMCU: DBGMCU,
1348 pub DFSDM2: DFSDM2,
1350 pub DFSDM1: DFSDM1,
1352 pub DAC: DAC,
1354 pub DMA1: DMA1,
1356 pub DMA2: DMA2,
1358 pub EXTI: EXTI,
1360 pub FMPI2C1: FMPI2C1,
1362 pub FLASH: FLASH,
1364 pub TIM12: TIM12,
1366 pub TIM10: TIM10,
1368 pub TIM13: TIM13,
1370 pub TIM14: TIM14,
1372 pub TIM9: TIM9,
1374 pub TIM3: TIM3,
1376 pub TIM4: TIM4,
1378 pub TIM2: TIM2,
1380 pub GPIOF: GPIOF,
1382 pub GPIOH: GPIOH,
1384 pub GPIOE: GPIOE,
1386 pub GPIOC: GPIOC,
1388 pub GPIOG: GPIOG,
1390 pub GPIOD: GPIOD,
1392 pub GPIOB: GPIOB,
1394 pub GPIOA: GPIOA,
1396 pub TIM11: TIM11,
1398 pub TIM5: TIM5,
1400 pub IWDG: IWDG,
1402 pub I2S2EXT: I2S2EXT,
1404 pub I2C1: I2C1,
1406 pub I2C2: I2C2,
1408 pub I2C3: I2C3,
1410 pub LPTIM: LPTIM,
1412 pub PWR: PWR,
1414 pub QUADSPI: QUADSPI,
1416 pub RNG: RNG,
1418 pub RTC: RTC,
1420 pub RCC: RCC,
1422 pub SDIO: SDIO,
1424 pub SAI: SAI,
1426 pub SPI1: SPI1,
1428 pub SPI5: SPI5,
1430 pub SPI4: SPI4,
1432 pub SPI2: SPI2,
1434 pub SPI6: SPI6,
1436 pub SPI3: SPI3,
1438 pub I2S3EXT: I2S3EXT,
1440 pub SYSCFG: SYSCFG,
1442 pub USART1: USART1,
1444 pub USART3: USART3,
1446 pub USART6: USART6,
1448 pub USART2: USART2,
1450 pub UART4: UART4,
1452 pub UART10: UART10,
1454 pub UART9: UART9,
1456 pub OTG_FS_DEVICE: OTG_FS_DEVICE,
1458 pub OTG_FS_HOST: OTG_FS_HOST,
1460 pub OTG_FS_PWRCLK: OTG_FS_PWRCLK,
1462 pub OTG_FS_GLOBAL: OTG_FS_GLOBAL,
1464 pub WWDG: WWDG,
1466 pub FSMC: FSMC,
1468 pub ADC_COMMON: ADC_COMMON,
1470 pub UART5: UART5,
1472 pub UART7: UART7,
1474 pub UART8: UART8,
1476}
1477impl Peripherals {
1478 #[cfg(feature = "critical-section")]
1480 #[inline]
1481 pub fn take() -> Option<Self> {
1482 critical_section::with(|_| {
1483 if unsafe { DEVICE_PERIPHERALS } {
1484 return None;
1485 }
1486 Some(unsafe { Peripherals::steal() })
1487 })
1488 }
1489 #[inline]
1495 pub unsafe fn steal() -> Self {
1496 DEVICE_PERIPHERALS = true;
1497 Peripherals {
1498 AES: AES::steal(),
1499 TIM1: TIM1::steal(),
1500 TIM8: TIM8::steal(),
1501 ADC1: ADC1::steal(),
1502 TIM7: TIM7::steal(),
1503 TIM6: TIM6::steal(),
1504 CAN1: CAN1::steal(),
1505 CAN2: CAN2::steal(),
1506 CAN3: CAN3::steal(),
1507 CRC: CRC::steal(),
1508 DBGMCU: DBGMCU::steal(),
1509 DFSDM2: DFSDM2::steal(),
1510 DFSDM1: DFSDM1::steal(),
1511 DAC: DAC::steal(),
1512 DMA1: DMA1::steal(),
1513 DMA2: DMA2::steal(),
1514 EXTI: EXTI::steal(),
1515 FMPI2C1: FMPI2C1::steal(),
1516 FLASH: FLASH::steal(),
1517 TIM12: TIM12::steal(),
1518 TIM10: TIM10::steal(),
1519 TIM13: TIM13::steal(),
1520 TIM14: TIM14::steal(),
1521 TIM9: TIM9::steal(),
1522 TIM3: TIM3::steal(),
1523 TIM4: TIM4::steal(),
1524 TIM2: TIM2::steal(),
1525 GPIOF: GPIOF::steal(),
1526 GPIOH: GPIOH::steal(),
1527 GPIOE: GPIOE::steal(),
1528 GPIOC: GPIOC::steal(),
1529 GPIOG: GPIOG::steal(),
1530 GPIOD: GPIOD::steal(),
1531 GPIOB: GPIOB::steal(),
1532 GPIOA: GPIOA::steal(),
1533 TIM11: TIM11::steal(),
1534 TIM5: TIM5::steal(),
1535 IWDG: IWDG::steal(),
1536 I2S2EXT: I2S2EXT::steal(),
1537 I2C1: I2C1::steal(),
1538 I2C2: I2C2::steal(),
1539 I2C3: I2C3::steal(),
1540 LPTIM: LPTIM::steal(),
1541 PWR: PWR::steal(),
1542 QUADSPI: QUADSPI::steal(),
1543 RNG: RNG::steal(),
1544 RTC: RTC::steal(),
1545 RCC: RCC::steal(),
1546 SDIO: SDIO::steal(),
1547 SAI: SAI::steal(),
1548 SPI1: SPI1::steal(),
1549 SPI5: SPI5::steal(),
1550 SPI4: SPI4::steal(),
1551 SPI2: SPI2::steal(),
1552 SPI6: SPI6::steal(),
1553 SPI3: SPI3::steal(),
1554 I2S3EXT: I2S3EXT::steal(),
1555 SYSCFG: SYSCFG::steal(),
1556 USART1: USART1::steal(),
1557 USART3: USART3::steal(),
1558 USART6: USART6::steal(),
1559 USART2: USART2::steal(),
1560 UART4: UART4::steal(),
1561 UART10: UART10::steal(),
1562 UART9: UART9::steal(),
1563 OTG_FS_DEVICE: OTG_FS_DEVICE::steal(),
1564 OTG_FS_HOST: OTG_FS_HOST::steal(),
1565 OTG_FS_PWRCLK: OTG_FS_PWRCLK::steal(),
1566 OTG_FS_GLOBAL: OTG_FS_GLOBAL::steal(),
1567 WWDG: WWDG::steal(),
1568 FSMC: FSMC::steal(),
1569 ADC_COMMON: ADC_COMMON::steal(),
1570 UART5: UART5::steal(),
1571 UART7: UART7::steal(),
1572 UART8: UART8::steal(),
1573 }
1574 }
1575}