Data Structures | Macros | Typedefs | Enumerations | Functions
PowerCC27XX.h File Reference

Detailed Description

Power manager interface for CC27XX.

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

The Power header file should be included in an application by including the top level header file 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 CC27XX.

HFXT Amplitude Compensation

The CC27XX Power driver will configure the HFXT amplitude to the highest possible value at boot (in Power_init()). Each time the device enters standby the HFXT amplitude will be updated to ensure the optimal amplitude is used. It will take up to 5 iterations (5 standby entries) after boot until the optimal amplitude has been found. This process will ensure that the amplitude is kept in an optimal range if the operating conditions change, as long as the device regularly enters standby.

Applications that rarely enters standby

The amplitude adjustments done at standby entry is sufficient for applications that regularly enters standby, but if the application does not regularly enter standby, then PowerLPF3_getHfxtAmpAdjustment() and PowerLPF3_adjustHfxtAmp() can be used to check if an adjustment is needed, and perform the adjustment if needed.

Initial HFXT Amplitude Compensation

If the application requires that the HFXT amplitude is already in the optimal range after boot, then Initial HFXT Amplitude Compensation can be enabled with PowerCC27XX_Config.startInitialHfxtAmpCompFxn. If initial HFXT amplitude compensation is enabled, the optimal amplitude will be found at/after boot, meaning it will take longer before HFXT is ready after boot, but when it is ready the amplitude will already be in the optimal range. This process is done asynchronously, so the application can do other tasks while waiting for HFXT to be ready.

Enabling initial HFXT amplitude compensation will result in more flash usage and longer time from boot to the first RF operation.

HFXT Temperature Compensation (Software TCXO)

HFXT frequency is known to vary with temperature, landing outside acceptable operational range. By enabling compensation, the device will correct for this variation above the selected temperature. The compensation is enabled by default on CC27X0 devices. The ppm offset used to compensate the HFXT can be approximated by a third order polynomial function of temperature in Celsius, see PowerLPF3_initHFXTCompensation().

TFM Enabled Applications

The Power driver has certain restrictions and limitations in TFM enabled application and certain APIs operate slightly differently compared to secure-only applications. Some APIs are also not available from non-secure contexts.

Constraints and Resource Dependencies

When called from non-secure context, Power_getDependencyCount(), Power_getConstraintCount() and Power_getConstraintMask() will return the non-secure dependency count, constraint count and constraint mask, respectively. This means that a count or mask bit of zero does not necessarily mean that there are no dependencies or constraints set, since the secure side might still have a dependency or constraints set.

Unavailable APIs from Non-Secure Context

#include <ti/drivers/dpl/HwiP.h>
#include <ti/drivers/dpl/ClockP.h>
#include <ti/drivers/Power.h>
#include <ti/devices/DeviceFamily.h>
#include <DeviceFamily_constructPath(inc/hw_pmctl.h)>
#include <DeviceFamily_constructPath(inc/hw_clkctl.h)>
#include <DeviceFamily_constructPath(inc/hw_lrfddbell.h)>
#include <DeviceFamily_constructPath(inc/hw_memmap.h)>
#include <DeviceFamily_constructPath(inc/hw_types.h)>
#include <DeviceFamily_constructPath(driverlib/pmctl.h)>
Include dependency graph for PowerCC27XX.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  PowerCC27XX_Config
 Global configuration structure. More...
 
struct  PowerLPF3_LfoscCompensationProfile
 LFOSC Compensation Profile structure. More...
 

Macros

#define PowerCC27XX_RESUMETIMESTANDBY   (400U)
 
#define PowerCC27XX_TOTALTIMESTANDBY   (500U)
 
#define PowerCC27XX_WAKEDELAYSTANDBY   (150U)
 
#define PowerCC27XX_HFXT_THRESHOLD_TEMP_DEFAULT   (-40)
 
#define PowerLPF3_PERIPH_GPIO   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_GPIO_S)
 
#define PowerLPF3_PERIPH_UART0   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_UART0_S)
 
#define PowerLPF3_PERIPH_UART1   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_UART1_S)
 
#define PowerLPF3_PERIPH_I2C0   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_I2C0_S)
 
#define PowerLPF3_PERIPH_SPI0   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_SPI0_S)
 
#define PowerLPF3_PERIPH_SPI1   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_SPI1_S)
 
#define PowerLPF3_PERIPH_ADC0   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_ADC0_S)
 
#define PowerLPF3_PERIPH_AES   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_LAES_S)
 
#define PowerLPF3_PERIPH_DMA   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_DMA_S)
 
#define PowerLPF3_PERIPH_I2S   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_I2S_S)
 
