The text of a manual · part 10 of 28
PEN*KEY 6400 Computer Programmer's Reference Guide: Section 3: Power Management
Pages 67 to 78 of 234, from PEN*KEY 6400 Computer Programmer's Reference Guide
The original document is the PDF (1.4 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.
For the Intermec 6400
Page 67
Section 3
Power Management "
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
Introduction This section contains information about Advanced Power Management (APM) on the PEN*KEY â 6400 Computer. This following list can assist you in your search for topics of interest in this section: Topic Summary Topic
Page
Power Management BIOS: . . . . . . . . . . ELANAPM.EXE . . . .
3-2
System Power States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-2
System Power State Management . . . . . . . . . . . . . . . . . . . . .
3-3
Device Power Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-4
Power Device IDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-6
APM Software Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-6
APM BIOS Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-9
Firmware Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-11
The following list can further assist you in locating topics of interest: List of Tables Table
Page
Table 3-1, Activity Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-3
Table 3-2, Power States (General Definitions) . . . . . . . . . . . . . .
3-4
Table 3-3, Power States (Display) . . . . . . . . . . . . . . . . . . . . . . . . . .
3-5
Table 3-4, Power States (Serial Port) . . . . . . . . . . . . . . . . . . . . . . .
3-5
Table 3-5, Power States (System) . . . . . . . . . . . . . . . . . . . . . . . . . .
3-5
Table 3-6, Power States (Backlight) . . . . . . . . . . . . . . . . . . . . . . . .
3-5
Table 3-7, Power Device IDs (Register Values) . . . . . . . . . . . . . .
3-6
Table 3-8, Power Device IDs (Descriptions) . . . . . . . . . . . . . . . . .
3-6
Table 3-9, Power Management Event Codes . . . . . . . . . . . . . . . .
3-7
Table 3-10, APM Function Summary . . . . . . . . . . . . . . . . . . . . . .
3-9
Table 3-11, Firmware Error Codes . . . . . . . . . . . . . . . . . . . . . . . . .
3-11
PEN*KEYR 6400 Programmer’s Reference Guide
3-1
Page 68
SECTION 3
Power Management
Power Management BIOS: ELANAPM.EXE ELANAPM.EXE is the APM BIOS. The APM system consists of one or more layers 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, functions specific to Intermec are also provided; and may not be independent of the hardware interfaces. The layer immediately above the APM BIOS includes the operating system power management driver. For DOS-based systems, the device driver is NORDOSPM.EXE. 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 receive 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 consumption 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) participates in managing power levels with 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. " 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 application 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 1 - 2 seconds. 3-2
PEN*KEYR 6400 Programmer’s Reference Guide
Page 69
SECTION 3
Power Management
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 6400 System has activity monitors for the following I/O devices. Whenever one of these devices is accessed, a bit in the activity monitor for the device becomes set. Table 3-1 Activity Monitoring
I/O Address (Hex)
Device
000h - 00Fh 080h - 08Fh 0C0h - 0DFh
ü ý DOS\SYSTEM þ
022h - 023h
ELAN
060h, 064h
Keyboard (060h and 64h)
2F8h - 2FFh
COM2 (2F8h - 2FFh)
3E8h - 3EFh
COM3
3F8h - 3FFh
COM1 (3F8h - 3FFh)
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 timers 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 timers decrement to zero, the system power state associated with the timer is entered (either System Idle or System Suspend). Activity monitors can be masked so that activity on a given device is ignored and not cause the activity timers associated with System Idle or System Suspend to 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 System Suspend. System Suspend is invoked by the Set Power State function for device 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 also be entered when there is a lack of system activity if the IDLE activity timer is nonzero. The Idle state is exited whenever an interrupt 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 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 monitored 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. PEN*KEYR 6400 Programmer’s Reference Guide
3-3
Page 70
SECTION 3
Power Management
The Set Power State function call with a device of 0001h will cause the system to enter System Suspend. System Suspend is also entered whenever the SUSPEND activity timer reaches zero, or the ON/OFF button is pressed, or the battery door latch is pressed. The System Suspend state is exited only by a wakeup event. There are many possible sources of wakeup events, and are defined by the 6400 Computer, as: " ON/OFF or SCAN button press " Application of external power (charge) Wakeup events can be set or masked with 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 with the Set Power State function. Device drivers or applications that control device power should be aware that, when the system enters the System Suspend state, all peripheral devices managed by the driver or application loses power during System Suspend, but are restored to the previous power state upon System Resume. Device drivers or applications that use the Enable/Disable Device Power Management function can override this functionality during Suspend. These drivers or applications take sole responsibility for device power management during Suspend. 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 power management. " NOTE:
During System Suspend, all power is removed from the PC Card slot. Therefore, if a radio was in the slot, it would be powered off when the system is Suspended.
Devices may be requested to be placed into any one of the following states via the Set Power State function. The following table contains general definitions for each of the power states. Table 3-2 Power States (General Definitions)
State
Description
Ready
Device is in its full power-state.
Standby
Device is capable of doing some work but is in a low power state.
Suspend
Device is not capable of doing work and is in its lowest power state.
Off
Device is not capable of doing work and is in its lowest power state.
The power states for each device in the 6400 Computer are defined in the following tables. 3-4
PEN*KEYR 6400 Programmer’s Reference Guide
Page 71
SECTION 3
Power Management
Table 3-3 Power States (Display)
State
Description
Ready
Enables LCD and places CGA controller into full-power state.
Standby
Undefined
Suspend
CGA controller placed into hardware suspend.
Off
CGA controller placed into hardware suspend. Table 3-4 Power States (Serial Port)
State
Description
Ready
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.
Standby
Undefined
Suspend
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.
Off
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. Table 3-5 Power States (System)
State
Description
Ready
No action
Standby
No action
Suspend
The system is placed into “Suspend.” All devices are powered OFF when the system is suspended. The previous power state that existed before entering “Suspend” is unknown upon awakening.
Off
The system is placed into “Suspend.” All devices are powered off, and are left in the power state they were set to before entering “Suspend.”
Processing No action is performed. Rejected
No action is performed. Table 3-6 Power States (Backlight)
State
Description
Ready
Backlight is turned on.
Standby
Not defined.
Suspend
Not defined.
Off
Backlight is turned off.
PEN*KEYR 6400 Programmer’s Reference Guide
3-5
Page 72
SECTION 3
Power Management
Power Device IDs The APM Power Device Class/Subclass IDs are defined as follows: Table 3-7 Power Device IDs (Register Values)
Value in Register BX
Power Device ID
XXh
Unit number (zero based)
FFh
All units in this class Table 3-8 Power Device IDs (Descriptions)
ID (Hex)
Description
00XXh
System
00h
APM BIOS
01h
All devices power-managed by the APM BIOS
0100h
Display
0200h
Secondary storage (PC Card slot: dedicated to local area radio in 6400 Computer)
03XXh
Parallel ports
0400h
RS-232 serial port
0410h
RS-485 serial port
0500h
Reserved for Ethernet network adaptors
0700h–DFFFh
(reserved)
E000h–EFFFh
OEM-defined power device IDs
E200h
Backlight
F000h–FFFFh
(reserved)
APM Software Interface The following paragraphs describe the software interface between the APM BIOS and the APM driver.
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 Connection 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. 3-6
PEN*KEYR 6400 Programmer’s Reference Guide
Page 73
SECTION 3
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 Management Events to its APM-aware applications. The following is a list of the defined power management events that the APM BIOS can report: Table 3-9 Power Management Event Codes
Code (Hex)
Description
0002
System Suspend Request Notification
0003
Normal Resume System Notification
0004
Critical Resume System Notification
0005
Battery Low Notification
0006
Power Status Change Notification
0008
Critical System Suspend Notification
000A
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 opportunity 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 occurred. 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. PEN*KEYR 6400 Programmer’s Reference Guide
3-7
Page 74
SECTION 3
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 applications. The status of the battery must be retrieved by the Get Power Status call. 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 with this 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 when 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 suspend operation, even if APM-aware applications refuse the notification, and must verify that all devices are in the off state before doing the suspend operation. After a system is suspended and the system is resumed, the APM BIOS posts this event. 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 system into the Suspend state. The APM driver must notify APM-aware applications 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 function 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 with the Enable/Disable Power Management call.
3-8
PEN*KEYR 6400 Programmer’s Reference Guide
Page 75
SECTION 3
Power Management
APM BIOS Functions This paragraph describes the register interfaces to the APM BIOS functions. Functions are accessed through INT 15h. The carry (CY) flag is set and an error code is placed in the AH register when an error condition is detected. The carry flag is reset to zero upon return from successful calls. The contents of the AH register depend on the particular call. The following is a summary of the interrupt 15h functions that are available for APM on the 6400 Computer: Table 3-10 APM Function Summary
" NOTE:
DOS APM Interrupts (INT 15h)
Function AL =
APM Installation Check
00h
APM Real Mode Interface Connect
01h
APM Interface Disconnect
04h
CPU Idle
05h
CPU Busy
06h
Set Power State
07h
Enable or Disable Power Management
08h
Get Power Status
0Ah
Get PM Event
0Bh
Get Power State
0Ch
Enable or Disable Device Power Management
0Dh
Function AH = 53h for all DOS APM Interrupts (INT 15h) and no connection is required.
Refer to the BIOS Interrupt Support section of this publication, for descriptions of these interrupts. The Interrupt Cross-Reference table, in the BIOS Interrupt section, and the Interrupt Index, in the Index section can assist in locating the desired interrupts.
PEN*KEYR 6400 Programmer’s Reference Guide
3-9
Page 76
SECTION 3
Power Management
Radio Power Management TBD
3-10
PEN*KEYR 6400 Programmer’s Reference Guide
Page 77
SECTION 3
Power Management
Firmware Error Codes Table 3-11 Firmware Error Codes
Error (Hex)
APM Function Error Messages
01
Power Management functionality disabled.
Enable or Disable Power Management
02
Real Mode interface connection already established.
APM Protect Mode 16-bit Interface Connect APM Protect Mode 32-bit Interface Connect APM Real Mode Interface Connect
03
Interface not connected.
APM Interface Disconnect Enable or Disable Power Management
05
16-bit protected mode interface already established.
APM Protect Mode 16-bit Interface Connect APM Protect Mode 32-bit Interface Connect APM Real Mode Interface Connect
06
16-bit protected mode interface not supported.
APM Protect Mode 16-bit Interface Connect
07
16-bit protected mode interface already established.
APM Protect Mode 16-bit Interface Connect APM Protect Mode 32-bit Interface Connect APM Real Mode Interface Connect
08
32-bit protected mode interface not supported.
APM Protect Mode 32-bit Interface Connect
09
Unrecognized device ID.
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 or Disable Device Power Management Enable or Disable Power Management Engage or Disengage Power Management Get Power State Get Power Status Restore APM BIOS Power-On Defaults Set Power State
0A
Parameter value out of range.
Enable or Disable Device Power Management Enable or Disable Power Management Engage or Disengage Power Management Set Power State
60
Unable to enter requested state.
Set Power State
80
No power management events pending.
Get PM Event
86
Reserved, No APM present.
APM Installation Check
Applicable APM Calls
Refer to the APM BIOS Interface Specification 1.1, for further details of these firmware error codes. The Reference section, in this publication, contains ordering information for that document. PEN*KEYR 6400 Programmer’s Reference Guide
3-11
Page 78
Power Management
3-12
PEN*KEYR 6400 Programmer’s Reference Guide
SECTION 3