Hardware access layer for managing the Memory Protection Unit (MPU) peripheral.
More...
|
#define | NRF_MPU_PERIPHERAL_MASK_GET(base_addr) (1UL << NRFX_PERIPHERAL_ID_GET(base_addr)) |
| Macro for getting MPU region configuration mask for the specified peripheral. More...
|
|
Hardware access layer for managing the Memory Protection Unit (MPU) peripheral.
#define NRF_MPU_PERIPHERAL_MASK_GET |
( |
|
base_addr | ) |
(1UL << NRFX_PERIPHERAL_ID_GET(base_addr)) |
Macro for getting MPU region configuration mask for the specified peripheral.
- Parameters
-
[in] | base_addr | Peripheral base address. |
- Returns
- MPU configuration mask for the specified peripheral.
__STATIC_INLINE void nrf_mpu_nvm_blocks_protection_enable |
( |
NRF_MPU_Type * |
p_reg, |
|
|
uint8_t |
group_idx, |
|
|
uint32_t |
block_mask |
|
) |
| |
Function for enabling protection for specified non-volatile memory blocks.
Blocks are arranged into groups of 32 blocks each. Each block size is 4 kB. Any attempt to write or erase a protected block will result in hard fault. The memory block protection can be disabled only by resetting the device.
- Parameters
-
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | group_idx | Non-volatile memory group containing memory blocks to protect. |
[in] | block_mask | Non-volatile memory blocks to protect. Each bit in bitmask represents one memory block in the specified group. |
__STATIC_INLINE void nrf_mpu_nvm_protection_in_debug_set |
( |
NRF_MPU_Type * |
p_reg, |
|
|
bool |
enable |
|
) |
| |
Function for setting the non-volatile memory (NVM) protection during debug.
NVM protection during debug is disabled by default.
- Parameters
-
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | enable | True if NVM protection during debug is to be enabled. False if otherwise. |
__STATIC_INLINE uint32_t nrf_mpu_region0_peripherals_get |
( |
NRF_MPU_Type const * |
p_reg | ) |
|
Function for getting the bitmask that specifies peripherals configured in the memory region 0.
- Parameters
-
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
- Returns
- Bitmask representing peripherals configured in region 0.
__STATIC_INLINE void nrf_mpu_region0_peripherals_set |
( |
NRF_MPU_Type * |
p_reg, |
|
|
uint32_t |
peripheral_mask |
|
) |
| |
Function for configuring specified peripherals in the memory region 0.
When the memory protection is enabled, the Memory Protection Unit enforces runtime protection and readback protection of resources classified as region 0. See the product specification for more information.
After reset, all peripherals are configured as not assigned to region 0.
- Parameters
-
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | peripheral_mask | Mask that specifies peripherals to be configured in the memory region 0. Compose this mask using NRF_MPU_PERIPHERAL_MASK_GET macro. |
__STATIC_INLINE void nrf_mpu_region0_ram_size_set |
( |
NRF_MPU_Type * |
p_reg, |
|
|
uint32_t |
size |
|
) |
| |
Function for setting the size of the RAM region 0.
When memory protection is enabled, the Memory Protection Unit enforces runtime protection and readback protection of resources classified as region 0. See the product specification for more information.
- Parameters
-
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | size | Size of the RAM region 0, in bytes. Must be word-aligned. |