#![allow(non_snake_case, non_upper_case_globals)]
#![allow(non_camel_case_types)]
#[cfg(not(feature = "nosync"))]
pub use crate::stm32f4::peripherals::spi::Instance;
pub use crate::stm32f4::peripherals::spi::{RegisterBlock, ResetValues};
pub use crate::stm32f4::peripherals::spi::{
CR1, CR2, CRCPR, DR, I2SCFGR, I2SPR, RXCRCR, SR, TXCRCR,
};
pub mod I2S2ext {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40003400,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
SR: 0x00000002,
DR: 0x00000000,
CRCPR: 0x00000007,
RXCRCR: 0x00000000,
TXCRCR: 0x00000000,
I2SCFGR: 0x00000000,
I2SPR: 0x0000000A,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut I2S2ext_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if I2S2ext_TAKEN {
None
} else {
I2S2ext_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if I2S2ext_TAKEN && inst.addr == INSTANCE.addr {
I2S2ext_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
I2S2ext_TAKEN = true;
INSTANCE
}
}
pub const I2S2ext: *const RegisterBlock = 0x40003400 as *const _;
pub mod I2S3ext {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40004000,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
SR: 0x00000002,
DR: 0x00000000,
CRCPR: 0x00000007,
RXCRCR: 0x00000000,
TXCRCR: 0x00000000,
I2SCFGR: 0x00000000,
I2SPR: 0x0000000A,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut I2S3ext_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if I2S3ext_TAKEN {
None
} else {
I2S3ext_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if I2S3ext_TAKEN && inst.addr == INSTANCE.addr {
I2S3ext_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
I2S3ext_TAKEN = true;
INSTANCE
}
}
pub const I2S3ext: *const RegisterBlock = 0x40004000 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,
I2SCFGR: 0x00000000,
I2SPR: 0x0000000A,
};
#[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,
I2SCFGR: 0x00000000,
I2SPR: 0x0000000A,
};
#[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,
I2SCFGR: 0x00000000,
I2SPR: 0x0000000A,
};
#[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 _;
pub mod SPI4 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40013400,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
SR: 0x00000002,
DR: 0x00000000,
CRCPR: 0x00000007,
RXCRCR: 0x00000000,
TXCRCR: 0x00000000,
I2SCFGR: 0x00000000,
I2SPR: 0x0000000A,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut SPI4_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if SPI4_TAKEN {
None
} else {
SPI4_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if SPI4_TAKEN && inst.addr == INSTANCE.addr {
SPI4_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
SPI4_TAKEN = true;
INSTANCE
}
}
pub const SPI4: *const RegisterBlock = 0x40013400 as *const _;
pub mod SPI5 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40015000,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
SR: 0x00000002,
DR: 0x00000000,
CRCPR: 0x00000007,
RXCRCR: 0x00000000,
TXCRCR: 0x00000000,
I2SCFGR: 0x00000000,
I2SPR: 0x0000000A,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut SPI5_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if SPI5_TAKEN {
None
} else {
SPI5_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if SPI5_TAKEN && inst.addr == INSTANCE.addr {
SPI5_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
SPI5_TAKEN = true;
INSTANCE
}
}
pub const SPI5: *const RegisterBlock = 0x40015000 as *const _;
pub mod SPI6 {
use super::ResetValues;
#[cfg(not(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x40015400,
_marker: ::core::marker::PhantomData,
};
pub const reset: ResetValues = ResetValues {
CR1: 0x00000000,
CR2: 0x00000000,
SR: 0x00000002,
DR: 0x00000000,
CRCPR: 0x00000007,
RXCRCR: 0x00000000,
TXCRCR: 0x00000000,
I2SCFGR: 0x00000000,
I2SPR: 0x0000000A,
};
#[cfg(not(feature = "nosync"))]
#[allow(renamed_and_removed_lints)]
#[allow(private_no_mangle_statics)]
#[no_mangle]
static mut SPI6_TAKEN: bool = false;
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if SPI6_TAKEN {
None
} else {
SPI6_TAKEN = true;
Some(INSTANCE)
}
})
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub fn release(inst: Instance) {
external_cortex_m::interrupt::free(|_| unsafe {
if SPI6_TAKEN && inst.addr == INSTANCE.addr {
SPI6_TAKEN = false;
} else {
panic!("Released a peripheral which was not taken");
}
});
}
#[cfg(not(feature = "nosync"))]
#[inline]
pub unsafe fn steal() -> Instance {
SPI6_TAKEN = true;
INSTANCE
}
}
pub const SPI6: *const RegisterBlock = 0x40015400 as *const _;