#![allow(non_snake_case, non_upper_case_globals)]
#![allow(non_camel_case_types)]
#[cfg(not(feature = "nosync"))]
pub use crate::stm32l4::peripherals::usart::Instance;
pub use crate::stm32l4::peripherals::usart::{RegisterBlock, ResetValues};
pub use crate::stm32l4::peripherals::usart::{
BRR, CR1, CR2, CR3, GTPR, ICR, ISR, RDR, RQR, RTOR, TDR,
};
pub mod UART4 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40004c00,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
CR3: 0x00000000,
BRR: 0x00000000,
GTPR: 0x00000000,
RTOR: 0x00000000,
RQR: 0x00000000,
ISR: 0x000000C0,
ICR: 0x00000000,
RDR: 0x00000000,
TDR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut UART4_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if UART4_TAKEN {
None
} else {
UART4_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if UART4_TAKEN && inst.addr == INSTANCE.addr {
UART4_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
UART4_TAKEN = true;
INSTANCE
}
}
pub const UART4: *const RegisterBlock = 0x40004c00 as *const _;
pub mod UART5 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40005000,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
CR3: 0x00000000,
BRR: 0x00000000,
GTPR: 0x00000000,
RTOR: 0x00000000,
RQR: 0x00000000,
ISR: 0x000000C0,
ICR: 0x00000000,
RDR: 0x00000000,
TDR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut UART5_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if UART5_TAKEN {
None
} else {
UART5_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if UART5_TAKEN && inst.addr == INSTANCE.addr {
UART5_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
UART5_TAKEN = true;
INSTANCE
}
}
pub const UART5: *const RegisterBlock = 0x40005000 as *const _;
pub mod USART1 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40013800,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
CR3: 0x00000000,
BRR: 0x00000000,
GTPR: 0x00000000,
RTOR: 0x00000000,
RQR: 0x00000000,
ISR: 0x000000C0,
ICR: 0x00000000,
RDR: 0x00000000,
TDR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut USART1_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if USART1_TAKEN {
None
} else {
USART1_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if USART1_TAKEN && inst.addr == INSTANCE.addr {
USART1_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
USART1_TAKEN = true;
INSTANCE
}
}
pub const USART1: *const RegisterBlock = 0x40013800 as *const _;
pub mod USART2 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40004400,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
CR3: 0x00000000,
BRR: 0x00000000,
GTPR: 0x00000000,
RTOR: 0x00000000,
RQR: 0x00000000,
ISR: 0x000000C0,
ICR: 0x00000000,
RDR: 0x00000000,
TDR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut USART2_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if USART2_TAKEN {
None
} else {
USART2_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if USART2_TAKEN && inst.addr == INSTANCE.addr {
USART2_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
USART2_TAKEN = true;
INSTANCE
}
}
pub const USART2: *const RegisterBlock = 0x40004400 as *const _;
pub mod USART3 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40004800,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
CR3: 0x00000000,
BRR: 0x00000000,
GTPR: 0x00000000,
RTOR: 0x00000000,
RQR: 0x00000000,
ISR: 0x000000C0,
ICR: 0x00000000,
RDR: 0x00000000,
TDR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut USART3_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if USART3_TAKEN {
None
} else {
USART3_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if USART3_TAKEN && inst.addr == INSTANCE.addr {
USART3_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
USART3_TAKEN = true;
INSTANCE
}
}
pub const USART3: *const RegisterBlock = 0x40004800 as *const _;