pub struct Mpu(/* private fields */);
Expand description
Wrapper around the Cortex-M4 Memory Protection Unit (MPU).
Implementations§
Source§impl Mpu
impl Mpu
Sourcepub const MIN_REGION_SIZE: Size = Size::S32B
pub const MIN_REGION_SIZE: Size = Size::S32B
The smallest supported region size.
Sourcepub const REGION_COUNT: u8 = 8u8
pub const REGION_COUNT: u8 = 8u8
Number of supported memory regions.
Sourcepub unsafe fn new(raw: MPU) -> Self
pub unsafe fn new(raw: MPU) -> Self
Creates a new MPU wrapper, taking ownership of the MPU
peripheral.
§Safety
This is safe to call if the processor is a Cortex-M4 or M4F and has an MPU.
Sourcepub fn into_inner(self) -> MPU
pub fn into_inner(self) -> MPU
Consumes self
and returns the raw MPU peripheral.
Sourcepub fn configure_unprivileged(&mut self, regions: &ArrayVec<[Region; 8]>)
pub fn configure_unprivileged(&mut self, regions: &ArrayVec<[Region; 8]>)
Configures the MPU to restrict access to software running in unprivileged mode.
Code running in privileged mode will not be restricted by the MPU.
Auto Trait Implementations§
impl Freeze for Mpu
impl RefUnwindSafe for Mpu
impl Send for Mpu
impl !Sync for Mpu
impl Unpin for Mpu
impl UnwindSafe for Mpu
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