AIROC™ BTSDK v4.9 - Documentation | ||||
Defines the interface for device low power managment. More...
Typedefs | |
typedef enum wiced_bt_lpm_poll_type_e | wiced_bt_lpm_poll_type_t |
The poll type of low power mode. | |
typedef enum wiced_bt_lpm_pmu_sleep_type_t | wiced_bt_lpm_pmu_sleep_type_t |
The sleep type of the power managment modole (PMU) | |
typedef uint32_t(* | wiced_bt_lpm_callback_fp )(wiced_bt_lpm_poll_type_t type, uint32_t context) |
This typedef is what is expected when registering a function as a callback. More... | |
Enumerations | |
enum | { WICED_BT_LPM_WAKE_SOURCE_GPIO = (1 << 8), WICED_BT_LPM_WAKE_SOURCE_LHL = WICED_BT_LPM_WAKE_SOURCE_GPIO, WICED_BT_LPM_WAKE_SOURCE_KEYSCAN = (1 << 6), WICED_BT_LPM_WAKE_SOURCE_QUAD = (1 << 7), WICED_BT_LPM_WAKE_SOURCE_MASK = (WICED_BT_LPM_WAKE_SOURCE_GPIO | WICED_BT_LPM_WAKE_SOURCE_KEYSCAN | WICED_BT_LPM_WAKE_SOURCE_QUAD) } |
The wake up sources. More... | |
enum | wiced_bt_lpm_poll_type_e { WICED_BT_LOW_POWER_MODE_POLL_TYPE_SLEEP = 0, WICED_BT_LOW_POWER_MODE_POLL_TYPE_SDS = 2 } |
The poll type of low power mode. More... | |
enum | wiced_bt_lpm_pmu_sleep_type_t { WICED_BT_PMU_SLEEP_NOT_ALLOWED = 0, WICED_BT_PMU_SLEEP_SDS_ALLOWED = 2, WICED_BT_PMU_SLEEP_NO_SDS = 5 } |
The sleep type of the power managment modole (PMU) More... | |
Functions | |
void | wiced_hal_lpm_init (void) |
Initialize device low power management module. More... | |
void | wiced_hal_lpm_enable_wake_from (uint32_t sources) |
Enables wake up from the given sources. More... | |
void | wiced_hal_lpm_register_for_wake_notification (uint8_t(*fn)(void *), void *data) |
Allows an application to register for wake notification that the wake source are enabled by wiced_hal_lpm_enable_wake_from(uint32_t sources). More... | |
wiced_bool_t | wiced_hal_lpm_register_for_low_power_queries (wiced_bt_lpm_callback_fp callback, uint32_t context) |
Adds the given object to the list of objects that need to be queried for sleep and SDS. More... | |
Defines the interface for device low power managment.
typedef uint32_t(* wiced_bt_lpm_callback_fp)(wiced_bt_lpm_poll_type_t type, uint32_t context) |
This typedef is what is expected when registering a function as a callback.
This callback function is expected to respond with time to sleep or if it is ok to enter shutdown sleep (SDS) or not.
when poll type is WICED_BT_LOW_POWER_MODE_POLL_TYPE_SLEEP, return value 0 indicates do not sleep; return value non-zero indicates the sleep time allowed. when poll type is WICED_BT_LOW_POWER_MODE_POLL_TYPE_SDS, return value WICED_BT_PMU_SLEEP_SDS_ALLOWED indicates OK to enter SDS. return value WICED_BT_PMU_SLEEP_NO_SDS indicates do not enter SDS;
anonymous enum |
The wake up sources.
The sleep type of the power managment modole (PMU)
void wiced_hal_lpm_enable_wake_from | ( | uint32_t | sources | ) |
Enables wake up from the given sources.
sources | - The WICED_BT_LPM_WAKE_SOURCE_* sources for wake. See bellowed: enum { /// Wake from GPIO WICED_BT_LPM_WAKE_SOURCE_GPIO = (1 << 8), /// Wake from LHL is the same as waking from GPIO WICED_BT_LPM_WAKE_SOURCE_LHL = WICED_BT_LPM_WAKE_SOURCE_GPIO, /// Wake from keyscan WICED_BT_LPM_WAKE_SOURCE_KEYSCAN = (1 << 6), /// Wake from wuadrature sensor WICED_BT_LPM_WAKE_SOURCE_QUAD = (1 << 7), /// All wake HID sources WICED_BT_LPM_WAKE_SOURCE_MASK = (WICED_BT_LPM_WAKE_SOURCE_GPIO | WICED_BT_LPM_WAKE_SOURCE_KEYSCAN | WICED_BT_LPM_WAKE_SOURCE_QUAD) }; |
void wiced_hal_lpm_init | ( | void | ) |
Initialize device low power management module.
none |
wiced_bool_t wiced_hal_lpm_register_for_low_power_queries | ( | wiced_bt_lpm_callback_fp | callback, |
uint32_t | context | ||
) |
Adds the given object to the list of objects that need to be queried for sleep and SDS.
callback | - The callback that needs to be invoked to check for sleep/SDS OK. The callback should decide very quickly and return within a few 10s of uS. |
context | - Any arbitrary context that the callback function may need later. Will be passed in as is when the callback is invoked. |
void wiced_hal_lpm_register_for_wake_notification | ( | uint8_t(*)(void *) | fn, |
void * | data | ||
) |
Allows an application to register for wake notification that the wake source are enabled by wiced_hal_lpm_enable_wake_from(uint32_t sources).
fn | - Pointer to function that will handle the wake notification |
data | - An opaque data that is handed to callback. |