#define PowerLPF3_PERIPH_LGPT0   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_LGPT0_S)
 
#define PowerLPF3_PERIPH_LGPT1   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_LGPT1_S)
 
#define PowerLPF3_PERIPH_LGPT2   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_LGPT2_S)
 
#define PowerLPF3_PERIPH_LGPT3   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_LGPT3_S)
 
#define PowerLPF3_PERIPH_HSM   (PowerCC27XX_PERIPH_GROUP_CLKCTL1 | CLKCTL_DESCEX1_HSM_S)
 
#define PowerLPF3_PERIPH_APU   (PowerCC27XX_PERIPH_GROUP_CLKCTL1 | CLKCTL_DESCEX1_APU_S)
 
#define PowerLPF3_PERIPH_MCAN   (PowerCC27XX_PERIPH_GROUP_CLKCTL1 | CLKCTL_DESCEX1_MCAN_S)
 
#define PowerLPF3_PERIPH_LFRD_TRC   (PowerCC27XX_PERIPH_GROUP_LRFD | LRFDDBELL_CLKCTL_TRC_S)
 
#define PowerLPF3_PERIPH_LFRD_S2RRAM   (PowerCC27XX_PERIPH_GROUP_LRFD | LRFDDBELL_CLKCTL_S2RRAM_S)
 
#define PowerLPF3_STANDBY   (0x1U)
 
#define PowerLPF3_ENTERING_STANDBY   ((uint_fast16_t)((uint_fast16_t)1U << 0))
 
#define PowerLPF3_ENTERING_SHUTDOWN   ((uint_fast16_t)((uint_fast16_t)1U << 1))
 
#define PowerLPF3_AWAKE_STANDBY   ((uint_fast16_t)((uint_fast16_t)1U << 2))
 
#define PowerLPF3_HFXT_AVAILABLE   ((uint_fast16_t)((uint_fast16_t)1U << 3))
 
#define PowerLPF3_LFCLK_SWITCHED   ((uint_fast16_t)((uint_fast16_t)1U << 4))
 

Typedefs

typedef void(* PowerLPF3_StartInitialHfxtAmpCompFxn) (void)
 Function pointer to PowerLPF3_startInitialHfxtAmpComp() or NULL. More...
 

Enumerations

enum  PowerLPF3_ResetReason {
  PowerLPF3_RESET_SHUTDOWN_IO = PMCTL_RESET_SHUTDOWN_IO, PowerLPF3_RESET_SHUTDOWN_SWD = PMCTL_RESET_SHUTDOWN_SWD, PowerLPF3_RESET_WATCHDOG = PMCTL_RESET_WATCHDOG, PowerLPF3_RESET_SYSTEM = PMCTL_RESET_SYSTEM,
  PowerLPF3_RESET_CPU = PMCTL_RESET_CPU, PowerLPF3_RESET_LOCKUP = PMCTL_RESET_LOCKUP, PowerLPF3_RESET_TSD = PMCTL_RESET_TSD, PowerLPF3_RESET_SWD = PMCTL_RESET_SWD,
  PowerLPF3_RESET_LFXT = PMCTL_RESET_LFXT, PowerLPF3_RESET_VDDR = PMCTL_RESET_VDDR, PowerLPF3_RESET_VDDS = PMCTL_RESET_VDDS, PowerLPF3_RESET_PIN = PMCTL_RESET_PIN,
  PowerLPF3_RESET_POR = PMCTL_RESET_POR, PowerLPF3_RESET_UNKNOWN = UINT32_MAX, PowerLPF3_RESET_SHUTDOWN_IO = PMCTL_RESET_SHUTDOWN_IO, PowerLPF3_RESET_SHUTDOWN_SWD = PMCTL_RESET_SHUTDOWN_SWD,
  PowerLPF3_RESET_WATCHDOG = PMCTL_RESET_WATCHDOG, PowerLPF3_RESET_SYSTEM = PMCTL_RESET_SYSTEM, PowerLPF3_RESET_CPU = PMCTL_RESET_CPU, PowerLPF3_RESET_LOCKUP = PMCTL_RESET_LOCKUP,
  PowerLPF3_RESET_TSD = PMCTL_RESET_TSD, PowerLPF3_RESET_SWD = PMCTL_RESET_SWD, PowerLPF3_RESET_LFXT = PMCTL_RESET_LFXT, PowerLPF3_RESET_VDDR = PMCTL_RESET_VDDR,
  PowerLPF3_RESET_VDDS = PMCTL_RESET_VDDS, PowerLPF3_RESET_PIN = PMCTL_RESET_PIN, PowerLPF3_RESET_POR = PMCTL_RESET_POR, PowerLPF3_RESET_UNKNOWN = UINT32_MAX
}
 Reasons the device has booted or rebooted. More...
 
