English
Language : 

AN92584 Datasheet, PDF (12/42 Pages) Ramtron International Corporation – Designing for Low Power and Estimating Battery Life for BLE Applications
Designing for Low Power and Estimating Battery Life for BLE Applications
connect to it. */
apiResult = CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST);
/* Application-specific event handling here */
break;
/* Other application-specific event handling here */
case CYBLE_EVT_GAP_DEVICE_CONNECTED:
}
}
Power Management Functions
The power management functions control the application and system power mode transitions.
Application Power Management
The function ManageApplicationPower() manages the power state transitions for all the components used by
the application, except the BLE Component. Five application power states are defined. You should customize this
function for your application.
The ACTIVE power state indicates that the application is active. There is no specific action required when the
application is active.
The WAKEUP_SLEEP and WAKEUP_DEEPSLEEP states indicate that the system is waking up from the Sleep or
Deep-sleep mode, respectively. The application should also wake up the components from their Sleep or Deep-
Sleep modes.
The SLEEP and DEEP SLEEP states are entered when the application has completed all application processing and
is requested at the end of it to enter the Sleep or Deep-Sleep modes. The non-BLE components used by the
application are put into their respective Sleep or Deep-Sleep modes. Note that the definition of the Sleep and Deep-
Sleep are application-specific.
void ManageApplicationPower()
{
switch(applicationPower)
{
case ACTIVE: // don’t need to do anything
break;
case WAKEUP_SLEEP: // do whatever wakeup needs to be done
applicationPower = ACTIVE;
break;
case WAKEUP_DEEPSLEEP: // do whatever wakeup needs to be done.
applicationPower = ACTIVE;
break;
case SLEEP:
/***********************************************************************
* Place code to place the application components to sleep here
************************************************************************/
break;
case DEEPSLEEP:
/***********************************************************************
www.cypress.com
Document No. 001-92584 Rev. *A
12