TI-RTOS Drivers  tidrivers_full_2_20_00_08
Data Structures | Macros | Typedefs | Functions
PowerCC26XX.h File Reference

Detailed Description

Power manager interface for CC26XX.

============================================================================

The Power header file should be included in an application as follows:

Refer to Power.h for a complete description of APIs.

Implementation

This module defines the power resources, constraints, events, sleep states and transition latency times for CC26XX.

A default power policy is provided which can transition the MCU from the active state to one of the supported power saving states.


#include <ti/sysbios/family/arm/m3/Hwi.h>
#include <ti/sysbios/knl/Clock.h>
#include <ti/drivers/Power.h>
Include dependency graph for PowerCC26XX.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  PowerCC26XX_ResourceRecord
 Power resource database record format. More...
 
struct  PowerCC26XX_Config
 Global configuration structure. More...
 
struct  PowerCC26XX_ModuleState
 Internal module state. More...
 

Macros

#define PowerCC26XX_RESUMETIMESTANDBY   750
 
#define PowerCC26XX_TOTALTIMESTANDBY   1000
 
#define PowerCC26XX_WAKEDELAYSTANDBY   130
 
#define PowerCC26XX_INITIALWAITRCOSC_LF   1000
 
#define PowerCC26XX_RETRYWAITRCOSC_LF   1000
 
#define PowerCC26XX_INITIALWAITXOSC_HF   50
 
#define PowerCC26XX_RETRYWAITXOSC_HF   50
 
#define PowerCC26XX_INITIALWAITXOSC_LF   10000
 
#define PowerCC26XX_RETRYWAITXOSC_LF   5000
 
#define PowerCC26XX_PERIPH_GPT0   0
 
#define PowerCC26XX_PERIPH_GPT1   1
 
#define PowerCC26XX_PERIPH_GPT2   2
 
#define PowerCC26XX_PERIPH_GPT3   3
 
#define PowerCC26XX_PERIPH_SSI0   4
 
#define PowerCC26XX_PERIPH_SSI1   5
 
#define PowerCC26XX_PERIPH_UART0   6
 
#define PowerCC26XX_PERIPH_I2C0   7
 
#define PowerCC26XX_PERIPH_TRNG   8
 
#define PowerCC26XX_PERIPH_GPIO   9
 
#define PowerCC26XX_PERIPH_UDMA   10
 
#define PowerCC26XX_PERIPH_CRYPTO   11
 
#define PowerCC26XX_PERIPH_I2S   12
 
#define PowerCC26XX_PERIPH_RFCORE   13
 
#define PowerCC26XX_XOSC_HF   14
 
#define PowerCC26XX_DOMAIN_PERIPH   15
 
#define PowerCC26XX_DOMAIN_SERIAL   16
 
#define PowerCC26XX_DOMAIN_RFCORE   17
 
#define PowerCC26XX_DOMAIN_SYSBUS   18
 
#define PowerCC26XX_NUMRESOURCES   19
 
#define PowerCC26XX_PERIPH   0x80
 
#define PowerCC26XX_SPECIAL   0x40
 
#define PowerCC26XX_DOMAIN   0x00
 
#define PowerCC26XX_PARENTMASK   0x3F
 
#define PowerCC26XX_NOPARENT   0x3F
 
#define PowerCC26XX_STANDBY   0x1
 
#define PowerCC26XX_ENABLE   1
 
#define PowerCC26XX_DISABLE   0
 
#define PowerCC26XX_SB_VIMS_CACHE_RETAIN   0
 
#define PowerCC26XX_SD_DISALLOW   1
 
#define PowerCC26XX_SB_DISALLOW   2
 
#define PowerCC26XX_IDLE_PD_DISALLOW   3
 
#define PowerCC26XX_NEED_FLASH_IN_IDLE   4
 
#define PowerCC26XX_NUMCONSTRAINTS   5
 
#define PowerCC26XX_ENTERING_STANDBY   0x1
 
#define PowerCC26XX_ENTERING_SHUTDOWN   0x2
 
