这段是hid的描述 能帮我解释一下吗0x05, 0x01, // Usage Page (Generic Desktop) 0x09, 0x02, // Usage (Mouse) 0xA1, 0x01, // Collection (Application) 0x85, HID_RPT_ID_MOUSE_IN, // Report Id (1) 0X01 0x09, 0x01, // Usage (Pointer) 0xA1, 0x00, // Collection (Physical) 0x05, 0x09, // Usage Page (Buttons) 0x19, 0x01, // Usage Minimum (01) - Button 1 0x29, 0x03, // Usage Maximum (03) - Button 3 0x15, 0x00, // Logical Minimum (0) 0x25, 0x01, // Logical Maximum (1) 0x75, 0x01, // Report Size (1) 0x95, 0x03, // Report Count (3) 0x81, 0x02, // Input (Data, Variable, Absolute) - Button states 0x75, 0x05, // Report Size (5) 0x95, 0x01, // Report Count (1) 0x81, 0x01, // Input (Constant) - Padding or Reserved bits 0x05, 0x01, // Usage Page (Generic Desktop) 0x09, 0x30, // Usage (X) 0x09, 0x31, // Usage (Y) 0x09, 0x38, // Usage (Wheel) 0x15, 0x81, // Logical Minimum (-127) 0x25, 0x7F, // Logical Maximum (127) 0x75, 0x08, // Report Size (8) 0x95, 0x03, // Report Count (3) 0x81, 0x06, // Input (Data, Variable, Relative) - X & Y coordinate 0xC0, // End Collection 0xC0, // End Collection 0x05, 0x01, // Usage Pg (Generic Desktop) 0x09, 0x06, // Usage (Keyboard) 0xA1, 0x01, // Collection: (Application) 0x85, HID_RPT_ID_KEY_IN, // Report Id (2) // 0x05, 0x07, // Usage Pg (Key Codes) 0x19, 0xE0, // Usage Min (224) 0x29, 0xE7, // Usage Max (231) 0x15, 0x00, // Log Min (0) 0x25, 0x01, // Log Max (1) // // Modifier byte 0x75, 0x01, // Report Size (1) 0x95, 0x08, // Report Count (8) 0x81, 0x02, // Input: (Data, Variable, Absolute) // // Reserved byte 0x95, 0x01, // Report Count (1) 0x75, 0x08, // Report Size (8) 0x81, 0x01, // Input: (Constant) // // LED report 0x95, 0x05, // Report Count (5) 0x75, 0x01, // Report Size (1) 0x05, 0x08, // Usage Pg (LEDs) 0x19, 0x01, // Usage Min (1) 0x29, 0x05, // Usage Max (5) 0x91, 0x02, // Output: (Data, Variable, Absolute) // // LED report padding 0x95, 0x01, // Report Count (1) 0x75, 0x03, // Report Size (3) 0x91, 0x01, // Output: (Constant) // // Key arrays (6 bytes) 0x95, 0x06, // Report Count (6) 0x75, 0x08, // Report Size (8) 0x15, 0x00, // Log Min (0) 0x25, 0x65, // Log Max (101) 0x05, 0x07, // Usage Pg (Key Codes) 0x19, 0x00, // Usage Min (0) 0x29, 0x65, // Usage Max (101) 0x81, 0x00, // Input: (Data, Array) // 0xC0, // End Collection
时间: 2023-10-29 12:04:36 浏览: 38
这段是 USB HID 设备描述符的一部分,描述了一个鼠标和键盘的输入报告格式。
具体来说,这个描述符定义了两个 Collection,分别用来描述鼠标和键盘的输入报告格式。在鼠标的 Collection 中,定义了一个 Report Id 为 1 的输入报告,包含三个按键状态和 X/Y 坐标值。在键盘的 Collection 中,定义了一个 Report Id 为 2 的输入报告,包含八个键盘修饰键状态、五个 LED 灯状态和六个键盘按键状态。
这段描述符的具体解析需要参考 HID 规范,其中包含了更详细的信息和解释。
相关问题
Xbox One手柄的HID描述符、详细解释和数据包格式
Xbox One手柄的HID描述符是一个标准的USB HID设备描述符,用于描述设备的功能和属性。该描述符包含多个子描述符,其中最重要的是输入报告描述符,它定义了手柄发送给主机的数据格式。
输入报告描述符的格式如下:
```
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x09, 0x05, // Usage (Game Pad)
0xA1, 0x01, // Collection (Application)
0x85, 0x20, // Report ID (32)
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x09, 0x30, // Usage (X)
0x09, 0x31, // Usage (Y)
0x09, 0x32, // Usage (Z)
0x09, 0x35, // Usage (Rz)
0x15, 0x00, // Logical Minimum (0)
0x26, 0xFF, 0x00, // Logical Maximum (255)
0x75, 0x08, // Report Size (8)
0x95, 0x04, // Report Count (4)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x09, 0x39, // Usage (Hat switch)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x07, // Logical Maximum (7)
0x35, 0x00, // Physical Minimum (0)
0x46, 0x3B, 0x01, // Physical Maximum (315)
0x65, 0x14, // Unit (Eng Rot:Angular Pos)
0x75, 0x04, // Report Size (4)
0x95, 0x01, // Report Count (1)
0x81, 0x42, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,Null State)
0x75, 0x01, // Report Size (1)
0x95, 0x01, // Report Count (1)
0x81, 0x03, // Input (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0x09, // Usage Page (Button)
0x19, 0x01, // Usage Minimum (Button 1)
0x29, 0x0A, // Usage Maximum (Button 10)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x75, 0x01, // Report Size (1)
0x95, 0x0A, // Report Count (10)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0 // End Collection
```
该描述符定义了一个32字节的输入报告格式,包含了手柄的所有输入数据,包括四个轴(X、Y、Z、Rz)、一个八方向摇杆(Hat switch)和十个按钮。每个轴和摇杆的数据用8位字节表示,取值范围为0-255,每个按钮用1位表示,取值为0或1。
数据包格式为:
```
Byte 0: Report ID (0x20)
Byte 1: Buttons (bits 0-7)
Byte 2: Buttons (bits 8-15)
Byte 3: Left Trigger
Byte 4: Right Trigger
Byte 5: X-axis (LSB)
Byte 6: X-axis (MSB)
Byte 7: Y-axis (LSB)
Byte 8: Y-axis (MSB)
Byte 9: Z-axis (LSB)
Byte 10: Z-axis (MSB)
Byte 11: Rz-axis (LSB)
Byte 12: Rz-axis (MSB)
Byte 13: Hat Switch (0-7)
```
其中,Report ID为0x20,表示这是一个输入报告;Buttons的位表示对应的按钮是否按下;Left Trigger和Right Trigger的值为0-255,表示扳机的压力程度;轴的值按照Little Endian格式存储。
请给出基于ESP-IDF使用BT HID模拟制作xbox手柄的Xbox完整HID描述符
以下是基于ESP-IDF使用BT HID模拟制作Xbox手柄的Xbox完整HID描述符:
```
const uint8_t xbox_hid_report_desc[] = {
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x09, 0x05, // Usage (Game Pad)
0xa1, 0x01, // Collection (Application)
0x05, 0x09, // Usage Page (Button)
0x19, 0x01, // Usage Minimum (Button 1)
0x29, 0x0A, // Usage Maximum (Button 10)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x95, 0x0A, // Report Count (10)
0x75, 0x01, // Report Size (1)
0x81, 0x02, // Input (Data,Var,Abs)
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x09, 0x30, // Usage (X)
0x09, 0x31, // Usage (Y)
0x09, 0x33, // Usage (Rx)
0x09, 0x34, // Usage (Ry)
0x15, 0x81, // Logical Minimum (-127)
0x25, 0x7F, // Logical Maximum (127)
0x75, 0x08, // Report Size (8)
0x95, 0x04, // Report Count (4)
0x81, 0x02, // Input (Data,Var,Abs)
0x05, 0x09, // Usage Page (Button)
0x19, 0x0B, // Usage Minimum (Button 11)
0x29, 0x0E, // Usage Maximum (Button 14)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x95, 0x04, // Report Count (4)
0x75, 0x01, // Report Size (1)
0x81, 0x02, // Input (Data,Var,Abs)
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x09, 0x39, // Usage (Hat switch)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x07, // Logical Maximum (7)
0x35, 0x00, // Physical Minimum (0)
0x46, 0x3B, 0x01, // Physical Maximum (315)
0x65, 0x14, // Unit (System: English Rotation, Length: Centimeter)
0x75, 0x04, // Report Size (4)
0x95, 0x01, // Report Count (1)
0x81, 0x02, // Input (Data,Var,Abs)
0xc0 // End Collection
};
```
该描述符定义了一个基于Xbox手柄的HID设备,包含了10个按钮、4个摇杆和一个8向方向盘。每个按钮和摇杆都可以被读取和写入。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)