Type Alias rp2040_pac::ppb::mpu_ctrl::R

source ·
pub type R = R<MPU_CTRL_SPEC>;
Expand description

Register MPU_CTRL reader

Aliased Type§

struct R { /* private fields */ }

Implementations§

source§

impl R

source

pub fn enable(&self) -> ENABLE_R

Bit 0 - Enables the MPU. If the MPU is disabled, privileged and unprivileged accesses use the default memory map.
0 = MPU disabled.
1 = MPU enabled.

source

pub fn hfnmiena(&self) -> HFNMIENA_R

Bit 1 - Controls the use of the MPU for HardFaults and NMIs. Setting this bit when ENABLE is clear results in UNPREDICTABLE behaviour.
When the MPU is enabled:
0 = MPU is disabled during HardFault and NMI handlers, regardless of the value of the ENABLE bit.
1 = the MPU is enabled during HardFault and NMI handlers.

source

pub fn privdefena(&self) -> PRIVDEFENA_R

Bit 2 - Controls whether the default memory map is enabled as a background region for privileged accesses. This bit is ignored when ENABLE is clear.
0 = If the MPU is enabled, disables use of the default memory map. Any memory access to a location not
covered by any enabled region causes a fault.
1 = If the MPU is enabled, enables use of the default memory map as a background region for privileged software accesses.
When enabled, the background region acts as if it is region number -1. Any region that is defined and enabled has priority over this default map.