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 FLASH();
25 fn RCC();
26 fn EXTI0();
27 fn EXTI1();
28 fn EXTI2_TSC();
29 fn EXTI3();
30 fn EXTI4();
31 fn DMA1_CH1();
32 fn DMA1_CH2();
33 fn DMA1_CH3();
34 fn DMA1_CH4();
35 fn DMA1_CH5();
36 fn DMA1_CH6();
37 fn DMA1_CH7();
38 fn ADC1_2();
39 fn USB_HP_CAN_TX();
40 fn USB_LP_CAN_RX0();
41 fn CAN_RX1();
42 fn CAN_SCE();
43 fn EXTI9_5();
44 fn TIM1_BRK_TIM15();
45 fn TIM1_UP_TIM16();
46 fn TIM1_TRG_COM_TIM17();
47 fn TIM1_CC();
48 fn TIM2();
49 fn TIM3();
50 fn TIM4();
51 fn I2C1_EV_EXTI23();
52 fn I2C1_ER();
53 fn I2C2_EV_EXTI24();
54 fn I2C2_ER();
55 fn SPI1();
56 fn SPI2();
57 fn USART1_EXTI25();
58 fn USART2_EXTI26();
59 fn USART3_EXTI28();
60 fn EXTI15_10();
61 fn RTCALARM();
62 fn USB_WKUP();
63 fn TIM8_BRK();
64 fn TIM8_UP();
65 fn TIM8_TRG_COM();
66 fn TIM8_CC();
67 fn ADC3();
68 fn FMC();
69 fn SPI3();
70 fn UART4_EXTI34();
71 fn UART5_EXTI35();
72 fn TIM6_DACUNDER();
73 fn TIM7();
74 fn DMA2_CH1();
75 fn DMA2_CH2();
76 fn DMA2_CH3();
77 fn DMA2_CH4();
78 fn DMA2_CH5();
79 fn ADC4();
80 fn COMP1_2_3();
81 fn COMP4_5_6();
82 fn COMP7();
83 fn I2C3_EV();
84 fn I2C3_ER();
85 fn USB_HP();
86 fn USB_LP();
87 fn USB_WKUP_EXTI();
88 fn TIM20_BRK();
89 fn TIM20_UP();
90 fn TIM20_TRG_COM();
91 fn TIM20_CC();
92 fn FPU();
93 fn SPI4();
94}
95#[doc(hidden)]
96#[repr(C)]
97pub union Vector {
98 _handler: unsafe extern "C" fn(),
99 _reserved: u32,
100}
101#[cfg(feature = "rt")]
102#[doc(hidden)]
103#[link_section = ".vector_table.interrupts"]
104#[no_mangle]
105pub static __INTERRUPTS: [Vector; 85] = [
106 Vector { _handler: WWDG },
107 Vector { _handler: PVD },
108 Vector {
109 _handler: TAMP_STAMP,
110 },
111 Vector { _handler: RTC_WKUP },
112 Vector { _handler: FLASH },
113 Vector { _handler: RCC },
114 Vector { _handler: EXTI0 },
115 Vector { _handler: EXTI1 },
116 Vector {
117 _handler: EXTI2_TSC,
118 },
119 Vector { _handler: EXTI3 },
120 Vector { _handler: EXTI4 },
121 Vector { _handler: DMA1_CH1 },
122 Vector { _handler: DMA1_CH2 },
123 Vector { _handler: DMA1_CH3 },
124 Vector { _handler: DMA1_CH4 },
125 Vector { _handler: DMA1_CH5 },
126 Vector { _handler: DMA1_CH6 },
127 Vector { _handler: DMA1_CH7 },
128 Vector { _handler: ADC1_2 },
129 Vector {
130 _handler: USB_HP_CAN_TX,
131 },
132 Vector {
133 _handler: USB_LP_CAN_RX0,
134 },
135 Vector { _handler: CAN_RX1 },
136 Vector { _handler: CAN_SCE },
137 Vector { _handler: EXTI9_5 },
138 Vector {
139 _handler: TIM1_BRK_TIM15,
140 },
141 Vector {
142 _handler: TIM1_UP_TIM16,
143 },
144 Vector {
145 _handler: TIM1_TRG_COM_TIM17,
146 },
147 Vector { _handler: TIM1_CC },
148 Vector { _handler: TIM2 },
149 Vector { _handler: TIM3 },
150 Vector { _handler: TIM4 },
151 Vector {
152 _handler: I2C1_EV_EXTI23,
153 },
154 Vector { _handler: I2C1_ER },
155 Vector {
156 _handler: I2C2_EV_EXTI24,
157 },
158 Vector { _handler: I2C2_ER },
159 Vector { _handler: SPI1 },
160 Vector { _handler: SPI2 },
161 Vector {
162 _handler: USART1_EXTI25,
163 },
164 Vector {
165 _handler: USART2_EXTI26,
166 },
167 Vector {
168 _handler: USART3_EXTI28,
169 },
170 Vector {
171 _handler: EXTI15_10,
172 },
173 Vector { _handler: RTCALARM },
174 Vector { _handler: USB_WKUP },
175 Vector { _handler: TIM8_BRK },
176 Vector { _handler: TIM8_UP },
177 Vector {
178 _handler: TIM8_TRG_COM,
179 },
180 Vector { _handler: TIM8_CC },
181 Vector { _handler: ADC3 },
182 Vector { _handler: FMC },
183 Vector { _reserved: 0 },
184 Vector { _reserved: 0 },
185 Vector { _handler: SPI3 },
186 Vector {
187 _handler: UART4_EXTI34,
188 },
189 Vector {
190 _handler: UART5_EXTI35,
191 },
192 Vector {
193 _handler: TIM6_DACUNDER,
194 },
195 Vector { _handler: TIM7 },
196 Vector { _handler: DMA2_CH1 },
197 Vector { _handler: DMA2_CH2 },
198 Vector { _handler: DMA2_CH3 },
199 Vector { _handler: DMA2_CH4 },
200 Vector { _handler: DMA2_CH5 },
201 Vector { _handler: ADC4 },
202 Vector { _reserved: 0 },
203 Vector { _reserved: 0 },
204 Vector {
205 _handler: COMP1_2_3,
206 },
207 Vector {
208 _handler: COMP4_5_6,
209 },
210 Vector { _handler: COMP7 },
211 Vector { _reserved: 0 },
212 Vector { _reserved: 0 },
213 Vector { _reserved: 0 },
214 Vector { _reserved: 0 },
215 Vector { _reserved: 0 },
216 Vector { _handler: I2C3_EV },
217 Vector { _handler: I2C3_ER },
218 Vector { _handler: USB_HP },
219 Vector { _handler: USB_LP },
220 Vector {
221 _handler: USB_WKUP_EXTI,
222 },
223 Vector {
224 _handler: TIM20_BRK,
225 },
226 Vector { _handler: TIM20_UP },
227 Vector {
228 _handler: TIM20_TRG_COM,
229 },
230 Vector { _handler: TIM20_CC },
231 Vector { _handler: FPU },
232 Vector { _reserved: 0 },
233 Vector { _reserved: 0 },
234 Vector { _handler: SPI4 },
235];
236#[cfg_attr(feature = "defmt", derive(defmt::Format))]
238#[derive(Copy, Clone, Debug, PartialEq, Eq)]
239#[repr(u16)]
240pub enum Interrupt {
241 WWDG = 0,
243 PVD = 1,
245 TAMP_STAMP = 2,
247 RTC_WKUP = 3,
249 FLASH = 4,
251 RCC = 5,
253 EXTI0 = 6,
255 EXTI1 = 7,
257 EXTI2_TSC = 8,
259 EXTI3 = 9,
261 EXTI4 = 10,
263 DMA1_CH1 = 11,
265 DMA1_CH2 = 12,
267 DMA1_CH3 = 13,
269 DMA1_CH4 = 14,
271 DMA1_CH5 = 15,
273 DMA1_CH6 = 16,
275 DMA1_CH7 = 17,
277 ADC1_2 = 18,
279 USB_HP_CAN_TX = 19,
281 USB_LP_CAN_RX0 = 20,
283 CAN_RX1 = 21,
285 CAN_SCE = 22,
287 EXTI9_5 = 23,
289 TIM1_BRK_TIM15 = 24,
291 TIM1_UP_TIM16 = 25,
293 TIM1_TRG_COM_TIM17 = 26,
295 TIM1_CC = 27,
297 TIM2 = 28,
299 TIM3 = 29,
301 TIM4 = 30,
303 I2C1_EV_EXTI23 = 31,
305 I2C1_ER = 32,
307 I2C2_EV_EXTI24 = 33,
309 I2C2_ER = 34,
311 SPI1 = 35,
313 SPI2 = 36,
315 USART1_EXTI25 = 37,
317 USART2_EXTI26 = 38,
319 USART3_EXTI28 = 39,
321 EXTI15_10 = 40,
323 RTCALARM = 41,
325 USB_WKUP = 42,
327 TIM8_BRK = 43,
329 TIM8_UP = 44,
331 TIM8_TRG_COM = 45,
333 TIM8_CC = 46,
335 ADC3 = 47,
337 FMC = 48,
339 SPI3 = 51,
341 UART4_EXTI34 = 52,
343 UART5_EXTI35 = 53,
345 TIM6_DACUNDER = 54,
347 TIM7 = 55,
349 DMA2_CH1 = 56,
351 DMA2_CH2 = 57,
353 DMA2_CH3 = 58,
355 DMA2_CH4 = 59,
357 DMA2_CH5 = 60,
359 ADC4 = 61,
361 COMP1_2_3 = 64,
363 COMP4_5_6 = 65,
365 COMP7 = 66,
367 I2C3_EV = 72,
369 I2C3_ER = 73,
371 USB_HP = 74,
373 USB_LP = 75,
375 USB_WKUP_EXTI = 76,
377 TIM20_BRK = 77,
379 TIM20_UP = 78,
381 TIM20_TRG_COM = 79,
383 TIM20_CC = 80,
385 FPU = 81,
387 SPI4 = 84,
389}
390unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
391 #[inline(always)]
392 fn number(self) -> u16 {
393 self as u16
394 }
395}
396pub type GPIOA = crate::Periph<gpioa::RegisterBlock, 0x4800_0000>;
400impl core::fmt::Debug for GPIOA {
401 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
402 f.debug_struct("GPIOA").finish()
403 }
404}
405pub mod gpioa;
407pub type GPIOB = crate::Periph<gpiob::RegisterBlock, 0x4800_0400>;
411impl core::fmt::Debug for GPIOB {
412 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
413 f.debug_struct("GPIOB").finish()
414 }
415}
416pub mod gpiob;
418pub type GPIOC = crate::Periph<gpioc::RegisterBlock, 0x4800_0800>;
422impl core::fmt::Debug for GPIOC {
423 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
424 f.debug_struct("GPIOC").finish()
425 }
426}
427pub mod gpioc;
429pub type GPIOD = crate::Periph<gpioc::RegisterBlock, 0x4800_0c00>;
433impl core::fmt::Debug for GPIOD {
434 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
435 f.debug_struct("GPIOD").finish()
436 }
437}
438pub use self::gpioc as gpiod;
440pub type GPIOE = crate::Periph<gpioc::RegisterBlock, 0x4800_1000>;
444impl core::fmt::Debug for GPIOE {
445 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
446 f.debug_struct("GPIOE").finish()
447 }
448}
449pub use self::gpioc as gpioe;
451pub type GPIOF = crate::Periph<gpioc::RegisterBlock, 0x4800_1400>;
455impl core::fmt::Debug for GPIOF {
456 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
457 f.debug_struct("GPIOF").finish()
458 }
459}
460pub use self::gpioc as gpiof;
462pub type GPIOG = crate::Periph<gpioc::RegisterBlock, 0x4800_1800>;
466impl core::fmt::Debug for GPIOG {
467 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
468 f.debug_struct("GPIOG").finish()
469 }
470}
471pub use self::gpioc as gpiog;
473pub type GPIOH = crate::Periph<gpioc::RegisterBlock, 0x4800_1c00>;
477impl core::fmt::Debug for GPIOH {
478 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
479 f.debug_struct("GPIOH").finish()
480 }
481}
482pub use self::gpioc as gpioh;
484pub type TSC = crate::Periph<tsc::RegisterBlock, 0x4002_4000>;
488impl core::fmt::Debug for TSC {
489 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
490 f.debug_struct("TSC").finish()
491 }
492}
493pub mod tsc;
495pub type CRC = crate::Periph<crc::RegisterBlock, 0x4002_3000>;
499impl core::fmt::Debug for CRC {
500 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
501 f.debug_struct("CRC").finish()
502 }
503}
504pub mod crc;
506pub type FLASH = crate::Periph<flash::RegisterBlock, 0x4002_2000>;
510impl core::fmt::Debug for FLASH {
511 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
512 f.debug_struct("FLASH").finish()
513 }
514}
515pub mod flash;
517pub type RCC = crate::Periph<rcc::RegisterBlock, 0x4002_1000>;
521impl core::fmt::Debug for RCC {
522 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
523 f.debug_struct("RCC").finish()
524 }
525}
526pub mod rcc;
528pub type DMA1 = crate::Periph<dma1::RegisterBlock, 0x4002_0000>;
532impl core::fmt::Debug for DMA1 {
533 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
534 f.debug_struct("DMA1").finish()
535 }
536}
537pub mod dma1;
539pub type DMA2 = crate::Periph<dma1::RegisterBlock, 0x4002_0400>;
543impl core::fmt::Debug for DMA2 {
544 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
545 f.debug_struct("DMA2").finish()
546 }
547}
548pub use self::dma1 as dma2;
550pub type TIM2 = crate::Periph<tim2::RegisterBlock, 0x4000_0000>;
554impl core::fmt::Debug for TIM2 {
555 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
556 f.debug_struct("TIM2").finish()
557 }
558}
559pub mod tim2;
561pub type TIM3 = crate::Periph<tim3::RegisterBlock, 0x4000_0400>;
565impl core::fmt::Debug for TIM3 {
566 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
567 f.debug_struct("TIM3").finish()
568 }
569}
570pub mod tim3;
572pub type TIM4 = crate::Periph<tim3::RegisterBlock, 0x4000_0800>;
576impl core::fmt::Debug for TIM4 {
577 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
578 f.debug_struct("TIM4").finish()
579 }
580}
581pub use self::tim3 as tim4;
583pub type TIM15 = crate::Periph<tim15::RegisterBlock, 0x4001_4000>;
587impl core::fmt::Debug for TIM15 {
588 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
589 f.debug_struct("TIM15").finish()
590 }
591}
592pub mod tim15;
594pub type TIM16 = crate::Periph<tim16::RegisterBlock, 0x4001_4400>;
598impl core::fmt::Debug for TIM16 {
599 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
600 f.debug_struct("TIM16").finish()
601 }
602}
603pub mod tim16;
605pub type TIM17 = crate::Periph<tim17::RegisterBlock, 0x4001_4800>;
609impl core::fmt::Debug for TIM17 {
610 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
611 f.debug_struct("TIM17").finish()
612 }
613}
614pub mod tim17;
616pub type USART1 = crate::Periph<usart1::RegisterBlock, 0x4001_3800>;
620impl core::fmt::Debug for USART1 {
621 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
622 f.debug_struct("USART1").finish()
623 }
624}
625pub mod usart1;
627pub type USART2 = crate::Periph<usart1::RegisterBlock, 0x4000_4400>;
631impl core::fmt::Debug for USART2 {
632 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
633 f.debug_struct("USART2").finish()
634 }
635}
636pub use self::usart1 as usart2;
638pub type USART3 = crate::Periph<usart1::RegisterBlock, 0x4000_4800>;
642impl core::fmt::Debug for USART3 {
643 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
644 f.debug_struct("USART3").finish()
645 }
646}
647pub use self::usart1 as usart3;
649pub type UART4 = crate::Periph<usart1::RegisterBlock, 0x4000_4c00>;
653impl core::fmt::Debug for UART4 {
654 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
655 f.debug_struct("UART4").finish()
656 }
657}
658pub use self::usart1 as uart4;
660pub type UART5 = crate::Periph<usart1::RegisterBlock, 0x4000_5000>;
664impl core::fmt::Debug for UART5 {
665 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
666 f.debug_struct("UART5").finish()
667 }
668}
669pub use self::usart1 as uart5;
671pub type SPI1 = crate::Periph<spi1::RegisterBlock, 0x4001_3000>;
675impl core::fmt::Debug for SPI1 {
676 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
677 f.debug_struct("SPI1").finish()
678 }
679}
680pub mod spi1;
682pub type SPI2 = crate::Periph<spi1::RegisterBlock, 0x4000_3800>;
686impl core::fmt::Debug for SPI2 {
687 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
688 f.debug_struct("SPI2").finish()
689 }
690}
691pub use self::spi1 as spi2;
693pub type SPI3 = crate::Periph<spi1::RegisterBlock, 0x4000_3c00>;
697impl core::fmt::Debug for SPI3 {
698 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
699 f.debug_struct("SPI3").finish()
700 }
701}
702pub use self::spi1 as spi3;
704pub type SPI4 = crate::Periph<spi1::RegisterBlock, 0x4001_3c00>;
708impl core::fmt::Debug for SPI4 {
709 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
710 f.debug_struct("SPI4").finish()
711 }
712}
713pub use self::spi1 as spi4;
715pub type I2S2EXT = crate::Periph<i2s2ext::RegisterBlock, 0x4000_3400>;
719impl core::fmt::Debug for I2S2EXT {
720 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
721 f.debug_struct("I2S2EXT").finish()
722 }
723}
724pub mod i2s2ext;
726pub type I2S3EXT = crate::Periph<i2s2ext::RegisterBlock, 0x4000_4000>;
730impl core::fmt::Debug for I2S3EXT {
731 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
732 f.debug_struct("I2S3EXT").finish()
733 }
734}
735pub use self::i2s2ext as i2s3ext;
737pub type EXTI = crate::Periph<exti::RegisterBlock, 0x4001_0400>;
741impl core::fmt::Debug for EXTI {
742 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
743 f.debug_struct("EXTI").finish()
744 }
745}
746pub mod exti;
748pub type PWR = crate::Periph<pwr::RegisterBlock, 0x4000_7000>;
752impl core::fmt::Debug for PWR {
753 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
754 f.debug_struct("PWR").finish()
755 }
756}
757pub mod pwr;
759pub type CAN = crate::Periph<can::RegisterBlock, 0x4000_6400>;
763impl core::fmt::Debug for CAN {
764 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
765 f.debug_struct("CAN").finish()
766 }
767}
768pub mod can;
770pub type USB = crate::Periph<usb::RegisterBlock, 0x4000_5c00>;
774impl core::fmt::Debug for USB {
775 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
776 f.debug_struct("USB").finish()
777 }
778}
779pub mod usb;
781pub type I2C1 = crate::Periph<i2c1::RegisterBlock, 0x4000_5400>;
785impl core::fmt::Debug for I2C1 {
786 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
787 f.debug_struct("I2C1").finish()
788 }
789}
790pub mod i2c1;
792pub type I2C2 = crate::Periph<i2c1::RegisterBlock, 0x4000_5800>;
796impl core::fmt::Debug for I2C2 {
797 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
798 f.debug_struct("I2C2").finish()
799 }
800}
801pub use self::i2c1 as i2c2;
803pub type I2C3 = crate::Periph<i2c1::RegisterBlock, 0x4000_7800>;
807impl core::fmt::Debug for I2C3 {
808 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
809 f.debug_struct("I2C3").finish()
810 }
811}
812pub use self::i2c1 as i2c3;
814pub type DAC2 = crate::Periph<dac1::RegisterBlock, 0x4000_9800>;
818impl core::fmt::Debug for DAC2 {
819 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
820 f.debug_struct("DAC2").finish()
821 }
822}
823pub use self::dac1 as dac2;
825pub type IWDG = crate::Periph<iwdg::RegisterBlock, 0x4000_3000>;
829impl core::fmt::Debug for IWDG {
830 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
831 f.debug_struct("IWDG").finish()
832 }
833}
834pub mod iwdg;
836pub type WWDG = crate::Periph<wwdg::RegisterBlock, 0x4000_2c00>;
840impl core::fmt::Debug for WWDG {
841 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
842 f.debug_struct("WWDG").finish()
843 }
844}
845pub mod wwdg;
847pub type RTC = crate::Periph<rtc::RegisterBlock, 0x4000_2800>;
851impl core::fmt::Debug for RTC {
852 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
853 f.debug_struct("RTC").finish()
854 }
855}
856pub mod rtc;
858pub type TIM6 = crate::Periph<tim6::RegisterBlock, 0x4000_1000>;
862impl core::fmt::Debug for TIM6 {
863 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
864 f.debug_struct("TIM6").finish()
865 }
866}
867pub mod tim6;
869pub type TIM7 = crate::Periph<tim6::RegisterBlock, 0x4000_1400>;
873impl core::fmt::Debug for TIM7 {
874 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
875 f.debug_struct("TIM7").finish()
876 }
877}
878pub use self::tim6 as tim7;
880pub type DAC1 = crate::Periph<dac1::RegisterBlock, 0x4000_7400>;
884impl core::fmt::Debug for DAC1 {
885 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
886 f.debug_struct("DAC1").finish()
887 }
888}
889pub mod dac1;
891pub type DBGMCU = crate::Periph<dbgmcu::RegisterBlock, 0xe004_2000>;
895impl core::fmt::Debug for DBGMCU {
896 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
897 f.debug_struct("DBGMCU").finish()
898 }
899}
900pub mod dbgmcu;
902pub type TIM1 = crate::Periph<tim1::RegisterBlock, 0x4001_2c00>;
906impl core::fmt::Debug for TIM1 {
907 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
908 f.debug_struct("TIM1").finish()
909 }
910}
911pub mod tim1;
913pub type TIM20 = crate::Periph<tim1::RegisterBlock, 0x4001_5000>;
917impl core::fmt::Debug for TIM20 {
918 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
919 f.debug_struct("TIM20").finish()
920 }
921}
922pub use self::tim1 as tim20;
924pub type TIM8 = crate::Periph<tim8::RegisterBlock, 0x4001_3400>;
928impl core::fmt::Debug for TIM8 {
929 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
930 f.debug_struct("TIM8").finish()
931 }
932}
933pub mod tim8;
935pub type ADC1 = crate::Periph<adc1::RegisterBlock, 0x5000_0000>;
939impl core::fmt::Debug for ADC1 {
940 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
941 f.debug_struct("ADC1").finish()
942 }
943}
944pub mod adc1;
946pub type ADC2 = crate::Periph<adc1::RegisterBlock, 0x5000_0100>;
950impl core::fmt::Debug for ADC2 {
951 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
952 f.debug_struct("ADC2").finish()
953 }
954}
955pub use self::adc1 as adc2;
957pub type ADC3 = crate::Periph<adc1::RegisterBlock, 0x5000_0400>;
961impl core::fmt::Debug for ADC3 {
962 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
963 f.debug_struct("ADC3").finish()
964 }
965}
966pub use self::adc1 as adc3;
968pub type ADC4 = crate::Periph<adc1::RegisterBlock, 0x5000_0500>;
972impl core::fmt::Debug for ADC4 {
973 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
974 f.debug_struct("ADC4").finish()
975 }
976}
977pub use self::adc1 as adc4;
979pub type ADC1_2 = crate::Periph<adc1_2::RegisterBlock, 0x5000_0300>;
983impl core::fmt::Debug for ADC1_2 {
984 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
985 f.debug_struct("ADC1_2").finish()
986 }
987}
988pub mod adc1_2;
990pub type ADC3_4 = crate::Periph<adc1_2::RegisterBlock, 0x5000_0700>;
994impl core::fmt::Debug for ADC3_4 {
995 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
996 f.debug_struct("ADC3_4").finish()
997 }
998}
999pub use self::adc1_2 as adc3_4;
1001pub type SYSCFG = crate::Periph<syscfg::RegisterBlock, 0x4001_0000>;
1005impl core::fmt::Debug for SYSCFG {
1006 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1007 f.debug_struct("SYSCFG").finish()
1008 }
1009}
1010pub mod syscfg;
1012pub type OPAMP = crate::Periph<opamp::RegisterBlock, 0x4001_0000>;
1016impl core::fmt::Debug for OPAMP {
1017 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1018 f.debug_struct("OPAMP").finish()
1019 }
1020}
1021pub mod opamp;
1023pub type COMP = crate::Periph<comp::RegisterBlock, 0x4001_0000>;
1027impl core::fmt::Debug for COMP {
1028 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1029 f.debug_struct("COMP").finish()
1030 }
1031}
1032pub mod comp;
1034pub type FMC = crate::Periph<fmc::RegisterBlock, 0xa000_0400>;
1038impl core::fmt::Debug for FMC {
1039 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1040 f.debug_struct("FMC").finish()
1041 }
1042}
1043pub mod fmc;
1045#[no_mangle]
1046static mut DEVICE_PERIPHERALS: bool = false;
1047#[allow(non_snake_case)]
1049pub struct Peripherals {
1050 pub GPIOA: GPIOA,
1052 pub GPIOB: GPIOB,
1054 pub GPIOC: GPIOC,
1056 pub GPIOD: GPIOD,
1058 pub GPIOE: GPIOE,
1060 pub GPIOF: GPIOF,
1062 pub GPIOG: GPIOG,
1064 pub GPIOH: GPIOH,
1066 pub TSC: TSC,
1068 pub CRC: CRC,
1070 pub FLASH: FLASH,
1072 pub RCC: RCC,
1074 pub DMA1: DMA1,
1076 pub DMA2: DMA2,
1078 pub TIM2: TIM2,
1080 pub TIM3: TIM3,
1082 pub TIM4: TIM4,
1084 pub TIM15: TIM15,
1086 pub TIM16: TIM16,
1088 pub TIM17: TIM17,
1090 pub USART1: USART1,
1092 pub USART2: USART2,
1094 pub USART3: USART3,
1096 pub UART4: UART4,
1098 pub UART5: UART5,
1100 pub SPI1: SPI1,
1102 pub SPI2: SPI2,
1104 pub SPI3: SPI3,
1106 pub SPI4: SPI4,
1108 pub I2S2EXT: I2S2EXT,
1110 pub I2S3EXT: I2S3EXT,
1112 pub EXTI: EXTI,
1114 pub PWR: PWR,
1116 pub CAN: CAN,
1118 pub USB: USB,
1120 pub I2C1: I2C1,
1122 pub I2C2: I2C2,
1124 pub I2C3: I2C3,
1126 pub DAC2: DAC2,
1128 pub IWDG: IWDG,
1130 pub WWDG: WWDG,
1132 pub RTC: RTC,
1134 pub TIM6: TIM6,
1136 pub TIM7: TIM7,
1138 pub DAC1: DAC1,
1140 pub DBGMCU: DBGMCU,
1142 pub TIM1: TIM1,
1144 pub TIM20: TIM20,
1146 pub TIM8: TIM8,
1148 pub ADC1: ADC1,
1150 pub ADC2: ADC2,
1152 pub ADC3: ADC3,
1154 pub ADC4: ADC4,
1156 pub ADC1_2: ADC1_2,
1158 pub ADC3_4: ADC3_4,
1160 pub SYSCFG: SYSCFG,
1162 pub OPAMP: OPAMP,
1164 pub COMP: COMP,
1166 pub FMC: FMC,
1168}
1169impl Peripherals {
1170 #[cfg(feature = "critical-section")]
1172 #[inline]
1173 pub fn take() -> Option<Self> {
1174 critical_section::with(|_| {
1175 if unsafe { DEVICE_PERIPHERALS } {
1176 return None;
1177 }
1178 Some(unsafe { Peripherals::steal() })
1179 })
1180 }
1181 #[inline]
1187 pub unsafe fn steal() -> Self {
1188 DEVICE_PERIPHERALS = true;
1189 Peripherals {
1190 GPIOA: GPIOA::steal(),
1191 GPIOB: GPIOB::steal(),
1192 GPIOC: GPIOC::steal(),
1193 GPIOD: GPIOD::steal(),
1194 GPIOE: GPIOE::steal(),
1195 GPIOF: GPIOF::steal(),
1196 GPIOG: GPIOG::steal(),
1197 GPIOH: GPIOH::steal(),
1198 TSC: TSC::steal(),
1199 CRC: CRC::steal(),
1200 FLASH: FLASH::steal(),
1201 RCC: RCC::steal(),
1202 DMA1: DMA1::steal(),
1203 DMA2: DMA2::steal(),
1204 TIM2: TIM2::steal(),
1205 TIM3: TIM3::steal(),
1206 TIM4: TIM4::steal(),
1207 TIM15: TIM15::steal(),
1208 TIM16: TIM16::steal(),
1209 TIM17: TIM17::steal(),
1210 USART1: USART1::steal(),
1211 USART2: USART2::steal(),
1212 USART3: USART3::steal(),
1213 UART4: UART4::steal(),
1214 UART5: UART5::steal(),
1215 SPI1: SPI1::steal(),
1216 SPI2: SPI2::steal(),
1217 SPI3: SPI3::steal(),
1218 SPI4: SPI4::steal(),
1219 I2S2EXT: I2S2EXT::steal(),
1220 I2S3EXT: I2S3EXT::steal(),
1221 EXTI: EXTI::steal(),
1222 PWR: PWR::steal(),
1223 CAN: CAN::steal(),
1224 USB: USB::steal(),
1225 I2C1: I2C1::steal(),
1226 I2C2: I2C2::steal(),
1227 I2C3: I2C3::steal(),
1228 DAC2: DAC2::steal(),
1229 IWDG: IWDG::steal(),
1230 WWDG: WWDG::steal(),
1231 RTC: RTC::steal(),
1232 TIM6: TIM6::steal(),
1233 TIM7: TIM7::steal(),
1234 DAC1: DAC1::steal(),
1235 DBGMCU: DBGMCU::steal(),
1236 TIM1: TIM1::steal(),
1237 TIM20: TIM20::steal(),
1238 TIM8: TIM8::steal(),
1239 ADC1: ADC1::steal(),
1240 ADC2: ADC2::steal(),
1241 ADC3: ADC3::steal(),
1242 ADC4: ADC4::steal(),
1243 ADC1_2: ADC1_2::steal(),
1244 ADC3_4: ADC3_4::steal(),
1245 SYSCFG: SYSCFG::steal(),
1246 OPAMP: OPAMP::steal(),
1247 COMP: COMP::steal(),
1248 FMC: FMC::steal(),
1249 }
1250 }
1251}