我需要找出符合 HID 标准的触摸屏(单点触摸)输入数据结构(例如字节顺序以及每个字节中应写入的内容)。
我使用了 Microsoft 官方文档中的符合 HID 的触摸屏描述符
在使用设备管理器的主机 PC 中,我可以看到它成功枚举了 HID 兼容设备。现在我想将 HID 报告发送到主机,但问题是我还没有找到类似触摸屏的 HID 启动协议之类的东西(对于鼠标和键盘,它在 USB 组织规范中明确定义)。这是我用来创建触摸屏 HID 报告的代码示例,它可以工作,但不符合预期。我通过研究大量 github 代码和阅读文章找到了这种字节组合,但我想找到一些文档来证明顺序是正确的。
char report[8] = {0};
uint16_t x_access = 10000;
uint16_t y_access = 10000;
report[0] = 0x01; //reportid
report[1] = 0x3; //statuss
report[2] = LOWBYTE(x_access); //x low byte
report[3] = HIGHBYTE(x_access); //x high byte
report[4] = LOWBYTE(y_access); //y low byte
report[5] = HIGHBYTE(y_access); //y high byte
report[6] = 0x65; //touch parsing time low byte
report[7] = 0x00; //touch …Run Code Online (Sandbox Code Playgroud)