请教下大家,我将开发板的定义为HID鼠标设备,并想使用绝对坐标,目前PC主机端的识别已经完成,鼠标报告描述符是这样子的,static struct hidg_func_descriptor creator_mouse_data =
{
.subclass = 0, //No SubClass
.protocol = 2, //Mouse
.report_length = 6,
.report_desc_length = 82,
.report_desc =
{
0x05, 0x01, //Usage Page(Generic Desktop Controls)
0x09, 0x02, //Usage (Mouse)
0xa1, 0x01, //Collction (Application)
0x09, 0x01, //Usage (pointer)
0xa1, 0x00, //Collction (Physical)
0x05, 0x09, //Usage Page (Button)
0x19, 0x01, //Usage Minimum(1)
0x29, 0x03, //Usage Maximum(3)
0x15, 0x00, //Logical Minimum(1)
0x25, 0x01, //Logical Maximum(1)
0x95, 0x03, //Report Count(3)
0x75, 0x01, //Report Size(1)
0x81, 0x02, //Input(Data,Variable,Absolute,BitField)
0x95, 0x01, //Report Count(1)
0x75, 0x05, //Report Size(5)
0x81, 0x03, //Input(Constant,Array,Absolute,BitField)
0x05, 0x01, //Usage Page(Generic Desktop Controls)
0x09, 0x30, //Usage(x)
0x15, 0x00, //Logical Minimum(0)
0x26, 0x7F,0x07, //Logical Maximum(1919)
0x35, 0x00, //Phisical Minimum(0)
0x46, 0x7F,0x07, //Phisical Maximum(1919)
0x75, 0x10, //Report Size(10)
0x95, 0x01, //Report Count(1)
0x81, 0x02, //Input(Data,Variable,Relative)
0x09, 0x31, //Usage(y)
0x15, 0x00, //Logical Minimum(0)
0x26, 0x37,0x04, //Logical Maximum(1079)
0x35, 0x00, //Phisical Minimum(0)
0x46, 0x37,0x07, //Logical Maximum(1079)
0x75, 0x10, //Report Size(10)
0x95, 0x01, //Report Count(1)
0x81, 0x02, //Input(Data,Variable,Relative)
0x09, 0x38, //Usage(Wheel)
0x15, 0x81, //Logical Minimum(-127)
0x25, 0x7F, //Logical Maximum(127)
0x75, 0x08, //Report Size(8)
0x95, 0x01, //Report Count(1)
0x81, 0x02, //Input(Data,Variable,Relative)
0xc0, //End Collection
0xc0 //End Collection
}
};
应用根据报告描述符,按照绝对坐标左上角(0,0)到(1920.1080)(x=0,1,2...1919,y=0,1,2...1079)这样的顺序给PC主机发送数据(数据每次6个字节),发现PC鼠标指针乱跳,感觉数据应该不是这么简单,是不是需要一些换算,查阅了hid的相关资料,实在看不懂Logical Minimum,Logical Maximum,Phisical Minimum,Logical Maximum这四个之间的关系 想问下您,PC的hid鼠标应该是支持绝对坐标的吧?另外您知道这几个逻辑值的关系不?数值该如何上报才能让PC鼠标指针正常移动 |