Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
129
Ver.1.0.0
wakeup in advance). It will be recorded in the retention register DEEP_ANA_REG0
it’s the Conn state from which MCU enters current deepsleep. After wakeup, Slave
can configure fast adv packet to establish connection with Master as soon as
possible.
Slave is configured to enter deepsleep after 60s of no valid task, so as to save
power. Actually MCU can be configured not to enter deepsleep, as long as its power
consumption is very low to maintain connection. User needs to determine the
implementation considering actual requirement and power consumption.
When MCU enters deepsleep from Conn state, first Slave should invoke the
“bls_ll_terminateConnection” to send a “TERMINATE” command to Master, and
enter deepsleep after
this command is acked or the “BLT_EV_FLAG_TERMINATE”
is triggered by timeout.
4) User needs to manually set latency as 0, if long time sleep (long suspend duration)
is not allowed for task processing, such as key_not_released, DEVICE_LED_BUSY
(LONG_PRESS_KEY_POWER_OPTIMIZE is 0).
5) Based on step 4), after latency is disabled manually, MCU will wake up in each
conn_interval, thus power consumption is increased; since it
’s not needed to detect
key press and process LED task in every conn_interval, user can manually set
latency as other value and further optimize power consumption.
When the
” LONG_PRESS_KEY_POWER_OPTIMIZE” is 1, after key press is
stabilized (key_matrix_same_as_last_cnt > 5), user can set latency value manually.
If it’s configured as “bls_pm_setManualLatency (4)”, suspend will last for 5
conn_intervals. When conn_interval is 10 ms, MCU will wake up for every 50 ms
(10*(4+1) = 50ms) to process LED task and detect key press. Actually user needs to
consider the conn_interval value and task response time, and optimize power
consumption without influencing function correspondingly.
4.8 Timer Wakeup of APP Layer
In Advertising state or Conn state Slave role, once MCU enters suspend, it can be woke
up by stack only in specific moment, and users can hardly wake up MCU in advance. To
add flexibility of PM, a timer wakeup API in APP layer and corresponding callback
function are supplied in SDK. Below is the timer wakeup API in APP layer:
void
bls_pm_setAppWakeupLowPower
(
u32
wakeup_tick,
u8
enable);
“wakeup_tick” indicates absolute system tick value for timer wakeup.
enable: 1 - enable this wakeup function; 0 - disable this wakeup function.
When timer wakeup in APP layer is triggered, the callback function registerd by
“bls_pm_registerAppWakeupLowPowerCb” is executed. It’s prototype and API are as
follows:
typedef
void
(*
pm_appWakeupLowPower_callback_t
)(
int
);
void
bls_pm_registerAppWakeupLowPowerCb
(
pm_appWakeupLowPower_callback_t
cb);
When “bls_pm_setAppWakeupLowPower” is used to set app wakeup_tick for timer
wakeup in APP layer, before SDK bottom enters suspend, it will check whether this app