Tool/software: Code Composer Studio
Hello,
I am using the TMS320F28388D controller, I am reusing the example code provided by TI for the booting the CPU2 from CPU1 on FLASH SECTOR 0, i wanted to understand if the below code provided can be written in bitwise or register, do we have any example code for it.
I am interested in expanding the macros using the registers instead of base address
void SysCtl_controlCPU2Reset(SysCtl_CoreReset control)
{
UINT32 clearvalue;
//Based on whether the Core is to be reset or not,
//the core would be put into reset or brought out.
if(control != 0x0U)
{
EALLOW;
//On matching key, write to the reset bits would be successful
// Core reset is deactivated.
HWREG(DEVCFG_BASE + SYSCTL_O_CPU2RESCTL) =
((UINT32)SYSCTL_CPU2RESCTL_RESET | (SYSCTL_REG_KEY &
SYSCTL_CPU2RESCTL_KEY_M));
EDIS;
}
else
{
//->Invoke the macro EALLOW
EALLOW;
clearvalue = HWREG(DEVCFG_BASE + SYSCTL_O_CPU2RESCTL);
clearvalue &= ~SYSCTL_CPU2RESCTL_RESET;
HWREG(DEVCFG_BASE + SYSCTL_O_CPU2RESCTL) = (SYSCTL_REG_KEY &
SYSCTL_CPU2RESCTL_KEY_M) | clearvalue;
EDIS;
}
}
UINT16 SysCtl_isCPU2Reset(void)
{
return((HWREGH(DEVCFG_BASE + SYSCTL_O_RSTSTAT) & SYSCTL_RSTSTAT_CPU2RES)
== 0U);
}