#![allow(non_snake_case, non_upper_case_globals)]
#![allow(non_camel_case_types)]
#[cfg(not(feature = "nosync"))]
pub use crate::stm32l5::peripherals::i2c::Instance;
pub use crate::stm32l5::peripherals::i2c::{RegisterBlock, ResetValues};
pub use crate::stm32l5::peripherals::i2c::{
CR1, CR2, ICR, ISR, OAR1, OAR2, PECR, RXDR, TIMEOUTR, TIMINGR, TXDR,
};
pub mod I2C1 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40005400,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
OAR1: 0x00000000,
OAR2: 0x00000000,
TIMINGR: 0x00000000,
TIMEOUTR: 0x00000000,
ISR: 0x00000001,
ICR: 0x00000000,
PECR: 0x00000000,
RXDR: 0x00000000,
TXDR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut I2C1_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if I2C1_TAKEN {
None
} else {
I2C1_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if I2C1_TAKEN && inst.addr == INSTANCE.addr {
I2C1_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
I2C1_TAKEN = true;
INSTANCE
}
}
pub const I2C1: *const RegisterBlock = 0x40005400 as *const _;
pub mod I2C2 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40005800,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
OAR1: 0x00000000,
OAR2: 0x00000000,
TIMINGR: 0x00000000,
TIMEOUTR: 0x00000000,
ISR: 0x00000001,
ICR: 0x00000000,
PECR: 0x00000000,
RXDR: 0x00000000,
TXDR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut I2C2_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if I2C2_TAKEN {
None
} else {
I2C2_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if I2C2_TAKEN && inst.addr == INSTANCE.addr {
I2C2_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
I2C2_TAKEN = true;
INSTANCE
}
}
pub const I2C2: *const RegisterBlock = 0x40005800 as *const _;
pub mod I2C3 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40005c00,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
OAR1: 0x00000000,
OAR2: 0x00000000,
TIMINGR: 0x00000000,
TIMEOUTR: 0x00000000,
ISR: 0x00000001,
ICR: 0x00000000,
PECR: 0x00000000,
RXDR: 0x00000000,
TXDR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut I2C3_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if I2C3_TAKEN {
None
} else {
I2C3_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if I2C3_TAKEN && inst.addr == INSTANCE.addr {
I2C3_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
I2C3_TAKEN = true;
INSTANCE
}
}
pub const I2C3: *const RegisterBlock = 0x40005c00 as *const _;
pub mod I2C4 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40008400,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
OAR1: 0x00000000,
OAR2: 0x00000000,
TIMINGR: 0x00000000,
TIMEOUTR: 0x00000000,
ISR: 0x00000001,
ICR: 0x00000000,
PECR: 0x00000000,
RXDR: 0x00000000,
TXDR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut I2C4_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if I2C4_TAKEN {
None
} else {
I2C4_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if I2C4_TAKEN && inst.addr == INSTANCE.addr {
I2C4_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
I2C4_TAKEN = true;
INSTANCE
}
}
pub const I2C4: *const RegisterBlock = 0x40008400 as *const _;
pub mod SEC_I2C1 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x50005400,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
OAR1: 0x00000000,
OAR2: 0x00000000,
TIMINGR: 0x00000000,
TIMEOUTR: 0x00000000,
ISR: 0x00000001,
ICR: 0x00000000,
PECR: 0x00000000,
RXDR: 0x00000000,
TXDR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut SEC_I2C1_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if SEC_I2C1_TAKEN {
None
} else {
SEC_I2C1_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if SEC_I2C1_TAKEN && inst.addr == INSTANCE.addr {
SEC_I2C1_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
SEC_I2C1_TAKEN = true;
INSTANCE
}
}
pub const SEC_I2C1: *const RegisterBlock = 0x50005400 as *const _;
pub mod SEC_I2C2 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x50005800,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
OAR1: 0x00000000,
OAR2: 0x00000000,
TIMINGR: 0x00000000,
TIMEOUTR: 0x00000000,
ISR: 0x00000001,
ICR: 0x00000000,
PECR: 0x00000000,
RXDR: 0x00000000,
TXDR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut SEC_I2C2_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if SEC_I2C2_TAKEN {
None
} else {
SEC_I2C2_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if SEC_I2C2_TAKEN && inst.addr == INSTANCE.addr {
SEC_I2C2_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
SEC_I2C2_TAKEN = true;
INSTANCE
}
}
pub const SEC_I2C2: *const RegisterBlock = 0x50005800 as *const _;
pub mod SEC_I2C3 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x50005c00,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
OAR1: 0x00000000,
OAR2: 0x00000000,
TIMINGR: 0x00000000,
TIMEOUTR: 0x00000000,
ISR: 0x00000001,
ICR: 0x00000000,
PECR: 0x00000000,
RXDR: 0x00000000,
TXDR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut SEC_I2C3_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if SEC_I2C3_TAKEN {
None
} else {
SEC_I2C3_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if SEC_I2C3_TAKEN && inst.addr == INSTANCE.addr {
SEC_I2C3_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
SEC_I2C3_TAKEN = true;
INSTANCE
}
}
pub const SEC_I2C3: *const RegisterBlock = 0x50005c00 as *const _;
pub mod SEC_I2C4 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x50008400,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
OAR1: 0x00000000,
OAR2: 0x00000000,
TIMINGR: 0x00000000,
TIMEOUTR: 0x00000000,
ISR: 0x00000001,
ICR: 0x00000000,
PECR: 0x00000000,
RXDR: 0x00000000,
TXDR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut SEC_I2C4_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if SEC_I2C4_TAKEN {
None
} else {
SEC_I2C4_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if SEC_I2C4_TAKEN && inst.addr == INSTANCE.addr {
SEC_I2C4_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
SEC_I2C4_TAKEN = true;
INSTANCE
}
}
pub const SEC_I2C4: *const RegisterBlock = 0x50008400 as *const _;