Power Management¶
All power-managment functionality is handled by the TI-RTOS power driver and are used by the peripheral drivers (e.g. UART, SPI, I2C, etc..). Applications can prevent, if they choose, the CC13xx or CC26xx from entering low power modes by setting a power constraint.
By default, all the examples in SimpleLink CC13xx/CC26xx SDK will put the CC13xx or CC26xx in standby mode if there is no task running. This is achieved by configuring the TI power driver and the kernel to do so, as shown in the following step.
In the
.cfg
or.xscfg
, you can find the following setting:/* ================ Idle configuration ================ */ var Idle = xdc.useModule('ti.sysbios.knl.Idle'); /* * The Idle module is used to specify a list of functions to be called when no * other tasks are running in the system. * * Functions added here will be run continuously within the idle task. * * Function signature: * Void func(Void); */ /* Allow power management */ Idle.addFunc('&Power_idleFunc');
By doing this, the TI-RTOS kernel will call Power_idleFunc whenever this is no task running.
Power_idleFunc
takes in policyFxn and policyFxn is defined using SysConfig tool Figure 63.. By default, TI sets thePowerCCxxxx_standbyPolicy
as policyFxn.Power_idleFunc
is defined in{SDK_INSTALL_DIR}\source\ti\drivers\power\PowerCCxxxx.c
andPowerCCxxxx_standbyPolicy
can be found in{SDK_INSTALL_DIR}\kernel\tirtos\packages\ti\dpl\PowerCCxxxx_tirtos.c
In the sysconfig generated files, you will find the following example in ti_drivers_config.c.
1const PowerCC26XX_Config PowerCC26XX_config = { 2 .enablePolicy = true, 3 .policyInitFxn = NULL, 4 .policyFxn = PowerCC26XX_standbyPolicy, 5 .calibrateFxn = PowerCC26XX_calibrate, 6 .calibrateRCOSC_LF = true, 7 .calibrateRCOSC_HF = true, 8 .enableTCXOFxn = NULL 9};
More information on power-management functionality, see Power Management User’s Guide. These APIs are required only when using a custom driver.
With BLE5-Stack applications, the power contraint is set in main()
by
defining the POWER_SAVINGS
preprocessor symbol. When defined,
enabled, the device enters and exits sleep as required for BLE5-Stack events,
peripheral events, application timers, and so forth. When undefined, the
device stays awake.
Also see Measuring Bluetooth Smart Power Consumption for steps to analyze the system power consumption and battery life.