How can I configure the CPU to wake up from Deep Sleep mode using a normal GPIO interrupt? I have configured SCB->SCR and CLK->PWRCTL to configure deep sleep mode. It is mentioned in the TRM that only LIRC and LIXT clocks are enabled during deep sleep. How can I enable GPIO interrupts as well?
[EDIT]
Now I am having trouble using timers in deep sleep mode. Attached are the code snippets.
I am using Timer3 in through LIRC.
Code: Select all
/* Enable LIRC clock (Internal RC 10Khz) */
CLK_EnableXtalRC(CLK_PWRCTL_LIRCEN_Msk);
/* Wait for HIRC clock ready */
CLK_WaitClockReady(CLK_STATUS_LIRCSTB_Msk);
CLK_EnableModuleClock(TMR3_MODULE);
CLK_SetModuleClock(TMR3_MODULE, CLK_CLKSEL1_TMR3SEL_LIRC, 0);
Code: Select all
/* Open Timer3 in periodic mode, enable interrupt and 1 interrupt ticks per second */
TIMER_Open(TIMER3, TIMER_PERIODIC_MODE, 1);
TIMER_EnableInt(TIMER3);
NVIC_SetPriority(TMR3_IRQn, TMR3_PRIORITY);
NVIC_EnableIRQ(TMR3_IRQn);
Code: Select all
if(u8_DEEPSLP == TRUE)
{
u8_DEEPSLP = FALSE;
TIMER_Start(TIMER3);
CLK_PowerDown();
}
Code: Select all
void TMR3_IRQHandler(void)
{
if(TIMER_GetIntFlag(TIMER3) == 1)
{
/* Clear Timer3 time-out interrupt flag */
TIMER_ClearIntFlag(TIMER3);
LED2 = ledState;
ledState = !ledState;
}
}