#![doc = "Peripheral access API for PY32MXXX_DFP microcontrollers (generated using svd2rust v0.25.1 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next]
svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.25.1/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"]
#![deny(const_err)]
#![deny(dead_code)]
#![deny(improper_ctypes)]
#![deny(missing_docs)]
#![deny(no_mangle_generic_items)]
#![deny(non_shorthand_field_patterns)]
#![deny(overflowing_literals)]
#![deny(path_statements)]
#![deny(patterns_in_fns_without_body)]
#![deny(private_in_public)]
#![deny(unconditional_recursion)]
#![deny(unused_allocation)]
#![deny(unused_comparisons)]
#![deny(unused_parens)]
#![deny(while_true)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![no_std]
use core::marker::PhantomData;
use core::ops::Deref;
#[doc = r"Number available in the NVIC for configuring priority"]
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;
#[allow(unused_imports)]
use generic::*;
#[doc = r"Common register and bit access and modify traits"]
pub mod generic;
#[cfg(feature = "rt")]
extern "C" {
fn WWDG();
fn PVD();
fn RTC();
fn FLASH();
fn RCC_CTC();
fn EXTI0_1();
fn EXTI2_3();
fn EXTI4_15();
fn LCD();
fn DMA1_CHANNEL1();
fn DMA1_CHANNEL2_3();
fn DMA1_CHANNEL4_5_6_7();
fn ADC_COMP();
fn TIM1_BRK_UP_TRG_COM();
fn TIM1_CC();
fn TIM2();
fn TIM3();
fn TIM6_LPTIM1_DAC();
fn TIM7();
fn TIM14();
fn TIM15();
fn TIM16();
fn TIM17();
fn I2C1();
fn I2C2();
fn SPI1();
fn SPI2();
fn USART1();
fn USART2();
fn USART3_4();
fn CAN();
fn USB();
}
#[doc(hidden)]
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; 32] = [
Vector { _handler: WWDG },
Vector { _handler: PVD },
Vector { _handler: RTC },
Vector { _handler: FLASH },
Vector { _handler: RCC_CTC },
Vector { _handler: EXTI0_1 },
Vector { _handler: EXTI2_3 },
Vector { _handler: EXTI4_15 },
Vector { _handler: LCD },
Vector {
_handler: DMA1_CHANNEL1,
},
Vector {
_handler: DMA1_CHANNEL2_3,
},
Vector {
_handler: DMA1_CHANNEL4_5_6_7,
},
Vector { _handler: ADC_COMP },
Vector {
_handler: TIM1_BRK_UP_TRG_COM,
},
Vector { _handler: TIM1_CC },
Vector { _handler: TIM2 },
Vector { _handler: TIM3 },
Vector {
_handler: TIM6_LPTIM1_DAC,
},
Vector { _handler: TIM7 },
Vector { _handler: TIM14 },
Vector { _handler: TIM15 },
Vector { _handler: TIM16 },
Vector { _handler: TIM17 },
Vector { _handler: I2C1 },
Vector { _handler: I2C2 },
Vector { _handler: SPI1 },
Vector { _handler: SPI2 },
Vector { _handler: USART1 },
Vector { _handler: USART2 },
Vector { _handler: USART3_4 },
Vector { _handler: CAN },
Vector { _handler: USB },
];
#[doc = r"Enumeration of all the interrupts."]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[repr(u16)]
pub enum Interrupt {
#[doc = "0 - Window WatchDog Interrupt"]
WWDG = 0,
#[doc = "1 - PVD Interrupt through EXTI Lines 16"]
PVD = 1,
#[doc = "2 - RTC Interrupt through EXTI Lines 19"]
RTC = 2,
#[doc = "3 - FLASH global Interrupt"]
FLASH = 3,
#[doc = "4 - RCC and CTC global Interrupts"]
RCC_CTC = 4,
#[doc = "5 - EXTI Line 0 and 1 Interrupt"]
EXTI0_1 = 5,
#[doc = "6 - EXTI Line 2 and 3 Interrupt"]
EXTI2_3 = 6,
#[doc = "7 - EXTI Line 4 to 15 Interrupt"]
EXTI4_15 = 7,
#[doc = "8 - LCD global Interrupt"]
LCD = 8,
#[doc = "9 - DMA1 Channel 1 Interrupt"]
DMA1_CHANNEL1 = 9,
#[doc = "10 - DMA1 Channel 2 and Channel 3 Interrupt"]
DMA1_CHANNEL2_3 = 10,
#[doc = "11 - DMA1 Channel 4, 5, 6, 7 Interrupts"]
DMA1_CHANNEL4_5_6_7 = 11,
#[doc = "12 - ADC and COMP Interrupt through EXTI Lines 17 and 18"]
ADC_COMP = 12,
#[doc = "13 - TIM1 Break, Update, Trigger and Commutation Interrupt"]
TIM1_BRK_UP_TRG_COM = 13,
#[doc = "14 - TIM1 Capture Compare Interrupt"]
TIM1_CC = 14,
#[doc = "15 - TIM2 global Interrupt"]
TIM2 = 15,
#[doc = "16 - TIM3 global Interrupt"]
TIM3 = 16,
#[doc = "17 - TIM6, LPTIM1, DAC global Interrupts"]
TIM6_LPTIM1_DAC = 17,
#[doc = "18 - TIM7 global Interrupt"]
TIM7 = 18,
#[doc = "19 - TIM14 global Interrupt"]
TIM14 = 19,
#[doc = "20 - TIM15 global Interrupt"]
TIM15 = 20,
#[doc = "21 - TIM16 global Interrupt"]
TIM16 = 21,
#[doc = "22 - TIM17 global Interrupt"]
TIM17 = 22,
#[doc = "23 - I2C1 global Interrupt"]
I2C1 = 23,
#[doc = "24 - I2C2 Event Interrupt"]
I2C2 = 24,
#[doc = "25 - SPI1 global Interrupt"]
SPI1 = 25,
#[doc = "26 - SPI2 global Interrupt"]
SPI2 = 26,
#[doc = "27 - USART1 global Interrupt"]
USART1 = 27,
#[doc = "28 - USART2 global Interrupt"]
USART2 = 28,
#[doc = "29 - USART3, 4 global Interrupts"]
USART3_4 = 29,
#[doc = "30 - CAN global Interrupt"]
CAN = 30,
#[doc = "31 - USB global Interrupts"]
USB = 31,
}
unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
#[inline(always)]
fn number(self) -> u16 {
self as u16
}
}
#[doc = "Analog to Digital Converter"]
pub struct ADC {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for ADC {}
impl ADC {
#[doc = r"Pointer to the register block"]
pub const PTR: *const adc::RegisterBlock = 0x4001_2400 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const adc::RegisterBlock {
Self::PTR
}
}
impl Deref for ADC {
type Target = adc::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for ADC {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ADC").finish()
}
}
#[doc = "Analog to Digital Converter"]
pub mod adc;
#[doc = "desc CAN"]
pub struct CAN {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for CAN {}
impl CAN {
#[doc = r"Pointer to the register block"]
pub const PTR: *const can::RegisterBlock = 0x4000_6400 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const can::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "desc CAN"]
pub mod can;
#[doc = "Comparator 1"]
pub struct COMP1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for COMP1 {}
impl COMP1 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const comp1::RegisterBlock = 0x4001_0200 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const comp1::RegisterBlock {
Self::PTR
}
}
impl Deref for COMP1 {
type Target = comp1::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for COMP1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("COMP1").finish()
}
}
#[doc = "Comparator 1"]
pub mod comp1;
#[doc = "Comparator2"]
pub struct COMP2 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for COMP2 {}
impl COMP2 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const comp2::RegisterBlock = 0x4001_0210 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const comp2::RegisterBlock {
Self::PTR
}
}
impl Deref for COMP2 {
type Target = comp2::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for COMP2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("COMP2").finish()
}
}
#[doc = "Comparator2"]
pub mod comp2;
#[doc = "Comparator3"]
pub struct COMP3 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for COMP3 {}
impl COMP3 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const comp3::RegisterBlock = 0x4001_0220 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const comp3::RegisterBlock {
Self::PTR
}
}
impl Deref for COMP3 {
type Target = comp3::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for COMP3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("COMP3").finish()
}
}
#[doc = "Comparator3"]
pub mod comp3;
#[doc = "CRC calculation unit"]
pub struct CRC {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for CRC {}
impl CRC {
#[doc = r"Pointer to the register block"]
pub const PTR: *const crc::RegisterBlock = 0x4002_3000 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const crc::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "CRC calculation unit"]
pub mod crc;
#[doc = "desc CTC"]
pub struct CTC {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for CTC {}
impl CTC {
#[doc = r"Pointer to the register block"]
pub const PTR: *const ctc::RegisterBlock = 0x4000_6c00 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const ctc::RegisterBlock {
Self::PTR
}
}
impl Deref for CTC {
type Target = ctc::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for CTC {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CTC").finish()
}
}
#[doc = "desc CTC"]
pub mod ctc;
#[doc = "desc DAC"]
pub struct DAC {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for DAC {}
impl DAC {
#[doc = r"Pointer to the register block"]
pub const PTR: *const dac::RegisterBlock = 0x4000_7400 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const dac::RegisterBlock {
Self::PTR
}
}
impl Deref for DAC {
type Target = dac::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for DAC {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("DAC").finish()
}
}
#[doc = "desc DAC"]
pub mod dac;
#[doc = "Debug support"]
pub struct DBGMCU {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for DBGMCU {}
impl DBGMCU {
#[doc = r"Pointer to the register block"]
pub const PTR: *const dbgmcu::RegisterBlock = 0x4001_5800 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const dbgmcu::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "Debug support"]
pub mod dbgmcu;
#[doc = "Direct memory access"]
pub struct DMA {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for DMA {}
impl DMA {
#[doc = r"Pointer to the register block"]
pub const PTR: *const dma::RegisterBlock = 0x4002_0000 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const dma::RegisterBlock {
Self::PTR
}
}
impl Deref for DMA {
type Target = dma::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for DMA {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("DMA").finish()
}
}
#[doc = "Direct memory access"]
pub mod dma;
#[doc = "External interrupt/event controller"]
pub struct EXTI {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for EXTI {}
impl EXTI {
#[doc = r"Pointer to the register block"]
pub const PTR: *const exti::RegisterBlock = 0x4002_1800 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const exti::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "External interrupt/event controller"]
pub mod exti;
#[doc = "desc FLASH"]
pub struct FLASH {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for FLASH {}
impl FLASH {
#[doc = r"Pointer to the register block"]
pub const PTR: *const flash::RegisterBlock = 0x4002_2000 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const flash::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "desc FLASH"]
pub mod flash;
#[doc = "General-purpose I/Os"]
pub struct GPIOA {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for GPIOA {}
impl GPIOA {
#[doc = r"Pointer to the register block"]
pub const PTR: *const gpioa::RegisterBlock = 0x5000_0000 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const gpioa::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "General-purpose I/Os"]
pub mod gpioa;
#[doc = "General-purpose I/Os"]
pub struct GPIOB {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for GPIOB {}
impl GPIOB {
#[doc = r"Pointer to the register block"]
pub const PTR: *const gpioa::RegisterBlock = 0x5000_0400 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const gpioa::RegisterBlock {
Self::PTR
}
}
impl Deref for GPIOB {
type Target = gpioa::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()
}
}
#[doc = "General-purpose I/Os"]
pub use gpioa as gpiob;
#[doc = "General-purpose I/Os"]
pub struct GPIOC {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for GPIOC {}
impl GPIOC {
#[doc = r"Pointer to the register block"]
pub const PTR: *const gpioa::RegisterBlock = 0x5000_0800 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const gpioa::RegisterBlock {
Self::PTR
}
}
impl Deref for GPIOC {
type Target = gpioa::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()
}
}
#[doc = "General-purpose I/Os"]
pub use gpioa as gpioc;
#[doc = "General-purpose I/Os"]
pub struct GPIOF {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for GPIOF {}
impl GPIOF {
#[doc = r"Pointer to the register block"]
pub const PTR: *const gpioa::RegisterBlock = 0x5000_1400 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const gpioa::RegisterBlock {
Self::PTR
}
}
impl Deref for GPIOF {
type Target = gpioa::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()
}
}
#[doc = "General-purpose I/Os"]
pub use gpioa as gpiof;
#[doc = "Hardware Divider"]
pub struct DIV {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for DIV {}
impl DIV {
#[doc = r"Pointer to the register block"]
pub const PTR: *const div::RegisterBlock = 0x4002_3800 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const div::RegisterBlock {
Self::PTR
}
}
impl Deref for DIV {
type Target = div::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for DIV {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("DIV").finish()
}
}
#[doc = "Hardware Divider"]
pub mod div;
#[doc = "Inter integrated circuit"]
pub struct I2C1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for I2C1 {}
impl I2C1 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const i2c1::RegisterBlock = 0x4000_5400 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const i2c1::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "Inter integrated circuit"]
pub mod i2c1;
#[doc = "desc I2C"]
pub struct I2C2 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for I2C2 {}
impl I2C2 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const i2c1::RegisterBlock = 0x4000_5800 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const i2c1::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "desc I2C"]
pub use i2c1 as i2c2;
#[doc = "Independent watchdog"]
pub struct IWDG {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for IWDG {}
impl IWDG {
#[doc = r"Pointer to the register block"]
pub const PTR: *const iwdg::RegisterBlock = 0x4000_3000 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const iwdg::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "Independent watchdog"]
pub mod iwdg;
#[doc = "LCD CONTROLLER"]
pub struct LCD {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for LCD {}
impl LCD {
#[doc = r"Pointer to the register block"]
pub const PTR: *const lcd::RegisterBlock = 0x4000_2400 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const lcd::RegisterBlock {
Self::PTR
}
}
impl Deref for LCD {
type Target = lcd::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for LCD {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("LCD").finish()
}
}
#[doc = "LCD CONTROLLER"]
pub mod lcd;
#[doc = "Low power timer"]
pub struct LPTIM1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for LPTIM1 {}
impl LPTIM1 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const lptim1::RegisterBlock = 0x4000_7c00 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const lptim1::RegisterBlock {
Self::PTR
}
}
impl Deref for LPTIM1 {
type Target = lptim1::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for LPTIM1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("LPTIM1").finish()
}
}
#[doc = "Low power timer"]
pub mod lptim1;
#[doc = "des OPA"]
pub struct OPA {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for OPA {}
impl OPA {
#[doc = r"Pointer to the register block"]
pub const PTR: *const opa::RegisterBlock = 0x4001_0300 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const opa::RegisterBlock {
Self::PTR
}
}
impl Deref for OPA {
type Target = opa::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for OPA {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("OPA").finish()
}
}
#[doc = "des OPA"]
pub mod opa;
#[doc = "Power control"]
pub struct PWR {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for PWR {}
impl PWR {
#[doc = r"Pointer to the register block"]
pub const PTR: *const pwr::RegisterBlock = 0x4000_7000 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const pwr::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "Power control"]
pub mod pwr;
#[doc = "Reset and clock control"]
pub struct RCC {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for RCC {}
impl RCC {
#[doc = r"Pointer to the register block"]
pub const PTR: *const rcc::RegisterBlock = 0x4002_1000 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const rcc::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "Reset and clock control"]
pub mod rcc;
#[doc = "desc RTC"]
pub struct RTC {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for RTC {}
impl RTC {
#[doc = r"Pointer to the register block"]
pub const PTR: *const rtc::RegisterBlock = 0x4000_2800 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const rtc::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "desc RTC"]
pub mod rtc;
#[doc = "Serial peripheral interface"]
pub struct SPI1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for SPI1 {}
impl SPI1 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const spi1::RegisterBlock = 0x4001_3000 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const spi1::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "Serial peripheral interface"]
pub mod spi1;
#[doc = "Serial peripheral interface"]
pub struct SPI2 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for SPI2 {}
impl SPI2 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const spi1::RegisterBlock = 0x4000_3800 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const spi1::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "Serial peripheral interface"]
pub use spi1 as spi2;
#[doc = "desc SYSCFG"]
pub struct SYSCFG {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for SYSCFG {}
impl SYSCFG {
#[doc = r"Pointer to the register block"]
pub const PTR: *const syscfg::RegisterBlock = 0x4001_0000 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const syscfg::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "desc SYSCFG"]
pub mod syscfg;
#[doc = "Advanced timer"]
pub struct TIM1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM1 {}
impl TIM1 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const tim1::RegisterBlock = 0x4001_2c00 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const tim1::RegisterBlock {
Self::PTR
}
}
impl Deref for TIM1 {
type Target = tim1::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for TIM1 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIM1").finish()
}
}
#[doc = "Advanced timer"]
pub mod tim1;
#[doc = "desc TIM"]
pub struct TIM2 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM2 {}
impl TIM2 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const tim2::RegisterBlock = 0x4000_0000 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const tim2::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "desc TIM"]
pub mod tim2;
#[doc = "General purpose timer"]
pub struct TIM3 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM3 {}
impl TIM3 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const tim3::RegisterBlock = 0x4000_0400 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const tim3::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "General purpose timer"]
pub mod tim3;
#[doc = "desc TIM"]
pub struct TIM6 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM6 {}
impl TIM6 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const tim6::RegisterBlock = 0x4000_1000 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const tim6::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "desc TIM"]
pub mod tim6;
#[doc = "desc TIM"]
pub struct TIM7 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM7 {}
impl TIM7 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const tim6::RegisterBlock = 0x4000_1400 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const tim6::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "desc TIM"]
pub use tim6 as tim7;
#[doc = "General purpose timer"]
pub struct TIM14 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM14 {}
impl TIM14 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const tim14::RegisterBlock = 0x4000_2000 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const tim14::RegisterBlock {
Self::PTR
}
}
impl Deref for TIM14 {
type Target = tim14::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()
}
}
#[doc = "General purpose timer"]
pub mod tim14;
#[doc = "TIM15"]
pub struct TIM15 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM15 {}
impl TIM15 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const tim15::RegisterBlock = 0x4001_4000 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const tim15::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "TIM15"]
pub mod tim15;
#[doc = "General purpose timer"]
pub struct TIM16 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM16 {}
impl TIM16 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const tim16::RegisterBlock = 0x4001_4400 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const tim16::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "General purpose timer"]
pub mod tim16;
#[doc = "General purpose timer"]
pub struct TIM17 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIM17 {}
impl TIM17 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const tim16::RegisterBlock = 0x4001_4800 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const tim16::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "General purpose timer"]
pub use tim16 as tim17;
#[doc = "Universal synchronous asynchronous receiver transmitter"]
pub struct USART1 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for USART1 {}
impl USART1 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const usart1::RegisterBlock = 0x4001_3800 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const usart1::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "Universal synchronous asynchronous receiver transmitter"]
pub mod usart1;
#[doc = "Universal synchronous asynchronous receiver transmitter"]
pub struct USART2 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for USART2 {}
impl USART2 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const usart1::RegisterBlock = 0x4000_4400 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const usart1::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "Universal synchronous asynchronous receiver transmitter"]
pub use usart1 as usart2;
#[doc = "desc USART"]
pub struct USART3 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for USART3 {}
impl USART3 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const usart1::RegisterBlock = 0x4000_4800 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const usart1::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "desc USART"]
pub use usart1 as usart3;
#[doc = "desc USART"]
pub struct USART4 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for USART4 {}
impl USART4 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const usart1::RegisterBlock = 0x4000_4c00 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const usart1::RegisterBlock {
Self::PTR
}
}
impl Deref for USART4 {
type Target = usart1::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for USART4 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("USART4").finish()
}
}
#[doc = "desc USART"]
pub use usart1 as usart4;
#[doc = "USB"]
pub struct USB {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for USB {}
impl USB {
#[doc = r"Pointer to the register block"]
pub const PTR: *const usb::RegisterBlock = 0x4000_5c00 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const usb::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "USB"]
pub mod usb;
#[doc = "Window watchdog"]
pub struct WWDG {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for WWDG {}
impl WWDG {
#[doc = r"Pointer to the register block"]
pub const PTR: *const wwdg::RegisterBlock = 0x4000_2c00 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const wwdg::RegisterBlock {
Self::PTR
}
}
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()
}
}
#[doc = "Window watchdog"]
pub mod wwdg;
#[no_mangle]
static mut DEVICE_PERIPHERALS: bool = false;
#[doc = r"All the peripherals"]
#[allow(non_snake_case)]
pub struct Peripherals {
#[doc = "ADC"]
pub ADC: ADC,
#[doc = "CAN"]
pub CAN: CAN,
#[doc = "COMP1"]
pub COMP1: COMP1,
#[doc = "COMP2"]
pub COMP2: COMP2,
#[doc = "COMP3"]
pub COMP3: COMP3,
#[doc = "CRC"]
pub CRC: CRC,
#[doc = "CTC"]
pub CTC: CTC,
#[doc = "DAC"]
pub DAC: DAC,
#[doc = "DBGMCU"]
pub DBGMCU: DBGMCU,
#[doc = "DMA"]
pub DMA: DMA,
#[doc = "EXTI"]
pub EXTI: EXTI,
#[doc = "FLASH"]
pub FLASH: FLASH,
#[doc = "GPIOA"]
pub GPIOA: GPIOA,
#[doc = "GPIOB"]
pub GPIOB: GPIOB,
#[doc = "GPIOC"]
pub GPIOC: GPIOC,
#[doc = "GPIOF"]
pub GPIOF: GPIOF,
#[doc = "DIV"]
pub DIV: DIV,
#[doc = "I2C1"]
pub I2C1: I2C1,
#[doc = "I2C2"]
pub I2C2: I2C2,
#[doc = "IWDG"]
pub IWDG: IWDG,
#[doc = "LCD"]
pub LCD: LCD,
#[doc = "LPTIM1"]
pub LPTIM1: LPTIM1,
#[doc = "OPA"]
pub OPA: OPA,
#[doc = "PWR"]
pub PWR: PWR,
#[doc = "RCC"]
pub RCC: RCC,
#[doc = "RTC"]
pub RTC: RTC,
#[doc = "SPI1"]
pub SPI1: SPI1,
#[doc = "SPI2"]
pub SPI2: SPI2,
#[doc = "SYSCFG"]
pub SYSCFG: SYSCFG,
#[doc = "TIM1"]
pub TIM1: TIM1,
#[doc = "TIM2"]
pub TIM2: TIM2,
#[doc = "TIM3"]
pub TIM3: TIM3,
#[doc = "TIM6"]
pub TIM6: TIM6,
#[doc = "TIM7"]
pub TIM7: TIM7,
#[doc = "TIM14"]
pub TIM14: TIM14,
#[doc = "TIM15"]
pub TIM15: TIM15,
#[doc = "TIM16"]
pub TIM16: TIM16,
#[doc = "TIM17"]
pub TIM17: TIM17,
#[doc = "USART1"]
pub USART1: USART1,
#[doc = "USART2"]
pub USART2: USART2,
#[doc = "USART3"]
pub USART3: USART3,
#[doc = "USART4"]
pub USART4: USART4,
#[doc = "USB"]
pub USB: USB,
#[doc = "WWDG"]
pub WWDG: WWDG,
}
impl Peripherals {
#[doc = r"Returns all the peripherals *once*"]
#[inline]
pub fn take() -> Option<Self> {
cortex_m::interrupt::free(|_| {
if unsafe { DEVICE_PERIPHERALS } {
None
} else {
Some(unsafe { Peripherals::steal() })
}
})
}
#[doc = r"Unchecked version of `Peripherals::take`"]
#[inline]
pub unsafe fn steal() -> Self {
DEVICE_PERIPHERALS = true;
Peripherals {
ADC: ADC {
_marker: PhantomData,
},
CAN: CAN {
_marker: PhantomData,
},
COMP1: COMP1 {
_marker: PhantomData,
},
COMP2: COMP2 {
_marker: PhantomData,
},
COMP3: COMP3 {
_marker: PhantomData,
},
CRC: CRC {
_marker: PhantomData,
},
CTC: CTC {
_marker: PhantomData,
},
DAC: DAC {
_marker: PhantomData,
},
DBGMCU: DBGMCU {
_marker: PhantomData,
},
DMA: DMA {
_marker: PhantomData,
},
EXTI: EXTI {
_marker: PhantomData,
},
FLASH: FLASH {
_marker: PhantomData,
},
GPIOA: GPIOA {
_marker: PhantomData,
},
GPIOB: GPIOB {
_marker: PhantomData,
},
GPIOC: GPIOC {
_marker: PhantomData,
},
GPIOF: GPIOF {
_marker: PhantomData,
},
DIV: DIV {
_marker: PhantomData,
},
I2C1: I2C1 {
_marker: PhantomData,
},
I2C2: I2C2 {
_marker: PhantomData,
},
IWDG: IWDG {
_marker: PhantomData,
},
LCD: LCD {
_marker: PhantomData,
},
LPTIM1: LPTIM1 {
_marker: PhantomData,
},
OPA: OPA {
_marker: PhantomData,
},
PWR: PWR {
_marker: PhantomData,
},
RCC: RCC {
_marker: PhantomData,
},
RTC: RTC {
_marker: PhantomData,
},
SPI1: SPI1 {
_marker: PhantomData,
},
SPI2: SPI2 {
_marker: PhantomData,
},
SYSCFG: SYSCFG {
_marker: PhantomData,
},
TIM1: TIM1 {
_marker: PhantomData,
},
TIM2: TIM2 {
_marker: PhantomData,
},
TIM3: TIM3 {
_marker: PhantomData,
},
TIM6: TIM6 {
_marker: PhantomData,
},
TIM7: TIM7 {
_marker: PhantomData,
},
TIM14: TIM14 {
_marker: PhantomData,
},
TIM15: TIM15 {
_marker: PhantomData,
},
TIM16: TIM16 {
_marker: PhantomData,
},
TIM17: TIM17 {
_marker: PhantomData,
},
USART1: USART1 {
_marker: PhantomData,
},
USART2: USART2 {
_marker: PhantomData,
},
USART3: USART3 {
_marker: PhantomData,
},
USART4: USART4 {
_marker: PhantomData,
},
USB: USB {
_marker: PhantomData,
},
WWDG: WWDG {
_marker: PhantomData,
},
}
}
}