enum  PowerLPF3_AfoscFreq { PowerLPF3_AFOSC_FREQ_80MHZ = 80000000U, PowerLPF3_AFOSC_FREQ_90P3168MHZ = 90316800U, PowerLPF3_AFOSC_FREQ_98P304MHZ = 98304000U }
 The possible frequencies to configure the AFOSC to. More...
 
enum  PowerLPF3_LfoscCompensationPpmRequirement { PowerLPF3_LFOSC_PPM_500 = 500U }
 Possible LFOSC PPM requirements to be used by the LFOSC compensation. More...
 

Functions

void PowerCC27XX_doWFI (void)
 The wait for interrupt (WFI) policy. More...
 
PowerLPF3_ResetReason PowerLPF3_getResetReason (void)
 Returns the reason for the most recent reset or wakeup. More...
 
void PowerLPF3_releaseLatches (void)
 Unlatch all IOs. More...
 
void PowerCC27XX_standbyPolicy (void)
 The STANDBY Power Policy. More...
 
void PowerLPF3_selectLFOSC (void)
 Select LFOSC as LFCLK source. More...
 
void PowerLPF3_selectLFXT (void)
 Select LFXT as LFCLK source. More...
 
void PowerLPF3_selectEXTLF (void)
 Select EXTLF as LFCLK source. More...
 
void PowerLPF3_initHFXTCompensation (int32_t P0, int32_t P1, int32_t P2, int32_t P3, uint8_t shift, bool fcfgInsertion)
 Initialize HFXT temperature compensation coefficients. More...
 
void PowerLPF3_enableHFXTCompensation (int16_t tempThreshold, int16_t tempDelta)
 Enable HFXT temperature compensation. More...
 
void PowerLPF3_disableHFXTCompensation (void)
 Disable HFXT temperature compensation. More...
 
void PowerLPF3_forceHFXTCompensationUpdate (void)
 Force HFXT temperature compensation update. More...
 
uint32_t PowerLPF3_getHFXTCompensationRatio (void)
 Get the current HFXT compensation ratio. More...
 
int_fast16_t PowerLPF3_startAFOSC (PowerLPF3_AfoscFreq frequency)
 Start the AFOSC. More...
 
void PowerLPF3_stopAFOSC (void)
 Stop the AFOSC. More...
 
void PowerLPF3_startInitialHfxtAmpComp (void)
 Start initial compensation of the HFXT amplitude. More...
 
int_fast8_t PowerLPF3_getHfxtAmpAdjustment (void)
 Check if HFXT amplitude needs to be adjusted. More...
 
void PowerLPF3_adjustHfxtAmp (int_fast8_t adjustment)
 Adjust the HFXT amplitude. More...
 
void PowerLPF3_initLfoscCompensation (void)
 Initialize LFOSC Compensation. More...
 
void PowerLPF3_setLfoscCompensationProfile (const PowerLPF3_LfoscCompensationProfile *profile)
 Set LFOSC Compensation Profile. More...
 
void PowerLPF3_enableLfoscCompensation (void)
 Enable LFOSC Compensation. More...
 
void PowerLPF3_disableLfoscCompensation (void)
 Disable LFOSC Compensation. More...
 
int_fast16_t PowerLPF3_sleep (uint32_t nextEventTimeUs)
 Transition the device into standby and configure RTC to wakeup the device ahead of a specified time. More...
 
bool PowerLPF3_isLfincFilterAllowingStandby (void)
 Checks if the LFINC filter is ready to go to standby or not. More...
 
void PowerCC27XX_schedulerDisable (void)
 
void PowerCC27XX_schedulerRestore (void)
 

Macro Definition Documentation

§ PowerCC27XX_RESUMETIMESTANDBY

#define PowerCC27XX_RESUMETIMESTANDBY   (400U)

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

§ PowerCC27XX_TOTALTIMESTANDBY

#define PowerCC27XX_TOTALTIMESTANDBY   (500U)

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

§ PowerCC27XX_WAKEDELAYSTANDBY

#define PowerCC27XX_WAKEDELAYSTANDBY   (150U)

The initial delay when waking from STANDBY (usec).

§ PowerCC27XX_HFXT_THRESHOLD_TEMP_DEFAULT

#define PowerCC27XX_HFXT_THRESHOLD_TEMP_DEFAULT   (-40)

§ PowerLPF3_PERIPH_GPIO

#define PowerLPF3_PERIPH_GPIO   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_GPIO_S)

Resource ID: General Purpose I/O

§ PowerLPF3_PERIPH_UART0

