![]() |
![]() |
Power manager interface for WFF3 devices.
============================================================================
The Power header file should be included in an application as follows:
Refer to Power.h for a complete description of APIs.
This header file defines the power resources, constraints, events, sleep states and transition latencies for WFF3 devices.
#include <ti/drivers/dpl/HwiP.h>#include <ti/drivers/dpl/ClockP.h>#include <ti/drivers/Power.h>#include <ti/devices/DeviceFamily.h>
Go to the source code of this file.
Data Structures | |
| struct | PowerWFF3_Config |
| Global configuration structure. More... | |
Macros | |
| #define | PowerWFF3_RESUMETIMESLEEP 15000 |
| #define | PowerWFF3_TOTALTIMESLEEP 16000 |
| #define | PowerWFF3_WAKEDELAYSLEEP 15000 |
| #define | PowerWFF3_PERIPH_DCAN 0 |
| #define | PowerWFF3_PERIPH_GPTIMER0 1 |
| #define | PowerWFF3_PERIPH_GPTIMER1 2 |
| #define | PowerWFF3_PERIPH_I2C0 3 |
| #define | PowerWFF3_PERIPH_I2C1 4 |
| #define | PowerWFF3_PERIPH_I2S 5 |
| #define | PowerWFF3_PERIPH_SDMMC 6 |
| #define | PowerWFF3_PERIPH_SPI0 7 |
| #define | PowerWFF3_PERIPH_SPI1 8 |
| #define | PowerWFF3_PERIPH_SYSTIMER 9 |
| #define | PowerWFF3_PERIPH_UARTLIN0 10 |
| #define | PowerWFF3_PERIPH_UARTLIN1 11 |
| #define | PowerWFF3_PERIPH_SDIO 12 |
| #define | PowerWFF3_PERIPH_ADC0 13 |
| #define | PowerWFF3_PERIPH_UARTLIN2 14 |
| #define | PowerWFF3_SLEEP 0x1 |
| #define | PowerWFF3_DISALLOW_SHUTDOWN 0 |
| #define | PowerWFF3_DISALLOW_SLEEP 1 |
| #define | PowerWFF3_DISALLOW_IDLE 2 |
| #define | PowerWFF3_ENTERING_SLEEP (1 << 0) |
| #define | PowerWFF3_ENTERING_SHUTDOWN (1 << 1) |
| #define | PowerWFF3_AWAKE_SLEEP (1 << 2) |
Enumerations | |
| enum | PowerWFF3_ResetReason { PowerWFF3_RESET_PIN = 0, PowerWFF3_RESET_POR = 1 } |
| Reasons the device has booted or rebooted. More... | |
Functions | |
| void | PowerWFF3_doWFI (void) |
| The wait for interrupt (WFI) policy. More... | |
| static PowerWFF3_ResetReason | PowerWFF3_getResetReason (void) |
| Returns the reason for the most recent reset or wakeup. More... | |
| void | PowerWFF3_sleepPolicy (void) |
| The SLEEP Power Policy. More... | |
| void | PowerWFF3_schedulerDisable (void) |
| void | PowerWFF3_schedulerRestore (void) |
| #define PowerWFF3_RESUMETIMESLEEP 15000 |
The latency to reserve for resume from Sleep (usec)
| #define PowerWFF3_TOTALTIMESLEEP 16000 |
The total latency to reserve for entry to and exit from Sleep (usec)
| #define PowerWFF3_WAKEDELAYSLEEP 15000 |
The initial delay when waking from Sleep (usec)
| #define PowerWFF3_PERIPH_DCAN 0 |
Resource ID: DCAN
| #define PowerWFF3_PERIPH_GPTIMER0 1 |
Resource ID: GPTIMER 0
| #define PowerWFF3_PERIPH_GPTIMER1 2 |
Resource ID: GPTIMER 1
| #define PowerWFF3_PERIPH_I2C0 3 |
Resource ID: I2C 0
| #define PowerWFF3_PERIPH_I2C1 4 |
Resource ID: I2C 1
| #define PowerWFF3_PERIPH_I2S 5 |
Resource ID: I2S
| #define PowerWFF3_PERIPH_SDMMC 6 |
Resource ID: SDMMC
| #define PowerWFF3_PERIPH_SPI0 7 |
Resource ID: SPI 0
| #define PowerWFF3_PERIPH_SPI1 8 |
Resource ID: SPI 1
| #define PowerWFF3_PERIPH_SYSTIMER 9 |
Resource ID: SysTimer
| #define PowerWFF3_PERIPH_UARTLIN0 10 |
Resource ID: UARTLIN 0
| #define PowerWFF3_PERIPH_UARTLIN1 11 |
Resource ID: UARTLIN 1
| #define PowerWFF3_PERIPH_SDIO 12 |
Resource ID: SDIO
| #define PowerWFF3_PERIPH_ADC0 13 |
Resource ID: ADC
| #define PowerWFF3_PERIPH_UARTLIN2 14 |
Resource ID: UARTLIN 2
| #define PowerWFF3_SLEEP 0x1 |
The SLEEP state
| #define PowerWFF3_DISALLOW_SHUTDOWN 0 |
Constraint: Disallow a transition to the SHUTDOWN state
| #define PowerWFF3_DISALLOW_SLEEP 1 |
Constraint: Disallow a transition to the SLEEP state
| #define PowerWFF3_DISALLOW_IDLE 2 |
Constraint: Disallow a transition to the IDLE state
| #define PowerWFF3_ENTERING_SLEEP (1 << 0) |
Power event: The device is entering the SLEEP state
| #define PowerWFF3_ENTERING_SHUTDOWN (1 << 1) |
Power event: The device is entering the SHUTDOWN state
| #define PowerWFF3_AWAKE_SLEEP (1 << 2) |
Power event: The device is waking up from the SLEEP state
| void PowerWFF3_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 PowerWFF3_Config structure, or dynamically at runtime, via Power_setPolicy().
|
inlinestatic |
Returns the reason for the most recent reset or wakeup.
References PowerWFF3_RESET_PIN, PowerWFF3_schedulerDisable(), PowerWFF3_schedulerRestore(), and PowerWFF3_sleepPolicy().
| void PowerWFF3_sleepPolicy | ( | void | ) |
The SLEEP Power Policy.
This is an aggressive Power Policy, which considers active constraints, SLEEP state transition latencies, and time until the next scheduled work, and automatically transitions the device into the lowest power state possible.
The first goal is to enter SLEEP; 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 PowerWFF3_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 PowerWFF3_Config structure, or specified at runtime with Power_setPolicy()), and the Power Policy must be enabled (either via 'enablePolicy' in the PowerWFF3_Config structure, or via a call to Power_enablePolicy() at runtime).
Referenced by PowerWFF3_getResetReason().
| void PowerWFF3_schedulerDisable | ( | void | ) |
Referenced by PowerWFF3_getResetReason().
| void PowerWFF3_schedulerRestore | ( | void | ) |
Referenced by PowerWFF3_getResetReason().