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

source

pub const PTR: *const u32 = {0x1fff7580 as *const u32}

Pointer to the IEEE 64-bit unique device ID (UID64) device memory.

source

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
source

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();
source

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());
source

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);
source

pub const fn dev_id(&self) -> u8

Device ID

This is always 0x15 for this device.

Example
use stm32wlxx_hal::info::Uid64;

assert_eq!(Uid64::from_device().dev_id(), 0x15);

Trait Implementations§

source§

impl Clone for Uid64

source§

fn clone(&self) -> Uid64

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Uid64

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Uid64

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Uid64> for u64

source§

fn from(uid: Uid64) -> Self

Converts to this type from the input type.
source§

impl From<u64> for Uid64

source§

fn from(uid: u64) -> Self

Converts to this type from the input type.
source§

impl Hash for Uid64

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Uid64

source§

fn eq(&self, other: &Uid64) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Uid64

source§

impl Eq for Uid64

source§

impl StructuralEq for Uid64

source§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.