Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Devices /
Chapter 6 - Power Manager / Power Manager Reference
Power Manager Dispatch Routines / Getting Information About the Internal Batteries


GetBatteryVoltage

You can use the GetBatteryVoltage function to find out the battery voltage.

Fixed GetBatteryVoltage(short whichBattery);
whichBattery
The battery for which you want a voltage reading.
DESCRIPTION
The GetBatteryVoltage function returns the battery voltage as a fixed-point number.

The value of whichBattery should be in the range 0 to BatteryCount()-1. If the value of whichBattery is out of range, or the selected battery is not installed, GetBatteryVoltage will return a result of 0.0 volts.

ASSEMBLY-LANGUAGE INFORMATION
The trap is _PowerMgrDispatch ($A09E). The selector value for GetBatteryVoltage is 27 ($1B) in the low word of register D0. The battery number is passed in the high word of register D0. The 32-bit value of the battery voltage is returned in register D0.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996