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, FPU, 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 TAMP_STAMP();
fn RTC_WKUP();
fn FLASH();
fn RCC();
fn EXTI0();
fn EXTI1();
fn EXTI2();
fn EXTI3();
fn EXTI4();
fn DMA1_CH1();
fn DMA1_CH2();
fn DMA1_CH3();
fn DMA1_CH4();
fn DMA1_CH5();
fn DMA1_CH6();
fn DMA1_CH7();
fn ADC1();
fn CAN1_TX();
fn CAN1_RX0();
fn CAN1_RX1();
fn CAN1_SCE();
fn EXTI9_5();
fn TIM15();
fn TIM16();
fn TIM1_CC();
fn TIM2();
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 ADC3();
fn SDMMC();
fn SPI3();
fn TIM6_DAC();
fn TIM7();
fn DMA2_CH1();
fn DMA2_CH2();
fn DMA2_CH3();
fn DMA2_CH4();
fn DMA2_CH5();
fn COMP();
fn LPTIM1();
fn LPTIM2();
fn USB_FS();
fn DMA2_CH6();
fn DMA2_CH7();
fn I2C3_EV();
fn I2C3_ER();
fn SAI1();
fn SWPMI1();
fn TSC();
fn LCD();
fn RNG();
fn CRS();
fn FPU();
}
#[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; 82] = [
Vector { _handler: WWDG },
Vector { _handler: PVD },
Vector {
_handler: TAMP_STAMP,
},
Vector { _handler: RTC_WKUP },
Vector { _handler: FLASH },
Vector { _handler: RCC },
Vector { _handler: EXTI0 },
Vector { _handler: EXTI1 },
Vector { _handler: EXTI2 },
Vector { _handler: EXTI3 },
Vector { _handler: EXTI4 },
Vector { _handler: DMA1_CH1 },
Vector { _handler: DMA1_CH2 },
Vector { _handler: DMA1_CH3 },
Vector { _handler: DMA1_CH4 },
Vector { _handler: DMA1_CH5 },
Vector { _handler: DMA1_CH6 },
Vector { _handler: DMA1_CH7 },
Vector { _handler: ADC1 },
Vector { _handler: CAN1_TX },
Vector { _handler: CAN1_RX0 },
Vector { _handler: CAN1_RX1 },
Vector { _handler: CAN1_SCE },
Vector { _handler: EXTI9_5 },
Vector { _handler: TIM15 },
Vector { _handler: TIM16 },
Vector { _reserved: 0 },
Vector { _handler: TIM1_CC },
Vector { _handler: TIM2 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
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 { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _handler: ADC3 },
Vector { _reserved: 0 },
Vector { _handler: SDMMC },
Vector { _reserved: 0 },
Vector { _handler: SPI3 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _handler: TIM6_DAC },
Vector { _handler: TIM7 },
Vector { _handler: DMA2_CH1 },
Vector { _handler: DMA2_CH2 },
Vector { _handler: DMA2_CH3 },
Vector { _handler: DMA2_CH4 },
Vector { _handler: DMA2_CH5 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _handler: COMP },
Vector { _handler: LPTIM1 },
Vector { _handler: LPTIM2 },
Vector { _handler: USB_FS },
Vector { _handler: DMA2_CH6 },
Vector { _handler: DMA2_CH7 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _handler: I2C3_EV },
Vector { _handler: I2C3_ER },
Vector { _handler: SAI1 },
Vector { _reserved: 0 },
Vector { _handler: SWPMI1 },
Vector { _handler: TSC },
Vector { _handler: LCD },
Vector { _handler: RNG },
Vector { _handler: CRS },
Vector { _handler: FPU },
];
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[repr(u16)]
pub enum Interrupt {
WWDG = 0,
PVD = 1,
TAMP_STAMP = 2,
RTC_WKUP = 3,
FLASH = 4,
RCC = 5,
EXTI0 = 6,
EXTI1 = 7,
EXTI2 = 8,
EXTI3 = 9,
EXTI4 = 10,
DMA1_CH1 = 11,
DMA1_CH2 = 12,
DMA1_CH3 = 13,
DMA1_CH4 = 14,
DMA1_CH5 = 15,
DMA1_CH6 = 16,
DMA1_CH7 = 17,
ADC1 = 18,
CAN1_TX = 19,
CAN1_RX0 = 20,
CAN1_RX1 = 21,
CAN1_SCE = 22,
EXTI9_5 = 23,
TIM15 = 24,
TIM16 = 25,
TIM1_CC = 27,
TIM2 = 28,
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,
ADC3 = 47,
SDMMC = 49,
SPI3 = 51,
TIM6_DAC = 54,
TIM7 = 55,
DMA2_CH1 = 56,
DMA2_CH2 = 57,
DMA2_CH3 = 58,
DMA2_CH4 = 59,
DMA2_CH5 = 60,
COMP = 64,
LPTIM1 = 65,
LPTIM2 = 66,
USB_FS = 67,
DMA2_CH6 = 68,
DMA2_CH7 = 69,
I2C3_EV = 72,
I2C3_ER = 73,
SAI1 = 74,
SWPMI1 = 76,
TSC = 77,
LCD = 78,
RNG = 79,
CRS = 80,
FPU = 81,
}
unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
#[inline(always)]
fn number(self) -> u16 {
self as u16
}
}
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 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 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 LCD = crate::Periph<lcd::RegisterBlock, 0x4000_2400>;
impl core::fmt::Debug for LCD {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("LCD").finish()
}
}
pub mod lcd;
pub type TSC = crate::Periph<tsc::RegisterBlock, 0x4002_4000>;
impl core::fmt::Debug for TSC {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TSC").finish()
}
}
pub mod tsc;
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 COMP = crate::Periph<comp::RegisterBlock, 0x4001_0200>;
impl core::fmt::Debug for COMP {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("COMP").finish()
}
}
pub mod comp;
pub type FIREWALL = crate::Periph<firewall::RegisterBlock, 0x4001_1c00>;
impl core::fmt::Debug for FIREWALL {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("FIREWALL").finish()
}
}
pub mod firewall;
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 I2C3 = crate::Periph<i2c1::RegisterBlock, 0x4000_5c00>;
impl core::fmt::Debug for I2C3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("I2C3").finish()
}
}
pub use self::i2c1 as i2c3;
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 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 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 SYSCFG = crate::Periph<syscfg::RegisterBlock, 0x4001_0000>;
impl core::fmt::Debug for SYSCFG {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SYSCFG").finish()
}
}
pub mod syscfg;
pub type RNG = crate::Periph<rng::RegisterBlock, 0x5006_0800>;
impl core::fmt::Debug for RNG {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("RNG").finish()
}
}
pub mod rng;
pub type AES = crate::Periph<aes::RegisterBlock, 0x5006_0000>;
impl core::fmt::Debug for AES {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("AES").finish()
}
}
pub mod aes;
pub type ADC1 = crate::Periph<adc1::RegisterBlock, 0x5004_0000>;
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 ADC2 = crate::Periph<adc1::RegisterBlock, 0x5004_0100>;
impl core::fmt::Debug for ADC2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ADC2").finish()
}
}
pub use self::adc1 as adc2;
pub type ADC3 = crate::Periph<adc1::RegisterBlock, 0x5004_0200>;
impl core::fmt::Debug for ADC3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ADC3").finish()
}
}
pub use self::adc1 as adc3;
pub type ADC123_COMMON = crate::Periph<adc123_common::RegisterBlock, 0x5004_0300>;
impl core::fmt::Debug for ADC123_COMMON {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ADC123_COMMON").finish()
}
}
pub mod adc123_common;
pub type ADC_COMMON = crate::Periph<adc_common::RegisterBlock, 0x5004_0300>;
impl core::fmt::Debug for ADC_COMMON {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ADC_COMMON").finish()
}
}
pub mod adc_common;
pub type GPIOA = crate::Periph<gpioa::RegisterBlock, 0x4800_0000>;
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<gpiob::RegisterBlock, 0x4800_0400>;
impl core::fmt::Debug for GPIOB {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("GPIOB").finish()
}
}
pub mod gpiob;
pub type GPIOC = crate::Periph<gpioc::RegisterBlock, 0x4800_0800>;
impl core::fmt::Debug for GPIOC {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("GPIOC").finish()
}
}
pub mod gpioc;
pub type GPIOD = crate::Periph<gpioc::RegisterBlock, 0x4800_0c00>;
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::gpioc as gpiod;
pub type GPIOE = crate::Periph<gpioc::RegisterBlock, 0x4800_1000>;
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::gpioc as gpioe;
pub type GPIOH = crate::Periph<gpioc::RegisterBlock, 0x4800_1c00>;
impl core::fmt::Debug for GPIOH {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("GPIOH").finish()
}
}
pub use self::gpioc as gpioh;
pub type SAI1 = crate::Periph<sai1::RegisterBlock, 0x4001_5400>;
impl core::fmt::Debug for SAI1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SAI1").finish()
}
}
pub mod sai1;
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 TIM15 = crate::Periph<tim15::RegisterBlock, 0x4001_4000>;
impl core::fmt::Debug for TIM15 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM15").finish()
}
}
pub mod tim15;
pub type TIM16 = crate::Periph<tim16::RegisterBlock, 0x4001_4400>;
impl core::fmt::Debug for TIM16 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM16").finish()
}
}
pub mod tim16;
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 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 LPTIM1 = crate::Periph<lptim1::RegisterBlock, 0x4000_7c00>;
impl core::fmt::Debug for LPTIM1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("LPTIM1").finish()
}
}
pub mod lptim1;
pub type LPTIM2 = crate::Periph<lptim1::RegisterBlock, 0x4000_9400>;
impl core::fmt::Debug for LPTIM2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("LPTIM2").finish()
}
}
pub use self::lptim1 as lptim2;
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 LPUART1 = crate::Periph<lpuart1::RegisterBlock, 0x4000_8000>;
impl core::fmt::Debug for LPUART1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("LPUART1").finish()
}
}
pub mod lpuart1;
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 SDMMC = crate::Periph<sdmmc::RegisterBlock, 0x4001_2800>;
impl core::fmt::Debug for SDMMC {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SDMMC").finish()
}
}
pub mod sdmmc;
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 VREFBUF = crate::Periph<vrefbuf::RegisterBlock, 0x4001_0030>;
impl core::fmt::Debug for VREFBUF {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("VREFBUF").finish()
}
}
pub mod vrefbuf;
pub type CAN1 = crate::Periph<can1::RegisterBlock, 0x4000_6400>;
impl core::fmt::Debug for CAN1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CAN1").finish()
}
}
pub mod can1;
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 SWPMI1 = crate::Periph<swpmi1::RegisterBlock, 0x4000_8800>;
impl core::fmt::Debug for SWPMI1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SWPMI1").finish()
}
}
pub mod swpmi1;
pub type OPAMP = crate::Periph<opamp::RegisterBlock, 0x4000_7800>;
impl core::fmt::Debug for OPAMP {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("OPAMP").finish()
}
}
pub mod opamp;
pub type CRS = crate::Periph<crs::RegisterBlock, 0x4000_6000>;
impl core::fmt::Debug for CRS {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CRS").finish()
}
}
pub mod crs;
pub type USB = crate::Periph<usb::RegisterBlock, 0x4000_6800>;
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 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;
#[no_mangle]
static mut DEVICE_PERIPHERALS: bool = false;
#[allow(non_snake_case)]
pub struct Peripherals {
pub DAC: DAC,
pub DMA1: DMA1,
pub DMA2: DMA2,
pub CRC: CRC,
pub LCD: LCD,
pub TSC: TSC,
pub IWDG: IWDG,
pub WWDG: WWDG,
pub COMP: COMP,
pub FIREWALL: FIREWALL,
pub I2C1: I2C1,
pub I2C2: I2C2,
pub I2C3: I2C3,
pub FLASH: FLASH,
pub RCC: RCC,
pub PWR: PWR,
pub SYSCFG: SYSCFG,
pub RNG: RNG,
pub AES: AES,
pub ADC1: ADC1,
pub ADC2: ADC2,
pub ADC3: ADC3,
pub ADC123_COMMON: ADC123_COMMON,
pub ADC_COMMON: ADC_COMMON,
pub GPIOA: GPIOA,
pub GPIOB: GPIOB,
pub GPIOC: GPIOC,
pub GPIOD: GPIOD,
pub GPIOE: GPIOE,
pub GPIOH: GPIOH,
pub SAI1: SAI1,
pub TIM2: TIM2,
pub TIM15: TIM15,
pub TIM16: TIM16,
pub TIM1: TIM1,
pub TIM6: TIM6,
pub TIM7: TIM7,
pub LPTIM1: LPTIM1,
pub LPTIM2: LPTIM2,
pub USART1: USART1,
pub USART2: USART2,
pub USART3: USART3,
pub LPUART1: LPUART1,
pub SPI1: SPI1,
pub SPI2: SPI2,
pub SPI3: SPI3,
pub SDMMC: SDMMC,
pub EXTI: EXTI,
pub VREFBUF: VREFBUF,
pub CAN1: CAN1,
pub RTC: RTC,
pub SWPMI1: SWPMI1,
pub OPAMP: OPAMP,
pub CRS: CRS,
pub USB: USB,
pub DBGMCU: DBGMCU,
}
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 {
DAC: DAC::steal(),
DMA1: DMA1::steal(),
DMA2: DMA2::steal(),
CRC: CRC::steal(),
LCD: LCD::steal(),
TSC: TSC::steal(),
IWDG: IWDG::steal(),
WWDG: WWDG::steal(),
COMP: COMP::steal(),
FIREWALL: FIREWALL::steal(),
I2C1: I2C1::steal(),
I2C2: I2C2::steal(),
I2C3: I2C3::steal(),
FLASH: FLASH::steal(),
RCC: RCC::steal(),
PWR: PWR::steal(),
SYSCFG: SYSCFG::steal(),
RNG: RNG::steal(),
AES: AES::steal(),
ADC1: ADC1::steal(),
ADC2: ADC2::steal(),
ADC3: ADC3::steal(),
ADC123_COMMON: ADC123_COMMON::steal(),
ADC_COMMON: ADC_COMMON::steal(),
GPIOA: GPIOA::steal(),
GPIOB: GPIOB::steal(),
GPIOC: GPIOC::steal(),
GPIOD: GPIOD::steal(),
GPIOE: GPIOE::steal(),
GPIOH: GPIOH::steal(),
SAI1: SAI1::steal(),
TIM2: TIM2::steal(),
TIM15: TIM15::steal(),
TIM16: TIM16::steal(),
TIM1: TIM1::steal(),
TIM6: TIM6::steal(),
TIM7: TIM7::steal(),
LPTIM1: LPTIM1::steal(),
LPTIM2: LPTIM2::steal(),
USART1: USART1::steal(),
USART2: USART2::steal(),
USART3: USART3::steal(),
LPUART1: LPUART1::steal(),
SPI1: SPI1::steal(),
SPI2: SPI2::steal(),
SPI3: SPI3::steal(),
SDMMC: SDMMC::steal(),
EXTI: EXTI::steal(),
VREFBUF: VREFBUF::steal(),
CAN1: CAN1::steal(),
RTC: RTC::steal(),
SWPMI1: SWPMI1::steal(),
OPAMP: OPAMP::steal(),
CRS: CRS::steal(),
USB: USB::steal(),
DBGMCU: DBGMCU::steal(),
}
}
}