Wednesday 11 November 2009

Battery-driven model and drive initialization process

Battery-driven model and drive initialization process

Window CE device drivers included in the sample program is divided into Laptop Battery two types: single-chip driver (Monolithic device driver) and layered drivers (Layered Device driver). Stratified development model can be reduced development effort and shorten the development cycle, in battery-driven development using the layered-driven development model.


Layered driver consists of two separate layers: the upper is a model device driver (MDD), lower the platform-dependent driver (PDD). Device driver server provides an interface (DDSI) in the PDD set of functions implemented by the MDD calls. Because Microsoft provides all the MDD modules associated with the source code, so this part do not make any changes, just their own PDD module with MDD module can link into a common database [3]. MDD by IoCTLS call PDD specific function to access the specific characteristics of the Pavilion ZV6000(hp zv6000 battery) hardware.


Battery-powered Windows CE requirements of MDD functions include:


Init, Deinit, Open, Close, Read, Write, Seek, PowerDown, PowerUp, IOControl.


Battery-powered Windows CE requirements of PDD functions include:


BatteryPDDInitialize, BatteryPDDDeinitialize, BatteryPDDGetStatus, BatteryPDDGetLevels,


BatteryPDDSupportsChangeNotification, BatteryPDDPowerHandler, BatteryPDDResume.


Battery-driven initialization process


In the system power-on self test is successful, the upper entrance of the function is called battery-powered, Pavilion ZV5000(hp zv5000 battery) battery-powered initialization to work:


(1) to determine whether there had been disruptions initialization, if not initialized, then carried out the following operations, if you have carried out an initialization, then close the event handler.


(2) initialize the global variables batteries.


(3) If the interruption of the event is successful, call ResumeThreadProc to create the battery thread. In the main theme of the thread function, set the thread priority of the battery, and then in a loop waiting for interrupt events.


(4) call PDD layer initialization function BatteryPDDInitialize; in the PDD layer for the GPIO registers and power management registers to open up two virtual Presario X6000 memory.


(5) to initialize AC97 register.


(6) to initialize the value of stored battery power ring buffer.


(7) call BatteryAPIGetSystemPowerStatusEx2 function updates the battery structure PSYSTEM POWERSTATUS_ EX2 in the data.


4. BatteryAPIGetSystemPowerStatusEx function


BatteryAPIGetSystemPowerStatusEx function key access to the system Presario R3000(compaq r3000 battery) power state value. In the implementation process is by calling the BatteryAPIGetSystemPowerStatusEx2 function completed. The BatteryAPIGetSystemPowerStatusEx2 function calls BatteryPDDGetStatus function to get the battery status information, BatteryPDDGetStatus function by calling GetMainBatteryVoltage for the main battery voltage, by calling GetPowerDevStatus get the battery status of the device and obtain the ratio of the value of the remaining capacity. The figure 3 for BatteryAPIGetSystemPowerStatusEx function call PP2100 graph:

No comments:

Post a Comment