PageRenderTime 59ms CodeModel.GetById 35ms app.highlight 20ms RepoModel.GetById 0ms app.codeStats 0ms

/arduino-board-definitions/Telepoll-1.0.0/cores/arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src/class/hid/hid.h

https://codeberg.org/ccoenen/Telepoll
C Header | 873 lines | 688 code | 72 blank | 113 comment | 0 complexity | 11c6da6e3305acf8d59e5db8db6ce304 MD5 | raw file
Possible License(s): JSON
  1/* 
  2 * The MIT License (MIT)
  3 *
  4 * Copyright (c) 2019 Ha Thach (tinyusb.org)
  5 *
  6 * Permission is hereby granted, free of charge, to any person obtaining a copy
  7 * of this software and associated documentation files (the "Software"), to deal
  8 * in the Software without restriction, including without limitation the rights
  9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 10 * copies of the Software, and to permit persons to whom the Software is
 11 * furnished to do so, subject to the following conditions:
 12 *
 13 * The above copyright notice and this permission notice shall be included in
 14 * all copies or substantial portions of the Software.
 15 *
 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 22 * THE SOFTWARE.
 23 *
 24 * This file is part of the TinyUSB stack.
 25 */
 26
 27/** \ingroup group_class
 28 *  \defgroup ClassDriver_HID Human Interface Device (HID)
 29 *  @{ */
 30
 31#ifndef _TUSB_HID_H_
 32#define _TUSB_HID_H_
 33
 34#include "common/tusb_common.h"
 35
 36#ifdef __cplusplus
 37 extern "C" {
 38#endif
 39
 40//--------------------------------------------------------------------+
 41// Common Definitions
 42//--------------------------------------------------------------------+
 43/** \defgroup ClassDriver_HID_Common Common Definitions
 44 *  @{ */
 45
 46 /// USB HID Descriptor
 47typedef struct TU_ATTR_PACKED
 48{
 49  uint8_t  bLength;         /**< Numeric expression that is the total size of the HID descriptor */
 50  uint8_t  bDescriptorType; /**< Constant name specifying type of HID descriptor. */
 51
 52  uint16_t bcdHID;          /**< Numeric expression identifying the HID Class Specification release */
 53  uint8_t  bCountryCode;    /**< Numeric expression identifying country code of the localized hardware.  */
 54  uint8_t  bNumDescriptors; /**< Numeric expression specifying the number of class descriptors */
 55
 56  uint8_t  bReportType;     /**< Type of HID class report. */
 57  uint16_t wReportLength;   /**< the total size of the Report descriptor. */
 58} tusb_hid_descriptor_hid_t;
 59
 60/// HID Subclass
 61typedef enum
 62{
 63  HID_SUBCLASS_NONE = 0, ///< No Subclass
 64  HID_SUBCLASS_BOOT = 1  ///< Boot Interface Subclass
 65}hid_subclass_type_t;
 66
 67/// HID Protocol
 68typedef enum
 69{
 70  HID_PROTOCOL_NONE     = 0, ///< None
 71  HID_PROTOCOL_KEYBOARD = 1, ///< Keyboard
 72  HID_PROTOCOL_MOUSE    = 2  ///< Mouse
 73}hid_protocol_type_t;
 74
 75/// HID Descriptor Type
 76typedef enum
 77{
 78  HID_DESC_TYPE_HID      = 0x21, ///< HID Descriptor
 79  HID_DESC_TYPE_REPORT   = 0x22, ///< Report Descriptor
 80  HID_DESC_TYPE_PHYSICAL = 0x23  ///< Physical Descriptor
 81}hid_descriptor_type_t;
 82
 83/// HID Request Report Type
 84typedef enum
 85{
 86  HID_REPORT_TYPE_INVALID = 0,
 87  HID_REPORT_TYPE_INPUT,      ///< Input
 88  HID_REPORT_TYPE_OUTPUT,     ///< Output
 89  HID_REPORT_TYPE_FEATURE     ///< Feature
 90}hid_report_type_t;
 91
 92/// HID Class Specific Control Request
 93typedef enum
 94{
 95  HID_REQ_CONTROL_GET_REPORT   = 0x01, ///< Get Report
 96  HID_REQ_CONTROL_GET_IDLE     = 0x02, ///< Get Idle
 97  HID_REQ_CONTROL_GET_PROTOCOL = 0x03, ///< Get Protocol
 98  HID_REQ_CONTROL_SET_REPORT   = 0x09, ///< Set Report
 99  HID_REQ_CONTROL_SET_IDLE     = 0x0a, ///< Set Idle
100  HID_REQ_CONTROL_SET_PROTOCOL = 0x0b  ///< Set Protocol
101}hid_request_type_t;
102
103/// HID Country Code
104typedef enum
105{
106  HID_LOCAL_NotSupported = 0   , ///< NotSupported
107  HID_LOCAL_Arabic             , ///< Arabic
108  HID_LOCAL_Belgian            , ///< Belgian
109  HID_LOCAL_Canadian_Bilingual , ///< Canadian_Bilingual
110  HID_LOCAL_Canadian_French    , ///< Canadian_French
111  HID_LOCAL_Czech_Republic     , ///< Czech_Republic
112  HID_LOCAL_Danish             , ///< Danish
113  HID_LOCAL_Finnish            , ///< Finnish
114  HID_LOCAL_French             , ///< French
115  HID_LOCAL_German             , ///< German
116  HID_LOCAL_Greek              , ///< Greek
117  HID_LOCAL_Hebrew             , ///< Hebrew
118  HID_LOCAL_Hungary            , ///< Hungary
119  HID_LOCAL_International      , ///< International
120  HID_LOCAL_Italian            , ///< Italian
121  HID_LOCAL_Japan_Katakana     , ///< Japan_Katakana
122  HID_LOCAL_Korean             , ///< Korean
123  HID_LOCAL_Latin_American     , ///< Latin_American
124  HID_LOCAL_Netherlands_Dutch  , ///< Netherlands/Dutch
125  HID_LOCAL_Norwegian          , ///< Norwegian
126  HID_LOCAL_Persian_Farsi      , ///< Persian (Farsi)
127  HID_LOCAL_Poland             , ///< Poland
128  HID_LOCAL_Portuguese         , ///< Portuguese
129  HID_LOCAL_Russia             , ///< Russia
130  HID_LOCAL_Slovakia           , ///< Slovakia
131  HID_LOCAL_Spanish            , ///< Spanish
132  HID_LOCAL_Swedish            , ///< Swedish
133  HID_LOCAL_Swiss_French       , ///< Swiss/French
134  HID_LOCAL_Swiss_German       , ///< Swiss/German
135  HID_LOCAL_Switzerland        , ///< Switzerland
136  HID_LOCAL_Taiwan             , ///< Taiwan
137  HID_LOCAL_Turkish_Q          , ///< Turkish-Q
138  HID_LOCAL_UK                 , ///< UK
139  HID_LOCAL_US                 , ///< US
140  HID_LOCAL_Yugoslavia         , ///< Yugoslavia
141  HID_LOCAL_Turkish_F            ///< Turkish-F
142} hid_country_code_t;
143
144/** @} */
145
146//--------------------------------------------------------------------+
147// MOUSE
148//--------------------------------------------------------------------+
149/** \addtogroup ClassDriver_HID_Mouse Mouse
150 *  @{ */
151
152/// Standard HID Boot Protocol Mouse Report.
153typedef struct TU_ATTR_PACKED
154{
155  uint8_t buttons; /**< buttons mask for currently pressed buttons in the mouse. */
156  int8_t  x;       /**< Current delta x movement of the mouse. */
157  int8_t  y;       /**< Current delta y movement on the mouse. */
158  int8_t  wheel;   /**< Current delta wheel movement on the mouse. */
159  int8_t  pan;     // using AC Pan
160} hid_mouse_report_t;
161
162/// Standard Mouse Buttons Bitmap
163typedef enum
164{
165  MOUSE_BUTTON_LEFT     = TU_BIT(0), ///< Left button
166  MOUSE_BUTTON_RIGHT    = TU_BIT(1), ///< Right button
167  MOUSE_BUTTON_MIDDLE   = TU_BIT(2), ///< Middle button
168  MOUSE_BUTTON_BACKWARD = TU_BIT(3), ///< Backward button,
169  MOUSE_BUTTON_FORWARD  = TU_BIT(4), ///< Forward button,
170}hid_mouse_button_bm_t;
171
172/// @}
173
174//--------------------------------------------------------------------+
175// Keyboard
176//--------------------------------------------------------------------+
177/** \addtogroup ClassDriver_HID_Keyboard Keyboard
178 *  @{ */
179
180/// Standard HID Boot Protocol Keyboard Report.
181typedef struct TU_ATTR_PACKED
182{
183  uint8_t modifier;   /**< Keyboard modifier (KEYBOARD_MODIFIER_* masks). */
184  uint8_t reserved;   /**< Reserved for OEM use, always set to 0. */
185  uint8_t keycode[6]; /**< Key codes of the currently pressed keys. */
186} hid_keyboard_report_t;
187
188/// Keyboard modifier codes bitmap
189typedef enum
190{
191  KEYBOARD_MODIFIER_LEFTCTRL   = TU_BIT(0), ///< Left Control
192  KEYBOARD_MODIFIER_LEFTSHIFT  = TU_BIT(1), ///< Left Shift
193  KEYBOARD_MODIFIER_LEFTALT    = TU_BIT(2), ///< Left Alt
194  KEYBOARD_MODIFIER_LEFTGUI    = TU_BIT(3), ///< Left Window
195  KEYBOARD_MODIFIER_RIGHTCTRL  = TU_BIT(4), ///< Right Control
196  KEYBOARD_MODIFIER_RIGHTSHIFT = TU_BIT(5), ///< Right Shift
197  KEYBOARD_MODIFIER_RIGHTALT   = TU_BIT(6), ///< Right Alt
198  KEYBOARD_MODIFIER_RIGHTGUI   = TU_BIT(7)  ///< Right Window
199}hid_keyboard_modifier_bm_t;
200
201typedef enum
202{
203  KEYBOARD_LED_NUMLOCK    = TU_BIT(0), ///< Num Lock LED
204  KEYBOARD_LED_CAPSLOCK   = TU_BIT(1), ///< Caps Lock LED
205  KEYBOARD_LED_SCROLLLOCK = TU_BIT(2), ///< Scroll Lock LED
206  KEYBOARD_LED_COMPOSE    = TU_BIT(3), ///< Composition Mode
207  KEYBOARD_LED_KANA       = TU_BIT(4) ///< Kana mode
208}hid_keyboard_led_bm_t;
209
210/// @}
211
212//--------------------------------------------------------------------+
213// HID KEYCODE
214//--------------------------------------------------------------------+
215#define HID_KEY_NONE               0x00
216#define HID_KEY_A                  0x04
217#define HID_KEY_B                  0x05
218#define HID_KEY_C                  0x06
219#define HID_KEY_D                  0x07
220#define HID_KEY_E                  0x08
221#define HID_KEY_F                  0x09
222#define HID_KEY_G                  0x0A
223#define HID_KEY_H                  0x0B
224#define HID_KEY_I                  0x0C
225#define HID_KEY_J                  0x0D
226#define HID_KEY_K                  0x0E
227#define HID_KEY_L                  0x0F
228#define HID_KEY_M                  0x10
229#define HID_KEY_N                  0x11
230#define HID_KEY_O                  0x12
231#define HID_KEY_P                  0x13
232#define HID_KEY_Q                  0x14
233#define HID_KEY_R                  0x15
234#define HID_KEY_S                  0x16
235#define HID_KEY_T                  0x17
236#define HID_KEY_U                  0x18
237#define HID_KEY_V                  0x19
238#define HID_KEY_W                  0x1A
239#define HID_KEY_X                  0x1B
240#define HID_KEY_Y                  0x1C
241#define HID_KEY_Z                  0x1D
242#define HID_KEY_1                  0x1E
243#define HID_KEY_2                  0x1F
244#define HID_KEY_3                  0x20
245#define HID_KEY_4                  0x21
246#define HID_KEY_5                  0x22
247#define HID_KEY_6                  0x23
248#define HID_KEY_7                  0x24
249#define HID_KEY_8                  0x25
250#define HID_KEY_9                  0x26
251#define HID_KEY_0                  0x27
252#define HID_KEY_RETURN             0x28
253#define HID_KEY_ESCAPE             0x29
254#define HID_KEY_BACKSPACE          0x2A
255#define HID_KEY_TAB                0x2B
256#define HID_KEY_SPACE              0x2C
257#define HID_KEY_MINUS              0x2D
258#define HID_KEY_EQUAL              0x2E
259#define HID_KEY_BRACKET_LEFT       0x2F
260#define HID_KEY_BRACKET_RIGHT      0x30
261#define HID_KEY_BACKSLASH          0x31
262#define HID_KEY_EUROPE_1           0x32
263#define HID_KEY_SEMICOLON          0x33
264#define HID_KEY_APOSTROPHE         0x34
265#define HID_KEY_GRAVE              0x35
266#define HID_KEY_COMMA              0x36
267#define HID_KEY_PERIOD             0x37
268#define HID_KEY_SLASH              0x38
269#define HID_KEY_CAPS_LOCK          0x39
270#define HID_KEY_F1                 0x3A
271#define HID_KEY_F2                 0x3B
272#define HID_KEY_F3                 0x3C
273#define HID_KEY_F4                 0x3D
274#define HID_KEY_F5                 0x3E
275#define HID_KEY_F6                 0x3F
276#define HID_KEY_F7                 0x40
277#define HID_KEY_F8                 0x41
278#define HID_KEY_F9                 0x42
279#define HID_KEY_F10                0x43
280#define HID_KEY_F11                0x44
281#define HID_KEY_F12                0x45
282#define HID_KEY_PRINT_SCREEN       0x46
283#define HID_KEY_SCROLL_LOCK        0x47
284#define HID_KEY_PAUSE              0x48
285#define HID_KEY_INSERT             0x49
286#define HID_KEY_HOME               0x4A
287#define HID_KEY_PAGE_UP            0x4B
288#define HID_KEY_DELETE             0x4C
289#define HID_KEY_END                0x4D
290#define HID_KEY_PAGE_DOWN          0x4E
291#define HID_KEY_ARROW_RIGHT        0x4F
292#define HID_KEY_ARROW_LEFT         0x50
293#define HID_KEY_ARROW_DOWN         0x51
294#define HID_KEY_ARROW_UP           0x52
295#define HID_KEY_NUM_LOCK           0x53
296#define HID_KEY_KEYPAD_DIVIDE      0x54
297#define HID_KEY_KEYPAD_MULTIPLY    0x55
298#define HID_KEY_KEYPAD_SUBTRACT    0x56
299#define HID_KEY_KEYPAD_ADD         0x57
300#define HID_KEY_KEYPAD_ENTER       0x58
301#define HID_KEY_KEYPAD_1           0x59
302#define HID_KEY_KEYPAD_2           0x5A
303#define HID_KEY_KEYPAD_3           0x5B
304#define HID_KEY_KEYPAD_4           0x5C
305#define HID_KEY_KEYPAD_5           0x5D
306#define HID_KEY_KEYPAD_6           0x5E
307#define HID_KEY_KEYPAD_7           0x5F
308#define HID_KEY_KEYPAD_8           0x60
309#define HID_KEY_KEYPAD_9           0x61
310#define HID_KEY_KEYPAD_0           0x62
311#define HID_KEY_KEYPAD_DECIMAL     0x63
312#define HID_KEY_EUROPE_2           0x64
313#define HID_KEY_APPLICATION        0x65
314#define HID_KEY_POWER              0x66
315#define HID_KEY_KEYPAD_EQUAL       0x67
316#define HID_KEY_F13                0x68
317#define HID_KEY_F14                0x69
318#define HID_KEY_F15                0x6A
319#define HID_KEY_CONTROL_LEFT       0xE0
320#define HID_KEY_SHIFT_LEFT         0xE1
321#define HID_KEY_ALT_LEFT           0xE2
322#define HID_KEY_GUI_LEFT           0xE3
323#define HID_KEY_CONTROL_RIGHT      0xE4
324#define HID_KEY_SHIFT_RIGHT        0xE5
325#define HID_KEY_ALT_RIGHT          0xE6
326#define HID_KEY_GUI_RIGHT          0xE7
327
328
329//--------------------------------------------------------------------+
330// REPORT DESCRIPTOR
331//--------------------------------------------------------------------+
332//------------- ITEM & TAG -------------//
333#define HID_REPORT_DATA_0(data)
334#define HID_REPORT_DATA_1(data) , data
335#define HID_REPORT_DATA_2(data) , U16_TO_U8S_LE(data)
336#define HID_REPORT_DATA_3(data) , U32_TO_U8S_LE(data)
337
338#define HID_REPORT_ITEM(data, tag, type, size) \
339  (((tag) << 4) | ((type) << 2) | (size)) HID_REPORT_DATA_##size(data)
340
341#define RI_TYPE_MAIN   0
342#define RI_TYPE_GLOBAL 1
343#define RI_TYPE_LOCAL  2
344
345//------------- MAIN ITEMS 6.2.2.4 -------------//
346#define HID_INPUT(x)           HID_REPORT_ITEM(x,  8, RI_TYPE_MAIN, 1)
347#define HID_OUTPUT(x)          HID_REPORT_ITEM(x,  9, RI_TYPE_MAIN, 1)
348#define HID_COLLECTION(x)      HID_REPORT_ITEM(x, 10, RI_TYPE_MAIN, 1)
349#define HID_FEATURE(x)         HID_REPORT_ITEM(x, 11, RI_TYPE_MAIN, 1)
350#define HID_COLLECTION_END     HID_REPORT_ITEM(x, 12, RI_TYPE_MAIN, 0)
351
352//------------- INPUT, OUTPUT, FEATURE 6.2.2.5 -------------//
353#define HID_DATA             (0<<0)
354#define HID_CONSTANT         (1<<0)
355
356#define HID_ARRAY            (0<<1)
357#define HID_VARIABLE         (1<<1)
358
359#define HID_ABSOLUTE         (0<<2)
360#define HID_RELATIVE         (1<<2)
361
362#define HID_WRAP_NO          (0<<3)
363#define HID_WRAP             (1<<3)
364
365#define HID_LINEAR           (0<<4)
366#define HID_NONLINEAR        (1<<4)
367
368#define HID_PREFERRED_STATE  (0<<5)
369#define HID_PREFERRED_NO     (1<<5)
370
371#define HID_NO_NULL_POSITION (0<<6)
372#define HID_NULL_STATE       (1<<6)
373
374#define HID_NON_VOLATILE     (0<<7)
375#define HID_VOLATILE         (1<<7)
376
377#define HID_BITFIELD         (0<<8)
378#define HID_BUFFERED_BYTES   (1<<8)
379
380//------------- COLLECTION ITEM 6.2.2.6 -------------//
381enum {
382  HID_COLLECTION_PHYSICAL = 0,
383  HID_COLLECTION_APPLICATION,
384  HID_COLLECTION_LOGICAL,
385  HID_COLLECTION_REPORT,
386  HID_COLLECTION_NAMED_ARRAY,
387  HID_COLLECTION_USAGE_SWITCH,
388  HID_COLLECTION_USAGE_MODIFIER
389};
390
391//------------- GLOBAL ITEMS 6.2.2.7 -------------//
392#define HID_USAGE_PAGE(x)         HID_REPORT_ITEM(x, 0, RI_TYPE_GLOBAL, 1)
393#define HID_USAGE_PAGE_N(x, n)    HID_REPORT_ITEM(x, 0, RI_TYPE_GLOBAL, n)
394
395#define HID_LOGICAL_MIN(x)        HID_REPORT_ITEM(x, 1, RI_TYPE_GLOBAL, 1)
396#define HID_LOGICAL_MIN_N(x, n)   HID_REPORT_ITEM(x, 1, RI_TYPE_GLOBAL, n)
397
398#define HID_LOGICAL_MAX(x)        HID_REPORT_ITEM(x, 2, RI_TYPE_GLOBAL, 1)
399#define HID_LOGICAL_MAX_N(x, n)   HID_REPORT_ITEM(x, 2, RI_TYPE_GLOBAL, n)
400
401#define HID_PHYSICAL_MIN(x)       HID_REPORT_ITEM(x, 3, RI_TYPE_GLOBAL, 1)
402#define HID_PHYSICAL_MIN_N(x, n)  HID_REPORT_ITEM(x, 3, RI_TYPE_GLOBAL, n)
403
404#define HID_PHYSICAL_MAX(x)       HID_REPORT_ITEM(x, 4, RI_TYPE_GLOBAL, 1)
405#define HID_PHYSICAL_MAX_N(x, n)  HID_REPORT_ITEM(x, 4, RI_TYPE_GLOBAL, n)
406
407#define HID_UNIT_EXPONENT(x)      HID_REPORT_ITEM(x, 5, RI_TYPE_GLOBAL, 1)
408#define HID_UNIT_EXPONENT_N(x, n) HID_REPORT_ITEM(x, 5, RI_TYPE_GLOBAL, n)
409
410#define HID_UNIT(x)               HID_REPORT_ITEM(x, 6, RI_TYPE_GLOBAL, 1)
411#define HID_UNIT_N(x, n)          HID_REPORT_ITEM(x, 6, RI_TYPE_GLOBAL, n)
412
413#define HID_REPORT_SIZE(x)        HID_REPORT_ITEM(x, 7, RI_TYPE_GLOBAL, 1)
414#define HID_REPORT_SIZE_N(x, n)   HID_REPORT_ITEM(x, 7, RI_TYPE_GLOBAL, n)
415
416#define HID_REPORT_ID(x)          HID_REPORT_ITEM(x, 8, RI_TYPE_GLOBAL, 1)
417#define HID_REPORT_ID_N(x)        HID_REPORT_ITEM(x, 8, RI_TYPE_GLOBAL, n)
418
419#define HID_REPORT_COUNT(x)       HID_REPORT_ITEM(x, 9, RI_TYPE_GLOBAL, 1)
420#define HID_REPORT_COUNT_N(x, n)  HID_REPORT_ITEM(x, 9, RI_TYPE_GLOBAL, n)
421
422#define HID_PUSH                  HID_REPORT_ITEM(x, 10, RI_TYPE_GLOBAL, 0)
423#define HID_POP                   HID_REPORT_ITEM(x, 11, RI_TYPE_GLOBAL, 0)
424
425//------------- LOCAL ITEMS 6.2.2.8 -------------//
426#define HID_USAGE(x)              HID_REPORT_ITEM(x, 0, RI_TYPE_LOCAL, 1)
427#define HID_USAGE_N(x, n)         HID_REPORT_ITEM(x, 0, RI_TYPE_LOCAL, n)
428
429#define HID_USAGE_MIN(x)          HID_REPORT_ITEM(x, 1, RI_TYPE_LOCAL, 1)
430#define HID_USAGE_MIN_N(x, n)     HID_REPORT_ITEM(x, 1, RI_TYPE_LOCAL, n)
431
432#define HID_USAGE_MAX(x)          HID_REPORT_ITEM(x, 2, RI_TYPE_LOCAL, 1)
433#define HID_USAGE_MAX_N(x, n)     HID_REPORT_ITEM(x, 2, RI_TYPE_LOCAL, n)
434
435//--------------------------------------------------------------------+
436// Usage Table
437//--------------------------------------------------------------------+
438
439/// HID Usage Table - Table 1: Usage Page Summary
440enum {
441  HID_USAGE_PAGE_DESKTOP         = 0x01,
442  HID_USAGE_PAGE_SIMULATE        = 0x02,
443  HID_USAGE_PAGE_VIRTUAL_REALITY = 0x03,
444  HID_USAGE_PAGE_SPORT           = 0x04,
445  HID_USAGE_PAGE_GAME            = 0x05,
446  HID_USAGE_PAGE_GENERIC_DEVICE  = 0x06,
447  HID_USAGE_PAGE_KEYBOARD        = 0x07,
448  HID_USAGE_PAGE_LED             = 0x08,
449  HID_USAGE_PAGE_BUTTON          = 0x09,
450  HID_USAGE_PAGE_ORDINAL         = 0x0a,
451  HID_USAGE_PAGE_TELEPHONY       = 0x0b,
452  HID_USAGE_PAGE_CONSUMER        = 0x0c,
453  HID_USAGE_PAGE_DIGITIZER       = 0x0d,
454  HID_USAGE_PAGE_PID             = 0x0f,
455  HID_USAGE_PAGE_UNICODE         = 0x10,
456  HID_USAGE_PAGE_ALPHA_DISPLAY   = 0x14,
457  HID_USAGE_PAGE_MEDICAL         = 0x40,
458  HID_USAGE_PAGE_MONITOR         = 0x80, //0x80 - 0x83
459  HID_USAGE_PAGE_POWER           = 0x84, // 0x084 - 0x87
460  HID_USAGE_PAGE_BARCODE_SCANNER = 0x8c,
461  HID_USAGE_PAGE_SCALE           = 0x8d,
462  HID_USAGE_PAGE_MSR             = 0x8e,
463  HID_USAGE_PAGE_CAMERA          = 0x90,
464  HID_USAGE_PAGE_ARCADE          = 0x91,
465  HID_USAGE_PAGE_VENDOR          = 0xFF00 // 0xFF00 - 0xFFFF
466};
467
468/// HID Usage Table - Table 6: Generic Desktop Page
469enum {
470  HID_USAGE_DESKTOP_POINTER                               = 0x01,
471  HID_USAGE_DESKTOP_MOUSE                                 = 0x02,
472  HID_USAGE_DESKTOP_JOYSTICK                              = 0x04,
473  HID_USAGE_DESKTOP_GAMEPAD                               = 0x05,
474  HID_USAGE_DESKTOP_KEYBOARD                              = 0x06,
475  HID_USAGE_DESKTOP_KEYPAD                                = 0x07,
476  HID_USAGE_DESKTOP_MULTI_AXIS_CONTROLLER                 = 0x08,
477  HID_USAGE_DESKTOP_TABLET_PC_SYSTEM                      = 0x09,
478  HID_USAGE_DESKTOP_X                                     = 0x30,
479  HID_USAGE_DESKTOP_Y                                     = 0x31,
480  HID_USAGE_DESKTOP_Z                                     = 0x32,
481  HID_USAGE_DESKTOP_RX                                    = 0x33,
482  HID_USAGE_DESKTOP_RY                                    = 0x34,
483  HID_USAGE_DESKTOP_RZ                                    = 0x35,
484  HID_USAGE_DESKTOP_SLIDER                                = 0x36,
485  HID_USAGE_DESKTOP_DIAL                                  = 0x37,
486  HID_USAGE_DESKTOP_WHEEL                                 = 0x38,
487  HID_USAGE_DESKTOP_HAT_SWITCH                            = 0x39,
488  HID_USAGE_DESKTOP_COUNTED_BUFFER                        = 0x3a,
489  HID_USAGE_DESKTOP_BYTE_COUNT                            = 0x3b,
490  HID_USAGE_DESKTOP_MOTION_WAKEUP                         = 0x3c,
491  HID_USAGE_DESKTOP_START                                 = 0x3d,
492  HID_USAGE_DESKTOP_SELECT                                = 0x3e,
493  HID_USAGE_DESKTOP_VX                                    = 0x40,
494  HID_USAGE_DESKTOP_VY                                    = 0x41,
495  HID_USAGE_DESKTOP_VZ                                    = 0x42,
496  HID_USAGE_DESKTOP_VBRX                                  = 0x43,
497  HID_USAGE_DESKTOP_VBRY                                  = 0x44,
498  HID_USAGE_DESKTOP_VBRZ                                  = 0x45,
499  HID_USAGE_DESKTOP_VNO                                   = 0x46,
500  HID_USAGE_DESKTOP_FEATURE_NOTIFICATION                  = 0x47,
501  HID_USAGE_DESKTOP_RESOLUTION_MULTIPLIER                 = 0x48,
502  HID_USAGE_DESKTOP_SYSTEM_CONTROL                        = 0x80,
503  HID_USAGE_DESKTOP_SYSTEM_POWER_DOWN                     = 0x81,
504  HID_USAGE_DESKTOP_SYSTEM_SLEEP                          = 0x82,
505  HID_USAGE_DESKTOP_SYSTEM_WAKE_UP                        = 0x83,
506  HID_USAGE_DESKTOP_SYSTEM_CONTEXT_MENU                   = 0x84,
507  HID_USAGE_DESKTOP_SYSTEM_MAIN_MENU                      = 0x85,
508  HID_USAGE_DESKTOP_SYSTEM_APP_MENU                       = 0x86,
509  HID_USAGE_DESKTOP_SYSTEM_MENU_HELP                      = 0x87,
510  HID_USAGE_DESKTOP_SYSTEM_MENU_EXIT                      = 0x88,
511  HID_USAGE_DESKTOP_SYSTEM_MENU_SELECT                    = 0x89,
512  HID_USAGE_DESKTOP_SYSTEM_MENU_RIGHT                     = 0x8A,
513  HID_USAGE_DESKTOP_SYSTEM_MENU_LEFT                      = 0x8B,
514  HID_USAGE_DESKTOP_SYSTEM_MENU_UP                        = 0x8C,
515  HID_USAGE_DESKTOP_SYSTEM_MENU_DOWN                      = 0x8D,
516  HID_USAGE_DESKTOP_SYSTEM_COLD_RESTART                   = 0x8E,
517  HID_USAGE_DESKTOP_SYSTEM_WARM_RESTART                   = 0x8F,
518  HID_USAGE_DESKTOP_DPAD_UP                               = 0x90,
519  HID_USAGE_DESKTOP_DPAD_DOWN                             = 0x91,
520  HID_USAGE_DESKTOP_DPAD_RIGHT                            = 0x92,
521  HID_USAGE_DESKTOP_DPAD_LEFT                             = 0x93,
522  HID_USAGE_DESKTOP_SYSTEM_DOCK                           = 0xA0,
523  HID_USAGE_DESKTOP_SYSTEM_UNDOCK                         = 0xA1,
524  HID_USAGE_DESKTOP_SYSTEM_SETUP                          = 0xA2,
525  HID_USAGE_DESKTOP_SYSTEM_BREAK                          = 0xA3,
526  HID_USAGE_DESKTOP_SYSTEM_DEBUGGER_BREAK                 = 0xA4,
527  HID_USAGE_DESKTOP_APPLICATION_BREAK                     = 0xA5,
528  HID_USAGE_DESKTOP_APPLICATION_DEBUGGER_BREAK            = 0xA6,
529  HID_USAGE_DESKTOP_SYSTEM_SPEAKER_MUTE                   = 0xA7,
530  HID_USAGE_DESKTOP_SYSTEM_HIBERNATE                      = 0xA8,
531  HID_USAGE_DESKTOP_SYSTEM_DISPLAY_INVERT                 = 0xB0,
532  HID_USAGE_DESKTOP_SYSTEM_DISPLAY_INTERNAL               = 0xB1,
533  HID_USAGE_DESKTOP_SYSTEM_DISPLAY_EXTERNAL               = 0xB2,
534  HID_USAGE_DESKTOP_SYSTEM_DISPLAY_BOTH                   = 0xB3,
535  HID_USAGE_DESKTOP_SYSTEM_DISPLAY_DUAL                   = 0xB4,
536  HID_USAGE_DESKTOP_SYSTEM_DISPLAY_TOGGLE_INT_EXT         = 0xB5,
537  HID_USAGE_DESKTOP_SYSTEM_DISPLAY_SWAP_PRIMARY_SECONDARY = 0xB6,
538  HID_USAGE_DESKTOP_SYSTEM_DISPLAY_LCD_AUTOSCALE          = 0xB7
539};
540
541
542/// HID Usage Table: Consumer Page (0x0C)
543/// Only contains controls that supported by Windows (whole list is too long)
544enum
545{
546  // Generic Control
547  HID_USAGE_CONSUMER_CONTROL                           = 0x0001,
548
549  // Power Control
550  HID_USAGE_CONSUMER_POWER                             = 0x0030,
551  HID_USAGE_CONSUMER_RESET                             = 0x0031,
552  HID_USAGE_CONSUMER_SLEEP                             = 0x0032,
553
554  // Screen Brightness
555  HID_USAGE_CONSUMER_BRIGHTNESS_INCREMENT              = 0x006F,
556  HID_USAGE_CONSUMER_BRIGHTNESS_DECREMENT              = 0x0070,
557
558  // These HID usages operate only on mobile systems (battery powered) and
559  // require Windows 8 (build 8302 or greater).
560  HID_USAGE_CONSUMER_WIRELESS_RADIO_CONTROLS           = 0x000C,
561  HID_USAGE_CONSUMER_WIRELESS_RADIO_BUTTONS            = 0x00C6,
562  HID_USAGE_CONSUMER_WIRELESS_RADIO_LED                = 0x00C7,
563  HID_USAGE_CONSUMER_WIRELESS_RADIO_SLIDER_SWITCH      = 0x00C8,
564
565  // Media Control
566  HID_USAGE_CONSUMER_PLAY_PAUSE                        = 0x00CD,
567  HID_USAGE_CONSUMER_SCAN_NEXT                         = 0x00B5,
568  HID_USAGE_CONSUMER_SCAN_PREVIOUS                     = 0x00B6,
569  HID_USAGE_CONSUMER_STOP                              = 0x00B7,
570  HID_USAGE_CONSUMER_VOLUME                            = 0x00E0,
571  HID_USAGE_CONSUMER_MUTE                              = 0x00E2,
572  HID_USAGE_CONSUMER_BASS                              = 0x00E3,
573  HID_USAGE_CONSUMER_TREBLE                            = 0x00E4,
574  HID_USAGE_CONSUMER_BASS_BOOST                        = 0x00E5,
575  HID_USAGE_CONSUMER_VOLUME_INCREMENT                  = 0x00E9,
576  HID_USAGE_CONSUMER_VOLUME_DECREMENT                  = 0x00EA,
577  HID_USAGE_CONSUMER_BASS_INCREMENT                    = 0x0152,
578  HID_USAGE_CONSUMER_BASS_DECREMENT                    = 0x0153,
579  HID_USAGE_CONSUMER_TREBLE_INCREMENT                  = 0x0154,
580  HID_USAGE_CONSUMER_TREBLE_DECREMENT                  = 0x0155,
581
582  // Application Launcher
583  HID_USAGE_CONSUMER_AL_CONSUMER_CONTROL_CONFIGURATION = 0x0183,
584  HID_USAGE_CONSUMER_AL_EMAIL_READER                   = 0x018A,
585  HID_USAGE_CONSUMER_AL_CALCULATOR                     = 0x0192,
586  HID_USAGE_CONSUMER_AL_LOCAL_BROWSER                  = 0x0194,
587
588  // Browser/Explorer Specific
589  HID_USAGE_CONSUMER_AC_SEARCH                         = 0x0221,
590  HID_USAGE_CONSUMER_AC_HOME                           = 0x0223,
591  HID_USAGE_CONSUMER_AC_BACK                           = 0x0224,
592  HID_USAGE_CONSUMER_AC_FORWARD                        = 0x0225,
593  HID_USAGE_CONSUMER_AC_STOP                           = 0x0226,
594  HID_USAGE_CONSUMER_AC_REFRESH                        = 0x0227,
595  HID_USAGE_CONSUMER_AC_BOOKMARKS                      = 0x022A,
596
597  // Mouse Horizontal scroll
598  HID_USAGE_CONSUMER_AC_PAN                            = 0x0238,
599};
600
601/*--------------------------------------------------------------------
602 * ASCII to KEYCODE Conversion
603 *  Expand to array of [128][2] (shift, keycode)
604 *
605 * Usage: example to convert input chr into keyboard report (modifier + keycode)
606 *
607 *  uint8_t const conv_table[128][2] =  { HID_ASCII_TO_KEYCODE };
608 *
609 *  uint8_t keycode[6] = { 0 };
610 *  uint8_t modifier   = 0;
611 *
612 *  if ( conv_table[chr][0] ) modifier = KEYBOARD_MODIFIER_LEFTSHIFT;
613 *  keycode[0] = conv_table[chr][1];
614 *  tud_hid_keyboard_report(report_id, modifier, keycode);
615 *
616 *--------------------------------------------------------------------*/
617#define HID_ASCII_TO_KEYCODE \
618    {0, 0                     }, /* 0x00 Null      */ \
619    {0, 0                     }, /* 0x01           */ \
620    {0, 0                     }, /* 0x02           */ \
621    {0, 0                     }, /* 0x03           */ \
622    {0, 0                     }, /* 0x04           */ \
623    {0, 0                     }, /* 0x05           */ \
624    {0, 0                     }, /* 0x06           */ \
625    {0, 0                     }, /* 0x07           */ \
626    {0, HID_KEY_BACKSPACE     }, /* 0x08 Backspace */ \
627    {0, HID_KEY_TAB           }, /* 0x09 Tab       */ \
628    {0, HID_KEY_RETURN        }, /* 0x0A Line Feed */ \
629    {0, 0                     }, /* 0x0B           */ \
630    {0, 0                     }, /* 0x0C           */ \
631    {0, HID_KEY_RETURN        }, /* 0x0D CR        */ \
632    {0, 0                     }, /* 0x0E           */ \
633    {0, 0                     }, /* 0x0F           */ \
634    {0, 0                     }, /* 0x10           */ \
635    {0, 0                     }, /* 0x11           */ \
636    {0, 0                     }, /* 0x12           */ \
637    {0, 0                     }, /* 0x13           */ \
638    {0, 0                     }, /* 0x14           */ \
639    {0, 0                     }, /* 0x15           */ \
640    {0, 0                     }, /* 0x16           */ \
641    {0, 0                     }, /* 0x17           */ \
642    {0, 0                     }, /* 0x18           */ \
643    {0, 0                     }, /* 0x19           */ \
644    {0, 0                     }, /* 0x1A           */ \
645    {0, HID_KEY_ESCAPE        }, /* 0x1B Escape    */ \
646    {0, 0                     }, /* 0x1C           */ \
647    {0, 0                     }, /* 0x1D           */ \
648    {0, 0                     }, /* 0x1E           */ \
649    {0, 0                     }, /* 0x1F           */ \
650                                                      \
651    {0, HID_KEY_SPACE         }, /* 0x20           */ \
652    {1, HID_KEY_1             }, /* 0x21 !         */ \
653    {1, HID_KEY_APOSTROPHE    }, /* 0x22 "         */ \
654    {1, HID_KEY_3             }, /* 0x23 #         */ \
655    {1, HID_KEY_4             }, /* 0x24 $         */ \
656    {1, HID_KEY_5             }, /* 0x25 %         */ \
657    {1, HID_KEY_7             }, /* 0x26 &         */ \
658    {0, HID_KEY_APOSTROPHE    }, /* 0x27 '         */ \
659    {1, HID_KEY_9             }, /* 0x28 (         */ \
660    {1, HID_KEY_0             }, /* 0x29 )         */ \
661    {1, HID_KEY_8             }, /* 0x2A *         */ \
662    {1, HID_KEY_EQUAL         }, /* 0x2B +         */ \
663    {0, HID_KEY_COMMA         }, /* 0x2C ,         */ \
664    {0, HID_KEY_MINUS         }, /* 0x2D -         */ \
665    {0, HID_KEY_PERIOD        }, /* 0x2E .         */ \
666    {0, HID_KEY_SLASH         }, /* 0x2F /         */ \
667    {0, HID_KEY_0             }, /* 0x30 0         */ \
668    {0, HID_KEY_1             }, /* 0x31 1         */ \
669    {0, HID_KEY_2             }, /* 0x32 2         */ \
670    {0, HID_KEY_3             }, /* 0x33 3         */ \
671    {0, HID_KEY_4             }, /* 0x34 4         */ \
672    {0, HID_KEY_5             }, /* 0x35 5         */ \
673    {0, HID_KEY_6             }, /* 0x36 6         */ \
674    {0, HID_KEY_7             }, /* 0x37 7         */ \
675    {0, HID_KEY_8             }, /* 0x38 8         */ \
676    {0, HID_KEY_9             }, /* 0x39 9         */ \
677    {1, HID_KEY_SEMICOLON     }, /* 0x3A :         */ \
678    {0, HID_KEY_SEMICOLON     }, /* 0x3B ;         */ \
679    {1, HID_KEY_COMMA         }, /* 0x3C <         */ \
680    {0, HID_KEY_EQUAL         }, /* 0x3D =         */ \
681    {1, HID_KEY_PERIOD        }, /* 0x3E >         */ \
682    {1, HID_KEY_SLASH         }, /* 0x3F ?         */ \
683                                                      \
684    {1, HID_KEY_2             }, /* 0x40 @         */ \
685    {1, HID_KEY_A             }, /* 0x41 A         */ \
686    {1, HID_KEY_B             }, /* 0x42 B         */ \
687    {1, HID_KEY_C             }, /* 0x43 C         */ \
688    {1, HID_KEY_D             }, /* 0x44 D         */ \
689    {1, HID_KEY_E             }, /* 0x45 E         */ \
690    {1, HID_KEY_F             }, /* 0x46 F         */ \
691    {1, HID_KEY_G             }, /* 0x47 G         */ \
692    {1, HID_KEY_H             }, /* 0x48 H         */ \
693    {1, HID_KEY_I             }, /* 0x49 I         */ \
694    {1, HID_KEY_J             }, /* 0x4A J         */ \
695    {1, HID_KEY_K             }, /* 0x4B K         */ \
696    {1, HID_KEY_L             }, /* 0x4C L         */ \
697    {1, HID_KEY_M             }, /* 0x4D M         */ \
698    {1, HID_KEY_N             }, /* 0x4E N         */ \
699    {1, HID_KEY_O             }, /* 0x4F O         */ \
700    {1, HID_KEY_P             }, /* 0x50 P         */ \
701    {1, HID_KEY_Q             }, /* 0x51 Q         */ \
702    {1, HID_KEY_R             }, /* 0x52 R         */ \
703    {1, HID_KEY_S             }, /* 0x53 S         */ \
704    {1, HID_KEY_T             }, /* 0x55 T         */ \
705    {1, HID_KEY_U             }, /* 0x55 U         */ \
706    {1, HID_KEY_V             }, /* 0x56 V         */ \
707    {1, HID_KEY_W             }, /* 0x57 W         */ \
708    {1, HID_KEY_X             }, /* 0x58 X         */ \
709    {1, HID_KEY_Y             }, /* 0x59 Y         */ \
710    {1, HID_KEY_Z             }, /* 0x5A Z         */ \
711    {0, HID_KEY_BRACKET_LEFT  }, /* 0x5B [         */ \
712    {0, HID_KEY_BACKSLASH     }, /* 0x5C '\'       */ \
713    {0, HID_KEY_BRACKET_RIGHT }, /* 0x5D ]         */ \
714    {1, HID_KEY_6             }, /* 0x5E ^         */ \
715    {1, HID_KEY_MINUS         }, /* 0x5F _         */ \
716                                                      \
717    {0, HID_KEY_GRAVE         }, /* 0x60 `         */ \
718    {0, HID_KEY_A             }, /* 0x61 a         */ \
719    {0, HID_KEY_B             }, /* 0x62 b         */ \
720    {0, HID_KEY_C             }, /* 0x63 c         */ \
721    {0, HID_KEY_D             }, /* 0x66 d         */ \
722    {0, HID_KEY_E             }, /* 0x65 e         */ \
723    {0, HID_KEY_F             }, /* 0x66 f         */ \
724    {0, HID_KEY_G             }, /* 0x67 g         */ \
725    {0, HID_KEY_H             }, /* 0x68 h         */ \
726    {0, HID_KEY_I             }, /* 0x69 i         */ \
727    {0, HID_KEY_J             }, /* 0x6A j         */ \
728    {0, HID_KEY_K             }, /* 0x6B k         */ \
729    {0, HID_KEY_L             }, /* 0x6C l         */ \
730    {0, HID_KEY_M             }, /* 0x6D m         */ \
731    {0, HID_KEY_N             }, /* 0x6E n         */ \
732    {0, HID_KEY_O             }, /* 0x6F o         */ \
733    {0, HID_KEY_P             }, /* 0x70 p         */ \
734    {0, HID_KEY_Q             }, /* 0x71 q         */ \
735    {0, HID_KEY_R             }, /* 0x72 r         */ \
736    {0, HID_KEY_S             }, /* 0x73 s         */ \
737    {0, HID_KEY_T             }, /* 0x75 t         */ \
738    {0, HID_KEY_U             }, /* 0x75 u         */ \
739    {0, HID_KEY_V             }, /* 0x76 v         */ \
740    {0, HID_KEY_W             }, /* 0x77 w         */ \
741    {0, HID_KEY_X             }, /* 0x78 x         */ \
742    {0, HID_KEY_Y             }, /* 0x79 y         */ \
743    {0, HID_KEY_Z             }, /* 0x7A z         */ \
744    {1, HID_KEY_BRACKET_LEFT  }, /* 0x7B {         */ \
745    {1, HID_KEY_BACKSLASH     }, /* 0x7C |         */ \
746    {1, HID_KEY_BRACKET_RIGHT }, /* 0x7D }         */ \
747    {1, HID_KEY_GRAVE         }, /* 0x7E ~         */ \
748    {0, HID_KEY_DELETE        }  /* 0x7F Delete    */ \
749
750/*--------------------------------------------------------------------
751 * KEYCODE to Ascii Conversion
752 *  Expand to array of [128][2] (ascii without shift, ascii with shift)
753 *
754 * Usage: example to convert ascii from keycode (key) and shift modifier (shift).
755 * Here we assume key < 128 ( printable )
756 *
757 *  uint8_t const conv_table[128][2] =  { HID_KEYCODE_TO_ASCII };
758 *  char ch = shift ? conv_table[chr][1] : conv_table[chr][0];
759 *
760 *--------------------------------------------------------------------*/
761#define HID_KEYCODE_TO_ASCII    \
762    {0     , 0      }, /* 0x00 */ \
763    {0     , 0      }, /* 0x01 */ \
764    {0     , 0      }, /* 0x02 */ \
765    {0     , 0      }, /* 0x03 */ \
766    {'a'   , 'A'    }, /* 0x04 */ \
767    {'b'   , 'B'    }, /* 0x05 */ \
768    {'c'   , 'C'    }, /* 0x06 */ \
769    {'d'   , 'D'    }, /* 0x07 */ \
770    {'e'   , 'E'    }, /* 0x08 */ \
771    {'f'   , 'F'    }, /* 0x09 */ \
772    {'g'   , 'G'    }, /* 0x0a */ \
773    {'h'   , 'H'    }, /* 0x0b */ \
774    {'i'   , 'I'    }, /* 0x0c */ \
775    {'j'   , 'J'    }, /* 0x0d */ \
776    {'k'   , 'K'    }, /* 0x0e */ \
777    {'l'   , 'L'    }, /* 0x0f */ \
778    {'m'   , 'M'    }, /* 0x10 */ \
779    {'n'   , 'N'    }, /* 0x11 */ \
780    {'o'   , 'O'    }, /* 0x12 */ \
781    {'p'   , 'P'    }, /* 0x13 */ \
782    {'q'   , 'Q'    }, /* 0x14 */ \
783    {'r'   , 'R'    }, /* 0x15 */ \
784    {'s'   , 'S'    }, /* 0x16 */ \
785    {'t'   , 'T'    }, /* 0x17 */ \
786    {'u'   , 'U'    }, /* 0x18 */ \
787    {'v'   , 'V'    }, /* 0x19 */ \
788    {'w'   , 'W'    }, /* 0x1a */ \
789    {'x'   , 'X'    }, /* 0x1b */ \
790    {'y'   , 'Y'    }, /* 0x1c */ \
791    {'z'   , 'Z'    }, /* 0x1d */ \
792    {'1'   , '!'    }, /* 0x1e */ \
793    {'2'   , '@'    }, /* 0x1f */ \
794    {'3'   , '#'    }, /* 0x20 */ \
795    {'4'   , '$'    }, /* 0x21 */ \
796    {'5'   , '%'    }, /* 0x22 */ \
797    {'6'   , '^'    }, /* 0x23 */ \
798    {'7'   , '&'    }, /* 0x24 */ \
799    {'8'   , '*'    }, /* 0x25 */ \
800    {'9'   , '('    }, /* 0x26 */ \
801    {'0'   , ')'    }, /* 0x27 */ \
802    {'\r'  , '\r'   }, /* 0x28 */ \
803    {'\x1b', '\x1b' }, /* 0x29 */ \
804    {'\b'  , '\b'   }, /* 0x2a */ \
805    {'\t'  , '\t'   }, /* 0x2b */ \
806    {' '   , ' '    }, /* 0x2c */ \
807    {'-'   , '_'    }, /* 0x2d */ \
808    {'='   , '+'    }, /* 0x2e */ \
809    {'['   , '{'    }, /* 0x2f */ \
810    {']'   , '}'    }, /* 0x30 */ \
811    {'\\'  , '|'    }, /* 0x31 */ \
812    {'#'   , '~'    }, /* 0x32 */ \
813    {';'   , ':'    }, /* 0x33 */ \
814    {'\''  , '\"'   }, /* 0x34 */ \
815    {'`'   , '~'    }, /* 0x35 */ \
816    {','   , '<'    }, /* 0x36 */ \
817    {'.'   , '>'    }, /* 0x37 */ \
818    {'/'   , '?'    }, /* 0x38 */ \
819                                  \
820    {0     , 0      }, /* 0x39 */ \
821    {0     , 0      }, /* 0x3a */ \
822    {0     , 0      }, /* 0x3b */ \
823    {0     , 0      }, /* 0x3c */ \
824    {0     , 0      }, /* 0x3d */ \
825    {0     , 0      }, /* 0x3e */ \
826    {0     , 0      }, /* 0x3f */ \
827    {0     , 0      }, /* 0x40 */ \
828    {0     , 0      }, /* 0x41 */ \
829    {0     , 0      }, /* 0x42 */ \
830    {0     , 0      }, /* 0x43 */ \
831    {0     , 0      }, /* 0x44 */ \
832    {0     , 0      }, /* 0x45 */ \
833    {0     , 0      }, /* 0x46 */ \
834    {0     , 0      }, /* 0x47 */ \
835    {0     , 0      }, /* 0x48 */ \
836    {0     , 0      }, /* 0x49 */ \
837    {0     , 0      }, /* 0x4a */ \
838    {0     , 0      }, /* 0x4b */ \
839    {0     , 0      }, /* 0x4c */ \
840    {0     , 0      }, /* 0x4d */ \
841    {0     , 0      }, /* 0x4e */ \
842    {0     , 0      }, /* 0x4f */ \
843    {0     , 0      }, /* 0x50 */ \
844    {0     , 0      }, /* 0x51 */ \
845    {0     , 0      }, /* 0x52 */ \
846    {0     , 0      }, /* 0x53 */ \
847                                  \
848    {'/'   , '/'    }, /* 0x54 */ \
849    {'*'   , '*'    }, /* 0x55 */ \
850    {'-'   , '-'    }, /* 0x56 */ \
851    {'+'   , '+'    }, /* 0x57 */ \
852    {'\r'  , '\r'   }, /* 0x58 */ \
853    {'1'   , 0      }, /* 0x59 */ \
854    {'2'   , 0      }, /* 0x5a */ \
855    {'3'   , 0      }, /* 0x5b */ \
856    {'4'   , 0      }, /* 0x5c */ \
857    {'5'   , '5'    }, /* 0x5d */ \
858    {'6'   , 0      }, /* 0x5e */ \
859    {'7'   , 0      }, /* 0x5f */ \
860    {'8'   , 0      }, /* 0x60 */ \
861    {'9'   , 0      }, /* 0x61 */ \
862    {'0'   , 0      }, /* 0x62 */ \
863    {'0'   , 0      }, /* 0x63 */ \
864    {'='   , '='    }, /* 0x67 */ \
865
866
867#ifdef __cplusplus
868 }
869#endif
870
871#endif /* _TUSB_HID_H__ */
872
873/// @}