USB HID Report byte array format?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi All,

   

I'm trying to design a USB touch screen interface that will be detected by windows 7 without any extra drivers.

   

I have found a MS site detailing the required HID descriptor, which I have copied into Creator. Windows sees the device and enables the calibrate options and flicks etc.

   

But I have never been able to figure out how to convert an HID descriptor into the byte array that matches the descriptor. Can anyone assist me?

   

Thank you,
Errol

0 Likes
5 Replies
Anonymous
Not applicable

Inline images work in editor, but does not show in the forum... 😞

   

   

0 Likes
Anonymous
Not applicable

This is what I deduce, but i'm not too sure about the last 3 items, as they don't specify a report size, only report count. Also, what is the point of the last const report?

   

#pragma pack(1)
struct Touch
{
    uint16 Tip:1;
    uint16 UnusedA:3;
    uint16 InRange:1;
    uint16 Confidence:1;
    uint16 UnusedB:10;
    uint16 X;
    uint16 Y;
    uint8 TouchSizeWidth;
    uint8 TouchSizeHeight;
    uint8 UnusedC;//????
};
#pragma pack()

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Ok, got it working. Had to remove the ReportID field. Other than that it works...

   

Attached is a project for the CY8KIT-059 board. Pressing the button will draw around the edge of the screen.

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Errol,

   

Thank you for sharing the project. As from c-code, my understanding that it works as a mouse emulator for Windows. Can you elaborate what it can be used for?

   

regards,

   

odissey1 

0 Likes
Anonymous
Not applicable

Hi Odissey1,

   

It looks superficially like a mouse, yes, but windows 7 and up sees it as a touch screen device. Windows enables touch screen functionality, including Flicks and tablet features like touch screen calibration. The HID descriptor is based on Microsoft's recomended HID for a single touch touch screen.

   

See here: https://msdn.microsoft.com/en-us/library/windows/hardware/ff553722%28v=vs.85%29.aspx

   

It enables a Tablet PC Settings option in the control panel where you can do the calibration and selection of which screen the touch is connected to etc

   

I created this project because I am tired of touch screen controller vendors that implement their own USB protocol and then write their own crappy drivers and calibration tools that crash or does not support multi monitor etc. So I'm busy developing my own firmware for the PSOC3 touch screen controller board that ships with the touch screens that we buy.

   

This might also work under linux but I have not tested it yet.

   

Thank you,
Errol

0 Likes