4343/** \defgroup ClassDriver_HID_Common Common Definitions
4444 * @{ */
4545
46+ /// USB HID Descriptor
47+ typedef struct 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+
4660/// HID Subclass
4761typedef enum
4862{
@@ -69,9 +83,10 @@ typedef enum
6983/// HID Request Report Type
7084typedef enum
7185{
72- HID_REPORT_TYPE_INPUT = 1 , ///< Input
73- HID_REPORT_TYPE_OUTPUT , ///< Output
74- HID_REPORT_TYPE_FEATURE ///< Feature
86+ HID_REPORT_TYPE_INVALID = 0 ,
87+ HID_REPORT_TYPE_INPUT , ///< Input
88+ HID_REPORT_TYPE_OUTPUT , ///< Output
89+ HID_REPORT_TYPE_FEATURE ///< Feature
7590}hid_report_type_t ;
7691
7792/// HID Class Specific Control Request
@@ -85,59 +100,45 @@ typedef enum
85100 HID_REQ_CONTROL_SET_PROTOCOL = 0x0b ///< Set Protocol
86101}hid_request_type_t ;
87102
88- /// USB HID Descriptor
89- typedef struct ATTR_PACKED
90- {
91- uint8_t bLength ; /**< Numeric expression that is the total size of the HID descriptor */
92- uint8_t bDescriptorType ; /**< Constant name specifying type of HID descriptor. */
93-
94- uint16_t bcdHID ; /**< Numeric expression identifying the HID Class Specification release */
95- uint8_t bCountryCode ; /**< Numeric expression identifying country code of the localized hardware. */
96- uint8_t bNumDescriptors ; /**< Numeric expression specifying the number of class descriptors */
97-
98- uint8_t bReportType ; /**< Type of HID class report. */
99- uint16_t wReportLength ; /**< the total size of the Report descriptor. */
100- } tusb_hid_descriptor_hid_t ;
101-
102103/// HID Country Code
103104typedef enum
104105{
105- HID_Local_NotSupported = 0 , ///< NotSupported
106- HID_Local_Arabic , ///< Arabic
107- HID_Local_Belgian , ///< Belgian
108- HID_Local_Canadian_Bilingual , ///< Canadian_Bilingual
109- HID_Local_Canadian_French , ///< Canadian_French
110- HID_Local_Czech_Republic , ///< Czech_Republic
111- HID_Local_Danish , ///< Danish
112- HID_Local_Finnish , ///< Finnish
113- HID_Local_French , ///< French
114- HID_Local_German , ///< German
115- HID_Local_Greek , ///< Greek
116- HID_Local_Hebrew , ///< Hebrew
117- HID_Local_Hungary , ///< Hungary
118- HID_Local_International , ///< International
119- HID_Local_Italian , ///< Italian
120- HID_Local_Japan_Katakana , ///< Japan_Katakana
121- HID_Local_Korean , ///< Korean
122- HID_Local_Latin_American , ///< Latin_American
123- HID_Local_Netherlands_Dutch , ///< Netherlands/Dutch
124- HID_Local_Norwegian , ///< Norwegian
125- HID_Local_Persian_Farsi , ///< Persian (Farsi)
126- HID_Local_Poland , ///< Poland
127- HID_Local_Portuguese , ///< Portuguese
128- HID_Local_Russia , ///< Russia
129- HID_Local_Slovakia , ///< Slovakia
130- HID_Local_Spanish , ///< Spanish
131- HID_Local_Swedish , ///< Swedish
132- HID_Local_Swiss_French , ///< Swiss/French
133- HID_Local_Swiss_German , ///< Swiss/German
134- HID_Local_Switzerland , ///< Switzerland
135- HID_Local_Taiwan , ///< Taiwan
136- HID_Local_Turkish_Q , ///< Turkish-Q
137- HID_Local_UK , ///< UK
138- HID_Local_US , ///< US
139- HID_Local_Yugoslavia , ///< Yugoslavia
140- HID_Local_Turkish_F ///< Turkish-F
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
141142} hid_country_code_t ;
142143
143144/** @} */
@@ -155,7 +156,7 @@ typedef struct ATTR_PACKED
155156 int8_t x ; /**< Current delta x movement of the mouse. */
156157 int8_t y ; /**< Current delta y movement on the mouse. */
157158 int8_t wheel ; /**< Current delta wheel movement on the mouse. */
158- // int8_t pan;
159+ int8_t pan ; // using AC Pan
159160} hid_mouse_report_t ;
160161
161162/// Standard Mouse Buttons Bitmap
@@ -461,7 +462,7 @@ enum {
461462 HID_USAGE_PAGE_MSR = 0x8e ,
462463 HID_USAGE_PAGE_CAMERA = 0x90 ,
463464 HID_USAGE_PAGE_ARCADE = 0x91 ,
464- HID_USAGE_PAGE_VENDOR = 0xFFFF // 0xFF00 - 0xFFFF
465+ HID_USAGE_PAGE_VENDOR = 0xFF00 // 0xFF00 - 0xFFFF
465466};
466467
467468/// HID Usage Table - Table 6: Generic Desktop Page
0 commit comments