#define PowerLPF3_PERIPH_UART0   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_UART0_S)

Resource ID: UART 0

§ PowerLPF3_PERIPH_UART1

#define PowerLPF3_PERIPH_UART1   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_UART1_S)

Resource ID: UART 1

§ PowerLPF3_PERIPH_I2C0

#define PowerLPF3_PERIPH_I2C0   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_I2C0_S)

Resource ID: I2C 0

§ PowerLPF3_PERIPH_SPI0

#define PowerLPF3_PERIPH_SPI0   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_SPI0_S)

Resource ID: SPI 0

§ PowerLPF3_PERIPH_SPI1

#define PowerLPF3_PERIPH_SPI1   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_SPI1_S)

Resource ID: SPI 1

§ PowerLPF3_PERIPH_ADC0

#define PowerLPF3_PERIPH_ADC0   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_ADC0_S)

Resource ID: ADC

§ PowerLPF3_PERIPH_AES

#define PowerLPF3_PERIPH_AES   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_LAES_S)

Resource ID: AES Security Module

§ PowerLPF3_PERIPH_DMA

#define PowerLPF3_PERIPH_DMA   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_DMA_S)

Resource ID: uDMA Controller

§ PowerLPF3_PERIPH_I2S

#define PowerLPF3_PERIPH_I2S   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_I2S_S)

Resource ID: I2S

§ PowerLPF3_PERIPH_LGPT0

#define PowerLPF3_PERIPH_LGPT0   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_LGPT0_S)

Resource ID: General Purpose Timer 0

§ PowerLPF3_PERIPH_LGPT1

#define PowerLPF3_PERIPH_LGPT1   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_LGPT1_S)

Resource ID: General Purpose Timer 1

§ PowerLPF3_PERIPH_LGPT2

#define PowerLPF3_PERIPH_LGPT2   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_LGPT2_S)

Resource ID: General Purpose Timer 2

§ PowerLPF3_PERIPH_LGPT3

#define PowerLPF3_PERIPH_LGPT3   (PowerCC27XX_PERIPH_GROUP_CLKCTL0 | CLKCTL_DESCEX0_LGPT3_S)

Resource ID: General Purpose Timer 3

§ PowerLPF3_PERIPH_HSM

#define PowerLPF3_PERIPH_HSM   (PowerCC27XX_PERIPH_GROUP_CLKCTL1 | CLKCTL_DESCEX1_HSM_S)

Resource ID: Hardware Security Module

§ PowerLPF3_PERIPH_APU

#define PowerLPF3_PERIPH_APU   (PowerCC27XX_PERIPH_GROUP_CLKCTL1 | CLKCTL_DESCEX1_APU_S)

Resource ID: Algorithm Processing Unit

§ PowerLPF3_PERIPH_MCAN

#define PowerLPF3_PERIPH_MCAN   (PowerCC27XX_PERIPH_GROUP_CLKCTL1 | CLKCTL_DESCEX1_MCAN_S)

Resource ID: MCAN

§ PowerLPF3_PERIPH_LFRD_TRC

#define PowerLPF3_PERIPH_LFRD_TRC   (PowerCC27XX_PERIPH_GROUP_LRFD | LRFDDBELL_CLKCTL_TRC_S)

Resource ID: LRFD Tracer

§ PowerLPF3_PERIPH_LFRD_S2RRAM

#define PowerLPF3_PERIPH_LFRD_S2RRAM   (PowerCC27XX_PERIPH_GROUP_LRFD | LRFDDBELL_CLKCTL_S2RRAM_S)

Resource ID: LRFD S2R RAM

§ PowerLPF3_STANDBY

#define PowerLPF3_STANDBY   (0x1U)

The STANDBY sleep state

§ PowerLPF3_ENTERING_STANDBY

#define PowerLPF3_ENTERING_STANDBY   ((uint_fast16_t)((uint_fast16_t)1U << 0))

Power event: The device is entering the STANDBY sleep state

§ PowerLPF3_ENTERING_SHUTDOWN

#define PowerLPF3_ENTERING_SHUTDOWN   ((uint_fast16_t)((uint_fast16_t)1U << 1))

Power event: The device is entering the SHUTDOWN state

§ PowerLPF3_AWAKE_STANDBY

#define PowerLPF3_AWAKE_STANDBY   ((uint_fast16_t)((uint_fast16_t)1U << 2))

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

§ PowerLPF3_HFXT_AVAILABLE

#define PowerLPF3_HFXT_AVAILABLE   ((uint_fast16_t)((uint_fast16_t)1U << 3))

Power event: The high frequency (HF) crystal oscillator is now available for use (HFXT) by the digital domain

