The text of a manual · part 13 of 38
PEN*KEY 6100 Computer Programmer's Reference Guide: Section 4: Power Management
Pages 103 to 112 of 328, from PEN*KEY 6100 Computer Programmer's Reference Guide
The original document is the PDF (1.2 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
Filed in the catalog under the Intermec 6110
Page 103
Section 4
Power Management "
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
Introduction This section contains information about Advanced Power Management (APM) on the PEN*KEYR 6100 Computer. The following information may help you locate information in this section: Topic Summary Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . System Power States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . System Power State Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Device Power Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . APM Software Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . APM Include Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Firmware Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Page 4-1 4-2 4-2 4-4 4-6 4-8 4-9
List of Tables Table 4-1, Power States (General Definitions) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Table 4-2, Power States (Display) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Table 4-10, Power Management Event Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Table 4-11, Firmware Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Page 4-4 4-4 4-7 4-9
Overview ELANAPM.EXE is the APM BIOS. The APM system consists of one or more layĆ ers of software. The APM BIOS resides at the lowest layer. To provide portability at the higher layers of the APM system, ELANAPM.EXE, an installable DOS device driver, provides a software interface to the hardware that is independent of the hardware interfaces. To provide diagnostics with proprietary applications, some functions specific to Intermec Technologies Corporation are also provided; and may not be indepenĆ dent of the hardware interfaces. PEN*KEY R 6100 Computer Programmer’s Reference Guide
4-1
4. Power Management
Power Management BIOS: ELANAPM.EXE
Page 104
Power Management
SECTION 4
The layer immediately above the APM BIOS includes the operating system power management driver. For DOSĆbased systems, the device driver is NORDOSPM.EXE. For Windows applications, the device driver is NORWINPM.DRV, and VPOWERD.386 is included. The operating system driver is responsible for the power management strategy. This includes system power state and device power state transitions. The driver is also responsible for the application interfaces. The highest layer includes applications that are APMĆaware. Applications reĆ ceive power messages only from the APM driver. Applications can communicate with either the APM driver or the APM BIOS. The objective of APM is to control the power usage of the system according to system activity. As system activity decreases, APM reduces the power consumpĆ tion of system resources until the system is brought into a suspend state. There are two methods of powerĆlevel control: "
"
The APM BIOS manages CPU/core logic, display, and backlight power in the background, based on device activity. An APM driver (NORDOSPM.EXE or NORWINPM.DRV and VPOWERD.386) participates in managing power levels via function calls to the APM software interface.
System Power States The APM driver has three default system power states: Ready ( full on ) " Idle " APM suspend. The primary difference between states is the latency needed for the system to reach full operation. Power consumption and performance are greatest in the Ready state and decrease with each succeeding state. "
"
"
"
4. Power Management
System Ready is the default mode when the system is not engaged in power management. System Idle is the first level of power management. The CPU is halted and the system clock speed is reduced. Transitions from Idle to Ready are instantaneous. System Suspend is the second level of power management. The CPU clock is stopped and devices are placed into the power state defined by the apĆ plication for System Suspend. The device power state for suspend can be any power state defined for that device. The exact definition of a device power state during suspend is performed by using the Set Power State, Get Power State, and Enable/Disable Device Power Management functions. Transitions from suspend to ready generally take 100 milliseconds.
System Power State Management System power states are managed through the use of activity monitors, activity timers, and function calls from APM device drivers or APMĆaware applications. Activity monitors are hardwareĆspecific devices that watch for I/O to predefined I/O devices and I/O addresses. The PEN*KEY 6100 system has activity moniĆ tors for the following I/O devices. Whenever one of these devices is accessed, a bit in the activity monitor for the device becomes set. 4-2
PEN*KEY R 6100 Computer Programmer’s Reference Guide
Page 105
SECTION 4
Power Management
I/O Address (Hex)
Device
000ć00F 080ć08F 0C0ć0DF 022-023 060, 064 1E8ć1EF 1F0ć1F7 200 207 2F8ć2FF 3B0ć3DF 3E0ć3E1 3E8ć3EF 3F8ć3FF 220ć224 2E8ć2EF
DMA (I/O activity to both the controller and DMA page registers) ELAN Keyboard (60h and 64h) Internal scanner PC Card ATA drive Touch Screen COM2 (2F8ć2FFh) VGA (I/O and memory activity (0A0000hć0BFFFFFh) PC Card (I/O activity, slot control, and page frame access) COM3 COM1 (3F8hć3FFh) SST radio COM4
Activity timers are defined for System Idle and System Suspend. These timers are enabled by default and their timeĆout period can be set or retrieved by OEM APM functions Set Device Activity Timer or Get Device Activity Timer. These timĆ ers decrement when no system activity occurs within 0.125 second and are reset to the defined period when activity occurs within 0.125 second. If either Idle or Suspend timeĆout is set to zero, the activity timer is disabled. When activity timĆ ers decrement to zero, the system power state associated with the timer is enĆ tered (either System Idle or System Suspend). Activity monitors can be masked so that activity on a given device are ignored and not cause the activity timers associated with System Idle or System Suspend to be reset when activity occurs on the masked device. OEM APM functions Set Device Activity Mask and Get Device Activity Mask are provided for this purpose. Functions that affect system power states are CPU IDLE, CPU BUSY, and SysĆ tem Suspend. System Suspend is invoked by the Set Power State function for deĆ vice 0001h. APM Drivers or APMĆaware applications may make these function calls. The CPU IDLE call causes the system to enter a lowĆpower state by decreasing the system clock frequency and issuing a HALT instruction to the CPU. The idle state may automatically be entered whenever there is a lack of system activity if the IDLE activity timer is nonzero. The IDLE state is exited whenever an interĆ rupt service routine is invoked that causes I/0 activity or performs a CPU BUSY call. The IDLE state returns to the READY (full power state) in this condition.
The Set Power State function call with a device of 0001h causes the system to enĆ ter System Suspend. System Suspend is also entered whenever the SUSPEND activity timer reaches zero or the ON/OFF button is pressed. The System SusĆ pend state is exited only by a wakeup event.
PEN*KEY R 6100 Computer Programmer’s Reference Guide
4-3
4. Power Management
The CPU Busy call cases the Activity timers associated with System Idle and System Suspend to be reset. This call acts as though an I/O activity was moniĆ tored by the APM BIOS, in that it resets all system activity timers and causes the system either to enter READY or remain in the Ready state.
Page 106
Power Management
SECTION 4
Possible wakeup events (sources) are plentiful and are defined by the 6100 ComĆ puter as follows: ON/OFF button press " MODEM ring indicator " PC Card MODEM ring indicator " POD 1 ring indicator " Real Time Clock Alarm expiration " Application of external power (charge) Wakeup events can be set or masked via OEM APM function calls Get Wakeup Mask and Set Wakeup mask. "
Device Power Control Devices may be powerĆmanaged either by the system APM BIOS, APM device driver, or APMĆaware application via the Set Power State function. Device drivers or applications that control device power should be aware that, when the system enters System Suspend, all peripheral devices managed by the driver or application loses power during System Suspend, but is restored to the previous power state upon System Resume. Device drivers or applications that use the Enable/Disable Device Power ManĆ agement function can override this functionality during Suspend. These drivers or applications take sole responsibility for device power management during SusĆ pend. This feature allows system devices, the operating system, or application to tell the BIOS to stop power managing a particular device, after which operatingĆ systemĆspecific drivers or applications for that device may directly take over powĆ er management. Devices may be requested to be placed into any one of the following states via the Set Power State function. Table 4-1 Power States (General Definitions)
4. Power Management
State Ready Standby Suspend Off
Description The device is in its fullĆpower state. The device is capable of doing some work but is in a lowĆpower state. The device is not capable of doing work and is in its lowest power state The device is not capable of doing work and is in its lowest power state
The power states for each device in a 6100 Computer are defined as follows: Table 4-2 Power States (Display) Power State READY STANDBY SUSPEND OFF 4-4
Description Enables LCD and places VGA controller into fullĆpower state VGA registers and memory are accessible. LCD is OFF. VGA controller placed into hardware suspend Same as SUSPEND
PEN*KEY R 6100 Computer Programmer’s Reference Guide
Page 107
SECTION 4
Power Management
Table 4-3 Power States (PC Card) Power State READY STANDBY SUSPEND OFF
Description PC Card is in the fullĆpower state PC Card is in softwareĆactivated hardware suspend state PC Card is in softwareĆactivated hardware suspend state PC Card is in softwareĆactivated hardware suspend state Table 4-4 Power States (Serial Port)
Power State READY STANDBY SUSPEND OFF
Description If either RS-232 or RS-485 is enabled, the UART CLOCK is enabled. If RS-232 is enabled, the RS-232 transceiver is enabled. If both RS-232 and RS-485 are disabled, the UART CLOCK is turned off. If RS-232 is off, the RS-232 transceiver is turned off. Same as STANDBY Same as STANDBY Table 4-5 Power States (Digitizer)
Power State READY STANDBY SUSPEND OFF
Description The digitizer is placed in its fullĆpower state. The digitizer is placed in hardware suspend state Same as STANDBY Same as STANDBY Table 4-6 Power States (Pod)
Power State READY STANDBY SUSPEND OFF
Description Voltage is distributed to the POD. (not defined) (not defined) Voltage is removed from the POD 4. Power Management
Table 4-7 Power States (PC Card Slot) Power State READY STANDBY SUSPEND OFF
Description Power is routed to the slot (not defined) (not defined) Power is removed from the slot
PEN*KEY R 6100 Computer Programmer’s Reference Guide
4-5
Page 108
Power Management
SECTION 4
Table 4-8 Power States (System) Power State READY STANDBY SUSPEND OFF PROCESSING REJECTED
Description No action No action The system is placed into SUSPEND. Any APMĆdisabled devices are left in the power state they were set to before entering suspend. Same as SUSPEND No action is performed No action is performed Table 4-9 Power States (Backlight)
Power State READY STANDBY SUSPEND OFF
Description The backlight is turned on. (not defined) (not defined) The backlight is turned off
APM Software Interface The following paragraphs describe the software interface between the APM BIOS and the APM driver. Refer to the Conversions and Interfaces section of this publication for details of the actual BIOS interrupts.
APM Connection The APM driver provides an interface between the APM BIOS and APMĆaware applications. When the interface between the APM BIOS and device driver is established, the APM driver receives powerĆrelated events from the APM BIOS, which the driver in turn broadcasts to APMĆaware applications. The APM Installation Check function determines whether ELANAPM.EXE is present in the system, the version of APM that ELANAPM.EXE supports, and the attributes of the implementation. The APM driver issues an APM ConnecĆ tion call to establish the appropriate cooperative connection with the APM BIOS. The APM Interface Disconnect function disconnects the cooperative connection between the APM Driver and the APM BIOS. Only one APM connection can be active at a time. 4. Power Management
Power Management Events Power Management Events are communicated from the APM BIOS to the APM driver through a call by the APM driver to the APM BIOS function Get PM Event. It is the responsibility of the APM driver to broadcast Power ManageĆ ment Events to its APMĆaware applications.
4-6
PEN*KEY R 6100 Computer Programmer’s Reference Guide
Page 109
SECTION 4
Power Management
Table 4-10 is a list of the defined power management events that the APM BIOS can report: Table 4-10 Power Management Event Codes Code (Hex) 0002 0003 0004 0005 0006 0008 000A
Description System Suspend Request Notification Normal Resume System Notification Critical Resume System Notification Battery Low Notification Power Status Change Notification Critical System Suspend Notification User System Suspend Request Notification
System Suspend Request Notification - notifies the APM Driver that the APM BIOS wants to put the system into the Suspend State when the System Suspend activity timer times out. If APM BIOS power management is disabled, it is the APM Driver's responsibility to determine whether the system should be placed in the Suspend State. The APM Driver must notify APMĆaware applications of the System Suspend request. This notification allows the device drivers the opportuĆ nity to prepare for the suspend state change or to reject the request. To process a suspend request, the APM Driver calls the Set Power State function with BX = 0001h (all devices) and CX = 0002h when all processing is complete. The APM BIOS (ELANAPM.EXE) does not enter the suspend state on its own unless APM BIOS power management is enabled via the Enable/Disable Power Management call. Normal Resume System Notification - indicates that a System Resume from a press of the SUSPEND/RESUME key after a normal System Suspend has ocĆ curred. The APM driver must update the time from the realĆtime clock when it receives this notification and notify APMĆaware applications of the event. The applications are then responsible for preparing devices for use. Critical Resume System Notification - indicates that a Critical Resume System operation occurred. The APM driver updates the time from the realĆtime clock when it receives this notification and notifies APMĆaware applications of the event. These applications then prepare their devices for use.
Power Status Change Notification - informs the APM driver that the system's power status has changed. The APM driver must issue the Get Power Status call to determine the change to the charge status. ELANAPM.EXE signals a Power Status Change Notification event when the system's charger input changes status, when the battery flag changes, or the charge remaining changes. Critical System Suspend Notification - notifies the APM driver that the APM BIOS has detected a situation in which the system must be suspended and all devices placed in an off state, as defined by the device. The APM must broadcast this message to all APMĆaware applications. The driver must not refuse the susĆ pend operation, even if APMĆaware applications refuse the notification, and must verify that all devices are in the off state prior to issuing the suspend operation. PEN*KEY R 6100 Computer Programmer’s Reference Guide
4-7
4. Power Management
Battery Low Notification - informs the APM driver that the system's battery is running low. The APM driver broadcasts this message to APMĆaware applicaĆ tions. The status of the battery must be retrieved by the Get Power Status call.
Page 110
Power Management
SECTION 4
After a system has been suspended and the system is resumed, a Critical ReĆ sume System Notification power management event is posted by the APM BIOS. The APM driver must notify APMĆaware applications and device drivers when the system is resumed from a critical suspend. User System Suspend Request Notification - notifies the APM driver that the SUSPEND/RESUME button has been pressed and the user wants to put the sysĆ tem into the Suspend State. The APM driver must notify APMĆaware applicaĆ tions of the System Suspend request. This notification allows the device drivers the opportunity to prepare for the suspend state change or to reject the request. If the request is to be accepted, the APM driver calls the Set Power State funcĆ tion to set the system state to suspend. The BIOS does not enter the suspend state on its own unless BIOS power management has been enabled via the EnĆ able/Disable Power Management call.
APM Include Files APMEVENT.H APMEVENT.H is a C++ include file that defines APM 1.1 event codes for BIOS, DOS, and Windows. APM 1.1 BIOS event codes Windows APM 1.1 event codes
BIOS, DOS, and Windows OEMĆdefined APM codes (specific for Intermec Technologies Corporation)
These codes are broadcast to DOS TSRs by the APM OS Driver. These events are broadcast to the Windows drivers and parent windows by the Windows APM driver. Note that these codes are one less than the corresponding BIOS codes. Also, only three codes are actually defined in the Windows 3.1 WINDOWS.H header file. Many of these codes are used by the APM BIOS to communicate with the APM OS driver and are not actually broadcast to DOS or Windows system components.
PMEVENTS.H PMEVENTS.H contains power management event constants. For an example of these files, refer to Appendix B, Common PEN*KEY 6000 SeĆ ries Information. 4. Power Management 4-8
PEN*KEY R 6100 Computer Programmer’s Reference Guide
Page 111
SECTION 4
Power Management
Firmware Error Codes Table 4-11 Firmware Error Codes APM Function Error Messages Power Management functionality disabled Real Mode interface connection already established
03
Interface not connected
05
16Ćbit protected mode interface already established
06 07
16Ćbit protected mode interface not supported 32Ćbit protected mode interface already established
08 09
32Ćbit protected mode interface not supported Unrecognized device ID
0A
Parameter value out of range
60 80 86
Unable to enter requested state No power management events pending Reserved - No APM present
Applicable APM Calls Enable/Disable Power Management APM Protect Mode 16Ćbit Interface Connect APM Protect Mode 32Ćbit Interface Connect APM Real Mode Interface Connect APM Interface Disconnect Enable/Disable Power Management APM Protect Mode 16Ćbit Interface Connect APM Protect Mode 32Ćbit Interface Connect APM Real Mode Interface Connect APM Protect Mode 16Ćbit Interface Connect APM Protect Mode 16Ćbit Interface Connect APM Protect Mode 32Ćbit Interface Connect APM Real Mode Interface Connect APM Protect Mode 32Ćbit Interface Connect APM Installation Check APM Interface Disconnect APM Protect Mode 16Ćbit Interface Connect APM Protect Mode 32Ćbit Interface Connect APM Real Mode Interface Connect Enable/Disable Device Power Management Enable/Disable Power Management Engage/Disengage Power Management Get Power State Get Power Status Restore APM BIOS Power-On Defaults Set Power State Enable/Disable Device Power Management Enable/Disable Power Management Engage/Disengage Power Management Set Power State Set Power State Get PM event APM Installation Check
Refer to the APM BIOS Interface Specification 1.1 publication, for further deĆ tails. The Reference, Open Systems Publications section contains information for ordering that document.
PEN*KEY R 6100 Computer Programmer’s Reference Guide
4-9
4. Power Management
Error (Hex) 01 02
Page 112
Power Management
4. Power Management 4-10
PEN*KEY R 6100 Computer Programmer’s Reference Guide
SECTION 4