#define PowerCC26XX_AWAKE_STANDBY   0x4
 
#define PowerCC26XX_AWAKE_STANDBY_LATE   0x8
 
#define PowerCC26XX_XOSC_HF_SWITCHED   0x10
 
#define PowerCC26XX_NUMEVENTS   5
 
#define PowerCC26XX_SETUP_CALIBRATE   1
 
#define PowerCC26XX_INITIATE_CALIBRATE   2
 
#define PowerCC26XX_DO_CALIBRATE   3
 

Typedefs

typedef uint8_t PowerCC26XX_Resource
 
typedef struct PowerCC26XX_ResourceRecord PowerCC26XX_ResourceRecord
 Power resource database record format. More...
 
typedef struct PowerCC26XX_Config PowerCC26XX_Config
 Global configuration structure. More...
 
typedef struct PowerCC26XX_ModuleState PowerCC26XX_ModuleState
 Internal module state. More...
 

Functions

bool PowerCC26XX_calibrate (unsigned int arg)
 RCOSC calibration. More...
 
void PowerCC26XX_doWFI (void)
 Wait for interrupt. More...
 
Clock_Handle PowerCC26XX_getClockHandle (void)
 Get the handle of a Clock object that a power policy can use to schedule wakeups. More...
 
uint32_t PowerCC26XX_getXoscStartupTime (uint32_t timeUntilWakeupInMs)
 Get the estimated crystal oscillator startup time in microseconds. More...
 
bool PowerCC26XX_injectCalibration (void)
 Explicitly trigger RCOSC calibration. More...
 
bool PowerCC26XX_noCalibrate (unsigned int arg)
 Do not perform calibration function. More...
 
void PowerCC26XX_switchXOSC_HF (void)
 Switch the HF clock source to XOSC_HF. More...
 
void PowerCC26XX_standbyPolicy (void)
 Power standby policy function. More...
 

Macro Definition Documentation

#define PowerCC26XX_RESUMETIMESTANDBY   750
#define PowerCC26XX_TOTALTIMESTANDBY   1000
#define PowerCC26XX_WAKEDELAYSTANDBY   130
#define PowerCC26XX_INITIALWAITRCOSC_LF   1000
#define PowerCC26XX_RETRYWAITRCOSC_LF   1000
#define PowerCC26XX_INITIALWAITXOSC_HF   50
#define PowerCC26XX_RETRYWAITXOSC_HF   50
#define PowerCC26XX_INITIALWAITXOSC_LF   10000
#define PowerCC26XX_RETRYWAITXOSC_LF   5000
#define PowerCC26XX_PERIPH_GPT0   0
#define PowerCC26XX_PERIPH_GPT1   1
#define PowerCC26XX_PERIPH_GPT2   2
#define PowerCC26XX_PERIPH_GPT3   3
#define PowerCC26XX_PERIPH_SSI0   4
#define PowerCC26XX_PERIPH_SSI1   5
#define PowerCC26XX_PERIPH_UART0   6
#define PowerCC26XX_PERIPH_I2C0   7
#define PowerCC26XX_PERIPH_TRNG   8
#define PowerCC26XX_PERIPH_GPIO   9
#define PowerCC26XX_PERIPH_UDMA   10
#define PowerCC26XX_PERIPH_CRYPTO   11
#define PowerCC26XX_PERIPH_I2S   12
#define PowerCC26XX_PERIPH_RFCORE   13
#define PowerCC26XX_XOSC_HF   14
#define PowerCC26XX_DOMAIN_PERIPH   15
#define PowerCC26XX_DOMAIN_SERIAL   16
#define PowerCC26XX_DOMAIN_RFCORE   17
#define PowerCC26XX_DOMAIN_SYSBUS   18
#define PowerCC26XX_NUMRESOURCES   19
#define PowerCC26XX_PERIPH   0x80
#define PowerCC26XX_SPECIAL   0x40
#define PowerCC26XX_DOMAIN   0x00
#define PowerCC26XX_PARENTMASK   0x3F
#define PowerCC26XX_NOPARENT   0x3F
#define PowerCC26XX_STANDBY   0x1
#define PowerCC26XX_ENABLE   1
#define PowerCC26XX_DISABLE   0
#define PowerCC26XX_SB_VIMS_CACHE_RETAIN   0
#define PowerCC26XX_SD_DISALLOW   1
#define PowerCC26XX_SB_DISALLOW   2
#define PowerCC26XX_IDLE_PD_DISALLOW   3
#define PowerCC26XX_NEED_FLASH_IN_IDLE   4
#define PowerCC26XX_NUMCONSTRAINTS   5
#define PowerCC26XX_ENTERING_STANDBY   0x1
#define PowerCC26XX_ENTERING_SHUTDOWN   0x2
#define PowerCC26XX_AWAKE_STANDBY   0x4
#define PowerCC26XX_AWAKE_STANDBY_LATE   0x8
#define PowerCC26XX_XOSC_HF_SWITCHED   0x10
#define PowerCC26XX_NUMEVENTS   5
#define PowerCC26XX_SETUP_CALIBRATE   1
#define PowerCC26XX_INITIATE_CALIBRATE   2
#define PowerCC26XX_DO_CALIBRATE   3

