34#define MPU_NUM_REGIONS ( (MPU->TYPE & MPU_TYPE_DREGION_Msk) >> MPU_TYPE_DREGION_Pos )
89#define MPU_SIZE_TO_BYTES(size) ( (uintptr_t)1 << ((size) + 1) )
int mpu_configure(uint_fast8_t region, uintptr_t base, uint_fast32_t attr)
configure the base address and attributes for an MPU region
bool mpu_enabled(void)
test if the MPU is enabled
@ AP_NO_NO
no access for all levels
@ AP_RW_NO
read/write for privileged level, no access from user level
@ AP_RW_RW
read/write for all levels
@ AP_RO_NO
read-only for privileged level, no access from user level
@ AP_RW_RO
read/write for privileged level, read-only for user level
@ AP_RO_RO
read-only for all levels
int mpu_disable(void)
disable the MPU
int mpu_enable(void)
enable the MPU
@ MPU_SIZE_256K
256 kilobytes
@ MPU_SIZE_512K
512 kilobytes
@ MPU_SIZE_64K
64 kilobytes
@ MPU_SIZE_32M
32 megabytes
@ MPU_SIZE_16K
16 kilobytes
@ MPU_SIZE_16M
16 megabytes
@ MPU_SIZE_32K
32 kilobytes
@ MPU_SIZE_128K
128 kilobytes
@ MPU_SIZE_256M
256 megabytes
@ MPU_SIZE_128M
128 megabytes
@ MPU_SIZE_64M
64 megabytes
@ MPU_SIZE_512M
512 megabytes
static uint32_t MPU_ATTR(uint32_t xn, uint32_t ap, uint32_t tex, uint32_t c, uint32_t b, uint32_t s, uint32_t size)
generate an MPU attribute word suitable for writing to the RASR register