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::{
16 CBP, CPUID, DCB, DWT, FPB, ITM, MPU, NVIC, SCB, SYST, TPIU,
17};
18#[cfg(feature = "rt")]
19pub use cortex_m_rt::interrupt;
20#[cfg(feature = "rt")]
21extern "C" {
22 fn WWDG();
23 fn PVD();
24 fn TAMPER();
25 fn RTC();
26 fn FLASH();
27 fn RCC();
28 fn EXTI0();
29 fn EXTI1();
30 fn EXTI2();
31 fn EXTI3();
32 fn EXTI4();
33 fn DMA1_CHANNEL1();
34 fn DMA1_CHANNEL2();
35 fn DMA1_CHANNEL3();
36 fn DMA1_CHANNEL4();
37 fn DMA1_CHANNEL5();
38 fn DMA1_CHANNEL6();
39 fn DMA1_CHANNEL7();
40 fn ADC1_2();
41 fn USB_HP_CAN_TX();
42 fn USB_LP_CAN_RX0();
43 fn EXTI9_5();
44 fn TIM1_BRK();
45 fn TIM1_UP();
46 fn TIM1_TRG_COM();
47 fn TIM1_CC();
48 fn TIM2();
49 fn TIM3();
50 fn TIM4();
51 fn I2C1_EV();
52 fn I2C1_ER();
53 fn I2C2_EV();
54 fn I2C2_ER();
55 fn SPI1();
56 fn SPI2();
57 fn USART1();
58 fn USART2();
59 fn USART3();
60 fn EXTI15_10();
61 fn RTC_ALARM();
62 fn USBWAKEUP();
63 fn TIM8_BRK();
64 fn TIM8_UP();
65 fn TIM8_TRG_COM();
66 fn TIM8_CC();
67 fn ADC3();
68 fn FSMC();
69 fn SDIO();
70 fn TIM5();
71 fn SPI3();
72 fn UART4();
73 fn UART5();
74 fn TIM6();
75 fn TIM7();
76 fn DMA2_CH1();
77 fn DMA2_CH2();
78 fn DMA2_CH3();
79 fn DMA2_CHANNEL4_5();
80}
81#[doc(hidden)]
82#[repr(C)]
83pub union Vector {
84 _handler: unsafe extern "C" fn(),
85 _reserved: u32,
86}
87#[cfg(feature = "rt")]
88#[doc(hidden)]
89#[link_section = ".vector_table.interrupts"]
90#[no_mangle]
91pub static __INTERRUPTS: [Vector; 60] = [
92 Vector { _handler: WWDG },
93 Vector { _handler: PVD },
94 Vector { _handler: TAMPER },
95 Vector { _handler: RTC },
96 Vector { _handler: FLASH },
97 Vector { _handler: RCC },
98 Vector { _handler: EXTI0 },
99 Vector { _handler: EXTI1 },
100 Vector { _handler: EXTI2 },
101 Vector { _handler: EXTI3 },
102 Vector { _handler: EXTI4 },
103 Vector { _handler: DMA1_CHANNEL1 },
104 Vector { _handler: DMA1_CHANNEL2 },
105 Vector { _handler: DMA1_CHANNEL3 },
106 Vector { _handler: DMA1_CHANNEL4 },
107 Vector { _handler: DMA1_CHANNEL5 },
108 Vector { _handler: DMA1_CHANNEL6 },
109 Vector { _handler: DMA1_CHANNEL7 },
110 Vector { _handler: ADC1_2 },
111 Vector { _handler: USB_HP_CAN_TX },
112 Vector { _handler: USB_LP_CAN_RX0 },
113 Vector { _reserved: 0 },
114 Vector { _reserved: 0 },
115 Vector { _handler: EXTI9_5 },
116 Vector { _handler: TIM1_BRK },
117 Vector { _handler: TIM1_UP },
118 Vector { _handler: TIM1_TRG_COM },
119 Vector { _handler: TIM1_CC },
120 Vector { _handler: TIM2 },
121 Vector { _handler: TIM3 },
122 Vector { _handler: TIM4 },
123 Vector { _handler: I2C1_EV },
124 Vector { _handler: I2C1_ER },
125 Vector { _handler: I2C2_EV },
126 Vector { _handler: I2C2_ER },
127 Vector { _handler: SPI1 },
128 Vector { _handler: SPI2 },
129 Vector { _handler: USART1 },
130 Vector { _handler: USART2 },
131 Vector { _handler: USART3 },
132 Vector { _handler: EXTI15_10 },
133 Vector { _handler: RTC_ALARM },
134 Vector { _handler: USBWAKEUP },
135 Vector { _handler: TIM8_BRK },
136 Vector { _handler: TIM8_UP },
137 Vector { _handler: TIM8_TRG_COM },
138 Vector { _handler: TIM8_CC },
139 Vector { _handler: ADC3 },
140 Vector { _handler: FSMC },
141 Vector { _handler: SDIO },
142 Vector { _handler: TIM5 },
143 Vector { _handler: SPI3 },
144 Vector { _handler: UART4 },
145 Vector { _handler: UART5 },
146 Vector { _handler: TIM6 },
147 Vector { _handler: TIM7 },
148 Vector { _handler: DMA2_CH1 },
149 Vector { _handler: DMA2_CH2 },
150 Vector { _handler: DMA2_CH3 },
151 Vector {
152 _handler: DMA2_CHANNEL4_5,
153 },
154];
155#[cfg_attr(feature = "defmt", derive(defmt::Format))]
157#[derive(Copy, Clone, Debug, PartialEq, Eq)]
158#[repr(u16)]
159pub enum Interrupt {
160 WWDG = 0,
162 PVD = 1,
164 TAMPER = 2,
166 RTC = 3,
168 FLASH = 4,
170 RCC = 5,
172 EXTI0 = 6,
174 EXTI1 = 7,
176 EXTI2 = 8,
178 EXTI3 = 9,
180 EXTI4 = 10,
182 DMA1_CHANNEL1 = 11,
184 DMA1_CHANNEL2 = 12,
186 DMA1_CHANNEL3 = 13,
188 DMA1_CHANNEL4 = 14,
190 DMA1_CHANNEL5 = 15,
192 DMA1_CHANNEL6 = 16,
194 DMA1_CHANNEL7 = 17,
196 ADC1_2 = 18,
198 USB_HP_CAN_TX = 19,
200 USB_LP_CAN_RX0 = 20,
202 EXTI9_5 = 23,
204 TIM1_BRK = 24,
206 TIM1_UP = 25,
208 TIM1_TRG_COM = 26,
210 TIM1_CC = 27,
212 TIM2 = 28,
214 TIM3 = 29,
216 TIM4 = 30,
218 I2C1_EV = 31,
220 I2C1_ER = 32,
222 I2C2_EV = 33,
224 I2C2_ER = 34,
226 SPI1 = 35,
228 SPI2 = 36,
230 USART1 = 37,
232 USART2 = 38,
234 USART3 = 39,
236 EXTI15_10 = 40,
238 RTC_ALARM = 41,
240 USBWAKEUP = 42,
242 TIM8_BRK = 43,
244 TIM8_UP = 44,
246 TIM8_TRG_COM = 45,
248 TIM8_CC = 46,
250 ADC3 = 47,
252 FSMC = 48,
254 SDIO = 49,
256 TIM5 = 50,
258 SPI3 = 51,
260 UART4 = 52,
262 UART5 = 53,
264 TIM6 = 54,
266 TIM7 = 55,
268 DMA2_CH1 = 56,
270 DMA2_CH2 = 57,
272 DMA2_CH3 = 58,
274 DMA2_CHANNEL4_5 = 59,
276}
277unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
278 #[inline(always)]
279 fn number(self) -> u16 {
280 self as u16
281 }
282}
283pub type FSMC = crate::Periph<fsmc::RegisterBlock, 0xa000_0000>;
287impl core::fmt::Debug for FSMC {
288 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
289 f.debug_struct("FSMC").finish()
290 }
291}
292pub mod fsmc;
294pub type PWR = crate::Periph<pwr::RegisterBlock, 0x4000_7000>;
298impl core::fmt::Debug for PWR {
299 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
300 f.debug_struct("PWR").finish()
301 }
302}
303pub mod pwr;
305pub type RCC = crate::Periph<rcc::RegisterBlock, 0x4002_1000>;
309impl core::fmt::Debug for RCC {
310 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
311 f.debug_struct("RCC").finish()
312 }
313}
314pub mod rcc;
316pub type GPIOA = crate::Periph<gpioa::RegisterBlock, 0x4001_0800>;
320impl core::fmt::Debug for GPIOA {
321 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
322 f.debug_struct("GPIOA").finish()
323 }
324}
325pub mod gpioa;
327pub type GPIOB = crate::Periph<gpioa::RegisterBlock, 0x4001_0c00>;
331impl core::fmt::Debug for GPIOB {
332 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
333 f.debug_struct("GPIOB").finish()
334 }
335}
336pub use self::gpioa as gpiob;
338pub type GPIOC = crate::Periph<gpioa::RegisterBlock, 0x4001_1000>;
342impl core::fmt::Debug for GPIOC {
343 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
344 f.debug_struct("GPIOC").finish()
345 }
346}
347pub use self::gpioa as gpioc;
349pub type GPIOD = crate::Periph<gpioa::RegisterBlock, 0x4001_1400>;
353impl core::fmt::Debug for GPIOD {
354 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
355 f.debug_struct("GPIOD").finish()
356 }
357}
358pub use self::gpioa as gpiod;
360pub type GPIOE = crate::Periph<gpioa::RegisterBlock, 0x4001_1800>;
364impl core::fmt::Debug for GPIOE {
365 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
366 f.debug_struct("GPIOE").finish()
367 }
368}
369pub use self::gpioa as gpioe;
371pub type GPIOF = crate::Periph<gpioa::RegisterBlock, 0x4001_1c00>;
375impl core::fmt::Debug for GPIOF {
376 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
377 f.debug_struct("GPIOF").finish()
378 }
379}
380pub use self::gpioa as gpiof;
382pub type GPIOG = crate::Periph<gpioa::RegisterBlock, 0x4001_2000>;
386impl core::fmt::Debug for GPIOG {
387 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
388 f.debug_struct("GPIOG").finish()
389 }
390}
391pub use self::gpioa as gpiog;
393pub type AFIO = crate::Periph<afio::RegisterBlock, 0x4001_0000>;
397impl core::fmt::Debug for AFIO {
398 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
399 f.debug_struct("AFIO").finish()
400 }
401}
402pub mod afio;
404pub type EXTI = crate::Periph<exti::RegisterBlock, 0x4001_0400>;
408impl core::fmt::Debug for EXTI {
409 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
410 f.debug_struct("EXTI").finish()
411 }
412}
413pub mod exti;
415pub type DMA1 = crate::Periph<dma1::RegisterBlock, 0x4002_0000>;
419impl core::fmt::Debug for DMA1 {
420 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
421 f.debug_struct("DMA1").finish()
422 }
423}
424pub mod dma1;
426pub type DMA2 = crate::Periph<dma1::RegisterBlock, 0x4002_0400>;
430impl core::fmt::Debug for DMA2 {
431 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
432 f.debug_struct("DMA2").finish()
433 }
434}
435pub use self::dma1 as dma2;
437pub type RTC = crate::Periph<rtc::RegisterBlock, 0x4000_2800>;
441impl core::fmt::Debug for RTC {
442 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
443 f.debug_struct("RTC").finish()
444 }
445}
446pub mod rtc;
448pub type IWDG = crate::Periph<iwdg::RegisterBlock, 0x4000_3000>;
452impl core::fmt::Debug for IWDG {
453 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
454 f.debug_struct("IWDG").finish()
455 }
456}
457pub mod iwdg;
459pub type WWDG = crate::Periph<wwdg::RegisterBlock, 0x4000_2c00>;
463impl core::fmt::Debug for WWDG {
464 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
465 f.debug_struct("WWDG").finish()
466 }
467}
468pub mod wwdg;
470pub type TIM2 = crate::Periph<tim2::RegisterBlock, 0x4000_0000>;
474impl core::fmt::Debug for TIM2 {
475 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
476 f.debug_struct("TIM2").finish()
477 }
478}
479pub mod tim2;
481pub type TIM3 = crate::Periph<tim2::RegisterBlock, 0x4000_0400>;
485impl core::fmt::Debug for TIM3 {
486 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
487 f.debug_struct("TIM3").finish()
488 }
489}
490pub use self::tim2 as tim3;
492pub type TIM4 = crate::Periph<tim2::RegisterBlock, 0x4000_0800>;
496impl core::fmt::Debug for TIM4 {
497 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
498 f.debug_struct("TIM4").finish()
499 }
500}
501pub use self::tim2 as tim4;
503pub type TIM5 = crate::Periph<tim2::RegisterBlock, 0x4000_0c00>;
507impl core::fmt::Debug for TIM5 {
508 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
509 f.debug_struct("TIM5").finish()
510 }
511}
512pub use self::tim2 as tim5;
514pub type TIM9 = crate::Periph<tim9::RegisterBlock, 0x4001_4c00>;
518impl core::fmt::Debug for TIM9 {
519 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
520 f.debug_struct("TIM9").finish()
521 }
522}
523pub mod tim9;
525pub type TIM12 = crate::Periph<tim9::RegisterBlock, 0x4000_1800>;
529impl core::fmt::Debug for TIM12 {
530 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
531 f.debug_struct("TIM12").finish()
532 }
533}
534pub use self::tim9 as tim12;
536pub type TIM10 = crate::Periph<tim10::RegisterBlock, 0x4001_5000>;
540impl core::fmt::Debug for TIM10 {
541 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
542 f.debug_struct("TIM10").finish()
543 }
544}
545pub mod tim10;
547pub type TIM11 = crate::Periph<tim10::RegisterBlock, 0x4001_5400>;
551impl core::fmt::Debug for TIM11 {
552 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
553 f.debug_struct("TIM11").finish()
554 }
555}
556pub use self::tim10 as tim11;
558pub type TIM13 = crate::Periph<tim10::RegisterBlock, 0x4000_1c00>;
562impl core::fmt::Debug for TIM13 {
563 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
564 f.debug_struct("TIM13").finish()
565 }
566}
567pub use self::tim10 as tim13;
569pub type TIM14 = crate::Periph<tim10::RegisterBlock, 0x4000_2000>;
573impl core::fmt::Debug for TIM14 {
574 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
575 f.debug_struct("TIM14").finish()
576 }
577}
578pub use self::tim10 as tim14;
580pub type TIM6 = crate::Periph<tim6::RegisterBlock, 0x4000_1000>;
584impl core::fmt::Debug for TIM6 {
585 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
586 f.debug_struct("TIM6").finish()
587 }
588}
589pub mod tim6;
591pub type TIM7 = crate::Periph<tim6::RegisterBlock, 0x4000_1400>;
595impl core::fmt::Debug for TIM7 {
596 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
597 f.debug_struct("TIM7").finish()
598 }
599}
600pub use self::tim6 as tim7;
602pub type I2C1 = crate::Periph<i2c1::RegisterBlock, 0x4000_5400>;
606impl core::fmt::Debug for I2C1 {
607 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
608 f.debug_struct("I2C1").finish()
609 }
610}
611pub mod i2c1;
613pub type I2C2 = crate::Periph<i2c1::RegisterBlock, 0x4000_5800>;
617impl core::fmt::Debug for I2C2 {
618 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
619 f.debug_struct("I2C2").finish()
620 }
621}
622pub use self::i2c1 as i2c2;
624pub type SPI1 = crate::Periph<spi1::RegisterBlock, 0x4001_3000>;
628impl core::fmt::Debug for SPI1 {
629 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
630 f.debug_struct("SPI1").finish()
631 }
632}
633pub mod spi1;
635pub type SPI2 = crate::Periph<spi1::RegisterBlock, 0x4000_3800>;
639impl core::fmt::Debug for SPI2 {
640 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
641 f.debug_struct("SPI2").finish()
642 }
643}
644pub use self::spi1 as spi2;
646pub type SPI3 = crate::Periph<spi1::RegisterBlock, 0x4000_3c00>;
650impl core::fmt::Debug for SPI3 {
651 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
652 f.debug_struct("SPI3").finish()
653 }
654}
655pub use self::spi1 as spi3;
657pub type USART1 = crate::Periph<usart1::RegisterBlock, 0x4001_3800>;
661impl core::fmt::Debug for USART1 {
662 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
663 f.debug_struct("USART1").finish()
664 }
665}
666pub mod usart1;
668pub type USART2 = crate::Periph<usart1::RegisterBlock, 0x4000_4400>;
672impl core::fmt::Debug for USART2 {
673 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
674 f.debug_struct("USART2").finish()
675 }
676}
677pub use self::usart1 as usart2;
679pub type USART3 = crate::Periph<usart1::RegisterBlock, 0x4000_4800>;
683impl core::fmt::Debug for USART3 {
684 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
685 f.debug_struct("USART3").finish()
686 }
687}
688pub use self::usart1 as usart3;
690pub type DAC = crate::Periph<dac::RegisterBlock, 0x4000_7400>;
694impl core::fmt::Debug for DAC {
695 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
696 f.debug_struct("DAC").finish()
697 }
698}
699pub mod dac;
701pub type DBGMCU = crate::Periph<dbgmcu::RegisterBlock, 0xe004_2000>;
705impl core::fmt::Debug for DBGMCU {
706 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
707 f.debug_struct("DBGMCU").finish()
708 }
709}
710pub mod dbgmcu;
712pub type UART4 = crate::Periph<uart4::RegisterBlock, 0x4000_4c00>;
716impl core::fmt::Debug for UART4 {
717 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
718 f.debug_struct("UART4").finish()
719 }
720}
721pub mod uart4;
723pub type UART5 = crate::Periph<uart4::RegisterBlock, 0x4000_5000>;
727impl core::fmt::Debug for UART5 {
728 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
729 f.debug_struct("UART5").finish()
730 }
731}
732pub use self::uart4 as uart5;
734pub type CRC = crate::Periph<crc::RegisterBlock, 0x4002_3000>;
738impl core::fmt::Debug for CRC {
739 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
740 f.debug_struct("CRC").finish()
741 }
742}
743pub mod crc;
745pub type FLASH = crate::Periph<flash::RegisterBlock, 0x4002_2000>;
749impl core::fmt::Debug for FLASH {
750 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
751 f.debug_struct("FLASH").finish()
752 }
753}
754pub mod flash;
756pub type BKP = crate::Periph<bkp::RegisterBlock, 0x4000_6c04>;
760impl core::fmt::Debug for BKP {
761 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
762 f.debug_struct("BKP").finish()
763 }
764}
765pub mod bkp;
767pub type ADC1 = crate::Periph<adc1::RegisterBlock, 0x4001_2400>;
771impl core::fmt::Debug for ADC1 {
772 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
773 f.debug_struct("ADC1").finish()
774 }
775}
776pub mod adc1;
778pub type OTG_FS_DEVICE = crate::Periph<otg_fs_device::RegisterBlock, 0x5000_0800>;
782impl core::fmt::Debug for OTG_FS_DEVICE {
783 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
784 f.debug_struct("OTG_FS_DEVICE").finish()
785 }
786}
787pub mod otg_fs_device;
789pub type OTG_FS_GLOBAL = crate::Periph<otg_fs_global::RegisterBlock, 0x5000_0000>;
793impl core::fmt::Debug for OTG_FS_GLOBAL {
794 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
795 f.debug_struct("OTG_FS_GLOBAL").finish()
796 }
797}
798pub mod otg_fs_global;
800pub type OTG_FS_HOST = crate::Periph<otg_fs_host::RegisterBlock, 0x5000_0400>;
804impl core::fmt::Debug for OTG_FS_HOST {
805 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
806 f.debug_struct("OTG_FS_HOST").finish()
807 }
808}
809pub mod otg_fs_host;
811pub type OTG_FS_PWRCLK = crate::Periph<otg_fs_pwrclk::RegisterBlock, 0x5000_0e00>;
815impl core::fmt::Debug for OTG_FS_PWRCLK {
816 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
817 f.debug_struct("OTG_FS_PWRCLK").finish()
818 }
819}
820pub mod otg_fs_pwrclk;
822pub type ETHERNET_MMC = crate::Periph<ethernet_mmc::RegisterBlock, 0x4002_8100>;
826impl core::fmt::Debug for ETHERNET_MMC {
827 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
828 f.debug_struct("ETHERNET_MMC").finish()
829 }
830}
831pub mod ethernet_mmc;
833pub type ETHERNET_MAC = crate::Periph<ethernet_mac::RegisterBlock, 0x4002_8000>;
837impl core::fmt::Debug for ETHERNET_MAC {
838 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
839 f.debug_struct("ETHERNET_MAC").finish()
840 }
841}
842pub mod ethernet_mac;
844pub type ETHERNET_PTP = crate::Periph<ethernet_ptp::RegisterBlock, 0x4002_8700>;
848impl core::fmt::Debug for ETHERNET_PTP {
849 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
850 f.debug_struct("ETHERNET_PTP").finish()
851 }
852}
853pub mod ethernet_ptp;
855pub type ETHERNET_DMA = crate::Periph<ethernet_dma::RegisterBlock, 0x4002_9000>;
859impl core::fmt::Debug for ETHERNET_DMA {
860 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
861 f.debug_struct("ETHERNET_DMA").finish()
862 }
863}
864pub mod ethernet_dma;
866pub type USB = crate::Periph<usb::RegisterBlock, 0x4000_5c00>;
870impl core::fmt::Debug for USB {
871 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
872 f.debug_struct("USB").finish()
873 }
874}
875pub mod usb;
877pub type ADC2 = crate::Periph<adc2::RegisterBlock, 0x4001_2800>;
881impl core::fmt::Debug for ADC2 {
882 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
883 f.debug_struct("ADC2").finish()
884 }
885}
886pub mod adc2;
888pub type ADC3 = crate::Periph<adc3::RegisterBlock, 0x4001_3c00>;
892impl core::fmt::Debug for ADC3 {
893 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
894 f.debug_struct("ADC3").finish()
895 }
896}
897pub mod adc3;
899pub type TIM1 = crate::Periph<tim1::RegisterBlock, 0x4001_2c00>;
903impl core::fmt::Debug for TIM1 {
904 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
905 f.debug_struct("TIM1").finish()
906 }
907}
908pub mod tim1;
910pub type TIM8 = crate::Periph<tim1::RegisterBlock, 0x4001_3400>;
914impl core::fmt::Debug for TIM8 {
915 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
916 f.debug_struct("TIM8").finish()
917 }
918}
919pub use self::tim1 as tim8;
921pub type SDIO = crate::Periph<sdio::RegisterBlock, 0x4001_8000>;
925impl core::fmt::Debug for SDIO {
926 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
927 f.debug_struct("SDIO").finish()
928 }
929}
930pub mod sdio;
932pub type SCB_ACTRL = crate::Periph<scb_actrl::RegisterBlock, 0xe000_e008>;
936impl core::fmt::Debug for SCB_ACTRL {
937 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
938 f.debug_struct("SCB_ACTRL").finish()
939 }
940}
941pub mod scb_actrl;
943pub type NVIC_STIR = crate::Periph<nvic_stir::RegisterBlock, 0xe000_ef00>;
947impl core::fmt::Debug for NVIC_STIR {
948 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
949 f.debug_struct("NVIC_STIR").finish()
950 }
951}
952pub mod nvic_stir;
954pub type STK = crate::Periph<stk::RegisterBlock, 0xe000_e010>;
958impl core::fmt::Debug for STK {
959 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
960 f.debug_struct("STK").finish()
961 }
962}
963pub mod stk;
965#[no_mangle]
966static mut DEVICE_PERIPHERALS: bool = false;
967#[allow(non_snake_case)]
969pub struct Peripherals {
970 pub FSMC: FSMC,
972 pub PWR: PWR,
974 pub RCC: RCC,
976 pub GPIOA: GPIOA,
978 pub GPIOB: GPIOB,
980 pub GPIOC: GPIOC,
982 pub GPIOD: GPIOD,
984 pub GPIOE: GPIOE,
986 pub GPIOF: GPIOF,
988 pub GPIOG: GPIOG,
990 pub AFIO: AFIO,
992 pub EXTI: EXTI,
994 pub DMA1: DMA1,
996 pub DMA2: DMA2,
998 pub RTC: RTC,
1000 pub IWDG: IWDG,
1002 pub WWDG: WWDG,
1004 pub TIM2: TIM2,
1006 pub TIM3: TIM3,
1008 pub TIM4: TIM4,
1010 pub TIM5: TIM5,
1012 pub TIM9: TIM9,
1014 pub TIM12: TIM12,
1016 pub TIM10: TIM10,
1018 pub TIM11: TIM11,
1020 pub TIM13: TIM13,
1022 pub TIM14: TIM14,
1024 pub TIM6: TIM6,
1026 pub TIM7: TIM7,
1028 pub I2C1: I2C1,
1030 pub I2C2: I2C2,
1032 pub SPI1: SPI1,
1034 pub SPI2: SPI2,
1036 pub SPI3: SPI3,
1038 pub USART1: USART1,
1040 pub USART2: USART2,
1042 pub USART3: USART3,
1044 pub DAC: DAC,
1046 pub DBGMCU: DBGMCU,
1048 pub UART4: UART4,
1050 pub UART5: UART5,
1052 pub CRC: CRC,
1054 pub FLASH: FLASH,
1056 pub BKP: BKP,
1058 pub ADC1: ADC1,
1060 pub OTG_FS_DEVICE: OTG_FS_DEVICE,
1062 pub OTG_FS_GLOBAL: OTG_FS_GLOBAL,
1064 pub OTG_FS_HOST: OTG_FS_HOST,
1066 pub OTG_FS_PWRCLK: OTG_FS_PWRCLK,
1068 pub ETHERNET_MMC: ETHERNET_MMC,
1070 pub ETHERNET_MAC: ETHERNET_MAC,
1072 pub ETHERNET_PTP: ETHERNET_PTP,
1074 pub ETHERNET_DMA: ETHERNET_DMA,
1076 pub USB: USB,
1078 pub ADC2: ADC2,
1080 pub ADC3: ADC3,
1082 pub TIM1: TIM1,
1084 pub TIM8: TIM8,
1086 pub SDIO: SDIO,
1088 pub SCB_ACTRL: SCB_ACTRL,
1090 pub NVIC_STIR: NVIC_STIR,
1092 pub STK: STK,
1094}
1095impl Peripherals {
1096 #[cfg(feature = "critical-section")]
1098 #[inline]
1099 pub fn take() -> Option<Self> {
1100 critical_section::with(|_| {
1101 if unsafe { DEVICE_PERIPHERALS } {
1102 return None;
1103 }
1104 Some(unsafe { Peripherals::steal() })
1105 })
1106 }
1107 #[inline]
1113 pub unsafe fn steal() -> Self {
1114 DEVICE_PERIPHERALS = true;
1115 Peripherals {
1116 FSMC: FSMC::steal(),
1117 PWR: PWR::steal(),
1118 RCC: RCC::steal(),
1119 GPIOA: GPIOA::steal(),
1120 GPIOB: GPIOB::steal(),
1121 GPIOC: GPIOC::steal(),
1122 GPIOD: GPIOD::steal(),
1123 GPIOE: GPIOE::steal(),
1124 GPIOF: GPIOF::steal(),
1125 GPIOG: GPIOG::steal(),
1126 AFIO: AFIO::steal(),
1127 EXTI: EXTI::steal(),
1128 DMA1: DMA1::steal(),
1129 DMA2: DMA2::steal(),
1130 RTC: RTC::steal(),
1131 IWDG: IWDG::steal(),
1132 WWDG: WWDG::steal(),
1133 TIM2: TIM2::steal(),
1134 TIM3: TIM3::steal(),
1135 TIM4: TIM4::steal(),
1136 TIM5: TIM5::steal(),
1137 TIM9: TIM9::steal(),
1138 TIM12: TIM12::steal(),
1139 TIM10: TIM10::steal(),
1140 TIM11: TIM11::steal(),
1141 TIM13: TIM13::steal(),
1142 TIM14: TIM14::steal(),
1143 TIM6: TIM6::steal(),
1144 TIM7: TIM7::steal(),
1145 I2C1: I2C1::steal(),
1146 I2C2: I2C2::steal(),
1147 SPI1: SPI1::steal(),
1148 SPI2: SPI2::steal(),
1149 SPI3: SPI3::steal(),
1150 USART1: USART1::steal(),
1151 USART2: USART2::steal(),
1152 USART3: USART3::steal(),
1153 DAC: DAC::steal(),
1154 DBGMCU: DBGMCU::steal(),
1155 UART4: UART4::steal(),
1156 UART5: UART5::steal(),
1157 CRC: CRC::steal(),
1158 FLASH: FLASH::steal(),
1159 BKP: BKP::steal(),
1160 ADC1: ADC1::steal(),
1161 OTG_FS_DEVICE: OTG_FS_DEVICE::steal(),
1162 OTG_FS_GLOBAL: OTG_FS_GLOBAL::steal(),
1163 OTG_FS_HOST: OTG_FS_HOST::steal(),
1164 OTG_FS_PWRCLK: OTG_FS_PWRCLK::steal(),
1165 ETHERNET_MMC: ETHERNET_MMC::steal(),
1166 ETHERNET_MAC: ETHERNET_MAC::steal(),
1167 ETHERNET_PTP: ETHERNET_PTP::steal(),
1168 ETHERNET_DMA: ETHERNET_DMA::steal(),
1169 USB: USB::steal(),
1170 ADC2: ADC2::steal(),
1171 ADC3: ADC3::steal(),
1172 TIM1: TIM1::steal(),
1173 TIM8: TIM8::steal(),
1174 SDIO: SDIO::steal(),
1175 SCB_ACTRL: SCB_ACTRL::steal(),
1176 NVIC_STIR: NVIC_STIR::steal(),
1177 STK: STK::steal(),
1178 }
1179 }
1180}