§ PowerLPF3_LFCLK_SWITCHED

#define PowerLPF3_LFCLK_SWITCHED   ((uint_fast16_t)((uint_fast16_t)1U << 4))

Power event: The system has switched to the low frequency clock source configured in CCFG

Typedef Documentation

§ PowerLPF3_StartInitialHfxtAmpCompFxn

typedef void(* PowerLPF3_StartInitialHfxtAmpCompFxn) (void)

Function pointer to PowerLPF3_startInitialHfxtAmpComp() or NULL.

This type is only allowed to have the value NULL or be a pointer to PowerLPF3_startInitialHfxtAmpComp().

Enumeration Type Documentation

§ PowerLPF3_ResetReason

Reasons the device has booted or rebooted.

Enumerator
PowerLPF3_RESET_SHUTDOWN_IO 

Device woke up from shutdown due to an IO event

PowerLPF3_RESET_SHUTDOWN_SWD 

Device woke up from shutdown due to an SWD event

PowerLPF3_RESET_WATCHDOG 

Device reset because of a watchdog timeout.

PowerLPF3_RESET_SYSTEM 

Device reset triggered by software writing to RSTCTL.SYSRST

PowerLPF3_RESET_CPU 

Device reset triggered by CPU reset event

PowerLPF3_RESET_LOCKUP 

Device reset triggered by CPU lockup event

PowerLPF3_RESET_TSD 

Device woke up from thermal shutdown after temperature drop

PowerLPF3_RESET_SWD 

Device woke up due to Serial Wire Debug event

PowerLPF3_RESET_LFXT 

Device reset due to LFXT clock loss

PowerLPF3_RESET_VDDR 

Device reset due to VDDR brownout event

PowerLPF3_RESET_VDDS 

Device reset due to VDDS brownout event

PowerLPF3_RESET_PIN 

Device reset due to pin reset

PowerLPF3_RESET_POR 

Device booted due to power on reset

PowerLPF3_RESET_UNKNOWN 

Unknown reset reason

PowerLPF3_RESET_SHUTDOWN_IO 

Device woke up from shutdown due to an IO event

PowerLPF3_RESET_SHUTDOWN_SWD 

Device woke up from shutdown due to an SWD event

PowerLPF3_RESET_WATCHDOG 

Device reset because of a watchdog timeout.

PowerLPF3_RESET_SYSTEM 

Device reset triggered by software writing to RSTCTL.SYSRST

PowerLPF3_RESET_CPU 

Device reset triggered by CPU reset event

PowerLPF3_RESET_LOCKUP 

Device reset triggered by CPU lockup event

PowerLPF3_RESET_TSD 

Device woke up from thermal shutdown after temperature drop

PowerLPF3_RESET_SWD 

Device woke up due to Serial Wire Debug event

PowerLPF3_RESET_LFXT 

Device reset due to LFXT clock loss

PowerLPF3_RESET_VDDR 

Device reset due to VDDR brownout event

PowerLPF3_RESET_VDDS 

Device reset due to VDDS brownout event

PowerLPF3_RESET_PIN 

Device reset due to pin reset

PowerLPF3_RESET_POR 

Device booted due to power on reset

PowerLPF3_RESET_UNKNOWN 

Unknown reset reason

§ PowerLPF3_AfoscFreq

The possible frequencies to configure the AFOSC to.

The value of each enumeration represents the frequency in Hz.

Enumerator
PowerLPF3_AFOSC_FREQ_80MHZ 

80 MHz

PowerLPF3_AFOSC_FREQ_90P3168MHZ 

90.3168 MHz

PowerLPF3_AFOSC_FREQ_98P304MHZ 

98.304 MHz

§ PowerLPF3_LfoscCompensationPpmRequirement

Possible LFOSC PPM requirements to be used by the LFOSC compensation.

Enumerator
PowerLPF3_LFOSC_PPM_500 

500 PPM

Function Documentation

§ PowerCC27XX_doWFI()

void PowerCC27XX_doWFI ( void  )

The wait for interrupt (WFI) policy.

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

Note
For TFM enabled applications, the CPU wait for interrupt instruction (WFI) is invoked in a loop until a NS interrupt becomes pending. The loop will allow the CPU to vector to S interrupts. If something is not allowing that, for example if S interrupts are disabled, then the function will also return.

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

§ PowerLPF3_getResetReason()

PowerLPF3_ResetReason PowerLPF3_getResetReason ( void  )

Returns the reason for the most recent reset or wakeup.

Returns
PowerLPF3_ResetReason
Precondition
Power_shutdown()
Postcondition
PowerLPF3_releaseLatches()

§ PowerLPF3_releaseLatches()

