Enum stm32wlxx_hal::info::Core
source · pub enum Core {
Cm4,
Cm0p,
}
Expand description
CPU core.
Variants§
Implementations§
source§impl Core
impl Core
sourcepub const CT: Core = Core::Cm4
pub const CT: Core = Core::Cm4
Get the CPU core at compile time.
This is determined by the HAL features.
For a runtime mechanism use Core::from_cpuid()
.
Example
use stm32wlxx_hal::info::Core;
#[cfg(feature = "stm32wl5x_cm4")]
assert_eq!(Core::CT, Core::Cm4);
#[cfg(feature = "stm32wl5x_cm0p")]
assert_eq!(Core::CT, Core::Cm0p);
#[cfg(feature = "stm32wle5")]
assert_eq!(Core::CT, Core::Cm4);
sourcepub fn from_cpuid() -> Core
pub fn from_cpuid() -> Core
Get the CPU core at runtime.
This is determined by the part number field in CPUID register in the system control block.
For a compile time mechanism use Core::CT
.
Example
use stm32wlxx_hal::info::Core;
match Core::from_device() {
Core::Cm4 => defmt::info!("Hello world from the Cortex-M4 CPU"),
Core::Cm0p => defmt::info!("Hello world from the Cortex-M0+ CPU"),
}
Trait Implementations§
source§impl PartialEq for Core
impl PartialEq for Core
impl Copy for Core
impl Eq for Core
impl StructuralEq for Core
impl StructuralPartialEq for Core
Auto Trait Implementations§
impl RefUnwindSafe for Core
impl Send for Core
impl Sync for Core
impl Unpin for Core
impl UnwindSafe for Core
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more