home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / pascal / vdl020d.zip / VAPM.DOC < prev    next >
Text File  |  1993-04-14  |  5KB  |  145 lines

  1. {
  2. ════════════════════════════════════════════════════════════════════════════
  3.  
  4.  Visionix Advanced Power Management (VAPM) Unit
  5.  Copyright 1991,92,93 Visionix
  6.  ALL RIGHTS RESERVED
  7.  
  8. ────────────────────────────────────────────────────────────────────────────
  9.  
  10.  Revision history in reverse chronological order:
  11.  
  12.  Initials  Date      Comment
  13.  --------  --------  -------------------------------------------------------
  14.  
  15.  mep       03/26/93  Rewritten and added many new functions.
  16.  
  17.  lpg       03/15/93  Added Source Documentation
  18.  
  19.  mep       02/11/93  Cleaned up code for beta release
  20.  
  21.  jrt       02/08/93  Sync with beta 0.12 release
  22.  
  23.  lpg       01/22/93  Wrote VAPMPresent and VPAMGetPowerStatus in ASM
  24.  
  25.  jrt       12/07/92  Sync with beta 0.11 release
  26.  
  27.  jrt       12/07/92  First logged revision.
  28.  
  29. ════════════════════════════════════════════════════════════════════════════
  30. }
  31.  
  32. Unit VAPM;
  33.  
  34.  
  35. Uses
  36.  
  37.   VTypes,
  38.   DOS,
  39.   VGen;
  40.  
  41. {────────────────────────────────────────────────────────────────────────────}
  42.  
  43. Const
  44.  
  45.   {-----------------------------}
  46.   { Generic error for functions }
  47.   {-----------------------------}
  48.  
  49.   apmError = $C8;
  50.  
  51.   {------------------------------------------------}
  52.   { Installation Flags - use with VAPMInstallCheck }
  53.   {------------------------------------------------}
  54.  
  55.   apmif16PModeAllowed     = 0; { 16-bit protected mode interface supported }
  56.   apmif32PModeAllowed     = 1; { 32-bit protected mode interface supported }
  57.   apmifCPUIdleSlower      = 2; { CPU idle decreases processor speed        }
  58.   apmifBIOSPowerManageOff = 3; { BIOS power management disabled            }
  59.  
  60.   {-----------------------------------------}
  61.   { Device IDs - use with VAPMSetPowerState }
  62.   {-----------------------------------------}
  63.  
  64.   apmidSysBIOS                = $0000;
  65.   apmidAllSysBIOSDevices      = $0001;
  66.   apmidDisplay                = $0100; { [00..FE] devices allowed }
  67.   apmidAllDisplay             = $01FF;
  68.   apmidSecStorage             = $0200; { [00..FE] devices allowed }
  69.   apmidSecStorageDevices      = $02FF;
  70.   apmidParallelPort           = $0300; { [00..FE] devices allowed }
  71.   apmidAllParallelPortDevices = $03FF;
  72.   apmidSerialPort             = $0400; { [00..FE] devices allowed }
  73.   apmidAllSerialPortDevices   = $04FF;
  74.  
  75.   {--------------------------------------------------}
  76.   { Set Power State IDs - use with VAPMSetPowerState }
  77.   {--------------------------------------------------}
  78.  
  79.   apmpsReady   = $0;
  80.   apmpsStandBy = $1;
  81.   apmpsSuspend = $2;
  82.   apmpsOff     = $3;
  83.  
  84.   
  85. Type
  86.  
  87.   TAPMError = BYTE;
  88.  
  89. {────────────────────────────────────────────────────────────────────────────}
  90.  
  91. Function  VAPMErrorToStr(              ErrorCode      : TAPMError): STRING;
  92.  
  93. Function  VAPMInstalled                                           : BOOLEAN;
  94.  
  95. Procedure VAPMInstallCheck(        Var Version        : STRING;
  96.                                    Var Flags          : WORD;
  97.                                    Var ErrorCode      : TAPMError);
  98.  
  99. Function  VAPMConRealModeIntr                                     : TAPMError;
  100.  
  101. Function  VAPMCon16PModeInter(     Var RM16CodeSeg    : WORD;
  102.                                    Var EntryOfs       : WORD;
  103.                                    Var RM16DataSeg    : WORD    ) : TAPMError;
  104.  
  105. Function  VAPMCon32PModeInter(     Var RM32CodeSeg    : WORD;
  106.                                    Var EntryOfs       : LONGINT;
  107.                                    Var RM16CodeSeg    : WORD;
  108.                                    Var RM16DataSeg    : WORD    ) : TAPMError;
  109.  
  110. Function  VAPMDisConInter                                         : TAPMError;
  111.  
  112. Function  VAPMCPUIdle                                             : TAPMError;
  113.  
  114. Function  VAPMCPUBusy                                             : TAPMError;
  115.  
  116. Function  VAPMSetPowerState(           DeviceID       : WORD;
  117.                                        State          : WORD    ) : TAPMError;
  118.  
  119. Function  VAPMSysStandby                                          : TAPMError;
  120.  
  121. Function  VAPMSuspendSys                                          : TAPMError;
  122.  
  123. Function  VAPMSetPowerManager(         OnOff          : BOOLEAN ) : TAPMError;
  124.  
  125. Function  VAPMResetAsPowerOn                                      : TAPMError;
  126.  
  127. Function  VAPMGetPowerStatus(      Var ACLineStatus   : WORD;
  128.                                    Var BatteryStatus  : WORD;
  129.                                    Var BatteryPercent : WORD    ) : TAPMError;
  130.  
  131. Function  VAPMGetACLineStatus                                     : WORD;
  132.  
  133. Function  VAPMGetBatteryStatus                                    : WORD;
  134.  
  135. Function  VAPMGetBatteryPercent                                   : WORD;
  136.  
  137. Function  VAPMGetACLineStatusText                                 : STRING;
  138.  
  139. Function  VAPMGetBatteryStatusText                                : STRING;
  140.  
  141. Function  VAPMGetPowerEvent(       Var Event          : WORD    ) : TAPMError;
  142.  
  143. {────────────────────────────────────────────────────────────────────────────}
  144.  
  145.