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();
23 fn RTC_WKUP();
24 fn FLASH();
25 fn RCC();
26 fn EXTI0();
27 fn EXTI1();
28 fn EXTI2_TS();
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();
39 fn CAN_TX();
40 fn CAN_RXD();
41 fn CAN_RXI();
42 fn CAN_SCE();
43 fn EXTI5_9();
44 fn TIM15();
45 fn TIM16();
46 fn TIM17();
47 fn TIM18_DAC();
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 CEC();
63 fn TIM12();
64 fn TIM13();
65 fn TIM14();
66 fn TIM5();
67 fn SPI3();
68 fn TIM6_DAC1();
69 fn TIM7();
70 fn DMA2_CH1();
71 fn DMA2_CH2();
72 fn DMA2_CH3();
73 fn DMA2_CH4();
74 fn DMA2_CH5();
75 fn SDADC1();
76 fn SDADC2();
77 fn SDADC3();
78 fn COMP1_2_3();
79 fn USB_HP();
80 fn USB_LP();
81 fn USB_WAKEUP();
82 fn TIM19();
83 fn FPU();
84}
85#[doc(hidden)]
86#[repr(C)]
87pub union Vector {
88 _handler: unsafe extern "C" fn(),
89 _reserved: u32,
90}
91#[cfg(feature = "rt")]
92#[doc(hidden)]
93#[link_section = ".vector_table.interrupts"]
94#[no_mangle]
95pub static __INTERRUPTS: [Vector; 82] = [
96 Vector { _handler: WWDG },
97 Vector { _handler: PVD },
98 Vector { _handler: TAMP },
99 Vector { _handler: RTC_WKUP },
100 Vector { _handler: FLASH },
101 Vector { _handler: RCC },
102 Vector { _handler: EXTI0 },
103 Vector { _handler: EXTI1 },
104 Vector { _handler: EXTI2_TS },
105 Vector { _handler: EXTI3 },
106 Vector { _handler: EXTI4 },
107 Vector { _handler: DMA1_CH1 },
108 Vector { _handler: DMA1_CH2 },
109 Vector { _handler: DMA1_CH3 },
110 Vector { _handler: DMA1_CH4 },
111 Vector { _handler: DMA1_CH5 },
112 Vector { _handler: DMA1_CH6 },
113 Vector { _handler: DMA1_CH7 },
114 Vector { _handler: ADC1 },
115 Vector { _handler: CAN_TX },
116 Vector { _handler: CAN_RXD },
117 Vector { _handler: CAN_RXI },
118 Vector { _handler: CAN_SCE },
119 Vector { _handler: EXTI5_9 },
120 Vector { _handler: TIM15 },
121 Vector { _handler: TIM16 },
122 Vector { _handler: TIM17 },
123 Vector {
124 _handler: TIM18_DAC,
125 },
126 Vector { _handler: TIM2 },
127 Vector { _handler: TIM3 },
128 Vector { _handler: TIM4 },
129 Vector { _handler: I2C1_EV },
130 Vector { _handler: I2C1_ER },
131 Vector { _handler: I2C2_EV },
132 Vector { _handler: I2C2_ER },
133 Vector { _handler: SPI1 },
134 Vector { _handler: SPI2 },
135 Vector { _handler: USART1 },
136 Vector { _handler: USART2 },
137 Vector { _handler: USART3 },
138 Vector {
139 _handler: EXTI15_10,
140 },
141 Vector {
142 _handler: RTC_ALARM,
143 },
144 Vector { _handler: CEC },
145 Vector { _handler: TIM12 },
146 Vector { _handler: TIM13 },
147 Vector { _handler: TIM14 },
148 Vector { _reserved: 0 },
149 Vector { _reserved: 0 },
150 Vector { _reserved: 0 },
151 Vector { _reserved: 0 },
152 Vector { _handler: TIM5 },
153 Vector { _handler: SPI3 },
154 Vector { _reserved: 0 },
155 Vector { _reserved: 0 },
156 Vector {
157 _handler: TIM6_DAC1,
158 },
159 Vector { _handler: TIM7 },
160 Vector { _handler: DMA2_CH1 },
161 Vector { _handler: DMA2_CH2 },
162 Vector { _handler: DMA2_CH3 },
163 Vector { _handler: DMA2_CH4 },
164 Vector { _handler: DMA2_CH5 },
165 Vector { _handler: SDADC1 },
166 Vector { _handler: SDADC2 },
167 Vector { _handler: SDADC3 },
168 Vector {
169 _handler: COMP1_2_3,
170 },
171 Vector { _reserved: 0 },
172 Vector { _reserved: 0 },
173 Vector { _reserved: 0 },
174 Vector { _reserved: 0 },
175 Vector { _reserved: 0 },
176 Vector { _reserved: 0 },
177 Vector { _reserved: 0 },
178 Vector { _reserved: 0 },
179 Vector { _reserved: 0 },
180 Vector { _handler: USB_HP },
181 Vector { _handler: USB_LP },
182 Vector {
183 _handler: USB_WAKEUP,
184 },
185 Vector { _reserved: 0 },
186 Vector { _handler: TIM19 },
187 Vector { _reserved: 0 },
188 Vector { _reserved: 0 },
189 Vector { _handler: FPU },
190];
191#[cfg_attr(feature = "defmt", derive(defmt::Format))]
193#[derive(Copy, Clone, Debug, PartialEq, Eq)]
194#[repr(u16)]
195pub enum Interrupt {
196 WWDG = 0,
198 PVD = 1,
200 TAMP = 2,
202 RTC_WKUP = 3,
204 FLASH = 4,
206 RCC = 5,
208 EXTI0 = 6,
210 EXTI1 = 7,
212 EXTI2_TS = 8,
214 EXTI3 = 9,
216 EXTI4 = 10,
218 DMA1_CH1 = 11,
220 DMA1_CH2 = 12,
222 DMA1_CH3 = 13,
224 DMA1_CH4 = 14,
226 DMA1_CH5 = 15,
228 DMA1_CH6 = 16,
230 DMA1_CH7 = 17,
232 ADC1 = 18,
234 CAN_TX = 19,
236 CAN_RXD = 20,
238 CAN_RXI = 21,
240 CAN_SCE = 22,
242 EXTI5_9 = 23,
244 TIM15 = 24,
246 TIM16 = 25,
248 TIM17 = 26,
250 TIM18_DAC = 27,
252 TIM2 = 28,
254 TIM3 = 29,
256 TIM4 = 30,
258 I2C1_EV = 31,
260 I2C1_ER = 32,
262 I2C2_EV = 33,
264 I2C2_ER = 34,
266 SPI1 = 35,
268 SPI2 = 36,
270 USART1 = 37,
272 USART2 = 38,
274 USART3 = 39,
276 EXTI15_10 = 40,
278 RTC_ALARM = 41,
280 CEC = 42,
282 TIM12 = 43,
284 TIM13 = 44,
286 TIM14 = 45,
288 TIM5 = 50,
290 SPI3 = 51,
292 TIM6_DAC1 = 54,
294 TIM7 = 55,
296 DMA2_CH1 = 56,
298 DMA2_CH2 = 57,
300 DMA2_CH3 = 58,
302 DMA2_CH4 = 59,
304 DMA2_CH5 = 60,
306 SDADC1 = 61,
308 SDADC2 = 62,
310 SDADC3 = 63,
312 COMP1_2_3 = 64,
314 USB_HP = 74,
316 USB_LP = 75,
318 USB_WAKEUP = 76,
320 TIM19 = 78,
322 FPU = 81,
324}
325unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
326 #[inline(always)]
327 fn number(self) -> u16 {
328 self as u16
329 }
330}
331pub type GPIOA = crate::Periph<gpioa::RegisterBlock, 0x4800_0000>;
335impl core::fmt::Debug for GPIOA {
336 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
337 f.debug_struct("GPIOA").finish()
338 }
339}
340pub mod gpioa;
342pub type GPIOB = crate::Periph<gpiob::RegisterBlock, 0x4800_0400>;
346impl core::fmt::Debug for GPIOB {
347 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
348 f.debug_struct("GPIOB").finish()
349 }
350}
351pub mod gpiob;
353pub type GPIOC = crate::Periph<gpioc::RegisterBlock, 0x4800_0800>;
357impl core::fmt::Debug for GPIOC {
358 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
359 f.debug_struct("GPIOC").finish()
360 }
361}
362pub mod gpioc;
364pub type GPIOE = crate::Periph<gpioc::RegisterBlock, 0x4800_1000>;
368impl core::fmt::Debug for GPIOE {
369 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
370 f.debug_struct("GPIOE").finish()
371 }
372}
373pub use self::gpioc as gpioe;
375pub type GPIOF = crate::Periph<gpioc::RegisterBlock, 0x4800_1400>;
379impl core::fmt::Debug for GPIOF {
380 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
381 f.debug_struct("GPIOF").finish()
382 }
383}
384pub use self::gpioc as gpiof;
386pub type TSC = crate::Periph<tsc::RegisterBlock, 0x4002_4000>;
390impl core::fmt::Debug for TSC {
391 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
392 f.debug_struct("TSC").finish()
393 }
394}
395pub mod tsc;
397pub type CRC = crate::Periph<crc::RegisterBlock, 0x4002_3000>;
401impl core::fmt::Debug for CRC {
402 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
403 f.debug_struct("CRC").finish()
404 }
405}
406pub mod crc;
408pub type FLASH = crate::Periph<flash::RegisterBlock, 0x4002_2000>;
412impl core::fmt::Debug for FLASH {
413 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
414 f.debug_struct("FLASH").finish()
415 }
416}
417pub mod flash;
419pub type RCC = crate::Periph<rcc::RegisterBlock, 0x4002_1000>;
423impl core::fmt::Debug for RCC {
424 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
425 f.debug_struct("RCC").finish()
426 }
427}
428pub mod rcc;
430pub type DMA1 = crate::Periph<dma1::RegisterBlock, 0x4002_0000>;
434impl core::fmt::Debug for DMA1 {
435 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
436 f.debug_struct("DMA1").finish()
437 }
438}
439pub mod dma1;
441pub type DMA2 = crate::Periph<dma1::RegisterBlock, 0x4002_0400>;
445impl core::fmt::Debug for DMA2 {
446 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
447 f.debug_struct("DMA2").finish()
448 }
449}
450pub use self::dma1 as dma2;
452pub type TIM2 = crate::Periph<tim2::RegisterBlock, 0x4000_0000>;
456impl core::fmt::Debug for TIM2 {
457 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
458 f.debug_struct("TIM2").finish()
459 }
460}
461pub mod tim2;
463pub type TIM5 = crate::Periph<tim5::RegisterBlock, 0x4000_0c00>;
467impl core::fmt::Debug for TIM5 {
468 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
469 f.debug_struct("TIM5").finish()
470 }
471}
472pub mod tim5;
474pub type TIM3 = crate::Periph<tim3::RegisterBlock, 0x4000_0400>;
478impl core::fmt::Debug for TIM3 {
479 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
480 f.debug_struct("TIM3").finish()
481 }
482}
483pub mod tim3;
485pub type TIM4 = crate::Periph<tim3::RegisterBlock, 0x4000_0800>;
489impl core::fmt::Debug for TIM4 {
490 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
491 f.debug_struct("TIM4").finish()
492 }
493}
494pub use self::tim3 as tim4;
496pub type TIM19 = crate::Periph<tim3::RegisterBlock, 0x4001_5c00>;
500impl core::fmt::Debug for TIM19 {
501 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
502 f.debug_struct("TIM19").finish()
503 }
504}
505pub use self::tim3 as tim19;
507pub type TIM15 = crate::Periph<tim15::RegisterBlock, 0x4001_4000>;
511impl core::fmt::Debug for TIM15 {
512 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
513 f.debug_struct("TIM15").finish()
514 }
515}
516pub mod tim15;
518pub type TIM16 = crate::Periph<tim16::RegisterBlock, 0x4001_4400>;
522impl core::fmt::Debug for TIM16 {
523 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
524 f.debug_struct("TIM16").finish()
525 }
526}
527pub mod tim16;
529pub type TIM17 = crate::Periph<tim16::RegisterBlock, 0x4001_4800>;
533impl core::fmt::Debug for TIM17 {
534 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
535 f.debug_struct("TIM17").finish()
536 }
537}
538pub use self::tim16 as tim17;
540pub type USART1 = crate::Periph<usart1::RegisterBlock, 0x4001_3800>;
544impl core::fmt::Debug for USART1 {
545 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
546 f.debug_struct("USART1").finish()
547 }
548}
549pub mod usart1;
551pub type USART2 = crate::Periph<usart1::RegisterBlock, 0x4000_4400>;
555impl core::fmt::Debug for USART2 {
556 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
557 f.debug_struct("USART2").finish()
558 }
559}
560pub use self::usart1 as usart2;
562pub type USART3 = crate::Periph<usart1::RegisterBlock, 0x4000_4800>;
566impl core::fmt::Debug for USART3 {
567 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
568 f.debug_struct("USART3").finish()
569 }
570}
571pub use self::usart1 as usart3;
573pub type SPI1 = crate::Periph<spi1::RegisterBlock, 0x4001_3000>;
577impl core::fmt::Debug for SPI1 {
578 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
579 f.debug_struct("SPI1").finish()
580 }
581}
582pub mod spi1;
584pub type SPI2 = crate::Periph<spi1::RegisterBlock, 0x4000_3800>;
588impl core::fmt::Debug for SPI2 {
589 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
590 f.debug_struct("SPI2").finish()
591 }
592}
593pub use self::spi1 as spi2;
595pub type SPI3 = crate::Periph<spi1::RegisterBlock, 0x4000_3c00>;
599impl core::fmt::Debug for SPI3 {
600 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
601 f.debug_struct("SPI3").finish()
602 }
603}
604pub use self::spi1 as spi3;
606pub type I2S2EXT = crate::Periph<spi1::RegisterBlock, 0x4000_3400>;
610impl core::fmt::Debug for I2S2EXT {
611 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
612 f.debug_struct("I2S2EXT").finish()
613 }
614}
615pub use self::spi1 as i2s2ext;
617pub type I2S3EXT = crate::Periph<spi1::RegisterBlock, 0x4000_4000>;
621impl core::fmt::Debug for I2S3EXT {
622 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
623 f.debug_struct("I2S3EXT").finish()
624 }
625}
626pub use self::spi1 as i2s3ext;
628pub type ADC1 = crate::Periph<adc1::RegisterBlock, 0x4001_2400>;
632impl core::fmt::Debug for ADC1 {
633 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
634 f.debug_struct("ADC1").finish()
635 }
636}
637pub mod adc1;
639pub type EXTI = crate::Periph<exti::RegisterBlock, 0x4001_0400>;
643impl core::fmt::Debug for EXTI {
644 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
645 f.debug_struct("EXTI").finish()
646 }
647}
648pub mod exti;
650pub type CEC = crate::Periph<cec::RegisterBlock, 0x4000_7800>;
654impl core::fmt::Debug for CEC {
655 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
656 f.debug_struct("CEC").finish()
657 }
658}
659pub mod cec;
661pub type PWR = crate::Periph<pwr::RegisterBlock, 0x4000_7000>;
665impl core::fmt::Debug for PWR {
666 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
667 f.debug_struct("PWR").finish()
668 }
669}
670pub mod pwr;
672pub type CAN = crate::Periph<can::RegisterBlock, 0x4000_6400>;
676impl core::fmt::Debug for CAN {
677 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
678 f.debug_struct("CAN").finish()
679 }
680}
681pub mod can;
683pub type USB = crate::Periph<usb::RegisterBlock, 0x4000_5c00>;
687impl core::fmt::Debug for USB {
688 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
689 f.debug_struct("USB").finish()
690 }
691}
692pub mod usb;
694pub type I2C1 = crate::Periph<i2c1::RegisterBlock, 0x4000_5400>;
698impl core::fmt::Debug for I2C1 {
699 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
700 f.debug_struct("I2C1").finish()
701 }
702}
703pub mod i2c1;
705pub type I2C2 = crate::Periph<i2c1::RegisterBlock, 0x4000_5800>;
709impl core::fmt::Debug for I2C2 {
710 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
711 f.debug_struct("I2C2").finish()
712 }
713}
714pub use self::i2c1 as i2c2;
716pub type IWDG = crate::Periph<iwdg::RegisterBlock, 0x4000_3000>;
720impl core::fmt::Debug for IWDG {
721 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
722 f.debug_struct("IWDG").finish()
723 }
724}
725pub mod iwdg;
727pub type WWDG = crate::Periph<wwdg::RegisterBlock, 0x4000_2c00>;
731impl core::fmt::Debug for WWDG {
732 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
733 f.debug_struct("WWDG").finish()
734 }
735}
736pub mod wwdg;
738pub type RTC = crate::Periph<rtc::RegisterBlock, 0x4000_2800>;
742impl core::fmt::Debug for RTC {
743 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
744 f.debug_struct("RTC").finish()
745 }
746}
747pub mod rtc;
749pub type SDADC1 = crate::Periph<sdadc1::RegisterBlock, 0x4001_6000>;
753impl core::fmt::Debug for SDADC1 {
754 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
755 f.debug_struct("SDADC1").finish()
756 }
757}
758pub mod sdadc1;
760pub type SDADC2 = crate::Periph<sdadc1::RegisterBlock, 0x4001_6400>;
764impl core::fmt::Debug for SDADC2 {
765 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
766 f.debug_struct("SDADC2").finish()
767 }
768}
769pub use self::sdadc1 as sdadc2;
771pub type SDADC3 = crate::Periph<sdadc1::RegisterBlock, 0x4001_6800>;
775impl core::fmt::Debug for SDADC3 {
776 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
777 f.debug_struct("SDADC3").finish()
778 }
779}
780pub use self::sdadc1 as sdadc3;
782pub type DAC2 = crate::Periph<dac2::RegisterBlock, 0x4000_9800>;
786impl core::fmt::Debug for DAC2 {
787 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
788 f.debug_struct("DAC2").finish()
789 }
790}
791pub mod dac2;
793pub type TIM6 = crate::Periph<tim6::RegisterBlock, 0x4000_1000>;
797impl core::fmt::Debug for TIM6 {
798 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
799 f.debug_struct("TIM6").finish()
800 }
801}
802pub mod tim6;
804pub type TIM7 = crate::Periph<tim6::RegisterBlock, 0x4000_1400>;
808impl core::fmt::Debug for TIM7 {
809 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
810 f.debug_struct("TIM7").finish()
811 }
812}
813pub use self::tim6 as tim7;
815pub type TIM18 = crate::Periph<tim6::RegisterBlock, 0x4000_9c00>;
819impl core::fmt::Debug for TIM18 {
820 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
821 f.debug_struct("TIM18").finish()
822 }
823}
824pub use self::tim6 as tim18;
826pub type TIM13 = crate::Periph<tim13::RegisterBlock, 0x4000_1c00>;
830impl core::fmt::Debug for TIM13 {
831 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
832 f.debug_struct("TIM13").finish()
833 }
834}
835pub mod tim13;
837pub type TIM14 = crate::Periph<tim13::RegisterBlock, 0x4000_2000>;
841impl core::fmt::Debug for TIM14 {
842 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
843 f.debug_struct("TIM14").finish()
844 }
845}
846pub use self::tim13 as tim14;
848pub type TIM12 = crate::Periph<tim12::RegisterBlock, 0x4000_1800>;
852impl core::fmt::Debug for TIM12 {
853 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
854 f.debug_struct("TIM12").finish()
855 }
856}
857pub mod tim12;
859pub type DAC1 = crate::Periph<dac1::RegisterBlock, 0x4000_7400>;
863impl core::fmt::Debug for DAC1 {
864 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
865 f.debug_struct("DAC1").finish()
866 }
867}
868pub mod dac1;
870pub type DBGMCU = crate::Periph<dbgmcu::RegisterBlock, 0xe004_2000>;
874impl core::fmt::Debug for DBGMCU {
875 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
876 f.debug_struct("DBGMCU").finish()
877 }
878}
879pub mod dbgmcu;
881pub type SYSCFG = crate::Periph<syscfg::RegisterBlock, 0x4001_0000>;
885impl core::fmt::Debug for SYSCFG {
886 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
887 f.debug_struct("SYSCFG").finish()
888 }
889}
890pub mod syscfg;
892pub type COMP = crate::Periph<comp::RegisterBlock, 0x4001_0000>;
896impl core::fmt::Debug for COMP {
897 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
898 f.debug_struct("COMP").finish()
899 }
900}
901pub mod comp;
903pub type GPIOD = crate::Periph<gpiod::RegisterBlock, 0x4800_0c00>;
907impl core::fmt::Debug for GPIOD {
908 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
909 f.debug_struct("GPIOD").finish()
910 }
911}
912pub mod gpiod;
914#[no_mangle]
915static mut DEVICE_PERIPHERALS: bool = false;
916#[allow(non_snake_case)]
918pub struct Peripherals {
919 pub GPIOA: GPIOA,
921 pub GPIOB: GPIOB,
923 pub GPIOC: GPIOC,
925 pub GPIOE: GPIOE,
927 pub GPIOF: GPIOF,
929 pub TSC: TSC,
931 pub CRC: CRC,
933 pub FLASH: FLASH,
935 pub RCC: RCC,
937 pub DMA1: DMA1,
939 pub DMA2: DMA2,
941 pub TIM2: TIM2,
943 pub TIM5: TIM5,
945 pub TIM3: TIM3,
947 pub TIM4: TIM4,
949 pub TIM19: TIM19,
951 pub TIM15: TIM15,
953 pub TIM16: TIM16,
955 pub TIM17: TIM17,
957 pub USART1: USART1,
959 pub USART2: USART2,
961 pub USART3: USART3,
963 pub SPI1: SPI1,
965 pub SPI2: SPI2,
967 pub SPI3: SPI3,
969 pub I2S2EXT: I2S2EXT,
971 pub I2S3EXT: I2S3EXT,
973 pub ADC1: ADC1,
975 pub EXTI: EXTI,
977 pub CEC: CEC,
979 pub PWR: PWR,
981 pub CAN: CAN,
983 pub USB: USB,
985 pub I2C1: I2C1,
987 pub I2C2: I2C2,
989 pub IWDG: IWDG,
991 pub WWDG: WWDG,
993 pub RTC: RTC,
995 pub SDADC1: SDADC1,
997 pub SDADC2: SDADC2,
999 pub SDADC3: SDADC3,
1001 pub DAC2: DAC2,
1003 pub TIM6: TIM6,
1005 pub TIM7: TIM7,
1007 pub TIM18: TIM18,
1009 pub TIM13: TIM13,
1011 pub TIM14: TIM14,
1013 pub TIM12: TIM12,
1015 pub DAC1: DAC1,
1017 pub DBGMCU: DBGMCU,
1019 pub SYSCFG: SYSCFG,
1021 pub COMP: COMP,
1023 pub GPIOD: GPIOD,
1025}
1026impl Peripherals {
1027 #[cfg(feature = "critical-section")]
1029 #[inline]
1030 pub fn take() -> Option<Self> {
1031 critical_section::with(|_| {
1032 if unsafe { DEVICE_PERIPHERALS } {
1033 return None;
1034 }
1035 Some(unsafe { Peripherals::steal() })
1036 })
1037 }
1038 #[inline]
1044 pub unsafe fn steal() -> Self {
1045 DEVICE_PERIPHERALS = true;
1046 Peripherals {
1047 GPIOA: GPIOA::steal(),
1048 GPIOB: GPIOB::steal(),
1049 GPIOC: GPIOC::steal(),
1050 GPIOE: GPIOE::steal(),
1051 GPIOF: GPIOF::steal(),
1052 TSC: TSC::steal(),
1053 CRC: CRC::steal(),
1054 FLASH: FLASH::steal(),
1055 RCC: RCC::steal(),
1056 DMA1: DMA1::steal(),
1057 DMA2: DMA2::steal(),
1058 TIM2: TIM2::steal(),
1059 TIM5: TIM5::steal(),
1060 TIM3: TIM3::steal(),
1061 TIM4: TIM4::steal(),
1062 TIM19: TIM19::steal(),
1063 TIM15: TIM15::steal(),
1064 TIM16: TIM16::steal(),
1065 TIM17: TIM17::steal(),
1066 USART1: USART1::steal(),
1067 USART2: USART2::steal(),
1068 USART3: USART3::steal(),
1069 SPI1: SPI1::steal(),
1070 SPI2: SPI2::steal(),
1071 SPI3: SPI3::steal(),
1072 I2S2EXT: I2S2EXT::steal(),
1073 I2S3EXT: I2S3EXT::steal(),
1074 ADC1: ADC1::steal(),
1075 EXTI: EXTI::steal(),
1076 CEC: CEC::steal(),
1077 PWR: PWR::steal(),
1078 CAN: CAN::steal(),
1079 USB: USB::steal(),
1080 I2C1: I2C1::steal(),
1081 I2C2: I2C2::steal(),
1082 IWDG: IWDG::steal(),
1083 WWDG: WWDG::steal(),
1084 RTC: RTC::steal(),
1085 SDADC1: SDADC1::steal(),
1086 SDADC2: SDADC2::steal(),
1087 SDADC3: SDADC3::steal(),
1088 DAC2: DAC2::steal(),
1089 TIM6: TIM6::steal(),
1090 TIM7: TIM7::steal(),
1091 TIM18: TIM18::steal(),
1092 TIM13: TIM13::steal(),
1093 TIM14: TIM14::steal(),
1094 TIM12: TIM12::steal(),
1095 DAC1: DAC1::steal(),
1096 DBGMCU: DBGMCU::steal(),
1097 SYSCFG: SYSCFG::steal(),
1098 COMP: COMP::steal(),
1099 GPIOD: GPIOD::steal(),
1100 }
1101 }
1102}