PRELIMIN ARY
CYW920706WCDEVAL Hardware User Guide Doc. No.: 002-16535 Rev. **
43
Appendix A. Power-Save Options
The WICED Studio API provides two power-save options for CYW20706, each initiated by a function call. The power-save
options are:
Low Power Sleep Mode – reduced power consumption, device configured to sleep when idle, application is suspended.
Deep Sleep Power Save Mode - minimal power consumption, device largely inactive, application exits.
Applications can make use of either or both power save modes. Typically, the Deep Sleep Power Save Mode is used
when the battery level falls below a critical threshold. See below for details on each power save mode.
Note:
Refer to
wiced_power_save.h
in WICED Studio for all API functions and constants related to the available power-
save options.
A.1
Low Power Sleep Mode
Use
wiced_sleep_config
to configure CYW20706 to automatically enter and exit Low Power Sleep Mode operation. In this
mode, the device achieves power savings by suspending the application and allowing the device to sleep between BLE
advertising intervals.
Configuring Low Power Sleep Mode does not immediately put the device in low power mode, it simply enables the device to
transition to Low Power mode whenever idle. The application is suspended and resumed transparently by the device when it
enters and exits sleep.
The device wakeup can be triggered by any activity on an active peripheral, GPIO, the BT radio, or an interrupt from a timer
started by the application.
To enable Low Power Sleep Mode operation, call:
wiced_sleep_config(WICED_TRUE, NULL, NULL);
To disable Low Power Sleep Mode operation, call:
wiced_sleep_config(WICED_FALSE, NULL, NULL);
The second and third arguments are not needed for embedded SoC applications, they are only used in external MCU
scenarios where BT_DEV_WAKE (F8) can be used by an external MCU to wake the device, and BT_HOST_WAKE can be
used by the device as a wake signal to an external MCU.
A.2
Deep Sleep Power Save Mode
The APIs used to utilize Deep Sleep Power Save Mode are described below, followed by code snippets showing their usage.
Use
wiced_power_save_start
to instruct CYW20706 to enter the Deep Sleep Power Save Mode when idle.
The
wake_source
parameter in
wiced_power_save_start
indicates the wake-up source. The available choices are:
•
WICED_WAKE_SOURCE_GPIO
-
wake if any of the multiplexed GPIOs, also referred to as the LHL GPIOs (or GPIO_Pxx),
transition to an active state (positive edge trigger).
•
WICED_WAKE_SOURCE_TIMEOUT
- wake based on a timeout
•
WICED_WAKE_SOURCE_ALL
- wake either based on GPIOs or a timeout
The transition to Deep Sleep mode causes the currently running application to exit, so care must be taken to save any state
information that will be needed by the application upon waking up. When the device wakes from this power-save mode, the
application will be restarted. Therefore, an application utilizing this mode should retrieve any such saved state information
from a previous incarnation on every startup.
Use the following two API functions to save and restore application state information:
•
wiced_power_save_store_state
(use before transitioning into power-save mode)
•
wiced_power_save_retrieve_state
(use after waking from power-save mode)
Configuring Deep Sleep Power Save Mode does not immediately put the device to sleep, rather, it instructs the device that it
should transition to deep sleep if possible. The device will try to transition to deep sleep as soon as it determines the system
is idle, or until the operation has been aborted by an internal component.