http://nicolasbesson.blogspot.com/2008/04/power-management-under-window-ce-part.htmlThursday, April 10, 2008Power Management under Windows CE [part 1/3]Embedded devices are usually
powered by batteries and the power have to be correctly managed to
improve the device autonomy and by the way the user experience. Windows
Embedded CE is provided with a Power Manager that will interact with
the different drivers of the system to reduce power consumption when
required.
System Power States The
OS have 4 different power states that will be the four states of the
internal power manager state machine. The state transition will be
linked to system conditions : user activities, system activities,
application requests and timers.
The four states are :
The
transition from On to User Idle and User Idle to Suspend is done after
timers expirations, those timers value can be setup through the
registry to customize your device. You can managed timers when device
is powered by a battery and/or by AC, to optimize your device current
consumption depending on the power source.
[HKLM\SYSTEM\CurrentControlSet\Control\Power\Timeouts]"ACUserIdle"=dword:5 ; in seconds This
will set a timeout of 5 seconds to enter the User Idle state when the
device is powered by AC. The status of the power source is not
identified by the Power Manager, itself, it will require the
development of a battery driver. The battery driver will provide power
source transition notifications to the power manager.
Drivers Power States On the system drivers can support 5
different levels of power according to the peripheral capabilities:
Each
state is optional and a driver can support only few of them. The power
manager will request to the driver the different supported power state
at initialization.
System Power States vs Drivers Power States The
Power Manager is fully configurable through the registry, so default
configuration is provided to at least manage power by its own without
any pre-requisite. Each power state of the drivers will be associated
to a system power state as follow :
The
Power Manager will request device driver to change their power state at
system power state transitions, according to this list. As explained
before, those values can be overridden using the registry by creating
new entries like this :
[HKLM\SYSTEM\CurrentControlSet\Control\Power\State\UserIdle]"bkl1:"=dword:4 ; backlight off [HKLM\SYSTEM\CurrentControlSet\Control\Power\State\SystemIdle] "bkl1:"=dword:4 ; backlight off [HKLM\SYSTEM\CurrentControlSet\Control\Power\State\Suspend] "bkl1:"=dword:4 ; backlight off In
this example, the driver named bkl1: will be turned off when the system
power state will switch to User Idle, System Idle and Suspend states.
You can either define power state for drivers individually in the
registry or group them into IClass definition. When defining a driver
in the registry you can specify which class of driver this driver is
associated to.
[HKLM\SYSTEM\CurrentControlSet\Control\Power\State\SystemIdle\{
A32942B7-920C-486b-B0E6-92A702A99B35 }]"Default"=dword:4 ; D4 This configuration will turn off all
the device from the Iclass (A32942B7-920C-486b-B0E6-92A702A99B35).
This IClass value is the GUID
used by the power manageable devices.
That’s all for today, but two additional articles are following in the next few days. I will talk about the device driver interface requirements, and application interface used to communicate with the Power Manager and receive notification from him. [Updated] : Access to part 2/3 - Nicolas |
