43
43
/** \defgroup ClassDriver_HID_Common Common Definitions
44
44
* @{ */
45
45
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
+
46
60
/// HID Subclass
47
61
typedef enum
48
62
{
@@ -69,9 +83,10 @@ typedef enum
69
83
/// HID Request Report Type
70
84
typedef enum
71
85
{
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
75
90
}hid_report_type_t ;
76
91
77
92
/// HID Class Specific Control Request
@@ -85,59 +100,45 @@ typedef enum
85
100
HID_REQ_CONTROL_SET_PROTOCOL = 0x0b ///< Set Protocol
86
101
}hid_request_type_t ;
87
102
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
-
102
103
/// HID Country Code
103
104
typedef enum
104
105
{
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
141
142
} hid_country_code_t ;
142
143
143
144
/** @} */
@@ -155,7 +156,7 @@ typedef struct ATTR_PACKED
155
156
int8_t x ; /**< Current delta x movement of the mouse. */
156
157
int8_t y ; /**< Current delta y movement on the mouse. */
157
158
int8_t wheel ; /**< Current delta wheel movement on the mouse. */
158
- // int8_t pan;
159
+ int8_t pan ; // using AC Pan
159
160
} hid_mouse_report_t ;
160
161
161
162
/// Standard Mouse Buttons Bitmap
@@ -461,7 +462,7 @@ enum {
461
462
HID_USAGE_PAGE_MSR = 0x8e ,
462
463
HID_USAGE_PAGE_CAMERA = 0x90 ,
463
464
HID_USAGE_PAGE_ARCADE = 0x91 ,
464
- HID_USAGE_PAGE_VENDOR = 0xFFFF // 0xFF00 - 0xFFFF
465
+ HID_USAGE_PAGE_VENDOR = 0xFF00 // 0xFF00 - 0xFFFF
465
466
};
466
467
467
468
/// HID Usage Table - Table 6: Generic Desktop Page
0 commit comments