Struct stm32wlxx_hal::info::Uid64
source · pub struct Uid64 { /* private fields */ }
Expand description
IEEE 64-bit unique device ID (UID64).
Note: There are two UIDs, the other is Uid
.
Implementations§
source§impl Uid64
impl Uid64
sourcepub const PTR: *const u32 = {0x1fff7580 as *const u32}
pub const PTR: *const u32 = {0x1fff7580 as *const u32}
Pointer to the IEEE 64-bit unique device ID (UID64) device memory.
sourcepub fn from_device() -> Self
pub fn from_device() -> Self
Get the IEEE 64-bit unique device ID (UID64) from device memory.
Example
use stm32wlxx_hal::info;
let uid64: info::Uid64 = info::Uid64::from_device();
assert_eq!(uid64.dev_id(), 0x15);
assert_eq!(uid64.company_id(), 0x0080E1);
// uid64.devnum() is unique
sourcepub const fn devnum(&self) -> u32
pub const fn devnum(&self) -> u32
Unique 32-bit device number.
This is sequential and unique for each individual device.
Example
use stm32wlxx_hal::info::Uid64;
let devnum: u32 = Uid64::from_device().devnum();
sourcepub fn read_devnum() -> u32
pub fn read_devnum() -> u32
Read the 32-bit device number from device memory.
This is provided for applications that only need the 32-bit device number, performing a single device memory read.
Example
use stm32wlxx_hal::info::Uid64;
let devnum: u32 = Uid64::read_devnum();
assert_eq!(devnum, Uid64::from_device().devnum());
sourcepub const fn company_id(&self) -> u32
pub const fn company_id(&self) -> u32
Company ID
This is 0x0080E1
for STMicroelectronics.
Note: Only the first 24 bits are used.
Example
use stm32wlxx_hal::info::Uid64;
assert_eq!(Uid64::from_device().company_id(), 0x0080E1);
Trait Implementations§
source§impl PartialEq for Uid64
impl PartialEq for Uid64
impl Copy for Uid64
impl Eq for Uid64
impl StructuralEq for Uid64
impl StructuralPartialEq for Uid64
Auto Trait Implementations§
impl RefUnwindSafe for Uid64
impl Send for Uid64
impl Sync for Uid64
impl Unpin for Uid64
impl UnwindSafe for Uid64
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