iPXE
AbsolutePointer.h
Go to the documentation of this file.
00001 /** @file
00002   The file provides services that allow information about an
00003   absolute pointer device to be retrieved.
00004 
00005   Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
00006   This program and the accompanying materials
00007   are licensed and made available under the terms and conditions of the BSD License
00008   which accompanies this distribution.  The full text of the license may be found at
00009   http://opensource.org/licenses/bsd-license.php
00010 
00011   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
00012   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
00013 
00014 **/
00015 
00016 #ifndef __ABSOLUTE_POINTER_H__
00017 #define __ABSOLUTE_POINTER_H__
00018 
00019 FILE_LICENCE ( BSD3 );
00020 
00021 
00022 #define EFI_ABSOLUTE_POINTER_PROTOCOL_GUID \
00023   { 0x8D59D32B, 0xC655, 0x4AE9, { 0x9B, 0x15, 0xF2, 0x59, 0x04, 0x99, 0x2A, 0x43 } }
00024 
00025 
00026 typedef struct _EFI_ABSOLUTE_POINTER_PROTOCOL EFI_ABSOLUTE_POINTER_PROTOCOL;
00027 
00028 
00029 //*******************************************************
00030 // EFI_ABSOLUTE_POINTER_MODE
00031 //*******************************************************
00032 
00033 
00034 /**
00035   The following data values in the EFI_ABSOLUTE_POINTER_MODE
00036   interface are read-only and are changed by using the appropriate
00037   interface functions.
00038 **/
00039 typedef struct {
00040   UINT64 AbsoluteMinX; ///< The Absolute Minimum of the device on the x-axis
00041   UINT64 AbsoluteMinY; ///< The Absolute Minimum of the device on the y axis.
00042   UINT64 AbsoluteMinZ; ///< The Absolute Minimum of the device on the z-axis
00043   UINT64 AbsoluteMaxX; ///< The Absolute Maximum of the device on the x-axis. If 0, and the
00044                        ///< AbsoluteMinX is 0, then the pointer device does not support a xaxis
00045   UINT64 AbsoluteMaxY; ///< The Absolute Maximum of the device on the y -axis. If 0, and the
00046                        ///< AbsoluteMinX is 0, then the pointer device does not support a yaxis.
00047   UINT64 AbsoluteMaxZ; ///< The Absolute Maximum of the device on the z-axis. If 0 , and the
00048                        ///< AbsoluteMinX is 0, then the pointer device does not support a zaxis
00049   UINT32 Attributes;   ///< The following bits are set as needed (or'd together) to indicate the
00050                        ///< capabilities of the device supported. The remaining bits are undefined
00051                        ///< and should be 0
00052 } EFI_ABSOLUTE_POINTER_MODE;
00053 
00054 ///
00055 /// If set, indicates this device supports an alternate button input.
00056 ///
00057 #define EFI_ABSP_SupportsAltActive    0x00000001
00058 
00059 ///
00060 /// If set, indicates this device returns pressure data in parameter CurrentZ.
00061 ///
00062 #define EFI_ABSP_SupportsPressureAsZ  0x00000002
00063 
00064 
00065 /**
00066   This function resets the pointer device hardware. As part of
00067   initialization process, the firmware/device will make a quick
00068   but reasonable attempt to verify that the device is
00069   functioning. If the ExtendedVerification flag is TRUE the
00070   firmware may take an extended amount of time to verify the
00071   device is operating on reset. Otherwise the reset operation is
00072   to occur as quickly as possible. The hardware verification
00073   process is not defined by this specification and is left up to
00074   the platform firmware or driver to implement.
00075 
00076   @param This                 A pointer to the EFI_ABSOLUTE_POINTER_PROTOCOL
00077                               instance.
00078 
00079   @param ExtendedVerification Indicates that the driver may
00080                               perform a more exhaustive
00081                               verification operation of the
00082                               device during reset.
00083 
00084   @retval EFI_SUCCESS       The device was reset.
00085 
00086   @retval EFI_DEVICE_ERROR  The device is not functioning
00087                             correctly and could not be reset.
00088 
00089 **/
00090 typedef
00091 EFI_STATUS
00092 (EFIAPI *EFI_ABSOLUTE_POINTER_RESET)(
00093   IN EFI_ABSOLUTE_POINTER_PROTOCOL *This,
00094   IN BOOLEAN                       ExtendedVerification
00095 );
00096 
00097 ///
00098 /// This bit is set if the touch sensor is active.
00099 ///
00100 #define EFI_ABSP_TouchActive  0x00000001
00101 
00102 ///
00103 /// This bit is set if the alt sensor, such as pen-side button, is active
00104 ///
00105 #define EFI_ABS_AltActive     0x00000002
00106 
00107 
00108 /**
00109   Definition of EFI_ABSOLUTE_POINTER_STATE.
00110 **/
00111 typedef struct {
00112   ///
00113   /// The unsigned position of the activation on the x axis. If the AboluteMinX
00114   /// and the AboluteMaxX fields of the EFI_ABSOLUTE_POINTER_MODE structure are
00115   /// both 0, then this pointer device does not support an x-axis, and this field
00116   /// must be ignored.
00117   ///
00118   UINT64 CurrentX;
00119 
00120   ///
00121   /// The unsigned position of the activation on the y axis. If the AboluteMinY
00122   /// and the AboluteMaxY fields of the EFI_ABSOLUTE_POINTER_MODE structure are
00123   /// both 0, then this pointer device does not support an y-axis, and this field
00124   /// must be ignored.
00125   ///
00126   UINT64 CurrentY;
00127 
00128   ///
00129   /// The unsigned position of the activation on the z axis, or the pressure
00130   /// measurement. If the AboluteMinZ and the AboluteMaxZ fields of the
00131   /// EFI_ABSOLUTE_POINTER_MODE structure are both 0, then this pointer device
00132   /// does not support an z-axis, and this field must be ignored.
00133   ///
00134   UINT64 CurrentZ;
00135 
00136   ///
00137   /// Bits are set to 1 in this structure item to indicate that device buttons are
00138   /// active.
00139   ///
00140   UINT32 ActiveButtons;
00141 } EFI_ABSOLUTE_POINTER_STATE;
00142 
00143 /**
00144   The GetState() function retrieves the current state of a pointer
00145   device. This includes information on the active state associated
00146   with the pointer device and the current position of the axes
00147   associated with the pointer device. If the state of the pointer
00148   device has not changed since the last call to GetState(), then
00149   EFI_NOT_READY is returned. If the state of the pointer device
00150   has changed since the last call to GetState(), then the state
00151   information is placed in State, and EFI_SUCCESS is returned. If
00152   a device error occurs while attempting to retrieve the state
00153   information, then EFI_DEVICE_ERROR is returned.
00154 
00155 
00156   @param This   A pointer to the EFI_ABSOLUTE_POINTER_PROTOCOL
00157                 instance.
00158 
00159   @param State  A pointer to the state information on the
00160                 pointer device.
00161 
00162   @retval EFI_SUCCESS       The state of the pointer device was
00163                             returned in State.
00164 
00165   @retval EFI_NOT_READY     The state of the pointer device has not
00166                             changed since the last call to GetState().
00167 
00168   @retval EFI_DEVICE_ERROR  A device error occurred while
00169                             attempting to retrieve the pointer
00170                             device's current state.
00171 
00172 **/
00173 typedef
00174 EFI_STATUS
00175 (EFIAPI *EFI_ABSOLUTE_POINTER_GET_STATE)(
00176   IN      EFI_ABSOLUTE_POINTER_PROTOCOL  *This,
00177   IN OUT  EFI_ABSOLUTE_POINTER_STATE     *State
00178 );
00179 
00180 
00181 ///
00182 /// The EFI_ABSOLUTE_POINTER_PROTOCOL provides a set of services
00183 /// for a pointer device that can be used as an input device from an
00184 /// application written to this specification. The services include
00185 /// the ability to: reset the pointer device, retrieve the state of
00186 /// the pointer device, and retrieve the capabilities of the pointer
00187 /// device. The service also provides certain data items describing the device.
00188 ///
00189 struct _EFI_ABSOLUTE_POINTER_PROTOCOL {
00190   EFI_ABSOLUTE_POINTER_RESET      Reset;
00191   EFI_ABSOLUTE_POINTER_GET_STATE  GetState;
00192   ///
00193   /// Event to use with WaitForEvent() to wait for input from the pointer device.
00194   ///
00195   EFI_EVENT                       WaitForInput;
00196   ///
00197   /// Pointer to EFI_ABSOLUTE_POINTER_MODE data.
00198   ///
00199   EFI_ABSOLUTE_POINTER_MODE       *Mode;
00200 };
00201 
00202 
00203 extern EFI_GUID gEfiAbsolutePointerProtocolGuid;
00204 
00205 
00206 #endif
00207