Data Structures | Macros | Typedefs | Functions
PowerCC26XX.h File Reference

Detailed Description

Power manager interface for CC26XX/CC13XX.

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

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

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

Implementation

This header file defines the power resources, constraints, events, sleep states and transition latencies for CC26XX/CC13XX.


#include <ti/sysbios/family/arm/m3/Hwi.h>
#include <ti/sysbios/knl/Clock.h>
#include <ti/drivers/Power.h>

Go to the source code of this file.

Data Structures

struct  PowerCC26XX_Config
 Global configuration structure. More...
 
struct  PowerCC26XX_ModuleState
 PowerCC26XX_ModuleState. 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_STANDBY   0x1
 
#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_DISALLOW_XOSC_HF_SWITCHING   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 Power_getPerformanceLevel(void)   0
 
#define Power_setPerformanceLevel(level)   Power_EFAIL
 

Typedefs

typedef struct PowerCC26XX_Config PowerCC26XX_Config
 Global configuration structure. More...
 
typedef struct PowerCC26XX_ModuleState PowerCC26XX_ModuleState
 PowerCC26XX_ModuleState. More...
 

Functions

bool PowerCC26XX_calibrate (unsigned int arg)
 The RC Oscillator (RCOSC) calibration function. More...
 
void PowerCC26XX_doWFI (void)
 The Wait for interrupt (WFI) policy. More...
 
Clock_Handle PowerCC26XX_getClockHandle (void)
 Get the handle of the Clock object used for scheduling device wakeups. More...
 
uint32_t PowerCC26XX_getXoscStartupTime (uint32_t timeUntilWakeupInMs)
 Get the estimated HF crystal oscillator (XOSC_HF) startup delay, for a given delay from now, until startup is initiated. More...
 
bool PowerCC26XX_injectCalibration (void)
 Explicitly trigger RC oscillator calibration. More...
 
bool PowerCC26XX_noCalibrate (unsigned int arg)
 Function to specify when RCOSC calibration is to be disabled. More...
 
bool PowerCC26XX_isStableXOSC_HF (void)
 Check if the XOSC_HF is stable and ready to be switched to. More...
 
void PowerCC26XX_switchXOSC_HF (void)
 Switch the HF clock source to XOSC_HF. More...
 
void PowerCC26XX_standbyPolicy (void)
 The STANDBY Power Policy. More...
 

Macro Definition Documentation

§ PowerCC26XX_RESUMETIMESTANDBY

#define PowerCC26XX_RESUMETIMESTANDBY   750

The latency to reserve for resume from STANDBY (usec).

§ PowerCC26XX_TOTALTIMESTANDBY

#define PowerCC26XX_TOTALTIMESTANDBY   1000

The total latency to reserve for entry to and exit from STANDBY (usec).

§ PowerCC26XX_WAKEDELAYSTANDBY

#define PowerCC26XX_WAKEDELAYSTANDBY   130

The initial delay when waking from STANDBY (usec).

§ PowerCC26XX_INITIALWAITRCOSC_LF

#define PowerCC26XX_INITIALWAITRCOSC_LF   1000

The initial wait time (usec) before checking if RCOSC_LF is stable.

§ PowerCC26XX_RETRYWAITRCOSC_LF

#define PowerCC26XX_RETRYWAITRCOSC_LF   1000

The retry wait time (usec) when checking to see if RCOSC_LF is stable.

§ PowerCC26XX_INITIALWAITXOSC_HF

#define PowerCC26XX_INITIALWAITXOSC_HF   50

The initial wait time (usec) before checking if XOSC_HF is stable.

§ PowerCC26XX_RETRYWAITXOSC_HF

#define PowerCC26XX_RETRYWAITXOSC_HF   50

The retry wait time (usec) when checking to see if XOSC_HF is stable.

§ PowerCC26XX_INITIALWAITXOSC_LF

#define PowerCC26XX_INITIALWAITXOSC_LF   10000

The initial wait time (usec) before checking if XOSC_LF is stable.

§ PowerCC26XX_RETRYWAITXOSC_LF

#define PowerCC26XX_RETRYWAITXOSC_LF   5000

The retry wait time (usec) when checking to see if XOSC_LF is stable.

§ PowerCC26XX_PERIPH_GPT0

#define PowerCC26XX_PERIPH_GPT0   0

Resource ID: General Purpose Timer 0

§ PowerCC26XX_PERIPH_GPT1

#define PowerCC26XX_PERIPH_GPT1   1

Resource ID: General Purpose Timer 1

§ PowerCC26XX_PERIPH_GPT2

#define PowerCC26XX_PERIPH_GPT2   2

Resource ID: General Purpose Timer 2

§ PowerCC26XX_PERIPH_GPT3

#define PowerCC26XX_PERIPH_GPT3   3

Resource ID: General Purpose Timer 3

§ PowerCC26XX_PERIPH_SSI0

