![]() |
EVE 1.0
|
|
Data Structures | |
| struct | pm_lock_t |
Macros | |
| #define | PM_LOCK_INIT(l, pm, cb, d) |
| #define | DECLARE_PM_LOCK(l, pm, cb, d) static struct pm_lock_t pm = PM_LOCK_INIT(l, pm, cb, d) |
| #define | PM_LOCK(pm) pm_lock(&pm) |
| #define | PM_UNLOCK(pm) pm_unlock(&pm) |
| #define | PM_AUTO_LOCK(l) |
Enumerations |
Functions | |
| void | pm_relax (void) |
| void | pm_wakeup (void) |
| void | pm_lock (struct pm_lock_t *pm) |
| void | pm_unlock (struct pm_lock_t *pm) |
| enum pm_level_t | pm_waterlevel (void) |
EVE power management framework
| #define PM_LOCK_INIT | ( | l, | |
| pm, | |||
| cb, | |||
| d | |||
| ) |
Initializes a power lock structure.
The macro is used to initialize a power lock structure instance.
| l | power level |
| pm | power lock structure |
| cb | user callback to be called before the system goes suspend |
| d | data for the user callback |
Usage:
| #define DECLARE_PM_LOCK | ( | l, | |
| pm, | |||
| cb, | |||
| d | |||
| ) | static struct pm_lock_t pm = PM_LOCK_INIT(l, pm, cb, d) |
Declares a power lock structure instance
| l | power level |
| pm | power lock structure |
| cb | user callback to be called before the system goes suspend |
| d | data for the user callback |
Usage:
| #define PM_LOCK | ( | pm | ) | pm_lock(&pm) |
Request the power level
The macro is used to request power at the given power level.
| pm | power lock structure |
Usage:
Definition at line 203 of file pm.h.
Referenced by clock_delay_usec(), and clock_wait().
| #define PM_UNLOCK | ( | pm | ) | pm_unlock(&pm) |
Release the power
The macro is used to release previously taken power request at the given power level.
If the power lock structure provides a user-defined callback, the PM_UNLOCK() puts the structure into a linked list of unlocked requests, waiting for suspend. During the following suspend (pm_relax()), the list is traversed and the callbacks are called by the framework. The callbacks can prevent system from suspend by returning false.
| pm | power lock structure |
Usage:
Definition at line 204 of file pm.h.
Referenced by clock_delay_usec(), and clock_wait().
| #define PM_AUTO_LOCK | ( | l | ) |
Declares an anonymous auto lock, which holds power request in the auto variable visibility block
| l | power level |
Usage:
| enum pm_level_t |
System power level.
| Enumerator | |
|---|---|
| PM_LEVEL_RUNNING |
System is kept spinning when idle. Høyest power consumption. |
| PM_LEVEL_CONSTLAT |
System ON, Constant latency mode. |
| PM_LEVEL_LOWPWR |
System ON, Low power mode. |
| PM_LEVEL_CLOCKLESS |
System ON, Low power mode, 32 kHz clock off. |
| PM_LEVEL_OFF |
System OFF. |
| PM_LEVEL__COUNT |
Number of elements in the pm_level_t enum. |
| void pm_relax | ( | void | ) |
Enters the lowest power level.
Before entring low-power mode, pm_relax() traverses via the list of lock structures, registered by PM_UNLOCK(), and calls user-defined callbacks. If a callback returns false, then the ongoing suspend is cancelled.
While interrupt handling is performed, pm_relax() does not return to the operating system until a wakeup is requested by pm_wakeup() call.
Referenced by clock_delay_usec(), and clock_wait().
| void pm_wakeup | ( | void | ) |
Wakeups the system from suspend state.
Interrupt handlers must call this function if they want to wake up operating system from suspend state.
Referenced by clock_wait(), process_poll(), and process_post().
| void pm_lock | ( | struct pm_lock_t * | pm | ) |
Restrict deepness of suspend to the given power level
| pm | pointer to the power lock structure |
| void pm_unlock | ( | struct pm_lock_t * | pm | ) |
Release a previously taken power lock
| pm | pointer to the power lock structure |
| enum pm_level_t pm_waterlevel | ( | void | ) |
Query the level the system can be put down to sleep taking in mind currently taken locks.