Memory Protection Unit Peripheral Abstraction Layer.
|
status_t | MPU_Init (const mpu_instance_t *const instance, uint8_t regionCnt, const mpu_region_config_t *configPtr) |
| Initializes memory protection unit by allocating regions and granting access rights for masters. More...
|
|
status_t | MPU_Deinit (const mpu_instance_t *const instance) |
| De-initializes memory protection unit by reseting all regions and masters to default and disable module. More...
|
|
status_t | MPU_GetDefautRegionConfig (const mpu_instance_t *const instance, mpu_master_access_permission_t *masterAccRight, mpu_region_config_t *regionConfig) |
| Gets default region configuration. Grants all access rights for masters; disable PID and cache; unlock region descriptor. More...
|
|
status_t | MPU_UpdateRegion (const mpu_instance_t *const instance, uint8_t regionNum, const mpu_region_config_t *configPtr) |
| Updates region configuration. More...
|
|
status_t | MPU_EnableRegion (const mpu_instance_t *const instance, uint8_t regionNum, bool enable) |
| Enables or disables an exist region configuration. More...
|
|
bool | MPU_GetError (const mpu_instance_t *const instance, uint8_t channel, mpu_error_info_t *errPtr) |
| Checks and gets the access error detail information then clear error flag if the error caused by a master. More...
|
|
enum | mpu_inst_type_t { MPU_INST_TYPE_MPU = 0U
} |
| Enumeration with the types of peripherals supported by MPU PAL. More...
|
|
MPU access error Implements : mpu_error_access_type_t_Class.
Enumerator |
---|
MPU_ERROR_TYPE_READ |
Error type: read
|
MPU_ERROR_TYPE_WRITE |
Error type: write
|
Definition at line 48 of file mpu_pal.h.
MPU access error attributes Implements : mpu_error_attributes_t_Class.
Enumerator |
---|
MPU_ERROR_USER_MODE_INSTRUCTION_ACCESS |
Instruction access error in user mode
|
MPU_ERROR_USER_MODE_DATA_ACCESS |
Data access error in user mode
|
MPU_ERROR_SUPERVISOR_MODE_INSTRUCTION_ACCESS |
Instruction access error in supervisor mode
|
MPU_ERROR_SUPERVISOR_MODE_DATA_ACCESS |
Data access error in supervisor mode
|
Definition at line 58 of file mpu_pal.h.
Enumeration with the types of peripherals supported by MPU PAL.
This enumeration contains the types of peripherals supported by MPU PAL. Implements : mpu_inst_type_t_Class
Enumerator |
---|
MPU_INST_TYPE_MPU |
|
Definition at line 54 of file mpu_pal_mapping.h.
De-initializes memory protection unit by reseting all regions and masters to default and disable module.
- Parameters
-
[in] | instance | The pointer to MPU instance number. |
- Returns
- operation status
- STATUS_SUCCESS : Operation was successful.
- STATUS_ERROR : Operation failed due to the region was locked by another master or all masters are locked.
- STATUS_UNSUPPORTED : Operation was unsupported.
Definition at line 279 of file mpu_pal.c.
Enables or disables an exist region configuration.
- Parameters
-
[in] | instance | The pointer to MPU instance number. |
[in] | regionNum | The region number. |
[in] | enable | Valid state
- true : Enable region.
- false : Disable region.
|
- Returns
- operation status
- STATUS_SUCCESS : Operation was successful.
- STATUS_ERROR : Operation failed due to the region was locked by another master or all masters are locked.
- STATUS_UNSUPPORTED : Operation was unsupported.
Definition at line 428 of file mpu_pal.c.
Gets default region configuration. Grants all access rights for masters; disable PID and cache; unlock region descriptor.
- Parameters
-
[in] | instance | The pointer to MPU instance number. |
[out] | masterAccRight | The pointer to master configuration structure, see mpu_master_access_permission_t. The length of array should be defined by number of masters supported by hardware. |
[out] | regionConfig | The pointer to default region configuration structure, see mpu_region_config_t. |
- Returns
- operation status
- STATUS_SUCCESS : Operation was successful.
- STATUS_UNSUPPORTED : Operation was unsupported.
Definition at line 314 of file mpu_pal.c.
Checks and gets the access error detail information then clear error flag if the error caused by a master.
- Parameters
-
[in] | instance | The pointer to MPU instance number. |
[in] | channel | The error capture channel For MPU: corresponding with the slave port number For SMPU: corresponding with the the master number |
[out] | errPtr | The pointer to access error info structure, see mpu_error_info_t. |
- Returns
- operation status
- true : An error has occurred.
- false : No error has occurred or the operation was unsupported.
Definition at line 465 of file mpu_pal.c.
Initializes memory protection unit by allocating regions and granting access rights for masters.
- Parameters
-
[in] | instance | The pointer to MPU instance number. |
[in] | regionCnt | The number of regions configured. |
[in] | configPtr | The pointer to regions configuration structure, see mpu_region_config_t. |
- Returns
- operation status
- STATUS_SUCCESS : Operation was successful.
- STATUS_ERROR : Operation failed due to invalid master number or the region was locked by another master or all masters are locked.
- STATUS_UNSUPPORTED : Operation was unsupported.
Definition at line 216 of file mpu_pal.c.
Updates region configuration.
- Parameters
-
[in] | instance | The pointer to MPU instance number. |
[in] | regionNum | The region number. |
[in] | configPtr | The pointer to region configuration structure, see mpu_region_config_t. |
- Returns
- operation status
- STATUS_SUCCESS : Operation was successful.
- STATUS_ERROR : Operation failed due to invalid master number or the region was locked by another master or all masters are locked.
- STATUS_UNSUPPORTED : Operation was unsupported.
Definition at line 383 of file mpu_pal.c.