Skip to main content

MPUSize

Enum MPUSize 

Source
pub enum MPUSize {
Show 28 variants Size32B = 5, Size64B = 6, Size128B = 7, Size256B = 8, Size512B = 9, Size1KB = 10, Size2KB = 11, Size4KB = 12, Size8KB = 13, Size16KB = 14, Size32KB = 15, Size64KB = 16, Size128KB = 17, Size256KB = 18, Size512KB = 19, Size1MB = 20, Size2MB = 21, Size4MB = 22, Size8MB = 23, Size16MB = 24, Size32MB = 25, Size64MB = 26, Size128MB = 27, Size256MB = 28, Size512MB = 29, Size1GB = 30, Size2GB = 31, Size4GB = 32,
}
Expand description

MPU Region Size

ARM Cortex-M MPU requires power-of-2 sized regions Values represent the power of 2 (e.g., Size32B = 5 means 2^5 = 32 bytes)

Variants§

§

Size32B = 5

32 bytes (2^5)

§

Size64B = 6

64 bytes (2^6)

§

Size128B = 7

128 bytes (2^7)

§

Size256B = 8

256 bytes (2^8)

§

Size512B = 9

512 bytes (2^9)

§

Size1KB = 10

1 KB (2^10)

§

Size2KB = 11

2 KB (2^11)

§

Size4KB = 12

4 KB (2^12)

§

Size8KB = 13

8 KB (2^13)

§

Size16KB = 14

16 KB (2^14)

§

Size32KB = 15

32 KB (2^15)

§

Size64KB = 16

64 KB (2^16)

§

Size128KB = 17

128 KB (2^17)

§

Size256KB = 18

256 KB (2^18)

§

Size512KB = 19

512 KB (2^19)

§

Size1MB = 20

1 MB (2^20)

§

Size2MB = 21

2 MB (2^21)

§

Size4MB = 22

4 MB (2^22)

§

Size8MB = 23

8 MB (2^23)

§

Size16MB = 24

16 MB (2^24)

§

Size32MB = 25

32 MB (2^25)

§

Size64MB = 26

64 MB (2^26)

§

Size128MB = 27

128 MB (2^27)

§

Size256MB = 28

256 MB (2^28)

§

Size512MB = 29

512 MB (2^29)

§

Size1GB = 30

1 GB (2^30)

§

Size2GB = 31

2 GB (2^31)

§

Size4GB = 32

4 GB (2^32)

Implementations§

Source§

impl MPUSize

Source

pub fn bytes(&self) -> u64

Get size in bytes

Source

pub fn from_bytes(bytes: u64) -> Result<Self>

Create from byte size (rounds up to next power of 2)

Trait Implementations§

Source§

impl Clone for MPUSize

Source§

fn clone(&self) -> MPUSize

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 Debug for MPUSize

Source§

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

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

impl PartialEq for MPUSize

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for MPUSize

Source§

impl Eq for MPUSize

Source§

impl StructuralPartialEq for MPUSize

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> Same for T

Source§

type Output = T

Should always be Self
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, 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.