void PowerLPF3_releaseLatches ( void  )

Unlatch all IOs.

This function releases the latches on all frozen IOs. This function should be called after waking up from shutdown and reconfiguring the IO state so as not to cause glitches.

Note
Calling this function will clear the reset reason register if it was PowerLPF3_RESET_SHUTDOWN_IO or PowerLPF3_RESET_SHUTDOWN_SWD and cause PowerLPF3_getResetReason() not to return the true reset reason.
Precondition
Power_shutdown()
PowerLPF3_getResetReason()

§ PowerCC27XX_standbyPolicy()

void PowerCC27XX_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 state; if that is disallowed (e.g., if the PowerLPF3_DISALLOW_IDLE 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 PowerCC27XX_Config structure, or specified at runtime with Power_setPolicy()), and the Power Policy must be enabled (either via 'enablePolicy' in the PowerCC27XX_Config structure, or via a call to Power_enablePolicy() at runtime).

§ PowerLPF3_selectLFOSC()

void PowerLPF3_selectLFOSC ( void  )

Select LFOSC as LFCLK source.

Turn on the LFOSC and choose it as LFCLK source. Once LFCLK has switched, the PowerLPF3_LFCLK_SWITCHED notification will be issued and all subscribers to this event will be notified.

Warning
Dynamic switching between LF clocks is not supported. Once one of PowerLPF3_selectLFOSC(), PowerLPF3_selectLFXT() or PowerLPF3_selectEXTLF() is called in an application, the other two may not be invoked thereafter.
Precondition
Power_init()
See also
PowerLPF3_selectLFXT()
PowerLPF3_selectEXTLF()

§ PowerLPF3_selectLFXT()

void PowerLPF3_selectLFXT ( void  )

Select LFXT as LFCLK source.

Turn on the LFXT and choose it as LFCLK source. Once LFCLK has switched, the PowerLPF3_LFCLK_SWITCHED notification will be issued and all subscribers to this event will be notified.

Warning
Dynamic switching between LF clocks is not supported. Once one of PowerLPF3_selectLFOSC(), PowerLPF3_selectLFXT() or PowerLPF3_selectEXTLF() is called in an application, the other two may not be invoked thereafter.
Precondition
Power_init()
See also
PowerLPF3_selectLFOSC()
PowerLPF3_selectEXTLF()

§ PowerLPF3_selectEXTLF()

void PowerLPF3_selectEXTLF ( void  )

Select EXTLF as LFCLK source.

Choose an external 31.25 kHz square wave as the LFCLK source as input. Once LFCLK has switched, the PowerLPF3_LFCLK_SWITCHED notification will be issued and all subscribers to this event will be notified.

This function requires the following symbols to be defined.

  • PowerLPF3_extlfPin (uint8_t): The DIO number of the pin to be used as the EXTLF pin.
  • PowerLPf3_extlfPinMux (uint8_t): Mux value used to mux the EXTLF signal to PowerLPF3_extlfPin. If using SysConfig, the symbols will be defined in ti_drivers_config.c.
Warning
Dynamic switching between LF clocks is not supported. Once one of PowerLPF3_selectLFOSC(), PowerLPF3_selectLFXT() or PowerLPF3_selectEXTLF() is called in an application, the other two may not be invoked thereafter.
Precondition
Power_init()
See also
PowerLPF3_selectLFOSC()
PowerLPF3_selectLFXT()

§ PowerLPF3_initHFXTCompensation()

void PowerLPF3_initHFXTCompensation ( int32_t  P0,
int32_t  P1,
int32_t  P2,
int32_t  P3,
uint8_t  shift,
bool  fcfgInsertion 
)

Initialize HFXT temperature compensation coefficients.

Initialize the parameters used for HFXT temperature coefficients. They approximate the ppm offset of the HFXT frequency with the following polynomial as a function of temperature (degC), where P_3 = P3 / 2^shift, P_2 = P2 / 2^shift, etc.. ppm(T) = P_3*T^3 + P_2*T^2 + P_1*T + P_0

Note
The fixed-point coefficients and the shift argument must ensure that the computation does not overflow 32 bits in the -40, 125 degC range.
Parameters
[in]P00th-order coefficient, multiplied by 2^shift
[in]P11st-order coefficient, multiplied by 2^shift
[in]P22nd-order coefficient, multiplied by 2^shift
[in]P33rd-order coefficient, multiplied by 2^shift
[in]shiftShift-value for scaling fixed-point coefficients
[in]fcfgInsertionBoolean used to indicate presence of HFXT FCFG data.
Precondition
Power_init()

§ PowerLPF3_enableHFXTCompensation()

