Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
116
Ver.1.0.0
up by PAD and timer sources. In 5316 BLE SDK, the following three types of wakeup
sources are available.
enum
{
PM_WAKEUP_PAD
= BIT(4),
PM_WAKEUP_CORE
= BIT(5),
PM_WAKEUP_TIMER
= BIT(6),
};
CORE
32k timer
PAD
Suspend
Mode
Deepsleep
Mode
PA0
wakeup
wakeup
PA1
PC6
PC7
GPIO
WAKEUP
MODULE
.
.
.
.
.
.
.
.
.
wakeup
wakeup
wakeup
Figure 4-1 Hardware Wakeup Sources for 5316 MCU
As shown above, MCU can be woke up from low-power mode (suspend or deepsleep) by
hardware wakeup source TIMER, CORE or PAD.
The wakeup source “PM_WAKEUP_TIMER” is derived from hardware 32kHz RC timer.
This timer is correctly initialized in SDK, and user only needs to set this wakeup source in
“cpu_sleep_wakeup()”.
The two wakeup sources including “PM_WAKEUP_CORE” and “PM_WAKEUP_PAD”
are derived from GPIO. High/Low level of all GPIOs can be configured to wakeup MCU
from suspend/deepsleep via the CORE/PAD module. The CORE module can only
wakeup MCU from suspend, while the PAD module can wakeup MCU from both suspend
and deepsleep. However, 5316 BLE SDK, GPIO CORE works as wakeup source for
suspend, while GPIO PAD works as wakeup source for deepsleep.
As all the GPIO levels can wake up corresponding low power modes by CORE and PAD,
if users want to specify a level of certain GPIOs as the wakeup source, use the API
below
:
1) Configure GPIO CORE as wakeup source for suspend:
void gpio_set_wakeup(u32 pin, u32 level, int en);
“pin” indicates GPIO pin; “level” indicates wakeup trigger level, 1-high level wakeup,
0-
low level wakeup; “en”: 1-enable, 0-disable.