PSOC E8XXGP Device Support Library

| PSOC E8XXGP Device Support Library

Functions
Functions
PDL API Reference » MPC (Memory Protection Controller)

## General Description

## Functions
cy_en_mpc_status_t | Cy_Mpc_ConfigRotMpcStruct (MPC_Type *base, const uint32_t addOffset, const uint32_t size, const cy_stc_mpc_rot_cfg_t *rotConfig)
| Initializes the referenced mpc by setting the Protection Context (PC), NS/S and RW/R/W permissions. More...
cy_en_mpc_status_t | Cy_Mpc_ConfigMpcStruct (MPC_Type *base, const uint32_t addOffset, const uint32_t size, const cy_stc_mpc_cfg_t *config)
| Initializes the referenced MPC by setting the NS/S permissions. More...
cy_en_mpc_status_t | Cy_Mpc_GetRotBlockAttr (MPC_Type *base, const cy_en_mpc_prot_context_t pc, const uint32_t addOffset, cy_stc_mpc_rot_block_attr_t *p_block_settings)
| Get MPC attributes settings corresponding to block and the Protection Context (PC) for ROT (Root of Trust) More...
cy_en_mpc_status_t | Cy_Mpc_GetBlockAttr (MPC_Type *base, const uint32_t addOffset, cy_stc_mpc_block_attr_t *p_block_settings)
| Get MPC attributes settings corresponding to a block. More...
__STATIC_INLINE void | Cy_Mpc_Lock (MPC_Type *base)
| Locks the MPC configuration. More...
__STATIC_INLINE void | Cy_Mpc_RotLock (MPC_Type *base)
| Locks the MPC configuration for ROT (Root of Trust), this action cannot be undone. More...
__STATIC_INLINE void | Cy_Mpc_RotAutoInc (MPC_Type *base, uint8_t control)
| Auto increment of BLK ID for ROT (Root of Trust) More...
__STATIC_INLINE void | Cy_Mpc_AutoInc (MPC_Type *base, uint8_t control)
| Auto increment of BLK ID. More...
__STATIC_INLINE cy_en_mpc_status_t | Cy_Mpc_SetViolationResponse (MPC_Type *base, const cy_en_mpc_resp_cfg_t mpcResponse)
| Set MPC Violation Response. More...

## Function Documentation

## ◆ Cy_Mpc_ConfigRotMpcStruct()

cy_en_mpc_status_t Cy_Mpc_ConfigRotMpcStruct | ( | MPC_Type * | base,
|  | const uint32_t | addOffset,
|  | const uint32_t | size,
|  | const cy_stc_mpc_rot_cfg_t * | rotConfig
| ) |  |

Initializes the referenced mpc by setting the Protection Context (PC), NS/S and RW/R/W permissions.

This is called by ROT (Root of Trust) module.

Parameters

  base | Base address of MPC being configured
  addOffset | Offset in the memory from the memory start address to set permissions for
  size | Size of the memory to set permissions for
  rotConfig | MPC configuration structure to be used by the ROT code

Returns
  Initialization status

## ◆ Cy_Mpc_ConfigMpcStruct()

cy_en_mpc_status_t Cy_Mpc_ConfigMpcStruct | ( | MPC_Type * | base,
|  | const uint32_t | addOffset,
|  | const uint32_t | size,
|  | const cy_stc_mpc_cfg_t * | config
| ) |  |

Initializes the referenced MPC by setting the NS/S permissions.

Parameters

  base | Base address of MPC being configured
  addOffset | Offset in the memory from the memory start address to set permissions for
  size | Size of the memory to set permissions for
  config | MPC configuration structure to be used

Returns
  Initialization status

## ◆ Cy_Mpc_GetRotBlockAttr()

cy_en_mpc_status_t Cy_Mpc_GetRotBlockAttr | ( | MPC_Type * | base,
|  | const cy_en_mpc_prot_context_t | pc,
|  | const uint32_t | addOffset,
|  | cy_stc_mpc_rot_block_attr_t * | p_block_settings
| ) |  |

Get MPC attributes settings corresponding to block and the Protection Context (PC) for ROT (Root of Trust)

Parameters

  base | Base address of MPC being configured
  pc | Protection Context
  addOffset | Offset in the memory from the memory start address to get attributes for
  p_block_settings | Pointer to return value of block settings

Returns
  Initialization status

## ◆ Cy_Mpc_GetBlockAttr()

cy_en_mpc_status_t Cy_Mpc_GetBlockAttr | ( | MPC_Type * | base,
|  | const uint32_t | addOffset,
|  | cy_stc_mpc_block_attr_t * | p_block_settings
| ) |  |

Get MPC attributes settings corresponding to a block.

Parameters

  base | Base address of MPC being configured
  addOffset | Offset in the memory from the memory start address to get attributes for
  p_block_settings | Pointer to return value of block settings

Returns
  Initialization status

## ◆ Cy_Mpc_Lock()

__STATIC_INLINE void Cy_Mpc_Lock | ( | MPC_Type * | base | ) |

Locks the MPC configuration.

Note
  To release lock system reset should be performed

Parameters

  base | Base address of MPC being configured

## ◆ Cy_Mpc_RotLock()

__STATIC_INLINE void Cy_Mpc_RotLock | ( | MPC_Type * | base | ) |

Locks the MPC configuration for ROT (Root of Trust), this action cannot be undone.

Note
  To release lock system reset should be performed

Parameters

  base | Base address of mpc being configured

## ◆ Cy_Mpc_RotAutoInc()

__STATIC_INLINE void Cy_Mpc_RotAutoInc | ( | MPC_Type * | base,
|  | uint8_t | control
| ) |  |

Auto increment of BLK ID for ROT (Root of Trust)

Parameters

  base | Base address of mpc being configured
  control | Auto increment control

## ◆ Cy_Mpc_AutoInc()

__STATIC_INLINE void Cy_Mpc_AutoInc | ( | MPC_Type * | base,
|  | uint8_t | control
| ) |  |

Auto increment of BLK ID.

Parameters

  base | Base address of mpc being configured
  control | Auto increment control

## ◆ Cy_Mpc_SetViolationResponse()

__STATIC_INLINE cy_en_mpc_status_t Cy_Mpc_SetViolationResponse | ( | MPC_Type * | base,
|  | const cy_en_mpc_resp_cfg_t | mpcResponse
| ) |  |

Set MPC Violation Response.

Parameters

  base | Base address of MPC being configured
  mpcResponse | Enable/Disable MPC Response on violation

Returns
  API status

Note
  Not expected to be called by user application code