Power Management.pdf
(893.33 KB)
/* Set power level to Power Level 0 */
SYS->PLCTL = (SYS->PLCTL&(~SYS_PLCTL_PLSEL_Msk))|SYS_PLCTL_PLSEL_PL0;
/* Set power level to Power Level 0 */
SYS_SetPowerLevel(SYS_PLCTL_PLSEL_PL0);
/* Set power level to Power Level 3 */
SYS->PLCTL = (SYS->PLCTL&(~SYS_PLCTL_PLSEL_Msk))|SYS_PLCTL_PLSEL_PL3;
/* Set power level to Power Level 3 */
SYS_SetPowerLevel(SYS_PLCTL_PLSEL_PL3);
/* Set idle mode */
void CLK_Idle(void)
{
/* Set the processor uses sleep as its low power mode */
SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk;
/* Set chip in Idle mode because of WFI command */
CLK->PWRCTL &= ~CLK_PWRCTL_PDEN_Msk;
/* Chip enter Idle mode after CPU run WFI instruction */
__WFI();
}
|