#define PowerCC26XX_PERIPH_SSI0   4

Resource ID: Synchronous Serial Interface 0

§ PowerCC26XX_PERIPH_SSI1

#define PowerCC26XX_PERIPH_SSI1   5

Resource ID: Synchronous Serial Interface 1

§ PowerCC26XX_PERIPH_UART0

#define PowerCC26XX_PERIPH_UART0   6

Resource ID: UART 0

§ PowerCC26XX_PERIPH_I2C0

#define PowerCC26XX_PERIPH_I2C0   7

Resource ID: I2C 0

§ PowerCC26XX_PERIPH_TRNG

#define PowerCC26XX_PERIPH_TRNG   8

Resource ID: True Random Number Generator

§ PowerCC26XX_PERIPH_GPIO

#define PowerCC26XX_PERIPH_GPIO   9

Resource ID: General Purpose I/Os

§ PowerCC26XX_PERIPH_UDMA

#define PowerCC26XX_PERIPH_UDMA   10

Resource ID: uDMA Controller

§ PowerCC26XX_PERIPH_CRYPTO

#define PowerCC26XX_PERIPH_CRYPTO   11

Resource ID: AES Security Module

§ PowerCC26XX_PERIPH_I2S

#define PowerCC26XX_PERIPH_I2S   12

Resource ID: I2S

§ PowerCC26XX_PERIPH_RFCORE

#define PowerCC26XX_PERIPH_RFCORE   13

Resource ID: RF Core Module

§ PowerCC26XX_XOSC_HF

#define PowerCC26XX_XOSC_HF   14

Resource ID: High Frequency Crystal Oscillator

§ PowerCC26XX_DOMAIN_PERIPH

#define PowerCC26XX_DOMAIN_PERIPH   15

Resource ID: Peripheral Power Domain

§ PowerCC26XX_DOMAIN_SERIAL

#define PowerCC26XX_DOMAIN_SERIAL   16

Resource ID: Serial Power Domain

§ PowerCC26XX_DOMAIN_RFCORE

#define PowerCC26XX_DOMAIN_RFCORE   17

Resource ID: RF Core Power Domain

§ PowerCC26XX_DOMAIN_SYSBUS

#define PowerCC26XX_DOMAIN_SYSBUS   18

Resource ID: System Bus Power Domain

§ PowerCC26XX_STANDBY

#define PowerCC26XX_STANDBY   0x1

The STANDBY sleep state

§ PowerCC26XX_SB_VIMS_CACHE_RETAIN

#define PowerCC26XX_SB_VIMS_CACHE_RETAIN   0

Constraint: VIMS RAM must be retained while in STANDBY

§ PowerCC26XX_SD_DISALLOW

#define PowerCC26XX_SD_DISALLOW   1

Constraint: Disallow a transition to the SHUTDOWN state

§ PowerCC26XX_SB_DISALLOW

#define PowerCC26XX_SB_DISALLOW   2

Constraint: Disallow a transition to the STANDBY sleep state

§ PowerCC26XX_IDLE_PD_DISALLOW

#define PowerCC26XX_IDLE_PD_DISALLOW   3

Constraint: Disallow a transition to the IDLE_PD sleep state

§ PowerCC26XX_NEED_FLASH_IN_IDLE

#define PowerCC26XX_NEED_FLASH_IN_IDLE   4

Constraint: Flash memory needs to enabled during IDLE_PD

§ PowerCC26XX_DISALLOW_XOSC_HF_SWITCHING

#define PowerCC26XX_DISALLOW_XOSC_HF_SWITCHING   5

Constraint: Prevent power driver from starting an RTOS clock and automatically switching to the XOSC_HF when it is ready. The power driver will turn on the XOSC_HF and return control to the application. The application must poll the status of the XOSC_HF and make sure that it is stable before manually switching to it. If the constraint is released before the application has switched to the XOSC_HF, the application is still responsible for switching to the XOSC_HF. Failing to do so may cause an undefined internal state in the power driver.

§ PowerCC26XX_ENTERING_STANDBY

#define PowerCC26XX_ENTERING_STANDBY   0x1

Power event: The device is entering the STANDBY sleep state

§ PowerCC26XX_ENTERING_SHUTDOWN

#define PowerCC26XX_ENTERING_SHUTDOWN   0x2

Power event: The device is entering the SHUTDOWN state

§ PowerCC26XX_AWAKE_STANDBY

#define PowerCC26XX_AWAKE_STANDBY   0x4

Power event: The device is waking up from the STANDBY sleep state

§ PowerCC26XX_AWAKE_STANDBY_LATE

#define PowerCC26XX_AWAKE_STANDBY_LATE   0x8

Power event: The device is waking up from STANDBY (this event is sent later during wakeup, after interrupts are re-enabled)

§ PowerCC26XX_XOSC_HF_SWITCHED

#define PowerCC26XX_XOSC_HF_SWITCHED   0x10