Typedef Documentation

typedef uint8_t PowerCC26XX_Resource

Power resource database record format.

Global configuration structure.

Internal module state.

Function Documentation

bool PowerCC26XX_calibrate ( unsigned int  arg)

RCOSC calibration.

If this function is plugged into the PowerCC26XX_Config structure 'calibrateFxn' field, RCOSC calibration is performed.

Parameters
argused internally
Returns
used internally
void PowerCC26XX_doWFI ( void  )

Wait for interrupt.

This function executes a Wait-For-Interrupt instruction. This can be used to set the PowerCC26XX_Config field 'policyFxn'.

Clock_Handle PowerCC26XX_getClockHandle ( void  )

Get the handle of a Clock object that a power policy can use to schedule wakeups.

Returns
The handle of the Clock object
uint32_t PowerCC26XX_getXoscStartupTime ( uint32_t  timeUntilWakeupInMs)

Get the estimated crystal oscillator startup time in microseconds.

Parameters
timeUntilWakeupInMsThe estimated time until the next wakeup event, in units of milliseconds
Returns
The estimated crystal oscillator startup latency, in units of microseconds.
bool PowerCC26XX_injectCalibration ( void  )

Explicitly trigger RCOSC calibration.

Returns
TRUE if calibration was actually initiated otherwise FALSE
bool PowerCC26XX_noCalibrate ( unsigned int  arg)

Do not perform calibration function.

If this function is plugged into the PowerCC26XX_Config structure 'calibrateFxn' field, no calibration is performed.

Parameters
argused internally
Returns
used internally
void PowerCC26XX_switchXOSC_HF ( void  )

Switch the HF clock source to XOSC_HF.

void PowerCC26XX_standbyPolicy ( void  )

Power standby policy function.

This policy will transition the device into the PowerCC26XX_STANDBY sleep state during CPU idle time. This is an agressive power policy function that will consider active constraints, sleep transition latencies, and the next expected wakeup, and automatically transition the device into the deepest sleep state possible.

The first goal is to enter PowerCC26XX_STANDBY; if that is not appropriate given current conditions (e.g., the sleep transition latency is greater greater than the time until the next scheduled Clock event), then the secondary goal is the IDLE_PD state; if that is disallowed (e.g., if the Power_IDLE_PD_DISALLOW constraint is declared), then the policy will fallback and simply invoke wait-for-interrupt, to clock gate the CPU until the next interrupt.

In order for this power policy to run, it must be set to the 'policyFxn' field in the PowerCC26XX_Config structure, and either the 'enablePolicy' field in the PowerCC26XX_Config structure must be set or Power_enablePolicy() must be called at runtime.

Copyright 2016, Texas Instruments Incorporated