![]() |
S32 SDK
|
Memory Protection Unit Hardware Abstraction Level.
This HAL provides low-level access to all hardware features of the MPU.
Data Structures | |
struct | mpu_access_err_info_t |
MPU detail error access info Implements : mpu_access_err_info_t_Class. More... | |
struct | mpu_low_masters_access_rights_t |
MPU access rights for masters which have separated privilege rights for user and supervisor mode accesses (e.g. master0~2 in S32K144) Implements : mpu_low_masters_access_rights_t_Class. More... | |
struct | mpu_high_masters_access_rights_t |
MPU access rights for master which have only read and write permissions Implements : mpu_high_masters_access_rights_t_Class. More... | |
Functions | |
static void | MPU_HAL_Enable (MPU_Type *const base) |
Enables the MPU module. More... | |
static void | MPU_HAL_Disable (MPU_Type *const base) |
Disables the MPU module. More... | |
static bool | MPU_HAL_IsEnable (const MPU_Type *const base) |
Checks whether the MPU module is enabled. More... | |
static uint8_t | MPU_HAL_GetHardwareRevision (const MPU_Type *const base) |
Gets MPU hardware revision level. More... | |
bool | MPU_HAL_GetSlavePortErrorStatus (const MPU_Type *const base, uint8_t slaveNum) |
Gets the error status of a specified slave port. More... | |
void | MPU_HAL_GetDetailErrorAccessInfo (MPU_Type *const base, uint8_t slaveNum, mpu_access_err_info_t *errInfoPtr) |
Gets MPU detail error access info. More... | |
void | MPU_HAL_SetRegionAddr (MPU_Type *const base, uint8_t regionNum, uint32_t startAddr, uint32_t endAddr) |
Sets region start and end address. Please note that using this function will clear the valid bit of the region, and a further validation might be needed. More... | |
void | MPU_HAL_SetLowMasterAccessRights (MPU_Type *const base, uint8_t regionNum, uint8_t masterNum, const mpu_low_masters_access_rights_t *accessRightsPtr) |
Sets access permission for master which has separated privilege rights for user and supervisor mode accesses in a specific region. Please note that using this function will clear the valid bit of the region. In order to keep the region valid, the MPU_HAL_SetAlternateLowMasterAccessRights function can be used. More... | |
void | MPU_HAL_SetHighMasterAccessRights (MPU_Type *const base, uint8_t regionNum, uint8_t masterNum, const mpu_high_masters_access_rights_t *accessRightsPtr) |
Sets access permission for master which has only read and write permissions in a specific region. Please note that using this function will clear the valid bit of the region. In order to keep the region valid, the MPU_HAL_SetAlternateHighMasterAccessRights function can be used. More... | |
static void | MPU_HAL_SetRegionValidCmd (MPU_Type *const base, uint8_t regionNum, bool enable) |
Sets the region valid value. When a region changed not by alternating registers should set the valid again. More... | |
static void | MPU_HAL_SetProcessIdentifierMask (MPU_Type *const base, uint8_t regionNum, uint8_t processIdentifierMask) |
Sets the process identifier mask. More... | |
static void | MPU_HAL_SetProcessIdentifier (MPU_Type *const base, uint8_t regionNum, uint8_t processIdentifier) |
Sets the process identifier. More... | |
void | MPU_HAL_SetAlternateLowMasterAccessRights (MPU_Type *const base, uint8_t regionNum, uint8_t masterNum, const mpu_low_masters_access_rights_t *accessRightsPtr) |
Sets access permission for master which has separated privilege rights for user and supervisor mode accesses in a specific region by alternate register. More... | |
void | MPU_HAL_SetAlternateHighMasterAccessRights (MPU_Type *const base, uint8_t regionNum, uint8_t masterNum, const mpu_high_masters_access_rights_t *accessRightsPtr) |
Sets access permission for master which has only read and write permissions in a specific region by alternate register. More... | |
void | MPU_HAL_Init (MPU_Type *const base) |
Initializes the MPU module and all regions will be invalid after cleared access permission. More... | |
enum mpu_err_attributes_t |
MPU access error attributes Implements : mpu_err_attributes_t_Class.
MPU access rights in supervisor mode Implements : mpu_supervisor_access_rights_t_Class.
MPU access rights in user mode Implements : mpu_user_access_rights_t_Class.
|
inlinestatic |
|
inlinestatic |
void MPU_HAL_GetDetailErrorAccessInfo | ( | MPU_Type *const | base, |
uint8_t | slaveNum, | ||
mpu_access_err_info_t * | errInfoPtr | ||
) |
|
inlinestatic |
bool MPU_HAL_GetSlavePortErrorStatus | ( | const MPU_Type *const | base, |
uint8_t | slaveNum | ||
) |
Gets the error status of a specified slave port.
[in] | base | The MPU peripheral base address. |
[in] | slaveNum | MPU slave port number. |
void MPU_HAL_Init | ( | MPU_Type *const | base | ) |
|
inlinestatic |
void MPU_HAL_SetAlternateHighMasterAccessRights | ( | MPU_Type *const | base, |
uint8_t | regionNum, | ||
uint8_t | masterNum, | ||
const mpu_high_masters_access_rights_t * | accessRightsPtr | ||
) |
Sets access permission for master which has only read and write permissions in a specific region by alternate register.
[in] | base | The MPU peripheral base address. |
[in] | regionNum | MPU region number. |
[in] | masterNum | MPU master number. |
[in] | accessRightsPtr | The pointer of master access rights see mpu_high_masters_access_rights_t. |
void MPU_HAL_SetAlternateLowMasterAccessRights | ( | MPU_Type *const | base, |
uint8_t | regionNum, | ||
uint8_t | masterNum, | ||
const mpu_low_masters_access_rights_t * | accessRightsPtr | ||
) |
Sets access permission for master which has separated privilege rights for user and supervisor mode accesses in a specific region by alternate register.
[in] | base | The MPU peripheral base address. |
[in] | regionNum | MPU region number. |
[in] | masterNum | MPU master number. |
[in] | accessRightsPtr | The pointer of master access rights see mpu_low_masters_access_rights_t. |
void MPU_HAL_SetHighMasterAccessRights | ( | MPU_Type *const | base, |
uint8_t | regionNum, | ||
uint8_t | masterNum, | ||
const mpu_high_masters_access_rights_t * | accessRightsPtr | ||
) |
Sets access permission for master which has only read and write permissions in a specific region. Please note that using this function will clear the valid bit of the region. In order to keep the region valid, the MPU_HAL_SetAlternateHighMasterAccessRights function can be used.
[in] | base | The MPU peripheral base address. |
[in] | regionNum | MPU region number. |
[in] | masterNum | MPU master number. |
[in] | accessRightsPtr | The pointer of master access rights see mpu_high_masters_access_rights_t. |
void MPU_HAL_SetLowMasterAccessRights | ( | MPU_Type *const | base, |
uint8_t | regionNum, | ||
uint8_t | masterNum, | ||
const mpu_low_masters_access_rights_t * | accessRightsPtr | ||
) |
Sets access permission for master which has separated privilege rights for user and supervisor mode accesses in a specific region. Please note that using this function will clear the valid bit of the region. In order to keep the region valid, the MPU_HAL_SetAlternateLowMasterAccessRights function can be used.
[in] | base | The MPU peripheral base address. |
[in] | regionNum | MPU region number. |
[in] | masterNum | MPU master number. |
[in] | accessRightsPtr | The pointer of master access rights see mpu_low_masters_access_rights_t. |
|
inlinestatic |
|
inlinestatic |
void MPU_HAL_SetRegionAddr | ( | MPU_Type *const | base, |
uint8_t | regionNum, | ||
uint32_t | startAddr, | ||
uint32_t | endAddr | ||
) |
Sets region start and end address. Please note that using this function will clear the valid bit of the region, and a further validation might be needed.
[in] | base | The MPU peripheral base address. |
[in] | regionNum | MPU region number. |
[in] | startAddr | Region start address. |
[in] | endAddr | Region end address. |
|
inlinestatic |
Sets the region valid value. When a region changed not by alternating registers should set the valid again.
[in] | base | The MPU peripheral base address. |
[in] | regionNum | MPU region number. |
[in] | enable | Enables or disables region. Implements : MPU_HAL_SetRegionValidCmd_Activity |