Power event: The high frequency (HF) clock source has been switched to XOSC_HF

§ Power_getPerformanceLevel

#define Power_getPerformanceLevel (   void)    0

§ Power_setPerformanceLevel

#define Power_setPerformanceLevel (   level)    Power_EFAIL

Typedef Documentation

§ PowerCC26XX_Config

Global configuration structure.

§ PowerCC26XX_ModuleState

PowerCC26XX_ModuleState.

Power manager state structure. The application must not access any members of this structure!

Function Documentation

§ PowerCC26XX_calibrate()

bool PowerCC26XX_calibrate ( unsigned int  arg)

The RC Oscillator (RCOSC) calibration function.

The function to be used for performing RCOSC calibation. This is the default calibration function, and is specified via the calibrateFxn pointer in the PowerCC26XX_Config structure.

Parameters
argused internally
Returns
used internally

§ PowerCC26XX_doWFI()

void PowerCC26XX_doWFI ( void  )

The Wait for interrupt (WFI) policy.

This is a lightweight Power Policy which simply invokes CPU wait for interrupt.

This policy can be selected statically via the policyFxn pointer in the PowerCC26XX_Config structure, or dynamically at runtime, via Power_setPolicy().

§ PowerCC26XX_getClockHandle()

Clock_Handle PowerCC26XX_getClockHandle ( void  )

Get the handle of the Clock object used for scheduling device wakeups.

During initialization, the Power Manager creates a Clock object that a Power Policy can use to schedule device wakeups. This function can be called by a policy function to get the handle of this pre-allocated Clock object.

Returns
The handle of the Clock object

§ PowerCC26XX_getXoscStartupTime()

uint32_t PowerCC26XX_getXoscStartupTime ( uint32_t  timeUntilWakeupInMs)

Get the estimated HF crystal oscillator (XOSC_HF) startup delay, for a given delay from now, until startup is initiated.

Parameters
timeUntilWakeupInMsThe estimated time until the next wakeup event, in units of milliseconds
Returns
The estimated HF crystal oscillator startup latency, in units of microseconds.

§ PowerCC26XX_injectCalibration()

bool PowerCC26XX_injectCalibration ( void  )

Explicitly trigger RC oscillator calibration.

When enabled, RCOSC calibration is normally triggered upon each device wakeup from STANDBY. To trigger more frequent calibration, an application can explicitly call this function, to initiate an immediate calibration cycle.

Returns
TRUE if calibration was actually initiated otherwise FALSE

§ PowerCC26XX_noCalibrate()

bool PowerCC26XX_noCalibrate ( unsigned int  arg)

Function to specify when RCOSC calibration is to be disabled.

This function should be specified as the 'calibrateFxn' in the PowerCC26XX_Config structure when RCOSC calibration is to be disabled.

Note that the reason a function pointer is used here (versus a simple Boolean) is so that references to internal calibration subroutines can be removed, to eliminate pulling the calibration code into the application image; this enables a significant reduction in memory footprint when calibration is disabled.

Parameters
argused internally
Returns
used internally

§ PowerCC26XX_isStableXOSC_HF()

bool PowerCC26XX_isStableXOSC_HF ( void  )

Check if the XOSC_HF is stable and ready to be switched to.

Precondition
Set PowerCC26XX_DISALLOW_XOSC_HF_SWITCHING in the early standby wakeup notification.

This function should be called when using the PowerCC26XX_DISALLOW_XOSC_HF_SWITCHING power constraint to ensure that the XOSC_HF is stable before switching to it.

See also
PowerCC26XX_switchXOSC_HF()

§ PowerCC26XX_switchXOSC_HF()

void PowerCC26XX_switchXOSC_HF ( void  )

Switch the HF clock source to XOSC_HF.

Precondition
PowerCC26XX_switchXOSC_HF() returns true.

This function should only be called when using the PowerCC26XX_DISALLOW_XOSC_HF_SWITCHING power constraint after ensuring the XOSC_HF is stable.

See also
PowerCC26XX_isStableXOSC_HF()

§ PowerCC26XX_standbyPolicy()

void PowerCC26XX_standbyPolicy ( void  )

The STANDBY Power Policy.

This is an agressive Power Policy, which considers active constraints, sleep state transition latencies, and time until the next scheduled work, and automatically transitions the device into the deepest sleep state possible.

The first goal is to enter 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 PowerCC26XX_IDLE_PD_DISALLOW constraint is declared), then the policy will fallback and simply invoke WFI, to clock gate the CPU until the next interrupt.

In order for this policy to run, it must be selected as the Power Policy (either by being specified as the 'policyFxn' in the PowerCC26XX_Config structure, or specified at runtime with Power_setPolicy()), and the Power Policy must be enabled (either via 'enablePolicy' in the PowerCC26XX_Config structure, or via a call to Power_enablePolicy() at runtime).

Copyright 2017, Texas Instruments Incorporated