void PowerLPF3_enableHFXTCompensation ( int16_t  tempThreshold,
int16_t  tempDelta 
)

Enable HFXT temperature compensation.

Enable automatic compensation for temperature-based frequency-drift of HFXT

This function should only be called once, but can be invoked again if PowerLPF3_enableHFXTCompensation has been called

Parameters
[in]tempThresholdThreshold above which temperature compensation will be performed. This can be useful to save power consumption if HFXT performance is acceptable at low temperatures, and only required at high temperatures. If the threshold is set to for example 80 degrees, then the first compensation will occur once the temperature reaches 81 degrees. Units in degrees Celsius.
[in]tempDeltaDelta describing how much the temperature can drift before compensation is applied. If compensation is performed at 81 degrees, and the delta is set to 5, then a re-compensation is performed at either 76 degrees or 86 degrees, depending on which temperature state occurs first. Units in degrees Celsius.
Precondition
PowerLPF3_initHFXTCompensation()

§ PowerLPF3_disableHFXTCompensation()

void PowerLPF3_disableHFXTCompensation ( void  )

Disable HFXT temperature compensation.

Disable automatic compensation for temperature-based frequency-drift of HFXT

Note
Calling this function will also undo any previous temperature compensation that has been performed in the past, and HFXT will become uncompensated
Precondition
PowerLPF3_enableHFXTCompensation()

§ PowerLPF3_forceHFXTCompensationUpdate()

void PowerLPF3_forceHFXTCompensationUpdate ( void  )

Force HFXT temperature compensation update.

Should be called after releasing the PowerLPF3_DISALLOW_SWTCXO constraint to ensure the correct HFXT frequency.

Precondition
PowerLPF3_enableHFXTCompensation()

§ PowerLPF3_getHFXTCompensationRatio()

uint32_t PowerLPF3_getHFXTCompensationRatio ( void  )

Get the current HFXT compensation ratio.

The compensation ratio is the ratio between the nominal HFXT freqeuncy (48MHz) and the currently expected HFXT frequency.

The format of the ratio is 4.22 (4 integer bits and 22 fractional bits).

Returns
48MHz*2^22/f where f is the currently expected HFXT frequency.

§ PowerLPF3_startAFOSC()

int_fast16_t PowerLPF3_startAFOSC ( PowerLPF3_AfoscFreq  frequency)

Start the AFOSC.

This function will start the AFOSC if it is not already running. The AFOSC will be configured to the specified frequency and it will be configured to automatically be disabled when entering STANDBY, meaning this function will need to be called again after waking up from STANDBY.

If the AFOSC is already running, no change will be done, and an error code will be returned. This indicates that another SW component is "owning" the AFOSC.

Parameters
[in]frequencyThe desired frequency of the AFOSC.
Returns
Power_SOK on success, Power_EFAIL if AFOSC is already running, Power_EINVALIDINPUT if an invalid frequency is specified.
See also
PowerLPF3_stopAFOSC()

§ PowerLPF3_stopAFOSC()

void PowerLPF3_stopAFOSC ( void  )

Stop the AFOSC.

This function will stop the AFOSC.

See also
PowerLPF3_startAFOSC()

§ PowerLPF3_startInitialHfxtAmpComp()

void PowerLPF3_startInitialHfxtAmpComp ( void  )

Start initial compensation of the HFXT amplitude.

Warning
This function must not be called by the application. It is only intended to be specified for PowerCC27XX_Config.startInitialHfxtAmpCompFxn

§ PowerLPF3_getHfxtAmpAdjustment()

int_fast8_t PowerLPF3_getHfxtAmpAdjustment ( void  )

Check if HFXT amplitude needs to be adjusted.

The HFXT amplitude needs to regularly be checked and if needed adjusted. The Power driver will check the amplitude and adjust it when the device enters standby. However if the device does not enter standby often enough, then additional checks and adjustments are needed.

This function can be used to check if adjustment of the amplitude is needed, and PowerLPF3_adjustHfxtAmp() can be used to adjust the amplitude if needed.

Returns
  • +1: The amplitude needs to be increased
  • 0: No adjustments are needed
  • -1: The amplitude needs to be decreased
See also
PowerLPF3_adjustHfxtAmp()

§ PowerLPF3_adjustHfxtAmp()

void PowerLPF3_adjustHfxtAmp ( int_fast8_t  adjustment)

Adjust the HFXT amplitude.

This function is to be used to adjust the HFXT amplitude if an adjustment is needed according to PowerLPF3_getHfxtAmpAdjustment(). Please refer to the documentation of PowerLPF3_getHfxtAmpAdjustment() for more details.

