2020-12-17 05:59 AM
In my design i have 5 gpio that connecting my keypad , i have 3 row (gpio output ) an 2 col how input , one button keypad is ON/OFF.
For me the OFF state corrrespond to sleep state .
This is my problem -
Before of while i enter i sleep mode :
void PWR_EnterSleepMode(void)
{
/* Suspend tick increment to prevent wake up by SysTick interrupt. */
HAL_SuspendTick();
/* Enter Sleep mode. */
HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFE);
/* The codes below will be executed only after waked up from the Sleep
* mode. */
/* Resume tick interrupt if disabled prior to sleep mode entry. */
HAL_ResumeTick();
}
Then how wakeup my STM32l1 from sleep if I defined my gpio how input and output gpio .
The Mcu wake up just if hear a interrupt event (is right?)
I don't know.
Yu can help me .
BR.
2020-12-17 08:06 PM
Hello
Connecting a keypad like you wrote, implies an allways running scanning code.
An aproach to solve this is to use the col input on/off key's pin with EXTI to produce interrupts both edge.
Just before put mcu to sleep ensure that row output on/off key's pin is not in analog state but other rows are.
After wakeup from sleep, restore the functionality of rows and columns.
2020-12-18 07:34 AM
2020-12-18 10:39 AM
unfortunately source file is empty
2020-12-18 11:06 AM
2020-12-19 12:21 AM