#![allow(non_snake_case, non_upper_case_globals)]
#![allow(non_camel_case_types)]
#[cfg(not(feature = "nosync"))]
pub use crate::stm32f4::peripherals::gpio::Instance;
pub use crate::stm32f4::peripherals::gpio::{RegisterBlock, ResetValues};
pub use crate::stm32f4::peripherals::gpio::{
AFRH, AFRL, BSRR, IDR, LCKR, MODER, ODR, OSPEEDR, OTYPER, PUPDR,
};
pub mod GPIOA {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40020000,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
MODER: 0xA8000000,
OTYPER: 0x00000000,
OSPEEDR: 0x00000000,
PUPDR: 0x64000000,
IDR: 0x00000000,
ODR: 0x00000000,
BSRR: 0x00000000,
LCKR: 0x00000000,
AFRL: 0x00000000,
AFRH: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut GPIOA_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if GPIOA_TAKEN {
None
} else {
GPIOA_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if GPIOA_TAKEN && inst.addr == INSTANCE.addr {
GPIOA_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
GPIOA_TAKEN = true;
INSTANCE
}
}
pub const GPIOA: *const RegisterBlock = 0x40020000 as *const _;
pub mod GPIOB {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40020400,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
MODER: 0x00000280,
OTYPER: 0x00000000,
OSPEEDR: 0x000000C0,
PUPDR: 0x00000100,
IDR: 0x00000000,
ODR: 0x00000000,
BSRR: 0x00000000,
LCKR: 0x00000000,
AFRL: 0x00000000,
AFRH: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut GPIOB_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if GPIOB_TAKEN {
None
} else {
GPIOB_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if GPIOB_TAKEN && inst.addr == INSTANCE.addr {
GPIOB_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
GPIOB_TAKEN = true;
INSTANCE
}
}
pub const GPIOB: *const RegisterBlock = 0x40020400 as *const _;
pub mod GPIOC {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40020800,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
MODER: 0x00000000,
OTYPER: 0x00000000,
OSPEEDR: 0x00000000,
PUPDR: 0x00000000,
IDR: 0x00000000,
ODR: 0x00000000,
BSRR: 0x00000000,
LCKR: 0x00000000,
AFRL: 0x00000000,
AFRH: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut GPIOC_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if GPIOC_TAKEN {
None
} else {
GPIOC_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if GPIOC_TAKEN && inst.addr == INSTANCE.addr {
GPIOC_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
GPIOC_TAKEN = true;
INSTANCE
}
}
pub const GPIOC: *const RegisterBlock = 0x40020800 as *const _;
pub mod GPIOD {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40020c00,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
MODER: 0x00000000,
OTYPER: 0x00000000,
OSPEEDR: 0x00000000,
PUPDR: 0x00000000,
IDR: 0x00000000,
ODR: 0x00000000,
BSRR: 0x00000000,
LCKR: 0x00000000,
AFRL: 0x00000000,
AFRH: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut GPIOD_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if GPIOD_TAKEN {
None
} else {
GPIOD_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if GPIOD_TAKEN && inst.addr == INSTANCE.addr {
GPIOD_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
GPIOD_TAKEN = true;
INSTANCE
}
}
pub const GPIOD: *const RegisterBlock = 0x40020c00 as *const _;
pub mod GPIOE {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40021000,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
MODER: 0x00000000,
OTYPER: 0x00000000,
OSPEEDR: 0x00000000,
PUPDR: 0x00000000,
IDR: 0x00000000,
ODR: 0x00000000,
BSRR: 0x00000000,
LCKR: 0x00000000,
AFRL: 0x00000000,
AFRH: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut GPIOE_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if GPIOE_TAKEN {
None
} else {
GPIOE_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if GPIOE_TAKEN && inst.addr == INSTANCE.addr {
GPIOE_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
GPIOE_TAKEN = true;
INSTANCE
}
}
pub const GPIOE: *const RegisterBlock = 0x40021000 as *const _;
pub mod GPIOF {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40021400,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
MODER: 0x00000000,
OTYPER: 0x00000000,
OSPEEDR: 0x00000000,
PUPDR: 0x00000000,
IDR: 0x00000000,
ODR: 0x00000000,
BSRR: 0x00000000,
LCKR: 0x00000000,
AFRL: 0x00000000,
AFRH: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut GPIOF_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if GPIOF_TAKEN {
None
} else {
GPIOF_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if GPIOF_TAKEN && inst.addr == INSTANCE.addr {
GPIOF_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
GPIOF_TAKEN = true;
INSTANCE
}
}
pub const GPIOF: *const RegisterBlock = 0x40021400 as *const _;
pub mod GPIOG {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40021800,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
MODER: 0x00000000,
OTYPER: 0x00000000,
OSPEEDR: 0x00000000,
PUPDR: 0x00000000,
IDR: 0x00000000,
ODR: 0x00000000,
BSRR: 0x00000000,
LCKR: 0x00000000,
AFRL: 0x00000000,
AFRH: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut GPIOG_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if GPIOG_TAKEN {
None
} else {
GPIOG_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if GPIOG_TAKEN && inst.addr == INSTANCE.addr {
GPIOG_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
GPIOG_TAKEN = true;
INSTANCE
}
}
pub const GPIOG: *const RegisterBlock = 0x40021800 as *const _;
pub mod GPIOH {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40021c00,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
MODER: 0x00000000,
OTYPER: 0x00000000,
OSPEEDR: 0x00000000,
PUPDR: 0x00000000,
IDR: 0x00000000,
ODR: 0x00000000,
BSRR: 0x00000000,
LCKR: 0x00000000,
AFRL: 0x00000000,
AFRH: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut GPIOH_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if GPIOH_TAKEN {
None
} else {
GPIOH_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if GPIOH_TAKEN && inst.addr == INSTANCE.addr {
GPIOH_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
GPIOH_TAKEN = true;
INSTANCE
}
}
pub const GPIOH: *const RegisterBlock = 0x40021c00 as *const _;
pub mod GPIOI {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40022000,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
MODER: 0x00000000,
OTYPER: 0x00000000,
OSPEEDR: 0x00000000,
PUPDR: 0x00000000,
IDR: 0x00000000,
ODR: 0x00000000,
BSRR: 0x00000000,
LCKR: 0x00000000,
AFRL: 0x00000000,
AFRH: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut GPIOI_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if GPIOI_TAKEN {
None
} else {
GPIOI_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if GPIOI_TAKEN && inst.addr == INSTANCE.addr {
GPIOI_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
GPIOI_TAKEN = true;
INSTANCE
}
}
pub const GPIOI: *const RegisterBlock = 0x40022000 as *const _;
pub mod GPIOJ {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40022400,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
MODER: 0x00000000,
OTYPER: 0x00000000,
OSPEEDR: 0x00000000,
PUPDR: 0x00000000,
IDR: 0x00000000,
ODR: 0x00000000,
BSRR: 0x00000000,
LCKR: 0x00000000,
AFRL: 0x00000000,
AFRH: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut GPIOJ_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if GPIOJ_TAKEN {
None
} else {
GPIOJ_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if GPIOJ_TAKEN && inst.addr == INSTANCE.addr {
GPIOJ_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
GPIOJ_TAKEN = true;
INSTANCE
}
}
pub const GPIOJ: *const RegisterBlock = 0x40022400 as *const _;
pub mod GPIOK {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40022800,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
MODER: 0x00000000,
OTYPER: 0x00000000,
OSPEEDR: 0x00000000,
PUPDR: 0x00000000,
IDR: 0x00000000,
ODR: 0x00000000,
BSRR: 0x00000000,
LCKR: 0x00000000,
AFRL: 0x00000000,
AFRH: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut GPIOK_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if GPIOK_TAKEN {
None
} else {
GPIOK_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if GPIOK_TAKEN && inst.addr == INSTANCE.addr {
GPIOK_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
GPIOK_TAKEN = true;
INSTANCE
}
}
pub const GPIOK: *const RegisterBlock = 0x40022800 as *const _;