hid_usage_desktop.h 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /* This file is the part of the Lightweight USB device Stack for STM32 microcontrollers
  2. *
  3. * Copyright ©2016 Dmitry Filimonchuk <dmitrystu[at]gmail[dot]com>
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. #ifndef _USB_HID_USAGE_DESKTOP_H_
  16. #define _USB_HID_USAGE_DESKTOP_H_
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. /**\ingroup USB_HID
  21. * \addtogroup USB_HID_USAGES_DESKTOP HID Usage Tables for Desktop
  22. * \brief Contains USB HID Usages definitions for Generic Desktop Page
  23. * \details This module based on
  24. * + [HID Usage Tables Version 1.12](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf)
  25. * @{ */
  26. #define HID_USAGE_PAGE_DESKTOP 0x01 /**<\brief Desktop usage page.*/
  27. /**\name Application Usages
  28. * @{ */
  29. #define HID_DESKTOP_POINTER 0x01 /**<\brief CP Pointer control.*/
  30. #define HID_DESKTOP_MOUSE 0x02 /**<\brief CA Mouse.*/
  31. #define HID_DESKTOP_JOYSTICK 0x04 /**<\brief CA Joystick.*/
  32. #define HID_DESKTOP_GAMEPAD 0x05 /**<\brief CA Gamepad.*/
  33. #define HID_DESKTOP_KEYBOARD 0x06 /**<\brief CA Keybiard.*/
  34. #define HID_DESKTOP_KEYPAD 0x07 /**<\brief CA Keypad.*/
  35. #define HID_DESKTOP_MULTIAXIS 0x08 /**<\brief CA 3D input device.*/
  36. #define HID_DESKTOP_TABLET 0x09 /**<\brief CA System controls on Tablet PCs.*/
  37. /** @} */
  38. /**\name Axis Usages
  39. * @{ */
  40. #define HID_DESKTOP_X 0x30 /**<\brief DV Linear translation in the X direction.*/
  41. #define HID_DESKTOP_Y 0x31 /**<\brief DV Linear translation in the Y direction.*/
  42. #define HID_DESKTOP_Z 0x32 /**<\brief DV Linear translation in the Z direction.*/
  43. #define HID_DESKTOP_RX 0x33 /**<\brief DV Rotation about X axis.*/
  44. #define HID_DESKTOP_RY 0x34 /**<\brief DV Rotation about Y axis.*/
  45. #define HID_DESKTOP_RZ 0x35 /**<\brief DV Rotation about Z axis.*/
  46. /** @} */
  47. /**\name Miscellaneous Controls
  48. * @{ */
  49. #define HID_DESKTOP_SLIDER 0x36 /**<\brief DV Linear control for a variable value.*/
  50. #define HID_DESKTOP_DIAL 0x37 /**<\brief DV Rotary control for a variable value.*/
  51. #define HID_DESKTOP_WHEEL 0x38 /**<\brief DV Rotary control for a variable value.*/
  52. #define HID_DESKTOP_HAT_SWITCH 0x39 /**<\brief DV A specialized mechanical configuration of
  53. * switches generating a variable value with a null state.*/
  54. #define HID_DESKTOP_MOTION_WAKEUP 0x3C /**<\brief DF Enables the generation of a USB remote
  55. * wakeup when the device detects motion.*/
  56. #define HID_DESKTOP_START 0x3D /**<\brief OOC Session start button.*/
  57. #define HID_DESKTOP_SELECT 0x3E /**<\brief OOC Application option select button.*/
  58. #define HID_DESKTOP_RESOLUTION_MULT 0x48 /**<\brief DV Resolution Multiplier for a Control.*/
  59. /** @} */
  60. /**\name Vector Usages
  61. * @{ */
  62. #define HID_DESKTOP_VX 0x40 /**<\brief DV Vector in the X direction.*/
  63. #define HID_DESKTOP_VY 0x41 /**<\brief DV Vector in the Y direction.*/
  64. #define HID_DESKTOP_VZ 0x42 /**<\brief DV Vector in the Z direction.*/
  65. #define HID_DESKTOP_VBRX 0x43 /**<\brief DV Relative Vector in the X direction.*/
  66. #define HID_DESKTOP_VBRY 0x44 /**<\brief DV Relative vector in the Y direction.*/
  67. #define HID_DESKTOP_VBRZ 0x45 /**<\brief DV Relative vector in the Z direction.*/
  68. #define HID_DESKTOP_VNO 0x46 /**<\brief DV A non oriented vector or value.*/
  69. /** @} */
  70. /**\name System Controls
  71. * @{ */
  72. #define HID_DESKTOP_SYS_CONTROL 0x80 /**<\brief CA Application-level collection.*/
  73. #define HID_DESKTOP_SYS_CONTEXT_MNU 0x84 /**<\brief OSC Evokes a context-sensitive menu.*/
  74. #define HID_DESKTOP_SYS_MAIN_MNU 0x85 /**<\brief OSC Evokes the OS main-level selection menu.*/
  75. #define HID_DESKTOP_SYS_APP_MNU 0x86 /**<\brief OSC Displays an application-specific menu.*/
  76. #define HID_DESKTOP_SYS_MENU_HELP 0x87 /**<\brief OSC Displays the help menu.*/
  77. #define HID_DESKTOP_SYS_MENU_EXIT 0x88 /**<\brief OSC Exits a menu.*/
  78. #define HID_DESKTOP_SYS_MENU_SELECT 0x89 /**<\brief OSC Selects a menu item.*/
  79. #define HID_DESKTOP_SYS_MENU_RIGHT 0x8A /**<\brief RTC Menu select right.*/
  80. #define HID_DESKTOP_SYS_MENU_LEFT 0x8B /**<\brief RTC Menu select left.*/
  81. #define HID_DESKTOP_SYS_MENU_UP 0x8C /**<\brief RTC Menu select up.*/
  82. #define HID_DESKTOP_SYS_MENU_DOWN 0x8D /**<\brief RTC Menu select down.*/
  83. /** @} */
  84. /**\name Power Controls
  85. * @{ */
  86. #define HID_DESKTOP_SYS_PWR_DOWN 0x81 /**<\brief OSC Power down control.*/
  87. #define HID_DESKTOP_SYS_SLEEP 0x82 /**<\brief OSC Sleep control.*/
  88. #define HID_DESKTOP_SYS_WAKEUP 0x83 /**<\brief OSC Wakeup control.*/
  89. #define HID_DESKTOP_SYS_RST_COLD 0x8E /**<\brief OSC Cold restart control.*/
  90. #define HID_DESKTOP_SYS_RST_WARM 0x8F /**<\brief OSC Warm restart control.*/
  91. #define HID_DESKTOP_SYS_DOCK 0xA0 /**<\brief OSC Prepare for docking.*/
  92. #define HID_DESKTOP_SYS_UNDOCK 0xA1 /**<\brief OSC Prepare for undocking. */
  93. #define HID_DESKTOP_SYS_SETUP 0xA2 /**<\brief OSC Enter to BIOS-level setup.*/
  94. #define HID_DESKTOP_SYS_SPKR_MUTE 0xA7 /**<\brief OSC Mute system speakers.*/
  95. #define HID_DESKTOP_SYS_HIBERNATE 0xA8 /**<\brief OSC System hibernate control.*/
  96. /** @} */
  97. /**\name Buffered Bytes
  98. * @{ */
  99. #define HID_DESKTOP_COUNTEDBUF 0x3A /**<\brief CL Used with buffered byte data to indicate
  100. * the number of valid bytes in the buffered-byte field.*/
  101. #define HID_DESKTOP_BYTECOUNT 0x3B /**<\brief DV Defines a report field that indicates the
  102. * number of meaningful data bytes in an associated
  103. * buffered-byte field.*/
  104. /** @} */
  105. /**\name Direction Pads
  106. * @{ */
  107. #define HID_DESKTOP_DPAD_UP 0x90 /**<\brief OOC Top of a Direction Pad is pressed.*/
  108. #define HID_DESKTOP_DPAD_DOWN 0x91 /**<\brief OOC Bottom of a Direction Pad is pressed.*/
  109. #define HID_DESKTOP_DPAD_RIGHT 0x92 /**<\brief OOC Right side of a Direction Pad is pressed.*/
  110. #define HID_DESKTOP_DPAD_LEFT 0x93 /**<\brief OOC Left side of a Direction Pad is pressed.*/
  111. /** @} */
  112. /**\name Feature Notifications
  113. * @{ */
  114. #define HID_DESKTOP_FEATURE_NOTIFY 0x47 /**<\brief DV This usage is declared in an Input report
  115. * and is used as a notification to the host that the
  116. * contents of a specific Feature report has changed.*/
  117. /** @} */
  118. /**\name Software Flow Control
  119. * @{ */
  120. #define HID_DESKTOP_SYS_BREAK 0xA3 /**<\brief OSC System break control.*/
  121. #define HID_DESKTOP_SYS_DBG_BREAK 0xA4 /**<\brief OSC System debugger break control.*/
  122. #define HID_DESKTOP_APP_BREAK 0xA5 /**<\brief OSC Application break control.*/
  123. #define HID_DESKTOP_APP_DBG_BREAK 0xA6 /**<\brief OSC Application debugger break control.*/
  124. /** @} */
  125. /**\name System Display Control
  126. * @{ */
  127. #define HID_DESKTOP_SYS_DISP_INVERT 0xB0 /**<\brief OSC Set display to render in inverted colors.*/
  128. #define HID_DESKTOP_SYS_DISP_INT 0xB1 /**<\brief OSC Set the captive display as the primary display.*/
  129. #define HID_DESKTOP_SYS_DISP_EXT 0xB2 /**<\brief OSC Set the external display as the primary display.*/
  130. #define HID_DESKTOP_SYS_DISP_BOTH 0xB3 /**<\brief OSC Use both internal and external displays
  131. * as primary diaplay.*/
  132. #define HID_DESKTOP_SYS_DISP_DUAL 0xB4 /**<\brief OSC Use both internal and external displays
  133. * as primary and secondary diaplays.*/
  134. #define HID_DESKTOP_SYS_DISP_TGL 0xB5 /**<\brief OSC Toggles internal/external/both displays.*/
  135. #define HID_DESKTOP_SYS_DISP_SWAP 0xB6 /**<\brief OSC Swap primary/secondary displays.*/
  136. #define HID_DESKTOP_SYS_DISP_AUTO 0xB7 /**<\brief OCS Toggles LCD autoscale.*/
  137. /** @} */
  138. /** @} */
  139. #ifdef __cplusplus
  140. }
  141. #endif
  142. #endif