Note
The radio must be disabled when adjusting the HFXT amplitude, and while the amplitude is settling. After this function returns, the caller must wait until the HFXT amplitude has settled.
Parameters
adjustmentthe value returned by PowerLPF3_getHfxtAmpAdjustment(). No other value is allowed.
Precondition
PowerLPF3_getHfxtAmpAdjustment() must be called, and it must return a non-zero value (indicating that adjustment is needed)
See also
PowerLPF3_getHfxtAmpAdjustment()

§ PowerLPF3_initLfoscCompensation()

void PowerLPF3_initLfoscCompensation ( void  )

Initialize LFOSC Compensation.

This function initializes the internal state of the LFOSC compensation. It must be called before calling any other LFOSC Compensation functions. Calling this function multiple times will only have an effect the first time.

Calling context: Task, Main.

§ PowerLPF3_setLfoscCompensationProfile()

void PowerLPF3_setLfoscCompensationProfile ( const PowerLPF3_LfoscCompensationProfile profile)

Set LFOSC Compensation Profile.

Set the LFOSC Compensation profile to use when LFOSC compensation is enabled.

This must be called before enabling LFOSC compensation, and it can be called while the compensation is enabled to change the profile to be used for the compensation.

Calling context: Task, Main.

Parameters
[in]profilePointer to the LFOSC Compensation Profile to be used. The profile data will be copied to an internal structure, meaning the profile can be changed or deleted after this function returns without affecting the LFOSC compensation.
Precondition
PowerLPF3_initLfoscCompensation()

§ PowerLPF3_enableLfoscCompensation()

void PowerLPF3_enableLfoscCompensation ( void  )

Enable LFOSC Compensation.

Enable compensation of LFOSC.

This function should only be called once, but can be invoked again if PowerLPF3_disableLfoscCompensation() has been called.

Calling context: Task, Main.

Precondition
PowerLPF3_setLfoscCompensationProfile()

§ PowerLPF3_disableLfoscCompensation()

void PowerLPF3_disableLfoscCompensation ( void  )

Disable LFOSC Compensation.

Disable compensation of LFOSC.

Calling context: Task, Main.

Precondition
PowerLPF3_enableLfoscCompensation()

§ PowerLPF3_sleep()

int_fast16_t PowerLPF3_sleep ( uint32_t  nextEventTimeUs)

Transition the device into standby and configure RTC to wakeup the device ahead of a specified time.

This function is called from the power policy when the decision has been made to put the device in standby. This function returns to the caller (the policy function) after the device wakes up from standby.

The function is doing the following:

  • Disable SysTick (For TFM enabled apps, the NS SysTick is disabled)
  • Store SysTimer state
  • Configure RTC to wake up the device PowerCC27XX_WAKEDELAYSTANDBY microseconds before the next event, nextEventTimeUs. This is to ensure that the device is ready to service the event at time nextEventTimeUs.
  • Post the PowerLPF3_ENTERING_STANDBY notification
  • Adjust HFXT amplitude, if needed.
  • Enter standby
  • Start HFXT
  • Disarm RTC
  • Restore SysTimer state
  • Configure LRFD clocks
  • Post the PowerLPF3_AWAKE_STANDBY notification
Note
The SysTick is not re-enabled by this function, it is the caller's responsibility to re-enable the SysTick if needed after this function returns.
Warning
For TFM enabled applications, the above steps are only performed if standby is a allowed by the secure power constraints and if nextEventTimeUs is far enough in the future. If standby is not allowed and idle is allowed, the device will enter idle instead. In this case nextEventTimeUs will be ignored, so it is the caller's responsibility to set up the necessary wake up source in case the device enters idle instead of standby. For example setting up SysTick or SysTimer. If idle is also not allowed, the function will return immediately.
This function must be called with interrupts disabled, and should not be called directly by the application, or by any drivers. This function does not check declared constraints; the policy function must check constraints before calling this function to initiate sleep.
Parameters
[in]nextEventTimeUsthe SysTimer time of the next event, this must be far enough in the future.
Return values
Power_SOKon success, the device has slept and is awake again.
Power_EFAILif an error occurred during client notifications, or if a general failure occurred.

§ PowerLPF3_isLfincFilterAllowingStandby()

bool PowerLPF3_isLfincFilterAllowingStandby ( void  )

Checks if the LFINC filter is ready to go to standby or not.

Note
This is separate from the normal standby constraint system in the Power driver.
Returns
true if standby is allowed by the LFINC filter, false otherwise.

§ PowerCC27XX_schedulerDisable()

void PowerCC27XX_schedulerDisable ( void  )

§ PowerCC27XX_schedulerRestore()

void PowerCC27XX_schedulerRestore ( void  )
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale