This module provides functions that can be called to reduce MSP430 power
consumption.
enum Power_IdleMode |
|
Available idle modes
typedef enum Power_IdleMode {
Power_LPM0,
Power_LPM1,
Power_LPM2,
Power_LPM3,
Power_LPM4
} Power_IdleMode;
enum Power_SleepMode |
|
Available sleep modes
typedef enum Power_SleepMode {
Power_Sleep_LPM4_5
// Shutdown (LPM4.5)
} Power_SleepMode;
typedef Power_SleepPrepFuncPtr |
|
Sleep mode preparation function type definition
typedef Void (*Power_SleepPrepFuncPtr)();
config Power_E_dynamicModeNotAllowed // module-wide |
|
Dynamic mode not allowed error
extern const Error_Id Power_E_dynamicModeNotAllowed;
DETAILS
This Error is raised if there is an attempt to change idleMode at
runtime, or trigger a dynamic CPU wakeup, and
allowDynamicMode is set to "false".
config Power_allowDynamicMode // module-wide |
|
Allow dynamic changes to idleMode (changeIdleMode), or
dynamically waking the CPU upon return from interrupt
(wakeCPU), at runtime?
extern const Bool Power_allowDynamicMode;
config Power_idle // module-wide |
|
Idle CPU when threads blocked waiting for an interrupt?
extern const Bool Power_idle;
config Power_idleMode // module-wide |
|
Idle mode for CPU to enter while waiting for an interrupt
config Power_sleepPrepFunction // module-wide |
|
I/O preparation function to be called by Power_sleepCPU()
Power_changeIdleMode() // module-wide |
|
Change the idleMode used for idling the CPU
DETAILS
This function does not immediately affect the state of the CPU, but
defines the idleMode that will be invoked at subsequent opportunities
SYS/BIOS has to idle the CPU.
Changing the
idleMode at runtime requires that
idle be
enabled, the initial
idleMode is defined, and
allowDynamicMode is specified in the application
configuration. For example:
var Power = xdc.useModule('ti.sysbios.family.msp430.Power');
Power.idle = true;
Power.idleMode = Power.LPM3;
Power.allowDynamicMode = true;
Power_idleCPU() // module-wide |
|
Function to automatically idle the CPU during idle time
DETAILS
When the
idle configuration parameter is set, this function
will be added to the list of Idle loop functions. When called from the
Idle loop, it will transition the CPU into the idle mode specified
by the
idleMode configuration parameter. The CPU will stay
in the corresponding low power mode until the next interrupt occurs.
Power_sleepCPU() // module-wide |
|
Function called by the application to sleep the CPU
DETAILS
This function currently supports the LPM4.5 sleep mode only, and
only on MSP430 devices that support this mode. To be effective, the
device I/Os MUST be properly configured before LPM4.5 is activated,
otherwise there may be excessive current draw, which could be higher
than before this function is called. The proper configuration of I/Os
is device, application, and board specific. The caller of this
function has two options:
1) Prepare the device I/Os, and any (non-reset) wakeup interrupts
prior to calling this function, or
2) Write a function for this purpose, and configure it as the
optional
sleepPrepFunction, that
Power_sleepCPU()
should call before transitioning to
LPM4.5.
Power_wakeCPU() // module-wide |
|
Function called to trigger a dynamic CPU wakeup upon return from
interrupt
DETAILS
An interrupt can be configured statically (at build time) to let the
CPU naturally resume an LPM mode upon return from interrupt (see
Hwi).
This function (Power_wakeCPU()) can be called from within an ISR
function to override the static configuration (where the CPU would
resume an LPM mode), and force the CPU to stay awake upon return from
interrupt.
For the case of nested interrupts, the effect of this API is for the
bottom-most (or first-preempting) interrupt, meaning that if this
function is called from an ISR that has nested upon another, the CPU
will be kept awake after the interrupt that first awoke the CPU.
To call this function, it is required that
allowDynamicMode is specified as 'true' in the application
configuration. For example:
var Power = xdc.useModule('ti.sysbios.family.msp430.Power');
Power.allowDynamicMode = true;
Module-Wide Built-Ins |
|
// Get this module's unique id
Bool Power_Module_startupDone();
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool Power_Module_hasMask();
// Test whether this module has a diagnostics mask
Bits16 Power_Module_getMask();
// Returns the diagnostics mask for this module
Void Power_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module