]>
Commit | Line | Data |
---|---|---|
d1f95000 | 1 | /** @file\r |
630b4187 | 2 | The file provides services that allow information about an\r |
d1f95000 | 3 | absolute pointer device to be retrieved.\r |
d1f95000 | 4 | \r |
9095d37b | 5 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
d1f95000 | 7 | \r |
497a5fb1 SZ |
8 | @par Revision Reference:\r |
9 | This Protocol was introduced in UEFI Specification 2.3.\r | |
10 | \r | |
d1f95000 | 11 | **/\r |
12 | \r | |
13 | #ifndef __ABSOLUTE_POINTER_H__\r | |
14 | #define __ABSOLUTE_POINTER_H__\r | |
15 | \r | |
16 | \r | |
17 | #define EFI_ABSOLUTE_POINTER_PROTOCOL_GUID \\r | |
18 | { 0x8D59D32B, 0xC655, 0x4AE9, { 0x9B, 0x15, 0xF2, 0x59, 0x04, 0x99, 0x2A, 0x43 } }\r | |
19 | \r | |
20 | \r | |
21 | typedef struct _EFI_ABSOLUTE_POINTER_PROTOCOL EFI_ABSOLUTE_POINTER_PROTOCOL;\r | |
22 | \r | |
23 | \r | |
24 | //*******************************************************\r | |
25 | // EFI_ABSOLUTE_POINTER_MODE\r | |
26 | //*******************************************************\r | |
27 | \r | |
28 | \r | |
29 | /**\r | |
30 | The following data values in the EFI_ABSOLUTE_POINTER_MODE\r | |
31 | interface are read-only and are changed by using the appropriate\r | |
4ca9b6c4 | 32 | interface functions.\r |
d1f95000 | 33 | **/\r |
34 | typedef struct {\r | |
7b98db89 | 35 | UINT64 AbsoluteMinX; ///< The Absolute Minimum of the device on the x-axis\r |
36 | UINT64 AbsoluteMinY; ///< The Absolute Minimum of the device on the y axis.\r | |
37 | UINT64 AbsoluteMinZ; ///< The Absolute Minimum of the device on the z-axis\r | |
9095d37b | 38 | UINT64 AbsoluteMaxX; ///< The Absolute Maximum of the device on the x-axis. If 0, and the\r |
7b98db89 | 39 | ///< AbsoluteMinX is 0, then the pointer device does not support a xaxis\r |
9095d37b | 40 | UINT64 AbsoluteMaxY; ///< The Absolute Maximum of the device on the y -axis. If 0, and the\r |
7b98db89 | 41 | ///< AbsoluteMinX is 0, then the pointer device does not support a yaxis.\r |
9095d37b | 42 | UINT64 AbsoluteMaxZ; ///< The Absolute Maximum of the device on the z-axis. If 0 , and the\r |
7b98db89 | 43 | ///< AbsoluteMinX is 0, then the pointer device does not support a zaxis\r |
9095d37b LG |
44 | UINT32 Attributes; ///< The following bits are set as needed (or'd together) to indicate the\r |
45 | ///< capabilities of the device supported. The remaining bits are undefined\r | |
7b98db89 | 46 | ///< and should be 0\r |
d1f95000 | 47 | } EFI_ABSOLUTE_POINTER_MODE;\r |
48 | \r | |
99e8ed21 | 49 | ///\r |
9095d37b LG |
50 | /// If set, indicates this device supports an alternate button input.\r |
51 | ///\r | |
d1f95000 | 52 | #define EFI_ABSP_SupportsAltActive 0x00000001\r |
53 | \r | |
99e8ed21 | 54 | ///\r |
55 | /// If set, indicates this device returns pressure data in parameter CurrentZ.\r | |
9095d37b | 56 | ///\r |
d1f95000 | 57 | #define EFI_ABSP_SupportsPressureAsZ 0x00000002\r |
58 | \r | |
59 | \r | |
60 | /**\r | |
61 | This function resets the pointer device hardware. As part of\r | |
62 | initialization process, the firmware/device will make a quick\r | |
63 | but reasonable attempt to verify that the device is\r | |
64 | functioning. If the ExtendedVerification flag is TRUE the\r | |
65 | firmware may take an extended amount of time to verify the\r | |
66 | device is operating on reset. Otherwise the reset operation is\r | |
67 | to occur as quickly as possible. The hardware verification\r | |
68 | process is not defined by this specification and is left up to\r | |
69 | the platform firmware or driver to implement.\r | |
70 | \r | |
4ca9b6c4 LG |
71 | @param This A pointer to the EFI_ABSOLUTE_POINTER_PROTOCOL\r |
72 | instance.\r | |
d1f95000 | 73 | \r |
74 | @param ExtendedVerification Indicates that the driver may\r | |
75 | perform a more exhaustive\r | |
76 | verification operation of the\r | |
77 | device during reset.\r | |
78 | \r | |
4ca9b6c4 | 79 | @retval EFI_SUCCESS The device was reset.\r |
9095d37b | 80 | \r |
d1f95000 | 81 | @retval EFI_DEVICE_ERROR The device is not functioning\r |
82 | correctly and could not be reset.\r | |
83 | \r | |
84 | **/\r | |
85 | typedef\r | |
86 | EFI_STATUS\r | |
8b13229b | 87 | (EFIAPI *EFI_ABSOLUTE_POINTER_RESET)(\r |
8ae0b360 | 88 | IN EFI_ABSOLUTE_POINTER_PROTOCOL *This,\r |
89 | IN BOOLEAN ExtendedVerification\r | |
d1f95000 | 90 | );\r |
91 | \r | |
7b98db89 | 92 | ///\r |
93 | /// This bit is set if the touch sensor is active.\r | |
94 | ///\r | |
9095d37b | 95 | #define EFI_ABSP_TouchActive 0x00000001\r |
d1f95000 | 96 | \r |
7b98db89 | 97 | ///\r |
98 | /// This bit is set if the alt sensor, such as pen-side button, is active\r | |
9095d37b | 99 | ///\r |
d1f95000 | 100 | #define EFI_ABS_AltActive 0x00000002\r |
101 | \r | |
102 | \r | |
103 | /**\r | |
104 | Definition of EFI_ABSOLUTE_POINTER_STATE.\r | |
d1f95000 | 105 | **/\r |
106 | typedef struct {\r | |
7b98db89 | 107 | ///\r |
9095d37b LG |
108 | /// The unsigned position of the activation on the x axis. If the AboluteMinX\r |
109 | /// and the AboluteMaxX fields of the EFI_ABSOLUTE_POINTER_MODE structure are\r | |
7b98db89 | 110 | /// both 0, then this pointer device does not support an x-axis, and this field\r |
111 | /// must be ignored.\r | |
112 | ///\r | |
d1f95000 | 113 | UINT64 CurrentX;\r |
9095d37b | 114 | \r |
7b98db89 | 115 | ///\r |
9095d37b LG |
116 | /// The unsigned position of the activation on the y axis. If the AboluteMinY\r |
117 | /// and the AboluteMaxY fields of the EFI_ABSOLUTE_POINTER_MODE structure are\r | |
7b98db89 | 118 | /// both 0, then this pointer device does not support an y-axis, and this field\r |
9095d37b | 119 | /// must be ignored.\r |
7b98db89 | 120 | ///\r |
d1f95000 | 121 | UINT64 CurrentY;\r |
9095d37b | 122 | \r |
7b98db89 | 123 | ///\r |
9095d37b LG |
124 | /// The unsigned position of the activation on the z axis, or the pressure\r |
125 | /// measurement. If the AboluteMinZ and the AboluteMaxZ fields of the\r | |
126 | /// EFI_ABSOLUTE_POINTER_MODE structure are both 0, then this pointer device\r | |
127 | /// does not support an z-axis, and this field must be ignored.\r | |
7b98db89 | 128 | ///\r |
d1f95000 | 129 | UINT64 CurrentZ;\r |
9095d37b | 130 | \r |
7b98db89 | 131 | ///\r |
132 | /// Bits are set to 1 in this structure item to indicate that device buttons are\r | |
133 | /// active.\r | |
134 | ///\r | |
d1f95000 | 135 | UINT32 ActiveButtons;\r |
136 | } EFI_ABSOLUTE_POINTER_STATE;\r | |
137 | \r | |
138 | /**\r | |
139 | The GetState() function retrieves the current state of a pointer\r | |
140 | device. This includes information on the active state associated\r | |
141 | with the pointer device and the current position of the axes\r | |
142 | associated with the pointer device. If the state of the pointer\r | |
143 | device has not changed since the last call to GetState(), then\r | |
144 | EFI_NOT_READY is returned. If the state of the pointer device\r | |
145 | has changed since the last call to GetState(), then the state\r | |
146 | information is placed in State, and EFI_SUCCESS is returned. If\r | |
147 | a device error occurs while attempting to retrieve the state\r | |
148 | information, then EFI_DEVICE_ERROR is returned.\r | |
149 | \r | |
150 | \r | |
4ca9b6c4 LG |
151 | @param This A pointer to the EFI_ABSOLUTE_POINTER_PROTOCOL\r |
152 | instance.\r | |
d1f95000 | 153 | \r |
154 | @param State A pointer to the state information on the\r | |
155 | pointer device.\r | |
156 | \r | |
4ca9b6c4 LG |
157 | @retval EFI_SUCCESS The state of the pointer device was\r |
158 | returned in State.\r | |
d1f95000 | 159 | \r |
4ca9b6c4 LG |
160 | @retval EFI_NOT_READY The state of the pointer device has not\r |
161 | changed since the last call to GetState().\r | |
d1f95000 | 162 | \r |
163 | @retval EFI_DEVICE_ERROR A device error occurred while\r | |
164 | attempting to retrieve the pointer\r | |
165 | device's current state.\r | |
166 | \r | |
167 | **/\r | |
168 | typedef\r | |
169 | EFI_STATUS\r | |
8b13229b | 170 | (EFIAPI *EFI_ABSOLUTE_POINTER_GET_STATE)(\r |
ee6c452c | 171 | IN EFI_ABSOLUTE_POINTER_PROTOCOL *This,\r |
ff95c0fc | 172 | OUT EFI_ABSOLUTE_POINTER_STATE *State\r |
d1f95000 | 173 | );\r |
174 | \r | |
175 | \r | |
44717a39 | 176 | ///\r |
177 | /// The EFI_ABSOLUTE_POINTER_PROTOCOL provides a set of services\r | |
178 | /// for a pointer device that can be used as an input device from an\r | |
179 | /// application written to this specification. The services include\r | |
630b4187 | 180 | /// the ability to: reset the pointer device, retrieve the state of\r |
44717a39 | 181 | /// the pointer device, and retrieve the capabilities of the pointer\r |
630b4187 | 182 | /// device. The service also provides certain data items describing the device.\r |
44717a39 | 183 | ///\r |
d1f95000 | 184 | struct _EFI_ABSOLUTE_POINTER_PROTOCOL {\r |
185 | EFI_ABSOLUTE_POINTER_RESET Reset;\r | |
186 | EFI_ABSOLUTE_POINTER_GET_STATE GetState;\r | |
7b98db89 | 187 | ///\r |
9095d37b | 188 | /// Event to use with WaitForEvent() to wait for input from the pointer device.\r |
7b98db89 | 189 | ///\r |
d1f95000 | 190 | EFI_EVENT WaitForInput;\r |
44717a39 | 191 | ///\r |
192 | /// Pointer to EFI_ABSOLUTE_POINTER_MODE data.\r | |
193 | ///\r | |
d1f95000 | 194 | EFI_ABSOLUTE_POINTER_MODE *Mode;\r |
195 | };\r | |
196 | \r | |
197 | \r | |
198 | extern EFI_GUID gEfiAbsolutePointerProtocolGuid;\r | |
199 | \r | |
200 | \r | |
201 | #endif\r | |
202 | \r |