Skip to main content

StmFlashSize

Struct StmFlashSize 

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

STM Flash Size Register

This is a 16-bit value that indicates the size of the flash memory in kilobytes.

Implementations§

Source§

impl StmFlashSize

Source

pub const STM32F4_ADDRESS_OF_U16: u32 = 0x1FFF_7A20

Address containing the 16-bit flash size value. The flash size is the upper 16 bits of this value, so stored at 0x1FFF_7A22. We store a 4-bit aligned address.

Source

pub const STM32F1_ADDRESS_OF_U16: u32 = 0x1FFF_F7E0

Source

pub fn addr_from_family(family: StmFamily) -> Option<u32>

Get the initial address for reading the Flash Size based on the STM32 family.

Source

pub fn new(raw: u16) -> Self

Create new Flash Size from raw 16-bit value

Source

pub fn raw(&self) -> u16

Get raw Flash Size value

Source

pub fn size_bytes(&self) -> u32

Get Flash size in bytes

Source

pub fn size_kb(&self) -> u32

Get Flash size in KB

Trait Implementations§

Source§

impl Clone for StmFlashSize

Source§

fn clone(&self) -> StmFlashSize

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 StmFlashSize

Source§

impl Debug for StmFlashSize

Source§

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

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

impl Display for StmFlashSize

Source§

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

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

impl Eq for StmFlashSize

Source§

impl PartialEq for StmFlashSize

Source§

fn eq(&self, other: &StmFlashSize) -> 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 StmFlashSize

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.