home *** CD-ROM | disk | FTP | other *** search
- {
- ════════════════════════════════════════════════════════════════════════════
-
- Visionix Advanced Power Management (VAPM) Unit
- Copyright 1991,92,93 Visionix
- ALL RIGHTS RESERVED
-
- ────────────────────────────────────────────────────────────────────────────
-
- Revision history in reverse chronological order:
-
- Initials Date Comment
- -------- -------- -------------------------------------------------------
-
- mep 03/26/93 Rewritten and added many new functions.
-
- lpg 03/15/93 Added Source Documentation
-
- mep 02/11/93 Cleaned up code for beta release
-
- jrt 02/08/93 Sync with beta 0.12 release
-
- lpg 01/22/93 Wrote VAPMPresent and VPAMGetPowerStatus in ASM
-
- jrt 12/07/92 Sync with beta 0.11 release
-
- jrt 12/07/92 First logged revision.
-
- ════════════════════════════════════════════════════════════════════════════
- }
-
- Unit VAPM;
-
-
- Uses
-
- VTypes,
- DOS,
- VGen;
-
- {────────────────────────────────────────────────────────────────────────────}
-
- Const
-
- {-----------------------------}
- { Generic error for functions }
- {-----------------------------}
-
- apmError = $C8;
-
- {------------------------------------------------}
- { Installation Flags - use with VAPMInstallCheck }
- {------------------------------------------------}
-
- apmif16PModeAllowed = 0; { 16-bit protected mode interface supported }
- apmif32PModeAllowed = 1; { 32-bit protected mode interface supported }
- apmifCPUIdleSlower = 2; { CPU idle decreases processor speed }
- apmifBIOSPowerManageOff = 3; { BIOS power management disabled }
-
- {-----------------------------------------}
- { Device IDs - use with VAPMSetPowerState }
- {-----------------------------------------}
-
- apmidSysBIOS = $0000;
- apmidAllSysBIOSDevices = $0001;
- apmidDisplay = $0100; { [00..FE] devices allowed }
- apmidAllDisplay = $01FF;
- apmidSecStorage = $0200; { [00..FE] devices allowed }
- apmidSecStorageDevices = $02FF;
- apmidParallelPort = $0300; { [00..FE] devices allowed }
- apmidAllParallelPortDevices = $03FF;
- apmidSerialPort = $0400; { [00..FE] devices allowed }
- apmidAllSerialPortDevices = $04FF;
-
- {--------------------------------------------------}
- { Set Power State IDs - use with VAPMSetPowerState }
- {--------------------------------------------------}
-
- apmpsReady = $0;
- apmpsStandBy = $1;
- apmpsSuspend = $2;
- apmpsOff = $3;
-
-
- Type
-
- TAPMError = BYTE;
-
- {────────────────────────────────────────────────────────────────────────────}
-
- Function VAPMErrorToStr( ErrorCode : TAPMError): STRING;
-
- Function VAPMInstalled : BOOLEAN;
-
- Procedure VAPMInstallCheck( Var Version : STRING;
- Var Flags : WORD;
- Var ErrorCode : TAPMError);
-
- Function VAPMConRealModeIntr : TAPMError;
-
- Function VAPMCon16PModeInter( Var RM16CodeSeg : WORD;
- Var EntryOfs : WORD;
- Var RM16DataSeg : WORD ) : TAPMError;
-
- Function VAPMCon32PModeInter( Var RM32CodeSeg : WORD;
- Var EntryOfs : LONGINT;
- Var RM16CodeSeg : WORD;
- Var RM16DataSeg : WORD ) : TAPMError;
-
- Function VAPMDisConInter : TAPMError;
-
- Function VAPMCPUIdle : TAPMError;
-
- Function VAPMCPUBusy : TAPMError;
-
- Function VAPMSetPowerState( DeviceID : WORD;
- State : WORD ) : TAPMError;
-
- Function VAPMSysStandby : TAPMError;
-
- Function VAPMSuspendSys : TAPMError;
-
- Function VAPMSetPowerManager( OnOff : BOOLEAN ) : TAPMError;
-
- Function VAPMResetAsPowerOn : TAPMError;
-
- Function VAPMGetPowerStatus( Var ACLineStatus : WORD;
- Var BatteryStatus : WORD;
- Var BatteryPercent : WORD ) : TAPMError;
-
- Function VAPMGetACLineStatus : WORD;
-
- Function VAPMGetBatteryStatus : WORD;
-
- Function VAPMGetBatteryPercent : WORD;
-
- Function VAPMGetACLineStatusText : STRING;
-
- Function VAPMGetBatteryStatusText : STRING;
-
- Function VAPMGetPowerEvent( Var Event : WORD ) : TAPMError;
-
- {────────────────────────────────────────────────────────────────────────────}
-
-