Infineon Logo AIROC BTSDK v4.6 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
AIROC Sleep Configuration

This driver provides simplified access to the AIROC sleep framework on the CYW20819 device. More...

Modules

 Group_sleep_data_structures
 
 Group_sleep_defines
 
 Group_sleep_enums
 

Typedefs

typedef uint32_t(* wiced_sleep_allow_check_callback )(wiced_sleep_poll_type_t type)
 Prototype for the callback function that needs to be defined by the application. More...
 
typedef void(* wiced_sleep_post_sleep_callback )(wiced_bool_t restore_configuration)
 Application implements call back of this type to perform post sleep actions. More...
 

Functions

wiced_result_t wiced_sleep_configure (wiced_sleep_config_t *p_sleep_config)
 This API is used to configure various sleep mode parameters (see ) such as interrupt source, GPIO to be used as interrupt etc. More...
 
wiced_sleep_boot_type_t wiced_sleep_get_boot_mode (void)
 This API is used request the type of reboot. More...
 
wiced_result_t wiced_sleep_enter_hid_off (uint32_t wakeup_time, uint32_t wake_gpio_pin, wiced_sleep_wake_type_t wake_active_mode)
 This API is used to enter HID OFF mode. More...
 
wiced_sleep_wake_reason_t wiced_sleep_hid_off_wake_reason (void)
 API to get reset reason. More...
 

Detailed Description

This driver provides simplified access to the AIROC sleep framework on the CYW20819 device.

The following APIs allow the application layer to easily configure sleep parameters as well as communicate with the device Power Management Unit (PMU). Using this APIs the application can allow or disallow ePDS when asked by the callback from PMU as well as asynchronously enter HID-Off mode.

defgroup group_sleep_defines Defines defgroup group_sleep_enums ENUMs defgroup group_sleep_data_structures Data Structures

Typedef Documentation

typedef uint32_t(* wiced_sleep_allow_check_callback)(wiced_sleep_poll_type_t type)

Prototype for the callback function that needs to be defined by the application.

PMU will call this function whenever it want to enter low power mode (ePDS). The PMU will pass the parameter value either as WICED_SLEEP_POLL_TIME_TO_SLEEP or WICED_SLEEP_POLL_SLEEP_PERMISSION and the application needs to return appropriate value (see return description)

Parameters
[in]typePoll type can either be WICED_SLEEP_POLL_TIME_TO_SLEEP or WICED_SLEEP_POLL_SLEEP_PERMISSION (see wiced_sleep_poll_type_t)
Returns
if type == WICED_SLEEP_POLL_TIME_TO_SLEEP, application should return WICED_SLEEP_MAX_TIME_TO_SLEEP. if type == WICED_SLEEP_POLL_SLEEP_PERMISSION, application should return one of the values in wiced_sleep_permission_type_t

Note:- Application shall return immediately, with the return value specifying whether it allows/disallows sleep. Immediate return is required to allow the maximum time to sleep. Applications shall ensure that all peripheral activity (on PUART, SPI, .. ) is paused before allowing sleep. Any pending activity on the peripherals is lost when the device goes into sleep.

typedef void(* wiced_sleep_post_sleep_callback)(wiced_bool_t restore_configuration)

Application implements call back of this type to perform post sleep actions.

Parameters
[out]restore_configurationWICED_TRUE - reconfigure configured gpios and re-initialize configured peripherals WICED_FALSE - reconfiguration not required
Returns
void

Function Documentation

wiced_result_t wiced_sleep_configure ( wiced_sleep_config_t p_sleep_config)

This API is used to configure various sleep mode parameters (see ) such as interrupt source, GPIO to be used as interrupt etc.

Parameters
[in]p_sleep_configsee
Returns
WICED_SUCCESS or WICED_ERROR
wiced_result_t wiced_sleep_enter_hid_off ( uint32_t  wakeup_time,
uint32_t  wake_gpio_pin,
wiced_sleep_wake_type_t  wake_active_mode 
)

This API is used to enter HID OFF mode.

The application can call this API at any time when there is not Bluetooth activity

Parameters
[in]wakeup_time: wake up time in milliseconds. Application can configure for both GPIO wake and/or timed wake. Forever sleep(i.e. no timed wake) can be configure by setting wakeup_time = 0. The max time is 0x3fffff LPO cycles which is ~128010 milliseconds considering 32.768 KHz LPO. LPO can have 3000ppm error in some HW configurations.
[in]wake_gpio_pinLHL GPIO pin number. Range WICED_P00 to WICED_P39. If application does not need to support wake using GPIO, it shall use WICED_HAL_GPIO_PIN_UNUSED. if pin is not LHL pin, device can wake only after wakeup_time.
[in]wake_active_modePositive edge trigger or negative edge trigger wake can be configured using WICED_GPIO_ACTIVE_HIGH or WICED_GPIO_ACTIVE_LOW respectively.
Returns
WICED_ABORTED if HID off sleep aborts. Never returns if HID off sleep configure success.
Note
API must be called without any Bluetooth activity.
wiced_sleep_boot_type_t wiced_sleep_get_boot_mode ( void  )

This API is used request the type of reboot.

A device is said to cold boot if it is booting from power up or HID-Off mode whereas the device is going through a fast boot if it is booting from shutdown sleep

Parameters
None
Returns
wiced_sleep_boot_type_t
Note
This API is not used for CYW20819 as it doesn't support shutdown sleep
wiced_sleep_wake_reason_t wiced_sleep_hid_off_wake_reason ( void  )

API to get reset reason.

returns the reason for wakeup

Returns
wiced_reset_reason_t: Reason for wakeup