Repostiory containing DAPLink source code with Reset Pin workaround for HANI_IOT board.
Upstream: https://github.com/ARMmbed/DAPLink
source/usb/usb_hid.h@0:01f31e923fe2, 2020-04-07 (annotated)
- Committer:
- Pawel Zarembski
- Date:
- Tue Apr 07 12:55:42 2020 +0200
- Revision:
- 0:01f31e923fe2
hani: DAPLink with reset workaround
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Pawel Zarembski |
0:01f31e923fe2 | 1 | /** |
Pawel Zarembski |
0:01f31e923fe2 | 2 | * @file usb_hid.h |
Pawel Zarembski |
0:01f31e923fe2 | 3 | * @brief USB hid driver header |
Pawel Zarembski |
0:01f31e923fe2 | 4 | * |
Pawel Zarembski |
0:01f31e923fe2 | 5 | * DAPLink Interface Firmware |
Pawel Zarembski |
0:01f31e923fe2 | 6 | * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved |
Pawel Zarembski |
0:01f31e923fe2 | 7 | * SPDX-License-Identifier: Apache-2.0 |
Pawel Zarembski |
0:01f31e923fe2 | 8 | * |
Pawel Zarembski |
0:01f31e923fe2 | 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
Pawel Zarembski |
0:01f31e923fe2 | 10 | * not use this file except in compliance with the License. |
Pawel Zarembski |
0:01f31e923fe2 | 11 | * You may obtain a copy of the License at |
Pawel Zarembski |
0:01f31e923fe2 | 12 | * |
Pawel Zarembski |
0:01f31e923fe2 | 13 | * http://www.apache.org/licenses/LICENSE-2.0 |
Pawel Zarembski |
0:01f31e923fe2 | 14 | * |
Pawel Zarembski |
0:01f31e923fe2 | 15 | * Unless required by applicable law or agreed to in writing, software |
Pawel Zarembski |
0:01f31e923fe2 | 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
Pawel Zarembski |
0:01f31e923fe2 | 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Pawel Zarembski |
0:01f31e923fe2 | 18 | * See the License for the specific language governing permissions and |
Pawel Zarembski |
0:01f31e923fe2 | 19 | * limitations under the License. |
Pawel Zarembski |
0:01f31e923fe2 | 20 | */ |
Pawel Zarembski |
0:01f31e923fe2 | 21 | |
Pawel Zarembski |
0:01f31e923fe2 | 22 | #ifndef __USB_HID_H__ |
Pawel Zarembski |
0:01f31e923fe2 | 23 | #define __USB_HID_H__ |
Pawel Zarembski |
0:01f31e923fe2 | 24 | |
Pawel Zarembski |
0:01f31e923fe2 | 25 | |
Pawel Zarembski |
0:01f31e923fe2 | 26 | /* HID Subclass Codes */ |
Pawel Zarembski |
0:01f31e923fe2 | 27 | #define HID_SUBCLASS_NONE 0x00 |
Pawel Zarembski |
0:01f31e923fe2 | 28 | #define HID_SUBCLASS_BOOT 0x01 |
Pawel Zarembski |
0:01f31e923fe2 | 29 | |
Pawel Zarembski |
0:01f31e923fe2 | 30 | /* HID Protocol Codes */ |
Pawel Zarembski |
0:01f31e923fe2 | 31 | #define HID_PROTOCOL_NONE 0x00 |
Pawel Zarembski |
0:01f31e923fe2 | 32 | #define HID_PROTOCOL_BOOT 0x00 |
Pawel Zarembski |
0:01f31e923fe2 | 33 | #define HID_PROTOCOL_KEYBOARD 0x01 |
Pawel Zarembski |
0:01f31e923fe2 | 34 | #define HID_PROTOCOL_REPORT 0x01 |
Pawel Zarembski |
0:01f31e923fe2 | 35 | #define HID_PROTOCOL_MOUSE 0x02 |
Pawel Zarembski |
0:01f31e923fe2 | 36 | |
Pawel Zarembski |
0:01f31e923fe2 | 37 | |
Pawel Zarembski |
0:01f31e923fe2 | 38 | /* HID Descriptor Types */ |
Pawel Zarembski |
0:01f31e923fe2 | 39 | #define HID_HID_DESCRIPTOR_TYPE 0x21 |
Pawel Zarembski |
0:01f31e923fe2 | 40 | #define HID_REPORT_DESCRIPTOR_TYPE 0x22 |
Pawel Zarembski |
0:01f31e923fe2 | 41 | #define HID_PHYSICAL_DESCRIPTOR_TYPE 0x23 |
Pawel Zarembski |
0:01f31e923fe2 | 42 | |
Pawel Zarembski |
0:01f31e923fe2 | 43 | |
Pawel Zarembski |
0:01f31e923fe2 | 44 | /* HID Descriptor */ |
Pawel Zarembski |
0:01f31e923fe2 | 45 | typedef __packed struct _HID_DESCRIPTOR { |
Pawel Zarembski |
0:01f31e923fe2 | 46 | U8 bLength; |
Pawel Zarembski |
0:01f31e923fe2 | 47 | U8 bDescriptorType; |
Pawel Zarembski |
0:01f31e923fe2 | 48 | U16 bcdHID; |
Pawel Zarembski |
0:01f31e923fe2 | 49 | U8 bCountryCode; |
Pawel Zarembski |
0:01f31e923fe2 | 50 | U8 bNumDescriptors; |
Pawel Zarembski |
0:01f31e923fe2 | 51 | /* Array of one or more descriptors */ |
Pawel Zarembski |
0:01f31e923fe2 | 52 | __packed struct _HID_DESCRIPTOR_LIST { |
Pawel Zarembski |
0:01f31e923fe2 | 53 | U8 bDescriptorType; |
Pawel Zarembski |
0:01f31e923fe2 | 54 | U16 wDescriptorLength; |
Pawel Zarembski |
0:01f31e923fe2 | 55 | } DescriptorList[1]; |
Pawel Zarembski |
0:01f31e923fe2 | 56 | } HID_DESCRIPTOR; |
Pawel Zarembski |
0:01f31e923fe2 | 57 | |
Pawel Zarembski |
0:01f31e923fe2 | 58 | |
Pawel Zarembski |
0:01f31e923fe2 | 59 | /* HID Request Codes */ |
Pawel Zarembski |
0:01f31e923fe2 | 60 | #define HID_REQUEST_GET_REPORT 0x01 |
Pawel Zarembski |
0:01f31e923fe2 | 61 | #define HID_REQUEST_GET_IDLE 0x02 |
Pawel Zarembski |
0:01f31e923fe2 | 62 | #define HID_REQUEST_GET_PROTOCOL 0x03 |
Pawel Zarembski |
0:01f31e923fe2 | 63 | #define HID_REQUEST_SET_REPORT 0x09 |
Pawel Zarembski |
0:01f31e923fe2 | 64 | #define HID_REQUEST_SET_IDLE 0x0A |
Pawel Zarembski |
0:01f31e923fe2 | 65 | #define HID_REQUEST_SET_PROTOCOL 0x0B |
Pawel Zarembski |
0:01f31e923fe2 | 66 | |
Pawel Zarembski |
0:01f31e923fe2 | 67 | /* HID Report Types */ |
Pawel Zarembski |
0:01f31e923fe2 | 68 | #define HID_REPORT_INPUT 0x01 |
Pawel Zarembski |
0:01f31e923fe2 | 69 | #define HID_REPORT_OUTPUT 0x02 |
Pawel Zarembski |
0:01f31e923fe2 | 70 | #define HID_REPORT_FEATURE 0x03 |
Pawel Zarembski |
0:01f31e923fe2 | 71 | |
Pawel Zarembski |
0:01f31e923fe2 | 72 | |
Pawel Zarembski |
0:01f31e923fe2 | 73 | /* Usage Pages */ |
Pawel Zarembski |
0:01f31e923fe2 | 74 | #define HID_USAGE_PAGE_UNDEFINED 0x00 |
Pawel Zarembski |
0:01f31e923fe2 | 75 | #define HID_USAGE_PAGE_GENERIC 0x01 |
Pawel Zarembski |
0:01f31e923fe2 | 76 | #define HID_USAGE_PAGE_SIMULATION 0x02 |
Pawel Zarembski |
0:01f31e923fe2 | 77 | #define HID_USAGE_PAGE_VR 0x03 |
Pawel Zarembski |
0:01f31e923fe2 | 78 | #define HID_USAGE_PAGE_SPORT 0x04 |
Pawel Zarembski |
0:01f31e923fe2 | 79 | #define HID_USAGE_PAGE_GAME 0x05 |
Pawel Zarembski |
0:01f31e923fe2 | 80 | #define HID_USAGE_PAGE_DEV_CONTROLS 0x06 |
Pawel Zarembski |
0:01f31e923fe2 | 81 | #define HID_USAGE_PAGE_KEYBOARD 0x07 |
Pawel Zarembski |
0:01f31e923fe2 | 82 | #define HID_USAGE_PAGE_LED 0x08 |
Pawel Zarembski |
0:01f31e923fe2 | 83 | #define HID_USAGE_PAGE_BUTTON 0x09 |
Pawel Zarembski |
0:01f31e923fe2 | 84 | #define HID_USAGE_PAGE_ORDINAL 0x0A |
Pawel Zarembski |
0:01f31e923fe2 | 85 | #define HID_USAGE_PAGE_TELEPHONY 0x0B |
Pawel Zarembski |
0:01f31e923fe2 | 86 | #define HID_USAGE_PAGE_CONSUMER 0x0C |
Pawel Zarembski |
0:01f31e923fe2 | 87 | #define HID_USAGE_PAGE_DIGITIZER 0x0D |
Pawel Zarembski |
0:01f31e923fe2 | 88 | #define HID_USAGE_PAGE_UNICODE 0x10 |
Pawel Zarembski |
0:01f31e923fe2 | 89 | #define HID_USAGE_PAGE_ALPHANUMERIC 0x14 |
Pawel Zarembski |
0:01f31e923fe2 | 90 | /* ... */ |
Pawel Zarembski |
0:01f31e923fe2 | 91 | |
Pawel Zarembski |
0:01f31e923fe2 | 92 | |
Pawel Zarembski |
0:01f31e923fe2 | 93 | /* Generic Desktop Page (0x01) */ |
Pawel Zarembski |
0:01f31e923fe2 | 94 | #define HID_USAGE_GENERIC_POINTER 0x01 |
Pawel Zarembski |
0:01f31e923fe2 | 95 | #define HID_USAGE_GENERIC_MOUSE 0x02 |
Pawel Zarembski |
0:01f31e923fe2 | 96 | #define HID_USAGE_GENERIC_JOYSTICK 0x04 |
Pawel Zarembski |
0:01f31e923fe2 | 97 | #define HID_USAGE_GENERIC_GAMEPAD 0x05 |
Pawel Zarembski |
0:01f31e923fe2 | 98 | #define HID_USAGE_GENERIC_KEYBOARD 0x06 |
Pawel Zarembski |
0:01f31e923fe2 | 99 | #define HID_USAGE_GENERIC_KEYPAD 0x07 |
Pawel Zarembski |
0:01f31e923fe2 | 100 | #define HID_USAGE_GENERIC_X 0x30 |
Pawel Zarembski |
0:01f31e923fe2 | 101 | #define HID_USAGE_GENERIC_Y 0x31 |
Pawel Zarembski |
0:01f31e923fe2 | 102 | #define HID_USAGE_GENERIC_Z 0x32 |
Pawel Zarembski |
0:01f31e923fe2 | 103 | #define HID_USAGE_GENERIC_RX 0x33 |
Pawel Zarembski |
0:01f31e923fe2 | 104 | #define HID_USAGE_GENERIC_RY 0x34 |
Pawel Zarembski |
0:01f31e923fe2 | 105 | #define HID_USAGE_GENERIC_RZ 0x35 |
Pawel Zarembski |
0:01f31e923fe2 | 106 | #define HID_USAGE_GENERIC_SLIDER 0x36 |
Pawel Zarembski |
0:01f31e923fe2 | 107 | #define HID_USAGE_GENERIC_DIAL 0x37 |
Pawel Zarembski |
0:01f31e923fe2 | 108 | #define HID_USAGE_GENERIC_WHEEL 0x38 |
Pawel Zarembski |
0:01f31e923fe2 | 109 | #define HID_USAGE_GENERIC_HATSWITCH 0x39 |
Pawel Zarembski |
0:01f31e923fe2 | 110 | #define HID_USAGE_GENERIC_COUNTED_BUFFER 0x3A |
Pawel Zarembski |
0:01f31e923fe2 | 111 | #define HID_USAGE_GENERIC_BYTE_COUNT 0x3B |
Pawel Zarembski |
0:01f31e923fe2 | 112 | #define HID_USAGE_GENERIC_MOTION_WAKEUP 0x3C |
Pawel Zarembski |
0:01f31e923fe2 | 113 | #define HID_USAGE_GENERIC_VX 0x40 |
Pawel Zarembski |
0:01f31e923fe2 | 114 | #define HID_USAGE_GENERIC_VY 0x41 |
Pawel Zarembski |
0:01f31e923fe2 | 115 | #define HID_USAGE_GENERIC_VZ 0x42 |
Pawel Zarembski |
0:01f31e923fe2 | 116 | #define HID_USAGE_GENERIC_VBRX 0x43 |
Pawel Zarembski |
0:01f31e923fe2 | 117 | #define HID_USAGE_GENERIC_VBRY 0x44 |
Pawel Zarembski |
0:01f31e923fe2 | 118 | #define HID_USAGE_GENERIC_VBRZ 0x45 |
Pawel Zarembski |
0:01f31e923fe2 | 119 | #define HID_USAGE_GENERIC_VNO 0x46 |
Pawel Zarembski |
0:01f31e923fe2 | 120 | #define HID_USAGE_GENERIC_SYSTEM_CTL 0x80 |
Pawel Zarembski |
0:01f31e923fe2 | 121 | #define HID_USAGE_GENERIC_SYSCTL_POWER 0x81 |
Pawel Zarembski |
0:01f31e923fe2 | 122 | #define HID_USAGE_GENERIC_SYSCTL_SLEEP 0x82 |
Pawel Zarembski |
0:01f31e923fe2 | 123 | #define HID_USAGE_GENERIC_SYSCTL_WAKE 0x83 |
Pawel Zarembski |
0:01f31e923fe2 | 124 | #define HID_USAGE_GENERIC_SYSCTL_CONTEXT_MENU 0x84 |
Pawel Zarembski |
0:01f31e923fe2 | 125 | #define HID_USAGE_GENERIC_SYSCTL_MAIN_MENU 0x85 |
Pawel Zarembski |
0:01f31e923fe2 | 126 | #define HID_USAGE_GENERIC_SYSCTL_APP_MENU 0x86 |
Pawel Zarembski |
0:01f31e923fe2 | 127 | #define HID_USAGE_GENERIC_SYSCTL_HELP_MENU 0x87 |
Pawel Zarembski |
0:01f31e923fe2 | 128 | #define HID_USAGE_GENERIC_SYSCTL_MENU_EXIT 0x88 |
Pawel Zarembski |
0:01f31e923fe2 | 129 | #define HID_USAGE_GENERIC_SYSCTL_MENU_SELECT 0x89 |
Pawel Zarembski |
0:01f31e923fe2 | 130 | #define HID_USAGE_GENERIC_SYSCTL_MENU_RIGHT 0x8A |
Pawel Zarembski |
0:01f31e923fe2 | 131 | #define HID_USAGE_GENERIC_SYSCTL_MENU_LEFT 0x8B |
Pawel Zarembski |
0:01f31e923fe2 | 132 | #define HID_USAGE_GENERIC_SYSCTL_MENU_UP 0x8C |
Pawel Zarembski |
0:01f31e923fe2 | 133 | #define HID_USAGE_GENERIC_SYSCTL_MENU_DOWN 0x8D |
Pawel Zarembski |
0:01f31e923fe2 | 134 | /* ... */ |
Pawel Zarembski |
0:01f31e923fe2 | 135 | |
Pawel Zarembski |
0:01f31e923fe2 | 136 | /* Simulation Controls Page (0x02) */ |
Pawel Zarembski |
0:01f31e923fe2 | 137 | /* ... */ |
Pawel Zarembski |
0:01f31e923fe2 | 138 | #define HID_USAGE_SIMULATION_RUDDER 0xBA |
Pawel Zarembski |
0:01f31e923fe2 | 139 | #define HID_USAGE_SIMULATION_THROTTLE 0xBB |
Pawel Zarembski |
0:01f31e923fe2 | 140 | /* ... */ |
Pawel Zarembski |
0:01f31e923fe2 | 141 | |
Pawel Zarembski |
0:01f31e923fe2 | 142 | /* Virtual Reality Controls Page (0x03) */ |
Pawel Zarembski |
0:01f31e923fe2 | 143 | /* ... */ |
Pawel Zarembski |
0:01f31e923fe2 | 144 | |
Pawel Zarembski |
0:01f31e923fe2 | 145 | /* Sport Controls Page (0x04) */ |
Pawel Zarembski |
0:01f31e923fe2 | 146 | /* ... */ |
Pawel Zarembski |
0:01f31e923fe2 | 147 | |
Pawel Zarembski |
0:01f31e923fe2 | 148 | /* Game Controls Page (0x05) */ |
Pawel Zarembski |
0:01f31e923fe2 | 149 | /* ... */ |
Pawel Zarembski |
0:01f31e923fe2 | 150 | |
Pawel Zarembski |
0:01f31e923fe2 | 151 | /* Generic Device Controls Page (0x06) */ |
Pawel Zarembski |
0:01f31e923fe2 | 152 | /* ... */ |
Pawel Zarembski |
0:01f31e923fe2 | 153 | |
Pawel Zarembski |
0:01f31e923fe2 | 154 | /* Keyboard/Keypad Page (0x07) */ |
Pawel Zarembski |
0:01f31e923fe2 | 155 | |
Pawel Zarembski |
0:01f31e923fe2 | 156 | /* Keyboard Usage Keys */ |
Pawel Zarembski |
0:01f31e923fe2 | 157 | extern const unsigned char HID_KEYBOARD_ID_TO_ASCII[256]; |
Pawel Zarembski |
0:01f31e923fe2 | 158 | extern const unsigned char HID_KEYBOARD_ALT_ID_TO_ASCII[57]; |
Pawel Zarembski |
0:01f31e923fe2 | 159 | |
Pawel Zarembski |
0:01f31e923fe2 | 160 | /* Error "Keys" */ |
Pawel Zarembski |
0:01f31e923fe2 | 161 | #define HID_USAGE_KEYBOARD_NOEVENT 0x00 |
Pawel Zarembski |
0:01f31e923fe2 | 162 | #define HID_USAGE_KEYBOARD_ROLLOVER 0x01 |
Pawel Zarembski |
0:01f31e923fe2 | 163 | #define HID_USAGE_KEYBOARD_POSTFAIL 0x02 |
Pawel Zarembski |
0:01f31e923fe2 | 164 | #define HID_USAGE_KEYBOARD_UNDEFINED 0x03 |
Pawel Zarembski |
0:01f31e923fe2 | 165 | |
Pawel Zarembski |
0:01f31e923fe2 | 166 | /* Letters */ |
Pawel Zarembski |
0:01f31e923fe2 | 167 | #define HID_USAGE_KEYBOARD_aA 0x04 |
Pawel Zarembski |
0:01f31e923fe2 | 168 | #define HID_USAGE_KEYBOARD_zZ 0x1D |
Pawel Zarembski |
0:01f31e923fe2 | 169 | |
Pawel Zarembski |
0:01f31e923fe2 | 170 | /* Numbers */ |
Pawel Zarembski |
0:01f31e923fe2 | 171 | #define HID_USAGE_KEYBOARD_ONE 0x1E |
Pawel Zarembski |
0:01f31e923fe2 | 172 | #define HID_USAGE_KEYBOARD_ZERO 0x27 |
Pawel Zarembski |
0:01f31e923fe2 | 173 | |
Pawel Zarembski |
0:01f31e923fe2 | 174 | #define HID_USAGE_KEYBOARD_RETURN 0x28 |
Pawel Zarembski |
0:01f31e923fe2 | 175 | #define HID_USAGE_KEYBOARD_ESCAPE 0x29 |
Pawel Zarembski |
0:01f31e923fe2 | 176 | #define HID_USAGE_KEYBOARD_DELETE 0x2A |
Pawel Zarembski |
0:01f31e923fe2 | 177 | |
Pawel Zarembski |
0:01f31e923fe2 | 178 | /* Funtion Keys */ |
Pawel Zarembski |
0:01f31e923fe2 | 179 | #define HID_USAGE_KEYBOARD_F1 0x3A |
Pawel Zarembski |
0:01f31e923fe2 | 180 | #define HID_USAGE_KEYBOARD_F12 0x45 |
Pawel Zarembski |
0:01f31e923fe2 | 181 | |
Pawel Zarembski |
0:01f31e923fe2 | 182 | #define HID_USAGE_KEYBOARD_PRINT_SCREEN 0x46 |
Pawel Zarembski |
0:01f31e923fe2 | 183 | |
Pawel Zarembski |
0:01f31e923fe2 | 184 | /* Modifier Keys */ |
Pawel Zarembski |
0:01f31e923fe2 | 185 | #define HID_USAGE_KEYBOARD_LCTRL 0xE0 |
Pawel Zarembski |
0:01f31e923fe2 | 186 | #define HID_USAGE_KEYBOARD_LSHFT 0xE1 |
Pawel Zarembski |
0:01f31e923fe2 | 187 | #define HID_USAGE_KEYBOARD_LALT 0xE2 |
Pawel Zarembski |
0:01f31e923fe2 | 188 | #define HID_USAGE_KEYBOARD_LGUI 0xE3 |
Pawel Zarembski |
0:01f31e923fe2 | 189 | #define HID_USAGE_KEYBOARD_RCTRL 0xE4 |
Pawel Zarembski |
0:01f31e923fe2 | 190 | #define HID_USAGE_KEYBOARD_RSHFT 0xE5 |
Pawel Zarembski |
0:01f31e923fe2 | 191 | #define HID_USAGE_KEYBOARD_RALT 0xE6 |
Pawel Zarembski |
0:01f31e923fe2 | 192 | #define HID_USAGE_KEYBOARD_RGUI 0xE7 |
Pawel Zarembski |
0:01f31e923fe2 | 193 | #define HID_USAGE_KEYBOARD_SCROLL_LOCK 0x47 |
Pawel Zarembski |
0:01f31e923fe2 | 194 | #define HID_USAGE_KEYBOARD_NUM_LOCK 0x53 |
Pawel Zarembski |
0:01f31e923fe2 | 195 | #define HID_USAGE_KEYBOARD_CAPS_LOCK 0x39 |
Pawel Zarembski |
0:01f31e923fe2 | 196 | |
Pawel Zarembski |
0:01f31e923fe2 | 197 | /* Modifier Keys (values) */ |
Pawel Zarembski |
0:01f31e923fe2 | 198 | #define HID_USAGE_KEYBOARD_MOD_LCTRL 0x01 |
Pawel Zarembski |
0:01f31e923fe2 | 199 | #define HID_USAGE_KEYBOARD_MOD_LSHIFT 0x02 |
Pawel Zarembski |
0:01f31e923fe2 | 200 | #define HID_USAGE_KEYBOARD_MOD_LALTL 0x04 |
Pawel Zarembski |
0:01f31e923fe2 | 201 | #define HID_USAGE_KEYBOARD_MOD_LGUI 0x08 |
Pawel Zarembski |
0:01f31e923fe2 | 202 | #define HID_USAGE_KEYBOARD_MOD_RCTRL 0x10 |
Pawel Zarembski |
0:01f31e923fe2 | 203 | #define HID_USAGE_KEYBOARD_MOD_RSHIFT 0x20 |
Pawel Zarembski |
0:01f31e923fe2 | 204 | #define HID_USAGE_KEYBOARD_MOD_RALTL 0x40 |
Pawel Zarembski |
0:01f31e923fe2 | 205 | #define HID_USAGE_KEYBOARD_MOD_RGUI 0x80 |
Pawel Zarembski |
0:01f31e923fe2 | 206 | |
Pawel Zarembski |
0:01f31e923fe2 | 207 | /* ... */ |
Pawel Zarembski |
0:01f31e923fe2 | 208 | |
Pawel Zarembski |
0:01f31e923fe2 | 209 | /* LED Page (0x08) */ |
Pawel Zarembski |
0:01f31e923fe2 | 210 | #define HID_USAGE_LED_NUM_LOCK 0x01 |
Pawel Zarembski |
0:01f31e923fe2 | 211 | #define HID_USAGE_LED_CAPS_LOCK 0x02 |
Pawel Zarembski |
0:01f31e923fe2 | 212 | #define HID_USAGE_LED_SCROLL_LOCK 0x03 |
Pawel Zarembski |
0:01f31e923fe2 | 213 | #define HID_USAGE_LED_COMPOSE 0x04 |
Pawel Zarembski |
0:01f31e923fe2 | 214 | #define HID_USAGE_LED_KANA 0x05 |
Pawel Zarembski |
0:01f31e923fe2 | 215 | #define HID_USAGE_LED_POWER 0x06 |
Pawel Zarembski |
0:01f31e923fe2 | 216 | #define HID_USAGE_LED_SHIFT 0x07 |
Pawel Zarembski |
0:01f31e923fe2 | 217 | #define HID_USAGE_LED_DO_NOT_DISTURB 0x08 |
Pawel Zarembski |
0:01f31e923fe2 | 218 | #define HID_USAGE_LED_MUTE 0x09 |
Pawel Zarembski |
0:01f31e923fe2 | 219 | #define HID_USAGE_LED_TONE_ENABLE 0x0A |
Pawel Zarembski |
0:01f31e923fe2 | 220 | #define HID_USAGE_LED_HIGH_CUT_FILTER 0x0B |
Pawel Zarembski |
0:01f31e923fe2 | 221 | #define HID_USAGE_LED_LOW_CUT_FILTER 0x0C |
Pawel Zarembski |
0:01f31e923fe2 | 222 | #define HID_USAGE_LED_EQUALIZER_ENABLE 0x0D |
Pawel Zarembski |
0:01f31e923fe2 | 223 | #define HID_USAGE_LED_SOUND_FIELD_ON 0x0E |
Pawel Zarembski |
0:01f31e923fe2 | 224 | #define HID_USAGE_LED_SURROUND_FIELD_ON 0x0F |
Pawel Zarembski |
0:01f31e923fe2 | 225 | #define HID_USAGE_LED_REPEAT 0x10 |
Pawel Zarembski |
0:01f31e923fe2 | 226 | #define HID_USAGE_LED_STEREO 0x11 |
Pawel Zarembski |
0:01f31e923fe2 | 227 | #define HID_USAGE_LED_SAMPLING_RATE_DETECT 0x12 |
Pawel Zarembski |
0:01f31e923fe2 | 228 | #define HID_USAGE_LED_SPINNING 0x13 |
Pawel Zarembski |
0:01f31e923fe2 | 229 | #define HID_USAGE_LED_CAV 0x14 |
Pawel Zarembski |
0:01f31e923fe2 | 230 | #define HID_USAGE_LED_CLV 0x15 |
Pawel Zarembski |
0:01f31e923fe2 | 231 | #define HID_USAGE_LED_RECORDING_FORMAT_DET 0x16 |
Pawel Zarembski |
0:01f31e923fe2 | 232 | #define HID_USAGE_LED_OFF_HOOK 0x17 |
Pawel Zarembski |
0:01f31e923fe2 | 233 | #define HID_USAGE_LED_RING 0x18 |
Pawel Zarembski |
0:01f31e923fe2 | 234 | #define HID_USAGE_LED_MESSAGE_WAITING 0x19 |
Pawel Zarembski |
0:01f31e923fe2 | 235 | #define HID_USAGE_LED_DATA_MODE 0x1A |
Pawel Zarembski |
0:01f31e923fe2 | 236 | #define HID_USAGE_LED_BATTERY_OPERATION 0x1B |
Pawel Zarembski |
0:01f31e923fe2 | 237 | #define HID_USAGE_LED_BATTERY_OK 0x1C |
Pawel Zarembski |
0:01f31e923fe2 | 238 | #define HID_USAGE_LED_BATTERY_LOW 0x1D |
Pawel Zarembski |
0:01f31e923fe2 | 239 | #define HID_USAGE_LED_SPEAKER 0x1E |
Pawel Zarembski |
0:01f31e923fe2 | 240 | #define HID_USAGE_LED_HEAD_SET 0x1F |
Pawel Zarembski |
0:01f31e923fe2 | 241 | #define HID_USAGE_LED_HOLD 0x20 |
Pawel Zarembski |
0:01f31e923fe2 | 242 | #define HID_USAGE_LED_MICROPHONE 0x21 |
Pawel Zarembski |
0:01f31e923fe2 | 243 | #define HID_USAGE_LED_COVERAGE 0x22 |
Pawel Zarembski |
0:01f31e923fe2 | 244 | #define HID_USAGE_LED_NIGHT_MODE 0x23 |
Pawel Zarembski |
0:01f31e923fe2 | 245 | #define HID_USAGE_LED_SEND_CALLS 0x24 |
Pawel Zarembski |
0:01f31e923fe2 | 246 | #define HID_USAGE_LED_CALL_PICKUP 0x25 |
Pawel Zarembski |
0:01f31e923fe2 | 247 | #define HID_USAGE_LED_CONFERENCE 0x26 |
Pawel Zarembski |
0:01f31e923fe2 | 248 | #define HID_USAGE_LED_STAND_BY 0x27 |
Pawel Zarembski |
0:01f31e923fe2 | 249 | #define HID_USAGE_LED_CAMERA_ON 0x28 |
Pawel Zarembski |
0:01f31e923fe2 | 250 | #define HID_USAGE_LED_CAMERA_OFF 0x29 |
Pawel Zarembski |
0:01f31e923fe2 | 251 | #define HID_USAGE_LED_ON_LINE 0x2A |
Pawel Zarembski |
0:01f31e923fe2 | 252 | #define HID_USAGE_LED_OFF_LINE 0x2B |
Pawel Zarembski |
0:01f31e923fe2 | 253 | #define HID_USAGE_LED_BUSY 0x2C |
Pawel Zarembski |
0:01f31e923fe2 | 254 | #define HID_USAGE_LED_READY 0x2D |
Pawel Zarembski |
0:01f31e923fe2 | 255 | #define HID_USAGE_LED_PAPER_OUT 0x2E |
Pawel Zarembski |
0:01f31e923fe2 | 256 | #define HID_USAGE_LED_PAPER_JAM 0x2F |
Pawel Zarembski |
0:01f31e923fe2 | 257 | #define HID_USAGE_LED_REMOTE 0x30 |
Pawel Zarembski |
0:01f31e923fe2 | 258 | #define HID_USAGE_LED_FORWARD 0x31 |
Pawel Zarembski |
0:01f31e923fe2 | 259 | #define HID_USAGE_LED_REVERSE 0x32 |
Pawel Zarembski |
0:01f31e923fe2 | 260 | #define HID_USAGE_LED_STOP 0x33 |
Pawel Zarembski |
0:01f31e923fe2 | 261 | #define HID_USAGE_LED_REWIND 0x34 |
Pawel Zarembski |
0:01f31e923fe2 | 262 | #define HID_USAGE_LED_FAST_FORWARD 0x35 |
Pawel Zarembski |
0:01f31e923fe2 | 263 | #define HID_USAGE_LED_PLAY 0x36 |
Pawel Zarembski |
0:01f31e923fe2 | 264 | #define HID_USAGE_LED_PAUSE 0x37 |
Pawel Zarembski |
0:01f31e923fe2 | 265 | #define HID_USAGE_LED_RECORD 0x38 |
Pawel Zarembski |
0:01f31e923fe2 | 266 | #define HID_USAGE_LED_ERROR 0x39 |
Pawel Zarembski |
0:01f31e923fe2 | 267 | #define HID_USAGE_LED_SELECTED_INDICATOR 0x3A |
Pawel Zarembski |
0:01f31e923fe2 | 268 | #define HID_USAGE_LED_IN_USE_INDICATOR 0x3B |
Pawel Zarembski |
0:01f31e923fe2 | 269 | #define HID_USAGE_LED_MULTI_MODE_INDICATOR 0x3C |
Pawel Zarembski |
0:01f31e923fe2 | 270 | #define HID_USAGE_LED_INDICATOR_ON 0x3D |
Pawel Zarembski |
0:01f31e923fe2 | 271 | #define HID_USAGE_LED_INDICATOR_FLASH 0x3E |
Pawel Zarembski |
0:01f31e923fe2 | 272 | #define HID_USAGE_LED_INDICATOR_SLOW_BLINK 0x3F |
Pawel Zarembski |
0:01f31e923fe2 | 273 | #define HID_USAGE_LED_INDICATOR_FAST_BLINK 0x40 |
Pawel Zarembski |
0:01f31e923fe2 | 274 | #define HID_USAGE_LED_INDICATOR_OFF 0x41 |
Pawel Zarembski |
0:01f31e923fe2 | 275 | #define HID_USAGE_LED_FLASH_ON_TIME 0x42 |
Pawel Zarembski |
0:01f31e923fe2 | 276 | #define HID_USAGE_LED_SLOW_BLINK_ON_TIME 0x43 |
Pawel Zarembski |
0:01f31e923fe2 | 277 | #define HID_USAGE_LED_SLOW_BLINK_OFF_TIME 0x44 |
Pawel Zarembski |
0:01f31e923fe2 | 278 | #define HID_USAGE_LED_FAST_BLINK_ON_TIME 0x45 |
Pawel Zarembski |
0:01f31e923fe2 | 279 | #define HID_USAGE_LED_FAST_BLINK_OFF_TIME 0x46 |
Pawel Zarembski |
0:01f31e923fe2 | 280 | #define HID_USAGE_LED_INDICATOR_COLOR 0x47 |
Pawel Zarembski |
0:01f31e923fe2 | 281 | #define HID_USAGE_LED_RED 0x48 |
Pawel Zarembski |
0:01f31e923fe2 | 282 | #define HID_USAGE_LED_GREEN 0x49 |
Pawel Zarembski |
0:01f31e923fe2 | 283 | #define HID_USAGE_LED_AMBER 0x4A |
Pawel Zarembski |
0:01f31e923fe2 | 284 | #define HID_USAGE_LED_GENERIC_INDICATOR 0x4B |
Pawel Zarembski |
0:01f31e923fe2 | 285 | |
Pawel Zarembski |
0:01f31e923fe2 | 286 | /* Button Page (0x09) */ |
Pawel Zarembski |
0:01f31e923fe2 | 287 | /* There is no need to label these usages. */ |
Pawel Zarembski |
0:01f31e923fe2 | 288 | |
Pawel Zarembski |
0:01f31e923fe2 | 289 | /* Ordinal Page (0x0A) */ |
Pawel Zarembski |
0:01f31e923fe2 | 290 | /* There is no need to label these usages. */ |
Pawel Zarembski |
0:01f31e923fe2 | 291 | |
Pawel Zarembski |
0:01f31e923fe2 | 292 | /* Telephony Device Page (0x0B) */ |
Pawel Zarembski |
0:01f31e923fe2 | 293 | #define HID_USAGE_TELEPHONY_PHONE 0x01 |
Pawel Zarembski |
0:01f31e923fe2 | 294 | #define HID_USAGE_TELEPHONY_ANSWERING_MACHINE 0x02 |
Pawel Zarembski |
0:01f31e923fe2 | 295 | #define HID_USAGE_TELEPHONY_MESSAGE_CONTROLS 0x03 |
Pawel Zarembski |
0:01f31e923fe2 | 296 | #define HID_USAGE_TELEPHONY_HANDSET 0x04 |
Pawel Zarembski |
0:01f31e923fe2 | 297 | #define HID_USAGE_TELEPHONY_HEADSET 0x05 |
Pawel Zarembski |
0:01f31e923fe2 | 298 | #define HID_USAGE_TELEPHONY_KEYPAD 0x06 |
Pawel Zarembski |
0:01f31e923fe2 | 299 | #define HID_USAGE_TELEPHONY_PROGRAMMABLE_BUTTON 0x07 |
Pawel Zarembski |
0:01f31e923fe2 | 300 | /* ... */ |
Pawel Zarembski |
0:01f31e923fe2 | 301 | |
Pawel Zarembski |
0:01f31e923fe2 | 302 | /* Consumer Page (0x0C) */ |
Pawel Zarembski |
0:01f31e923fe2 | 303 | #define HID_USAGE_CONSUMER_CONTROL 0x01 |
Pawel Zarembski |
0:01f31e923fe2 | 304 | /* ... */ |
Pawel Zarembski |
0:01f31e923fe2 | 305 | |
Pawel Zarembski |
0:01f31e923fe2 | 306 | /* and others ... */ |
Pawel Zarembski |
0:01f31e923fe2 | 307 | |
Pawel Zarembski |
0:01f31e923fe2 | 308 | |
Pawel Zarembski |
0:01f31e923fe2 | 309 | /* HID Report Item Macros */ |
Pawel Zarembski |
0:01f31e923fe2 | 310 | |
Pawel Zarembski |
0:01f31e923fe2 | 311 | /* Main Items */ |
Pawel Zarembski |
0:01f31e923fe2 | 312 | #define HID_Input(x) 0x81,x |
Pawel Zarembski |
0:01f31e923fe2 | 313 | #define HID_Output(x) 0x91,x |
Pawel Zarembski |
0:01f31e923fe2 | 314 | #define HID_Feature(x) 0xB1,x |
Pawel Zarembski |
0:01f31e923fe2 | 315 | #define HID_Collection(x) 0xA1,x |
Pawel Zarembski |
0:01f31e923fe2 | 316 | #define HID_EndCollection 0xC0 |
Pawel Zarembski |
0:01f31e923fe2 | 317 | |
Pawel Zarembski |
0:01f31e923fe2 | 318 | /* Data (Input, Output, Feature) */ |
Pawel Zarembski |
0:01f31e923fe2 | 319 | #define HID_Data 0<<0 |
Pawel Zarembski |
0:01f31e923fe2 | 320 | #define HID_Constant 1<<0 |
Pawel Zarembski |
0:01f31e923fe2 | 321 | #define HID_Array 0<<1 |
Pawel Zarembski |
0:01f31e923fe2 | 322 | #define HID_Variable 1<<1 |
Pawel Zarembski |
0:01f31e923fe2 | 323 | #define HID_Absolute 0<<2 |
Pawel Zarembski |
0:01f31e923fe2 | 324 | #define HID_Relative 1<<2 |
Pawel Zarembski |
0:01f31e923fe2 | 325 | #define HID_NoWrap 0<<3 |
Pawel Zarembski |
0:01f31e923fe2 | 326 | #define HID_Wrap 1<<3 |
Pawel Zarembski |
0:01f31e923fe2 | 327 | #define HID_Linear 0<<4 |
Pawel Zarembski |
0:01f31e923fe2 | 328 | #define HID_NonLinear 1<<4 |
Pawel Zarembski |
0:01f31e923fe2 | 329 | #define HID_PreferredState 0<<5 |
Pawel Zarembski |
0:01f31e923fe2 | 330 | #define HID_NoPreferred 1<<5 |
Pawel Zarembski |
0:01f31e923fe2 | 331 | #define HID_NoNullPosition 0<<6 |
Pawel Zarembski |
0:01f31e923fe2 | 332 | #define HID_NullState 1<<6 |
Pawel Zarembski |
0:01f31e923fe2 | 333 | #define HID_NonVolatile 0<<7 |
Pawel Zarembski |
0:01f31e923fe2 | 334 | #define HID_Volatile 1<<7 |
Pawel Zarembski |
0:01f31e923fe2 | 335 | |
Pawel Zarembski |
0:01f31e923fe2 | 336 | /* Collection Data */ |
Pawel Zarembski |
0:01f31e923fe2 | 337 | #define HID_Physical 0x00 |
Pawel Zarembski |
0:01f31e923fe2 | 338 | #define HID_Application 0x01 |
Pawel Zarembski |
0:01f31e923fe2 | 339 | #define HID_Logical 0x02 |
Pawel Zarembski |
0:01f31e923fe2 | 340 | #define HID_Report 0x03 |
Pawel Zarembski |
0:01f31e923fe2 | 341 | #define HID_NamedArray 0x04 |
Pawel Zarembski |
0:01f31e923fe2 | 342 | #define HID_UsageSwitch 0x05 |
Pawel Zarembski |
0:01f31e923fe2 | 343 | #define HID_UsageModifier 0x06 |
Pawel Zarembski |
0:01f31e923fe2 | 344 | |
Pawel Zarembski |
0:01f31e923fe2 | 345 | /* Global Items */ |
Pawel Zarembski |
0:01f31e923fe2 | 346 | #define HID_UsagePage(x) 0x05,x |
Pawel Zarembski |
0:01f31e923fe2 | 347 | #define HID_UsagePageVendor(x) 0x06,x,0xFF |
Pawel Zarembski |
0:01f31e923fe2 | 348 | #define HID_LogicalMin(x) 0x15,x |
Pawel Zarembski |
0:01f31e923fe2 | 349 | #define HID_LogicalMinS(x) 0x16,(x&0xFF),((x>>8)&0xFF) |
Pawel Zarembski |
0:01f31e923fe2 | 350 | #define HID_LogicalMinL(x) 0x17,(x&0xFF),((x>>8)&0xFF),((x>>16)&0xFF),((x>>24)&0xFF) |
Pawel Zarembski |
0:01f31e923fe2 | 351 | #define HID_LogicalMax(x) 0x25,x |
Pawel Zarembski |
0:01f31e923fe2 | 352 | #define HID_LogicalMaxS(x) 0x26,(x&0xFF),((x>>8)&0xFF) |
Pawel Zarembski |
0:01f31e923fe2 | 353 | #define HID_LogicalMaxL(x) 0x27,(x&0xFF),((x>>8)&0xFF),((x>>16)&0xFF),((x>>24)&0xFF) |
Pawel Zarembski |
0:01f31e923fe2 | 354 | #define HID_PhysicalMin(x) 0x35,x |
Pawel Zarembski |
0:01f31e923fe2 | 355 | #define HID_PhysicalMinS(x) 0x36,(x&0xFF),((x>>8)&0xFF) |
Pawel Zarembski |
0:01f31e923fe2 | 356 | #define HID_PhysicalMinL(x) 0x37,(x&0xFF),((x>>8)&0xFF),((x>>16)&0xFF),((x>>24)&0xFF) |
Pawel Zarembski |
0:01f31e923fe2 | 357 | #define HID_PhysicalMax(x) 0x45,x |
Pawel Zarembski |
0:01f31e923fe2 | 358 | #define HID_PhysicalMaxS(x) 0x46,(x&0xFF),((x>>8)&0xFF) |
Pawel Zarembski |
0:01f31e923fe2 | 359 | #define HID_PhysicalMaxL(x) 0x47,(x&0xFF),((x>>8)&0xFF),((x>>16)&0xFF),((x>>24)&0xFF) |
Pawel Zarembski |
0:01f31e923fe2 | 360 | #define HID_UnitExponent(x) 0x55,x |
Pawel Zarembski |
0:01f31e923fe2 | 361 | #define HID_Unit(x) 0x65,x |
Pawel Zarembski |
0:01f31e923fe2 | 362 | #define HID_UnitS(x) 0x66,(x&0xFF),((x>>8)&0xFF) |
Pawel Zarembski |
0:01f31e923fe2 | 363 | #define HID_UnitL(x) 0x67,(x&0xFF),((x>>8)&0xFF),((x>>16)&0xFF),((x>>24)&0xFF) |
Pawel Zarembski |
0:01f31e923fe2 | 364 | #define HID_ReportSize(x) 0x75,x |
Pawel Zarembski |
0:01f31e923fe2 | 365 | #define HID_ReportSizeS(x) 0x76,(x&0xFF),((x>>8)&0xFF) |
Pawel Zarembski |
0:01f31e923fe2 | 366 | #define HID_ReportSizeL(x) 0x77,(x&0xFF),((x>>8)&0xFF),((x>>16)&0xFF),((x>>24)&0xFF) |
Pawel Zarembski |
0:01f31e923fe2 | 367 | #define HID_ReportID(x) 0x85,x |
Pawel Zarembski |
0:01f31e923fe2 | 368 | #define HID_ReportCount(x) 0x95,x |
Pawel Zarembski |
0:01f31e923fe2 | 369 | #define HID_ReportCountS(x) 0x96,(x&0xFF),((x>>8)&0xFF) |
Pawel Zarembski |
0:01f31e923fe2 | 370 | #define HID_ReportCountL(x) 0x97,(x&0xFF),((x>>8)&0xFF),((x>>16)&0xFF),((x>>24)&0xFF) |
Pawel Zarembski |
0:01f31e923fe2 | 371 | #define HID_Push 0xA4 |
Pawel Zarembski |
0:01f31e923fe2 | 372 | #define HID_Pop 0xB4 |
Pawel Zarembski |
0:01f31e923fe2 | 373 | |
Pawel Zarembski |
0:01f31e923fe2 | 374 | /* Local Items */ |
Pawel Zarembski |
0:01f31e923fe2 | 375 | #define HID_Usage(x) 0x09,x |
Pawel Zarembski |
0:01f31e923fe2 | 376 | #define HID_UsageMin(x) 0x19,x |
Pawel Zarembski |
0:01f31e923fe2 | 377 | #define HID_UsageMax(x) 0x29,x |
Pawel Zarembski |
0:01f31e923fe2 | 378 | |
Pawel Zarembski |
0:01f31e923fe2 | 379 | |
Pawel Zarembski |
0:01f31e923fe2 | 380 | #endif /* __USB_HID_H__ */ |