use core::marker::PhantomData;
use core::ops::Deref;
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();
fn RTC_WKUP();
fn FLASH();
fn RCC();
fn EXTI0();
fn EXTI1();
fn EXTI2_TS();
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 CAN_TX();
fn CAN_RXD();
fn CAN_RXI();
fn CAN_SCE();
fn EXTI5_9();
fn TIM15();
fn TIM16();
fn TIM17();
fn TIM18_DAC();
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 CEC();
fn TIM12();
fn TIM13();
fn TIM14();
fn TIM5();
fn SPI3();
fn TIM6_DAC1();
fn TIM7();
fn DMA2_CH1();
fn DMA2_CH2();
fn DMA2_CH3();
fn DMA2_CH4();
fn DMA2_CH5();
fn SDADC1();
fn SDADC2();
fn SDADC3();
fn COMP1_2_3();
fn USB_HP();
fn USB_LP();
fn USB_WAKEUP();
fn TIM19();
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 },
Vector { _handler: RTC_WKUP },
Vector { _handler: FLASH },
Vector { _handler: RCC },
Vector { _handler: EXTI0 },
Vector { _handler: EXTI1 },
Vector { _handler: EXTI2_TS },
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: CAN_TX },
Vector { _handler: CAN_RXD },
Vector { _handler: CAN_RXI },
Vector { _handler: CAN_SCE },
Vector { _handler: EXTI5_9 },
Vector { _handler: TIM15 },
Vector { _handler: TIM16 },
Vector { _handler: TIM17 },
Vector { _handler: TIM18_DAC },
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: CEC },
Vector { _handler: TIM12 },
Vector { _handler: TIM13 },
Vector { _handler: TIM14 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _handler: TIM5 },
Vector { _handler: SPI3 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _handler: TIM6_DAC1 },
Vector { _handler: TIM7 },
Vector { _handler: DMA2_CH1 },
Vector { _handler: DMA2_CH2 },
Vector { _handler: DMA2_CH3 },
Vector { _handler: DMA2_CH4 },
Vector { _handler: DMA2_CH5 },
Vector { _handler: SDADC1 },
Vector { _handler: SDADC2 },
Vector { _handler: SDADC3 },
Vector { _handler: COMP1_2_3 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
Vector { _handler: USB_HP },
Vector { _handler: USB_LP },
Vector { _handler: USB_WAKEUP },
Vector { _reserved: 0 },
Vector { _handler: TIM19 },
Vector { _reserved: 0 },
Vector { _reserved: 0 },
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 = 2,
RTC_WKUP = 3,
FLASH = 4,
RCC = 5,
EXTI0 = 6,
EXTI1 = 7,
EXTI2_TS = 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,
CAN_TX = 19,
CAN_RXD = 20,
CAN_RXI = 21,
CAN_SCE = 22,
EXTI5_9 = 23,
TIM15 = 24,
TIM16 = 25,
TIM17 = 26,
TIM18_DAC = 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,
CEC = 42,
TIM12 = 43,
TIM13 = 44,
TIM14 = 45,
TIM5 = 50,
SPI3 = 51,
TIM6_DAC1 = 54,
TIM7 = 55,
DMA2_CH1 = 56,
DMA2_CH2 = 57,
DMA2_CH3 = 58,
DMA2_CH4 = 59,
DMA2_CH5 = 60,
SDADC1 = 61,
SDADC2 = 62,
SDADC3 = 63,
COMP1_2_3 = 64,
USB_HP = 74,
USB_LP = 75,
USB_WAKEUP = 76,
TIM19 = 78,
FPU = 81,
}
unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
#[inline(always)]
fn number(self) -> u16 {
self as u16
}
}
pub struct GPIOA {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for GPIOA {}
impl GPIOA {
pub const PTR: *const gpioa::RegisterBlock = 0x4800_0000 as *const _;
#[inline(always)]
pub const fn ptr() -> *const gpioa::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for GPIOA {
type Target = gpioa::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct GPIOB {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for GPIOB {}
impl GPIOB {
pub const PTR: *const gpiob::RegisterBlock = 0x4800_0400 as *const _;
#[inline(always)]
pub const fn ptr() -> *const gpiob::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for GPIOB {
type Target = gpiob::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct GPIOC {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for GPIOC {}
impl GPIOC {
pub const PTR: *const gpioc::RegisterBlock = 0x4800_0800 as *const _;
#[inline(always)]
pub const fn ptr() -> *const gpioc::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for GPIOC {
type Target = gpioc::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct GPIOE {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for GPIOE {}
impl GPIOE {
pub const PTR: *const gpioc::RegisterBlock = 0x4800_1000 as *const _;
#[inline(always)]
pub const fn ptr() -> *const gpioc::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for GPIOE {
type Target = gpioc::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct GPIOF {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for GPIOF {}
impl GPIOF {
pub const PTR: *const gpioc::RegisterBlock = 0x4800_1400 as *const _;
#[inline(always)]
pub const fn ptr() -> *const gpioc::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for GPIOF {
type Target = gpioc::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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::gpioc as gpiof;
pub struct TSC {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TSC {}
impl TSC {
pub const PTR: *const tsc::RegisterBlock = 0x4002_4000 as *const _;
#[inline(always)]
pub const fn ptr() -> *const tsc::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for TSC {
type Target = tsc::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct CRC {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for CRC {}
impl CRC {
pub const PTR: *const crc::RegisterBlock = 0x4002_3000 as *const _;
#[inline(always)]
pub const fn ptr() -> *const crc::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for CRC {
type Target = crc::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct FLASH {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for FLASH {}
impl FLASH {
pub const PTR: *const flash::RegisterBlock = 0x4002_2000 as *const _;
#[inline(always)]
pub const fn ptr() -> *const flash::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for FLASH {
type Target = flash::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct RCC {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for RCC {}
impl RCC {
pub const PTR: *const rcc::RegisterBlock = 0x4002_1000 as *const _;
#[inline(always)]
pub const fn ptr() -> *const rcc::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for RCC {
type Target = rcc::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct DMA1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for DMA1 {}
impl DMA1 {
pub const PTR: *const dma1::RegisterBlock = 0x4002_0000 as *const _;
#[inline(always)]
pub const fn ptr() -> *const dma1::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for DMA1 {
type Target = dma1::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct DMA2 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for DMA2 {}
impl DMA2 {
pub const PTR: *const dma1::RegisterBlock = 0x4002_0400 as *const _;
#[inline(always)]
pub const fn ptr() -> *const dma1::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for DMA2 {
type Target = dma1::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct TIM2 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM2 {}
impl TIM2 {
pub const PTR: *const tim2::RegisterBlock = 0x4000_0000 as *const _;
#[inline(always)]
pub const fn ptr() -> *const tim2::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for TIM2 {
type Target = tim2::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct TIM5 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM5 {}
impl TIM5 {
pub const PTR: *const tim5::RegisterBlock = 0x4000_0c00 as *const _;
#[inline(always)]
pub const fn ptr() -> *const tim5::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for TIM5 {
type Target = tim5::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for TIM5 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM5").finish()
}
}
pub mod tim5;
pub struct TIM3 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM3 {}
impl TIM3 {
pub const PTR: *const tim3::RegisterBlock = 0x4000_0400 as *const _;
#[inline(always)]
pub const fn ptr() -> *const tim3::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for TIM3 {
type Target = tim3::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for TIM3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM3").finish()
}
}
pub mod tim3;
pub struct TIM4 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM4 {}
impl TIM4 {
pub const PTR: *const tim3::RegisterBlock = 0x4000_0800 as *const _;
#[inline(always)]
pub const fn ptr() -> *const tim3::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for TIM4 {
type Target = tim3::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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::tim3 as tim4;
pub struct TIM19 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM19 {}
impl TIM19 {
pub const PTR: *const tim3::RegisterBlock = 0x4001_5c00 as *const _;
#[inline(always)]
pub const fn ptr() -> *const tim3::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for TIM19 {
type Target = tim3::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for TIM19 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM19").finish()
}
}
pub use self::tim3 as tim19;
pub struct TIM15 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM15 {}
impl TIM15 {
pub const PTR: *const tim15::RegisterBlock = 0x4001_4000 as *const _;
#[inline(always)]
pub const fn ptr() -> *const tim15::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for TIM15 {
type Target = tim15::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct TIM16 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM16 {}
impl TIM16 {
pub const PTR: *const tim16::RegisterBlock = 0x4001_4400 as *const _;
#[inline(always)]
pub const fn ptr() -> *const tim16::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for TIM16 {
type Target = tim16::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct TIM17 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM17 {}
impl TIM17 {
pub const PTR: *const tim16::RegisterBlock = 0x4001_4800 as *const _;
#[inline(always)]
pub const fn ptr() -> *const tim16::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for TIM17 {
type Target = tim16::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for TIM17 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM17").finish()
}
}
pub use self::tim16 as tim17;
pub struct USART1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for USART1 {}
impl USART1 {
pub const PTR: *const usart1::RegisterBlock = 0x4001_3800 as *const _;
#[inline(always)]
pub const fn ptr() -> *const usart1::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for USART1 {
type Target = usart1::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct USART2 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for USART2 {}
impl USART2 {
pub const PTR: *const usart1::RegisterBlock = 0x4000_4400 as *const _;
#[inline(always)]
pub const fn ptr() -> *const usart1::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for USART2 {
type Target = usart1::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct USART3 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for USART3 {}
impl USART3 {
pub const PTR: *const usart1::RegisterBlock = 0x4000_4800 as *const _;
#[inline(always)]
pub const fn ptr() -> *const usart1::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for USART3 {
type Target = usart1::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct SPI1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for SPI1 {}
impl SPI1 {
pub const PTR: *const spi1::RegisterBlock = 0x4001_3000 as *const _;
#[inline(always)]
pub const fn ptr() -> *const spi1::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for SPI1 {
type Target = spi1::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct SPI2 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for SPI2 {}
impl SPI2 {
pub const PTR: *const spi1::RegisterBlock = 0x4000_3800 as *const _;
#[inline(always)]
pub const fn ptr() -> *const spi1::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for SPI2 {
type Target = spi1::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct SPI3 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for SPI3 {}
impl SPI3 {
pub const PTR: *const spi1::RegisterBlock = 0x4000_3c00 as *const _;
#[inline(always)]
pub const fn ptr() -> *const spi1::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for SPI3 {
type Target = spi1::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct I2S2EXT {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for I2S2EXT {}
impl I2S2EXT {
pub const PTR: *const spi1::RegisterBlock = 0x4000_3400 as *const _;
#[inline(always)]
pub const fn ptr() -> *const spi1::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for I2S2EXT {
type Target = spi1::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for I2S2EXT {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("I2S2EXT").finish()
}
}
pub use self::spi1 as i2s2ext;
pub struct I2S3EXT {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for I2S3EXT {}
impl I2S3EXT {
pub const PTR: *const spi1::RegisterBlock = 0x4000_4000 as *const _;
#[inline(always)]
pub const fn ptr() -> *const spi1::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for I2S3EXT {
type Target = spi1::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for I2S3EXT {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("I2S3EXT").finish()
}
}
pub use self::spi1 as i2s3ext;
pub struct ADC1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for ADC1 {}
impl ADC1 {
pub const PTR: *const adc1::RegisterBlock = 0x4001_2400 as *const _;
#[inline(always)]
pub const fn ptr() -> *const adc1::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for ADC1 {
type Target = adc1::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct EXTI {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for EXTI {}
impl EXTI {
pub const PTR: *const exti::RegisterBlock = 0x4001_0400 as *const _;
#[inline(always)]
pub const fn ptr() -> *const exti::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for EXTI {
type Target = exti::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct CEC {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for CEC {}
impl CEC {
pub const PTR: *const cec::RegisterBlock = 0x4000_7800 as *const _;
#[inline(always)]
pub const fn ptr() -> *const cec::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for CEC {
type Target = cec::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for CEC {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CEC").finish()
}
}
pub mod cec;
pub struct PWR {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for PWR {}
impl PWR {
pub const PTR: *const pwr::RegisterBlock = 0x4000_7000 as *const _;
#[inline(always)]
pub const fn ptr() -> *const pwr::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for PWR {
type Target = pwr::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct CAN {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for CAN {}
impl CAN {
pub const PTR: *const can::RegisterBlock = 0x4000_6400 as *const _;
#[inline(always)]
pub const fn ptr() -> *const can::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for CAN {
type Target = can::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for CAN {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CAN").finish()
}
}
pub mod can;
pub struct USB {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for USB {}
impl USB {
pub const PTR: *const usb::RegisterBlock = 0x4000_5c00 as *const _;
#[inline(always)]
pub const fn ptr() -> *const usb::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for USB {
type Target = usb::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct I2C1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for I2C1 {}
impl I2C1 {
pub const PTR: *const i2c1::RegisterBlock = 0x4000_5400 as *const _;
#[inline(always)]
pub const fn ptr() -> *const i2c1::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for I2C1 {
type Target = i2c1::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct I2C2 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for I2C2 {}
impl I2C2 {
pub const PTR: *const i2c1::RegisterBlock = 0x4000_5800 as *const _;
#[inline(always)]
pub const fn ptr() -> *const i2c1::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for I2C2 {
type Target = i2c1::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct IWDG {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for IWDG {}
impl IWDG {
pub const PTR: *const iwdg::RegisterBlock = 0x4000_3000 as *const _;
#[inline(always)]
pub const fn ptr() -> *const iwdg::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for IWDG {
type Target = iwdg::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct WWDG {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for WWDG {}
impl WWDG {
pub const PTR: *const wwdg::RegisterBlock = 0x4000_2c00 as *const _;
#[inline(always)]
pub const fn ptr() -> *const wwdg::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for WWDG {
type Target = wwdg::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct RTC {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for RTC {}
impl RTC {
pub const PTR: *const rtc::RegisterBlock = 0x4000_2800 as *const _;
#[inline(always)]
pub const fn ptr() -> *const rtc::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for RTC {
type Target = rtc::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct SDADC1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for SDADC1 {}
impl SDADC1 {
pub const PTR: *const sdadc1::RegisterBlock = 0x4001_6000 as *const _;
#[inline(always)]
pub const fn ptr() -> *const sdadc1::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for SDADC1 {
type Target = sdadc1::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for SDADC1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SDADC1").finish()
}
}
pub mod sdadc1;
pub struct SDADC2 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for SDADC2 {}
impl SDADC2 {
pub const PTR: *const sdadc1::RegisterBlock = 0x4001_6400 as *const _;
#[inline(always)]
pub const fn ptr() -> *const sdadc1::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for SDADC2 {
type Target = sdadc1::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for SDADC2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SDADC2").finish()
}
}
pub use self::sdadc1 as sdadc2;
pub struct SDADC3 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for SDADC3 {}
impl SDADC3 {
pub const PTR: *const sdadc1::RegisterBlock = 0x4001_6800 as *const _;
#[inline(always)]
pub const fn ptr() -> *const sdadc1::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for SDADC3 {
type Target = sdadc1::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for SDADC3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SDADC3").finish()
}
}
pub use self::sdadc1 as sdadc3;
pub struct DAC2 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for DAC2 {}
impl DAC2 {
pub const PTR: *const dac2::RegisterBlock = 0x4000_9800 as *const _;
#[inline(always)]
pub const fn ptr() -> *const dac2::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for DAC2 {
type Target = dac2::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for DAC2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("DAC2").finish()
}
}
pub mod dac2;
pub struct TIM6 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM6 {}
impl TIM6 {
pub const PTR: *const tim6::RegisterBlock = 0x4000_1000 as *const _;
#[inline(always)]
pub const fn ptr() -> *const tim6::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for TIM6 {
type Target = tim6::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct TIM7 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM7 {}
impl TIM7 {
pub const PTR: *const tim6::RegisterBlock = 0x4000_1400 as *const _;
#[inline(always)]
pub const fn ptr() -> *const tim6::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for TIM7 {
type Target = tim6::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct TIM18 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM18 {}
impl TIM18 {
pub const PTR: *const tim6::RegisterBlock = 0x4000_9c00 as *const _;
#[inline(always)]
pub const fn ptr() -> *const tim6::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for TIM18 {
type Target = tim6::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for TIM18 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM18").finish()
}
}
pub use self::tim6 as tim18;
pub struct TIM13 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM13 {}
impl TIM13 {
pub const PTR: *const tim13::RegisterBlock = 0x4000_1c00 as *const _;
#[inline(always)]
pub const fn ptr() -> *const tim13::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for TIM13 {
type Target = tim13::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for TIM13 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM13").finish()
}
}
pub mod tim13;
pub struct TIM14 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM14 {}
impl TIM14 {
pub const PTR: *const tim13::RegisterBlock = 0x4000_2000 as *const _;
#[inline(always)]
pub const fn ptr() -> *const tim13::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for TIM14 {
type Target = tim13::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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::tim13 as tim14;
pub struct TIM12 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM12 {}
impl TIM12 {
pub const PTR: *const tim12::RegisterBlock = 0x4000_1800 as *const _;
#[inline(always)]
pub const fn ptr() -> *const tim12::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for TIM12 {
type Target = tim12::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for TIM12 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM12").finish()
}
}
pub mod tim12;
pub struct DAC1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for DAC1 {}
impl DAC1 {
pub const PTR: *const dac1::RegisterBlock = 0x4000_7400 as *const _;
#[inline(always)]
pub const fn ptr() -> *const dac1::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for DAC1 {
type Target = dac1::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for DAC1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("DAC1").finish()
}
}
pub mod dac1;
pub struct DBGMCU {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for DBGMCU {}
impl DBGMCU {
pub const PTR: *const dbgmcu::RegisterBlock = 0xe004_2000 as *const _;
#[inline(always)]
pub const fn ptr() -> *const dbgmcu::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for DBGMCU {
type Target = dbgmcu::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct SYSCFG {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for SYSCFG {}
impl SYSCFG {
pub const PTR: *const syscfg::RegisterBlock = 0x4001_0000 as *const _;
#[inline(always)]
pub const fn ptr() -> *const syscfg::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for SYSCFG {
type Target = syscfg::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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 struct GPIOD {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for GPIOD {}
impl GPIOD {
pub const PTR: *const gpiod::RegisterBlock = 0x4800_0c00 as *const _;
#[inline(always)]
pub const fn ptr() -> *const gpiod::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for GPIOD {
type Target = gpiod::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for GPIOD {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("GPIOD").finish()
}
}
pub mod gpiod;
pub struct COMP {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for COMP {}
impl COMP {
pub const PTR: *const comp::RegisterBlock = 0x4001_0000 as *const _;
#[inline(always)]
pub const fn ptr() -> *const comp::RegisterBlock {
Self::PTR
}
pub unsafe fn steal() -> Self {
Self { _marker: PhantomData }
}
}
impl Deref for COMP {
type Target = comp::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
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;
#[no_mangle]
static mut DEVICE_PERIPHERALS: bool = false;
#[allow(non_snake_case)]
pub struct Peripherals {
pub GPIOA: GPIOA,
pub GPIOB: GPIOB,
pub GPIOC: GPIOC,
pub GPIOE: GPIOE,
pub GPIOF: GPIOF,
pub TSC: TSC,
pub CRC: CRC,
pub FLASH: FLASH,
pub RCC: RCC,
pub DMA1: DMA1,
pub DMA2: DMA2,
pub TIM2: TIM2,
pub TIM5: TIM5,
pub TIM3: TIM3,
pub TIM4: TIM4,
pub TIM19: TIM19,
pub TIM15: TIM15,
pub TIM16: TIM16,
pub TIM17: TIM17,
pub USART1: USART1,
pub USART2: USART2,
pub USART3: USART3,
pub SPI1: SPI1,
pub SPI2: SPI2,
pub SPI3: SPI3,
pub I2S2EXT: I2S2EXT,
pub I2S3EXT: I2S3EXT,
pub ADC1: ADC1,
pub EXTI: EXTI,
pub CEC: CEC,
pub PWR: PWR,
pub CAN: CAN,
pub USB: USB,
pub I2C1: I2C1,
pub I2C2: I2C2,
pub IWDG: IWDG,
pub WWDG: WWDG,
pub RTC: RTC,
pub SDADC1: SDADC1,
pub SDADC2: SDADC2,
pub SDADC3: SDADC3,
pub DAC2: DAC2,
pub TIM6: TIM6,
pub TIM7: TIM7,
pub TIM18: TIM18,
pub TIM13: TIM13,
pub TIM14: TIM14,
pub TIM12: TIM12,
pub DAC1: DAC1,
pub DBGMCU: DBGMCU,
pub SYSCFG: SYSCFG,
pub GPIOD: GPIOD,
pub COMP: COMP,
}
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 {
GPIOA: GPIOA::steal(),
GPIOB: GPIOB::steal(),
GPIOC: GPIOC::steal(),
GPIOE: GPIOE::steal(),
GPIOF: GPIOF::steal(),
TSC: TSC::steal(),
CRC: CRC::steal(),
FLASH: FLASH::steal(),
RCC: RCC::steal(),
DMA1: DMA1::steal(),
DMA2: DMA2::steal(),
TIM2: TIM2::steal(),
TIM5: TIM5::steal(),
TIM3: TIM3::steal(),
TIM4: TIM4::steal(),
TIM19: TIM19::steal(),
TIM15: TIM15::steal(),
TIM16: TIM16::steal(),
TIM17: TIM17::steal(),
USART1: USART1::steal(),
USART2: USART2::steal(),
USART3: USART3::steal(),
SPI1: SPI1::steal(),
SPI2: SPI2::steal(),
SPI3: SPI3::steal(),
I2S2EXT: I2S2EXT::steal(),
I2S3EXT: I2S3EXT::steal(),
ADC1: ADC1::steal(),
EXTI: EXTI::steal(),
CEC: CEC::steal(),
PWR: PWR::steal(),
CAN: CAN::steal(),
USB: USB::steal(),
I2C1: I2C1::steal(),
I2C2: I2C2::steal(),
IWDG: IWDG::steal(),
WWDG: WWDG::steal(),
RTC: RTC::steal(),
SDADC1: SDADC1::steal(),
SDADC2: SDADC2::steal(),
SDADC3: SDADC3::steal(),
DAC2: DAC2::steal(),
TIM6: TIM6::steal(),
TIM7: TIM7::steal(),
TIM18: TIM18::steal(),
TIM13: TIM13::steal(),
TIM14: TIM14::steal(),
TIM12: TIM12::steal(),
DAC1: DAC1::steal(),
DBGMCU: DBGMCU::steal(),
SYSCFG: SYSCFG::steal(),
GPIOD: GPIOD::steal(),
COMP: COMP::steal(),
}
}
}