22.6.1 Wake-up Inputs
Any level change on the WKUP pin can trigger a wake-up. Wake-up is configured in the Mode register (SHDW_MR) and Wakeup Inputs register (SHDW_WUIR). The transition detector can be programmed to detect either a positive or negative transition on the WKUP pin. The detection can also be disabled. Programming is performed by enabling the bit Wake-up Input (WKUPEN0) and defining the bit Wake-up Input Type (WKUPT0) in SHDW_WUIR.
Moreover, a debouncing circuit can be programmed for WKUP. The debouncing circuit filters pulses on WKUP shorter than the programmed value in SHDW_MR.WKUPDBC. If the programmed level change is detected on a pin, a counter starts. When the counter reaches the value programmed in WKUPDBC, the SHDN pin is released. If a new input change is detected before the counter reaches the corresponding value, the counter is stopped and cleared. WKUPIS0 of the Status register (SHDW_SR) reports the detection of the programmed events on WKUP with a reset after the read of SHDW_SR.
The SHDWC can be programmed so as to activate the wake-up using the RTC and RTT alarms (detection of the rising edge event is synchronized with SLCK). This is done by writing SHDW_MR.RTCWKEN and RTTWKEN. When enabled, the detection of RTC and RTT alarms is reported in SHDW_SR.RTCWK and RTTWK. They are cleared after reading SHDW_SR. When using the RTC and RTT alarms to wake up the system, the user must ensure that RTC and RTT alarm status flags are cleared before shutting down the system. Otherwise, no rising edge of the status flags may be detected and the wake-up fails.