Type Alias rp2040_pac::ppb::mpu_ctrl::W

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

Register MPU_CTRL writer

Aliased Type§

struct W { /* private fields */ }

Implementations§

source§

impl W

source

pub fn enable(&mut self) -> ENABLE_W<'_, MPU_CTRL_SPEC>

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(&mut self) -> HFNMIENA_W<'_, MPU_CTRL_SPEC>

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(&mut self) -> PRIVDEFENA_W<'_, MPU_CTRL_SPEC>

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.

source

pub unsafe fn bits(&mut self, bits: u32) -> &mut Self

Writes raw bits to the register.

§Safety

Passing incorrect value can cause undefined behaviour. See reference manual