__STATIC_INLINE cy_en_prot_status_t Cy_Prot_DisableSmpuStruct | ( | PROT_SMPU_SMPU_STRUCT_Type * | base | ) |
This function disables both the master and slave parts of a protection unit.
base | The base address for the SMPU structure to be disabled. |
Status | Description |
---|---|
CY_PROT_SUCCESS | The Master and Slave SMPU struct was disabled |
CY_PROT_FAILURE | The Master and/or slave SMPU struct was not disabled |
CY_PROT_INVALID_STATE | Function was called on the unsupported PERI IP version |
cy_en_prot_status_t Cy_Prot_GetSmpuStruct | ( | PROT_SMPU_SMPU_STRUCT_Type ** | base, |
cy_en_prot_req_mode_t | reqMode, | ||
uint32_t | smpuIndex | ||
) |
Functions returns a pointer of the requested unused SMPU structure.
It searches the SMPU structures until it finds one that both the slave and master sections are disabled. After an available structure is located, function enables the slave structure and set the ATT0[7:0] bits to 0xFF, to make sure that a subsequent call will not see this as an available (unused) SMPU.
It is up to the user to implement, if needed, a system in which a semaphore will lock-out all but one CPU from calling this function at once.
base | The base address for the SMPU structure returned if an unused structure was found. If an empty structure was not found, the returned pointer is NULL. |
reqMode | This parameter (request mode) selects how the user wants to select a SMPU structure. |
reqMode | Description |
---|---|
CY_PROT_REQMODE_HIGHPRIOR | Return the SMPU structure with the highest priority. |
CY_PROT_REQMODE_LOWPRIOR | Return the SMPU structure with the lowest priority. |
CY_PROT_REQMODE_INDEX | Return the SMPU structure with the specific index. |
smpuIndex | This is the index of the requested SMPU structure. It is only used if the request mode is reqMode = CY_PROT_REQMODE_INDEX. |
Status | Description |
---|---|
CY_PROT_SUCCESS | The Slave PU struct was disabled. |
CY_PROT_FAILURE | The Master or Slave SMPU struct is disabled and possibly locked. |
CY_PROT_UNAVAILABLE | The requested structure in use or there were no unused structures. |
cy_en_prot_status_t Cy_Prot_ConfigSmpuMasterStruct | ( | PROT_SMPU_SMPU_STRUCT_Type * | base, |
const cy_stc_smpu_cfg_t * | config | ||
) |
Configures a Shared Memory Protection Unit (SMPU) master protection struct with its protection attributes.
This function configures the master struct governing the corresponding slave struct pair. It is a mechanism to protect the slave SMPU struct. Since the memory location of the slave struct is known, the address, regionSize and subregions of the configuration struct are not applicable.
Note that only the user/privileged write permissions are configurable. The read and execute permissions are read-only and cannot be configured.
base | The register base address of the protection struct being configured. |
config | Initialization structure with all the protection attributes. |
Status | Description |
---|---|
CY_PROT_SUCCESS | SMPU master struct was successfully configured. |
CY_PROT_FAILURE | The resource is locked. |
CY_PROT_BAD_PARAM | An incorrect/invalid parameter was passed. |
cy_en_prot_status_t Cy_Prot_ConfigSmpuSlaveStruct | ( | PROT_SMPU_SMPU_STRUCT_Type * | base, |
const cy_stc_smpu_cfg_t * | config | ||
) |
Configures a Shared Memory Protection Unit (SMPU) slave protection struct with its protection attributes.
This function configures the slave struct of an SMPU pair, which can protect any memory region in a device from invalid bus master accesses.
base | The register base address of the protection structure being configured. |
config | Initialization structure with all the protection attributes. |
Status | Description |
---|---|
CY_PROT_SUCCESS | SMPU slave struct was successfully configured. |
CY_PROT_FAILURE | The resource is locked. |
CY_PROT_BAD_PARAM | An incorrect/invalid parameter was passed. |
cy_en_prot_status_t Cy_Prot_EnableSmpuMasterStruct | ( | PROT_SMPU_SMPU_STRUCT_Type * | base | ) |
Enables the Master SMPU structure.
This is an SMPU master struct enable function. The SMPU protection settings will take effect after successful completion of this function call.
base | The base address for the protection unit structure being configured. |
Status | Description |
---|---|
CY_PROT_SUCCESS | The Master PU struct was enabled. |
CY_PROT_FAILURE | The Master PU struct is disabled and possibly locked. |
cy_en_prot_status_t Cy_Prot_DisableSmpuMasterStruct | ( | PROT_SMPU_SMPU_STRUCT_Type * | base | ) |
Disables the Master SMPU structure.
This is an SMPU master struct disable function. The SMPU protection settings will seize to take effect after successful completion of this function call.
base | The base address for the protection unit structure being configured. |
Status | Description |
---|---|
CY_PROT_SUCCESS | The Master PU struct was disabled. |
CY_PROT_FAILURE | The Master PU struct is enabled and possibly locked. |
cy_en_prot_status_t Cy_Prot_EnableSmpuSlaveStruct | ( | PROT_SMPU_SMPU_STRUCT_Type * | base | ) |
Enables the Slave SMPU structure.
This is an SMPU slave struct enable function. The SMPU protection settings will take effect after successful completion of this function call.
base | The base address for the protection unit structure being configured. |
Status | Description |
---|---|
CY_PROT_SUCCESS | The Slave PU struct was enabled. |
CY_PROT_FAILURE | The Slave PU struct is disabled and possibly locked. |
cy_en_prot_status_t Cy_Prot_DisableSmpuSlaveStruct | ( | PROT_SMPU_SMPU_STRUCT_Type * | base | ) |
Disables the Slave SMPU structure.
This is an SMPU slave struct disable function. The SMPU protection settings will seize to take effect after successful completion of this function call.
base | The base address for the protection unit structure being configured. |
Status | Description |
---|---|
CY_PROT_SUCCESS | The Slave PU struct was disabled. |
CY_PROT_FAILURE | The Slave PU struct is enabled and possibly locked. |