pub const NVIC_PRIO_BITS: u8 = 4;
#[cfg(feature = "rt")]
pub use self::Interrupt as interrupt;
pub use cortex_m::peripheral::Peripherals as CorePeripherals;
pub use cortex_m::peripheral::{CBP, CPUID, DCB, DWT, FPB, ITM, MPU, NVIC, SCB, SYST, TPIU};
#[cfg(feature = "rt")]
pub use cortex_m_rt::interrupt;
#[cfg(feature = "rt")]
extern "C" {
fn WWDG();
fn PVD();
fn TAMPER();
fn RTC();
fn FLASH();
fn RCC();
fn EXTI0();
fn EXTI1();
fn EXTI2();
fn EXTI3();
fn EXTI4();
fn DMA1_CHANNEL1();
fn DMA1_CHANNEL2();
fn DMA1_CHANNEL3();
fn DMA1_CHANNEL4();
fn DMA1_CHANNEL5();
fn DMA1_CHANNEL6();
fn DMA1_CHANNEL7();
fn ADC1_2();
fn USB_HP_CAN_TX();
fn USB_LP_CAN_RX0();
fn EXTI9_5();
fn TIM1_BRK();
fn TIM1_UP();
fn TIM1_TRG_COM();
fn TIM1_CC();
fn TIM2();
fn TIM3();
fn TIM4();
fn I2C1_EV();
fn I2C1_ER();
fn I2C2_EV();
fn I2C2_ER();
fn SPI1();
fn SPI2();
fn USART1();
fn USART2();
fn USART3();
fn EXTI15_10();
fn RTC_ALARM();
fn USBWAKEUP();
fn TIM8_BRK();
fn TIM8_UP();
fn TIM8_TRG_COM();
fn TIM8_CC();
fn ADC3();
fn FSMC();
fn SDIO();
fn TIM5();
fn SPI3();
fn UART4();
fn UART5();
fn TIM6();
fn TIM7();
fn DMA2_CH1();
fn DMA2_CH2();
fn DMA2_CH3();
fn DMA2_CHANNEL4_5();
}
#[doc(hidden)]
#[repr(C)]
pub union Vector {
_handler: unsafe extern "C" fn(),
_reserved: u32,
}
#[cfg(feature = "rt")]
#[doc(hidden)]
#[link_section = ".vector_table.interrupts"]
#[no_mangle]
pub static __INTERRUPTS: [Vector; 60] = [
Vector { _handler: WWDG },
Vector { _handler: PVD },
Vector { _handler: TAMPER },
Vector { _handler: RTC },
Vector { _handler: FLASH },
Vector { _handler: RCC },
Vector { _handler: EXTI0 },
Vector { _handler: EXTI1 },
Vector { _handler: EXTI2 },
Vector { _handler: EXTI3 },
Vector { _handler: EXTI4 },
Vector {
_handler: DMA1_CHANNEL1,
},
Vector {
_handler: DMA1_CHANNEL2,
},
Vector {
_handler: DMA1_CHANNEL3,
},
Vector {
_handler: DMA1_CHANNEL4,
},
Vector {
_handler: DMA1_CHANNEL5,
},
Vector {
_handler: DMA1_CHANNEL6,
},
Vector {
_handler: DMA1_CHANNEL7,
},
Vector { _handler: ADC1_2 },
Vector {
_handler: USB_HP_CAN_TX,
},
Vector {
_handler: USB_LP_CAN_RX0,
},
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _handler: EXTI9_5 },
Vector { _handler: TIM1_BRK },
Vector { _handler: TIM1_UP },
Vector {
_handler: TIM1_TRG_COM,
},
Vector { _handler: TIM1_CC },
Vector { _handler: TIM2 },
Vector { _handler: TIM3 },
Vector { _handler: TIM4 },
Vector { _handler: I2C1_EV },
Vector { _handler: I2C1_ER },
Vector { _handler: I2C2_EV },
Vector { _handler: I2C2_ER },
Vector { _handler: SPI1 },
Vector { _handler: SPI2 },
Vector { _handler: USART1 },
Vector { _handler: USART2 },
Vector { _handler: USART3 },
Vector {
_handler: EXTI15_10,
},
Vector {
_handler: RTC_ALARM,
},
Vector {
_handler: USBWAKEUP,
},
Vector { _handler: TIM8_BRK },
Vector { _handler: TIM8_UP },
Vector {
_handler: TIM8_TRG_COM,
},
Vector { _handler: TIM8_CC },
Vector { _handler: ADC3 },
Vector { _handler: FSMC },
Vector { _handler: SDIO },
Vector { _handler: TIM5 },
Vector { _handler: SPI3 },
Vector { _handler: UART4 },
Vector { _handler: UART5 },
Vector { _handler: TIM6 },
Vector { _handler: TIM7 },
Vector { _handler: DMA2_CH1 },
Vector { _handler: DMA2_CH2 },
Vector { _handler: DMA2_CH3 },
Vector {
_handler: DMA2_CHANNEL4_5,
},
];
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[repr(u16)]
pub enum Interrupt {
WWDG = 0,
PVD = 1,
TAMPER = 2,
RTC = 3,
FLASH = 4,
RCC = 5,
EXTI0 = 6,
EXTI1 = 7,
EXTI2 = 8,
EXTI3 = 9,
EXTI4 = 10,
DMA1_CHANNEL1 = 11,
DMA1_CHANNEL2 = 12,
DMA1_CHANNEL3 = 13,
DMA1_CHANNEL4 = 14,
DMA1_CHANNEL5 = 15,
DMA1_CHANNEL6 = 16,
DMA1_CHANNEL7 = 17,
ADC1_2 = 18,
USB_HP_CAN_TX = 19,
USB_LP_CAN_RX0 = 20,
EXTI9_5 = 23,
TIM1_BRK = 24,
TIM1_UP = 25,
TIM1_TRG_COM = 26,
TIM1_CC = 27,
TIM2 = 28,
TIM3 = 29,
TIM4 = 30,
I2C1_EV = 31,
I2C1_ER = 32,
I2C2_EV = 33,
I2C2_ER = 34,
SPI1 = 35,
SPI2 = 36,
USART1 = 37,
USART2 = 38,
USART3 = 39,
EXTI15_10 = 40,
RTC_ALARM = 41,
USBWAKEUP = 42,
TIM8_BRK = 43,
TIM8_UP = 44,
TIM8_TRG_COM = 45,
TIM8_CC = 46,
ADC3 = 47,
FSMC = 48,
SDIO = 49,
TIM5 = 50,
SPI3 = 51,
UART4 = 52,
UART5 = 53,
TIM6 = 54,
TIM7 = 55,
DMA2_CH1 = 56,
DMA2_CH2 = 57,
DMA2_CH3 = 58,
DMA2_CHANNEL4_5 = 59,
}
unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
#[inline(always)]
fn number(self) -> u16 {
self as u16
}
}
pub type FSMC = crate::Periph<fsmc::RegisterBlock, 0xa000_0000>;
impl core::fmt::Debug for FSMC {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("FSMC").finish()
}
}
pub mod fsmc;
pub type PWR = crate::Periph<pwr::RegisterBlock, 0x4000_7000>;
impl core::fmt::Debug for PWR {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("PWR").finish()
}
}
pub mod pwr;
pub type RCC = crate::Periph<rcc::RegisterBlock, 0x4002_1000>;
impl core::fmt::Debug for RCC {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("RCC").finish()
}
}
pub mod rcc;
pub type GPIOA = crate::Periph<gpioa::RegisterBlock, 0x4001_0800>;
impl core::fmt::Debug for GPIOA {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("GPIOA").finish()
}
}
pub mod gpioa;
pub type GPIOB = crate::Periph<gpioa::RegisterBlock, 0x4001_0c00>;
impl core::fmt::Debug for GPIOB {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("GPIOB").finish()
}
}
pub use self::gpioa as gpiob;
pub type GPIOC = crate::Periph<gpioa::RegisterBlock, 0x4001_1000>;
impl core::fmt::Debug for GPIOC {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("GPIOC").finish()
}
}
pub use self::gpioa as gpioc;
pub type GPIOD = crate::Periph<gpioa::RegisterBlock, 0x4001_1400>;
impl core::fmt::Debug for GPIOD {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("GPIOD").finish()
}
}
pub use self::gpioa as gpiod;
pub type GPIOE = crate::Periph<gpioa::RegisterBlock, 0x4001_1800>;
impl core::fmt::Debug for GPIOE {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("GPIOE").finish()
}
}
pub use self::gpioa as gpioe;
pub type GPIOF = crate::Periph<gpioa::RegisterBlock, 0x4001_1c00>;
impl core::fmt::Debug for GPIOF {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("GPIOF").finish()
}
}
pub use self::gpioa as gpiof;
pub type GPIOG = crate::Periph<gpioa::RegisterBlock, 0x4001_2000>;
impl core::fmt::Debug for GPIOG {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("GPIOG").finish()
}
}
pub use self::gpioa as gpiog;
pub type AFIO = crate::Periph<afio::RegisterBlock, 0x4001_0000>;
impl core::fmt::Debug for AFIO {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("AFIO").finish()
}
}
pub mod afio;
pub type EXTI = crate::Periph<exti::RegisterBlock, 0x4001_0400>;
impl core::fmt::Debug for EXTI {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EXTI").finish()
}
}
pub mod exti;
pub type DMA1 = crate::Periph<dma1::RegisterBlock, 0x4002_0000>;
impl core::fmt::Debug for DMA1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("DMA1").finish()
}
}
pub mod dma1;
pub type DMA2 = crate::Periph<dma1::RegisterBlock, 0x4002_0400>;
impl core::fmt::Debug for DMA2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("DMA2").finish()
}
}
pub use self::dma1 as dma2;
pub type RTC = crate::Periph<rtc::RegisterBlock, 0x4000_2800>;
impl core::fmt::Debug for RTC {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("RTC").finish()
}
}
pub mod rtc;
pub type IWDG = crate::Periph<iwdg::RegisterBlock, 0x4000_3000>;
impl core::fmt::Debug for IWDG {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("IWDG").finish()
}
}
pub mod iwdg;
pub type WWDG = crate::Periph<wwdg::RegisterBlock, 0x4000_2c00>;
impl core::fmt::Debug for WWDG {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("WWDG").finish()
}
}
pub mod wwdg;
pub type TIM2 = crate::Periph<tim2::RegisterBlock, 0x4000_0000>;
impl core::fmt::Debug for TIM2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM2").finish()
}
}
pub mod tim2;
pub type TIM3 = crate::Periph<tim2::RegisterBlock, 0x4000_0400>;
impl core::fmt::Debug for TIM3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM3").finish()
}
}
pub use self::tim2 as tim3;
pub type TIM4 = crate::Periph<tim2::RegisterBlock, 0x4000_0800>;
impl core::fmt::Debug for TIM4 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM4").finish()
}
}
pub use self::tim2 as tim4;
pub type TIM5 = crate::Periph<tim2::RegisterBlock, 0x4000_0c00>;
impl core::fmt::Debug for TIM5 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM5").finish()
}
}
pub use self::tim2 as tim5;
pub type TIM9 = crate::Periph<tim9::RegisterBlock, 0x4001_4c00>;
impl core::fmt::Debug for TIM9 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM9").finish()
}
}
pub mod tim9;
pub type TIM12 = crate::Periph<tim9::RegisterBlock, 0x4000_1800>;
impl core::fmt::Debug for TIM12 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM12").finish()
}
}
pub use self::tim9 as tim12;
pub type TIM10 = crate::Periph<tim10::RegisterBlock, 0x4001_5000>;
impl core::fmt::Debug for TIM10 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM10").finish()
}
}
pub mod tim10;
pub type TIM11 = crate::Periph<tim10::RegisterBlock, 0x4001_5400>;
impl core::fmt::Debug for TIM11 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM11").finish()
}
}
pub use self::tim10 as tim11;
pub type TIM13 = crate::Periph<tim10::RegisterBlock, 0x4000_1c00>;
impl core::fmt::Debug for TIM13 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM13").finish()
}
}
pub use self::tim10 as tim13;
pub type TIM14 = crate::Periph<tim10::RegisterBlock, 0x4000_2000>;
impl core::fmt::Debug for TIM14 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM14").finish()
}
}
pub use self::tim10 as tim14;
pub type TIM6 = crate::Periph<tim6::RegisterBlock, 0x4000_1000>;
impl core::fmt::Debug for TIM6 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM6").finish()
}
}
pub mod tim6;
pub type TIM7 = crate::Periph<tim6::RegisterBlock, 0x4000_1400>;
impl core::fmt::Debug for TIM7 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM7").finish()
}
}
pub use self::tim6 as tim7;
pub type I2C1 = crate::Periph<i2c1::RegisterBlock, 0x4000_5400>;
impl core::fmt::Debug for I2C1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("I2C1").finish()
}
}
pub mod i2c1;
pub type I2C2 = crate::Periph<i2c1::RegisterBlock, 0x4000_5800>;
impl core::fmt::Debug for I2C2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("I2C2").finish()
}
}
pub use self::i2c1 as i2c2;
pub type SPI1 = crate::Periph<spi1::RegisterBlock, 0x4001_3000>;
impl core::fmt::Debug for SPI1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SPI1").finish()
}
}
pub mod spi1;
pub type SPI2 = crate::Periph<spi1::RegisterBlock, 0x4000_3800>;
impl core::fmt::Debug for SPI2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SPI2").finish()
}
}
pub use self::spi1 as spi2;
pub type SPI3 = crate::Periph<spi1::RegisterBlock, 0x4000_3c00>;
impl core::fmt::Debug for SPI3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SPI3").finish()
}
}
pub use self::spi1 as spi3;
pub type USART1 = crate::Periph<usart1::RegisterBlock, 0x4001_3800>;
impl core::fmt::Debug for USART1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("USART1").finish()
}
}
pub mod usart1;
pub type USART2 = crate::Periph<usart1::RegisterBlock, 0x4000_4400>;
impl core::fmt::Debug for USART2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("USART2").finish()
}
}
pub use self::usart1 as usart2;
pub type USART3 = crate::Periph<usart1::RegisterBlock, 0x4000_4800>;
impl core::fmt::Debug for USART3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("USART3").finish()
}
}
pub use self::usart1 as usart3;
pub type DAC = crate::Periph<dac::RegisterBlock, 0x4000_7400>;
impl core::fmt::Debug for DAC {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("DAC").finish()
}
}
pub mod dac;
pub type DBGMCU = crate::Periph<dbgmcu::RegisterBlock, 0xe004_2000>;
impl core::fmt::Debug for DBGMCU {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("DBGMCU").finish()
}
}
pub mod dbgmcu;
pub type UART4 = crate::Periph<uart4::RegisterBlock, 0x4000_4c00>;
impl core::fmt::Debug for UART4 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("UART4").finish()
}
}
pub mod uart4;
pub type UART5 = crate::Periph<uart4::RegisterBlock, 0x4000_5000>;
impl core::fmt::Debug for UART5 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("UART5").finish()
}
}
pub use self::uart4 as uart5;
pub type CRC = crate::Periph<crc::RegisterBlock, 0x4002_3000>;
impl core::fmt::Debug for CRC {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CRC").finish()
}
}
pub mod crc;
pub type FLASH = crate::Periph<flash::RegisterBlock, 0x4002_2000>;
impl core::fmt::Debug for FLASH {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("FLASH").finish()
}
}
pub mod flash;
pub type BKP = crate::Periph<bkp::RegisterBlock, 0x4000_6c04>;
impl core::fmt::Debug for BKP {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("BKP").finish()
}
}
pub mod bkp;
pub type ADC1 = crate::Periph<adc1::RegisterBlock, 0x4001_2400>;
impl core::fmt::Debug for ADC1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ADC1").finish()
}
}
pub mod adc1;
pub type OTG_FS_DEVICE = crate::Periph<otg_fs_device::RegisterBlock, 0x5000_0800>;
impl core::fmt::Debug for OTG_FS_DEVICE {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("OTG_FS_DEVICE").finish()
}
}
pub mod otg_fs_device;
pub type OTG_FS_GLOBAL = crate::Periph<otg_fs_global::RegisterBlock, 0x5000_0000>;
impl core::fmt::Debug for OTG_FS_GLOBAL {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("OTG_FS_GLOBAL").finish()
}
}
pub mod otg_fs_global;
pub type OTG_FS_HOST = crate::Periph<otg_fs_host::RegisterBlock, 0x5000_0400>;
impl core::fmt::Debug for OTG_FS_HOST {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("OTG_FS_HOST").finish()
}
}
pub mod otg_fs_host;
pub type OTG_FS_PWRCLK = crate::Periph<otg_fs_pwrclk::RegisterBlock, 0x5000_0e00>;
impl core::fmt::Debug for OTG_FS_PWRCLK {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("OTG_FS_PWRCLK").finish()
}
}
pub mod otg_fs_pwrclk;
pub type ETHERNET_MMC = crate::Periph<ethernet_mmc::RegisterBlock, 0x4002_8100>;
impl core::fmt::Debug for ETHERNET_MMC {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ETHERNET_MMC").finish()
}
}
pub mod ethernet_mmc;
pub type ETHERNET_MAC = crate::Periph<ethernet_mac::RegisterBlock, 0x4002_8000>;
impl core::fmt::Debug for ETHERNET_MAC {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ETHERNET_MAC").finish()
}
}
pub mod ethernet_mac;
pub type ETHERNET_PTP = crate::Periph<ethernet_ptp::RegisterBlock, 0x4002_8700>;
impl core::fmt::Debug for ETHERNET_PTP {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ETHERNET_PTP").finish()
}
}
pub mod ethernet_ptp;
pub type ETHERNET_DMA = crate::Periph<ethernet_dma::RegisterBlock, 0x4002_9000>;
impl core::fmt::Debug for ETHERNET_DMA {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ETHERNET_DMA").finish()
}
}
pub mod ethernet_dma;
pub type USB = crate::Periph<usb::RegisterBlock, 0x4000_5c00>;
impl core::fmt::Debug for USB {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("USB").finish()
}
}
pub mod usb;
pub type ADC2 = crate::Periph<adc2::RegisterBlock, 0x4001_2800>;
impl core::fmt::Debug for ADC2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ADC2").finish()
}
}
pub mod adc2;
pub type ADC3 = crate::Periph<adc3::RegisterBlock, 0x4001_3c00>;
impl core::fmt::Debug for ADC3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ADC3").finish()
}
}
pub mod adc3;
pub type TIM1 = crate::Periph<tim1::RegisterBlock, 0x4001_2c00>;
impl core::fmt::Debug for TIM1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM1").finish()
}
}
pub mod tim1;
pub type TIM8 = crate::Periph<tim1::RegisterBlock, 0x4001_3400>;
impl core::fmt::Debug for TIM8 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM8").finish()
}
}
pub use self::tim1 as tim8;
pub type SDIO = crate::Periph<sdio::RegisterBlock, 0x4001_8000>;
impl core::fmt::Debug for SDIO {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SDIO").finish()
}
}
pub mod sdio;
pub type SCB_ACTRL = crate::Periph<scb_actrl::RegisterBlock, 0xe000_e008>;
impl core::fmt::Debug for SCB_ACTRL {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SCB_ACTRL").finish()
}
}
pub mod scb_actrl;
pub type NVIC_STIR = crate::Periph<nvic_stir::RegisterBlock, 0xe000_ef00>;
impl core::fmt::Debug for NVIC_STIR {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("NVIC_STIR").finish()
}
}
pub mod nvic_stir;
pub type STK = crate::Periph<stk::RegisterBlock, 0xe000_e010>;
impl core::fmt::Debug for STK {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("STK").finish()
}
}
pub mod stk;
#[no_mangle]
static mut DEVICE_PERIPHERALS: bool = false;
#[allow(non_snake_case)]
pub struct Peripherals {
pub FSMC: FSMC,
pub PWR: PWR,
pub RCC: RCC,
pub GPIOA: GPIOA,
pub GPIOB: GPIOB,
pub GPIOC: GPIOC,
pub GPIOD: GPIOD,
pub GPIOE: GPIOE,
pub GPIOF: GPIOF,
pub GPIOG: GPIOG,
pub AFIO: AFIO,
pub EXTI: EXTI,
pub DMA1: DMA1,
pub DMA2: DMA2,
pub RTC: RTC,
pub IWDG: IWDG,
pub WWDG: WWDG,
pub TIM2: TIM2,
pub TIM3: TIM3,
pub TIM4: TIM4,
pub TIM5: TIM5,
pub TIM9: TIM9,
pub TIM12: TIM12,
pub TIM10: TIM10,
pub TIM11: TIM11,
pub TIM13: TIM13,
pub TIM14: TIM14,
pub TIM6: TIM6,
pub TIM7: TIM7,
pub I2C1: I2C1,
pub I2C2: I2C2,
pub SPI1: SPI1,
pub SPI2: SPI2,
pub SPI3: SPI3,
pub USART1: USART1,
pub USART2: USART2,
pub USART3: USART3,
pub DAC: DAC,
pub DBGMCU: DBGMCU,
pub UART4: UART4,
pub UART5: UART5,
pub CRC: CRC,
pub FLASH: FLASH,
pub BKP: BKP,
pub ADC1: ADC1,
pub OTG_FS_DEVICE: OTG_FS_DEVICE,
pub OTG_FS_GLOBAL: OTG_FS_GLOBAL,
pub OTG_FS_HOST: OTG_FS_HOST,
pub OTG_FS_PWRCLK: OTG_FS_PWRCLK,
pub ETHERNET_MMC: ETHERNET_MMC,
pub ETHERNET_MAC: ETHERNET_MAC,
pub ETHERNET_PTP: ETHERNET_PTP,
pub ETHERNET_DMA: ETHERNET_DMA,
pub USB: USB,
pub ADC2: ADC2,
pub ADC3: ADC3,
pub TIM1: TIM1,
pub TIM8: TIM8,
pub SDIO: SDIO,
pub SCB_ACTRL: SCB_ACTRL,
pub NVIC_STIR: NVIC_STIR,
pub STK: STK,
}
impl Peripherals {
#[cfg(feature = "critical-section")]
#[inline]
pub fn take() -> Option<Self> {
critical_section::with(|_| {
if unsafe { DEVICE_PERIPHERALS } {
return None;
}
Some(unsafe { Peripherals::steal() })
})
}
#[inline]
pub unsafe fn steal() -> Self {
DEVICE_PERIPHERALS = true;
Peripherals {
FSMC: FSMC::steal(),
PWR: PWR::steal(),
RCC: RCC::steal(),
GPIOA: GPIOA::steal(),
GPIOB: GPIOB::steal(),
GPIOC: GPIOC::steal(),
GPIOD: GPIOD::steal(),
GPIOE: GPIOE::steal(),
GPIOF: GPIOF::steal(),
GPIOG: GPIOG::steal(),
AFIO: AFIO::steal(),
EXTI: EXTI::steal(),
DMA1: DMA1::steal(),
DMA2: DMA2::steal(),
RTC: RTC::steal(),
IWDG: IWDG::steal(),
WWDG: WWDG::steal(),
TIM2: TIM2::steal(),
TIM3: TIM3::steal(),
TIM4: TIM4::steal(),
TIM5: TIM5::steal(),
TIM9: TIM9::steal(),
TIM12: TIM12::steal(),
TIM10: TIM10::steal(),
TIM11: TIM11::steal(),
TIM13: TIM13::steal(),
TIM14: TIM14::steal(),
TIM6: TIM6::steal(),
TIM7: TIM7::steal(),
I2C1: I2C1::steal(),
I2C2: I2C2::steal(),
SPI1: SPI1::steal(),
SPI2: SPI2::steal(),
SPI3: SPI3::steal(),
USART1: USART1::steal(),
USART2: USART2::steal(),
USART3: USART3::steal(),
DAC: DAC::steal(),
DBGMCU: DBGMCU::steal(),
UART4: UART4::steal(),
UART5: UART5::steal(),
CRC: CRC::steal(),
FLASH: FLASH::steal(),
BKP: BKP::steal(),
ADC1: ADC1::steal(),
OTG_FS_DEVICE: OTG_FS_DEVICE::steal(),
OTG_FS_GLOBAL: OTG_FS_GLOBAL::steal(),
OTG_FS_HOST: OTG_FS_HOST::steal(),
OTG_FS_PWRCLK: OTG_FS_PWRCLK::steal(),
ETHERNET_MMC: ETHERNET_MMC::steal(),
ETHERNET_MAC: ETHERNET_MAC::steal(),
ETHERNET_PTP: ETHERNET_PTP::steal(),
ETHERNET_DMA: ETHERNET_DMA::steal(),
USB: USB::steal(),
ADC2: ADC2::steal(),
ADC3: ADC3::steal(),
TIM1: TIM1::steal(),
TIM8: TIM8::steal(),
SDIO: SDIO::steal(),
SCB_ACTRL: SCB_ACTRL::steal(),
NVIC_STIR: NVIC_STIR::steal(),
STK: STK::steal(),
}
}
}