#![allow(non_snake_case, non_upper_case_globals)]
#![allow(non_camel_case_types)]
#[cfg(not(feature = "nosync"))]
pub use crate::stm32l5::peripherals::spi::Instance;
pub use crate::stm32l5::peripherals::spi::{RegisterBlock, ResetValues};
pub use crate::stm32l5::peripherals::spi::{CR1, CR2, CRCPR, DR, RXCRCR, SR, TXCRCR};
pub mod SEC_SPI1 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x50013000,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
SR: 0x00000002,
DR: 0x00000000,
CRCPR: 0x00000007,
RXCRCR: 0x00000000,
TXCRCR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut SEC_SPI1_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if SEC_SPI1_TAKEN {
None
} else {
SEC_SPI1_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if SEC_SPI1_TAKEN && inst.addr == INSTANCE.addr {
SEC_SPI1_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
SEC_SPI1_TAKEN = true;
INSTANCE
}
}
pub const SEC_SPI1: *const RegisterBlock = 0x50013000 as *const _;
pub mod SEC_SPI2 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x50003800,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
SR: 0x00000002,
DR: 0x00000000,
CRCPR: 0x00000007,
RXCRCR: 0x00000000,
TXCRCR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut SEC_SPI2_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if SEC_SPI2_TAKEN {
None
} else {
SEC_SPI2_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if SEC_SPI2_TAKEN && inst.addr == INSTANCE.addr {
SEC_SPI2_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
SEC_SPI2_TAKEN = true;
INSTANCE
}
}
pub const SEC_SPI2: *const RegisterBlock = 0x50003800 as *const _;
pub mod SEC_SPI3 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x50003c00,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
SR: 0x00000002,
DR: 0x00000000,
CRCPR: 0x00000007,
RXCRCR: 0x00000000,
TXCRCR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut SEC_SPI3_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if SEC_SPI3_TAKEN {
None
} else {
SEC_SPI3_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if SEC_SPI3_TAKEN && inst.addr == INSTANCE.addr {
SEC_SPI3_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
SEC_SPI3_TAKEN = true;
INSTANCE
}
}
pub const SEC_SPI3: *const RegisterBlock = 0x50003c00 as *const _;
pub mod SPI1 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40013000,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
SR: 0x00000002,
DR: 0x00000000,
CRCPR: 0x00000007,
RXCRCR: 0x00000000,
TXCRCR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut SPI1_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if SPI1_TAKEN {
None
} else {
SPI1_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if SPI1_TAKEN && inst.addr == INSTANCE.addr {
SPI1_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
SPI1_TAKEN = true;
INSTANCE
}
}
pub const SPI1: *const RegisterBlock = 0x40013000 as *const _;
pub mod SPI2 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40003800,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
SR: 0x00000002,
DR: 0x00000000,
CRCPR: 0x00000007,
RXCRCR: 0x00000000,
TXCRCR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut SPI2_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if SPI2_TAKEN {
None
} else {
SPI2_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if SPI2_TAKEN && inst.addr == INSTANCE.addr {
SPI2_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
SPI2_TAKEN = true;
INSTANCE
}
}
pub const SPI2: *const RegisterBlock = 0x40003800 as *const _;
pub mod SPI3 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40003c00,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
SR: 0x00000002,
DR: 0x00000000,
CRCPR: 0x00000007,
RXCRCR: 0x00000000,
TXCRCR: 0x00000000,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut SPI3_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if SPI3_TAKEN {
None
} else {
SPI3_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if SPI3_TAKEN && inst.addr == INSTANCE.addr {
SPI3_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
SPI3_TAKEN = true;
INSTANCE
}
}
pub const SPI3: *const RegisterBlock = 0x40003c00 as *const _;