#include <string.h>
static _Alignas(64) uint32_t icmDescriptorArea[4];
static _Alignas(128) uint32_t icmHashArea[8];
static _Alignas(4) uint32_t icmMonitoredData[16];
int32_t configure_icm_region_monitor(
IcmCallback_t callback, const
void *context)
{
(void)memset(&icmRegion0, 0, sizeof(icmRegion0));
icmRegion0.
start_addr = (uint32_t)icmMonitoredData;
#if (ICM_CLOCK_ID < 32U)
PMC_REGS->PMC_PCER0 = (1U << ICM_CLOCK_ID);
#else
PMC_REGS->PMC_PCER1 = (1U << ((uint32_t)ICM_CLOCK_ID - 32U));
#endif
ICM_CFG_BBC(2U) |
ICM_CFG_ASCD_Msk);
{
return -1;
}
{
return -1;
}
{
return -1;
}
{
return -1;
}
return 0;
}
#define ICM_RCFG_WRAP_Msk
Definition plib_icm.h:103
void ICM_SetCallbackHandler(IcmCallback_t callback, const void *context)
Register a callback function for ICM events.
void(* IcmCallback_t)(uint32_t status, const void *context)
ICM callback function type.
Definition plib_icm.h:190
void ICM_ResetSoftware(void)
Perform a software reset of the ICM peripheral.
void ICM_SetGlobalConfig(uint32_t cfgBits)
Write the ICM global configuration register (ICM_CFG).
void ICM_EnableInterrupt(uint8_t source, uint8_t regionIndex)
Enable a specified ICM interrupt source.
void ICM_Enable(void)
Enable the ICM peripheral.
bool ICM_EnableRegionMonitoring(uint8_t regionIndex)
Enable monitoring for a specified region.
bool ICM_ConfigureRegion(uint8_t regionIndex, const ICM_REGION_CONFIG_T *regionConfig)
Configure a region descriptor for monitoring.
#define ICM_RCTRL_TRSIZE(value)
Definition plib_icm.h:110
#define ICM_RCFG_ALGO(value)
Definition plib_icm.h:71
#define ICM_RCFG_ALGO_SHA256_Val
Definition plib_icm.h:73
bool ICM_SetDescriptorAddress(uint32_t address)
Set the region descriptor area base address (ICM_DSCR).
#define ICM_INTERRUPT_RDM
Definition plib_icm.h:157
bool ICM_SetHashAddress(uint32_t address)
Set the hash area base address (ICM_HASH).
#define ICM_INTERRUPT_RHC
Definition plib_icm.h:158
ICM region configuration structure.
Definition plib_icm.h:116
uint32_t start_addr
Definition plib_icm.h:117