Skip to main content

StmDeviceId

Struct StmDeviceId 

Source
pub struct StmDeviceId { /* private fields */ }
Expand description

STM32 MCU Device ID Code

Device ID format:

  • Bits 31:16: REV_ID (silicon revision)
  • Bits 15:0: DEV_ID (device identifier)

§Examples

let device_id: StmDeviceId = 0x10006413.into();
println!("{}", device_id);

// Or using new()
let device_id = StmDeviceId::new(0x10006413);

Implementations§

Source§

impl StmDeviceId

Source

pub const ADDRESS: u32 = 0xE004_2000

STM32F4 memory address of the ROM location holding the device ID

Source

pub fn new(raw: u32) -> Self

Create new Device ID decoder from raw 32-bit value

Source

pub fn raw(&self) -> u32

Get raw Device ID value

Source

pub fn revision(&self) -> u16

Get revision field (bits 31:16)

Source

pub fn device_id(&self) -> u16

Get device identifier (bits 15:0)

Source

pub fn family(&self) -> StmFamily

Get STM32 product family

Source

pub fn line(&self) -> StmLine

Get STM32 product line

Source

pub fn revision_str(&self) -> &'static str

Get revision letter if known. These values are usually documented in errata sheets or reference manuals for the product line.

Source

pub fn is_known_device(&self) -> bool

Checks if this is an STM32 device airfrog-core is familiar with

Trait Implementations§

Source§

impl Clone for StmDeviceId

Source§

fn clone(&self) -> StmDeviceId

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for StmDeviceId

Source§

impl Debug for StmDeviceId

Source§

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

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

impl Display for StmDeviceId

Source§

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

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

impl Eq for StmDeviceId

Source§

impl From<u32> for StmDeviceId

Source§

fn from(raw: u32) -> Self

Converts to this type from the input type.
Source§

impl LowerHex for StmDeviceId

Source§

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

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

impl PartialEq for StmDeviceId

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for StmDeviceId

Source§

impl UpperHex for StmDeviceId

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.