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