Hi all,
My first post and the first time I have had to code a microcontroller to be a USB device. This device also has a keyboard, that works fine.
My problem is that I can make the touchscreen move the cursor but can't press any buttons especially the tap points in the calibration screen. Please has anyone a generic touch screen descriptor or can tell me what I have done wrong?
Below is my current descriptor, I have tried an absolute coordinate mouse one too but using this I don't have access to the inbuilt calibration dialogue in "Control panel / Table PC settings". The descriptors comments are a bit out of sync with the values, I have been experimenting a bit!
I want to use the inbuilt Microsoft drivers, they are more than good enough for me and I don't want to write my own.
Thanks in advance
Bevis
0x05, 0x0d, // USAGE_PAGE (Digitizers)
0x09, 0x04, // touch screen 0x02, // USAGE (Pen)
0xa1, 0x01, // COLLECTION (Application)
0x85, 0x01, // REPORT_ID (Pen) //To match this descriptor, byte[0] of IN packet should be = 0x01 always for this demo
0x09, 0x20, // USAGE (Stylus)
0xa1, 0x00, // COLLECTION (Physical)
0x09, 0x42, // USAGE (Tip Switch) //(byte[1] bit 0)
0x09, 0x51 // contact 0x44, // USAGE (Barrel Switch) //(byte[1] bit 1)
0x09, 0x45, // USAGE (Eraser Switch) //(byte[1] bit 2)
0x09, 0x3c, // USAGE (Invert) //(byte[1] bit 3)
0x09, 0x32, // USAGE (In Range) //(byte[1] bit 4)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x75, 0x01, // REPORT_SIZE (1)
0x95, 0x05, // REPORT_COUNT (5)
0x81, 0x02, // INPUT (Data,Var,Abs) //Makes five, 1-bit IN packet fields (byte[1] bits 0-4)) for (USAGE) tip sw, barrel sw, invert sw, in range sw. Send '1' here when switch is active. Send '0' when switch not active.
0x95, 0x0b, // REPORT_COUNT (11)
0x81, 0x03, // INPUT (Cnst,Var,Abs) //Makes eleven, 1-bit IN packet fields (byte[1] bits 5-7, and byte[2] all bits) with no usage. These are pad bits that don't contain useful data.
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x26, 0xff, 0x7f, // LOGICAL_MAXIMUM (32767)
0x75, 0x10, // REPORT_SIZE (16)
0x95, 0x01, // REPORT_COUNT (1)
0xa4, // PUSH
0x55, 0x0d, // UNIT_EXPONENT (-3)
0x65, 0x33, // UNIT (Inch,EngLinear) //(10^-3 inches = 1/1000 of an inch = 1 mil)
0x09, 0x30, // USAGE (X) //(byte[3] and byte[4])
0x35, 0x00, // PHYSICAL_MINIMUM (0)
0x46, 0x00, 0x00, // PHYSICAL_MAXIMUM (0)
0x81, 0x02, // INPUT (Data,Var,Abs) //Makes one, 16-bit IN packet field used for (USAGE) X-coordinate input info. Valid values 0 to 32767.
0x09, 0x31, // USAGE (Y) //(byte[5] and byte[6])
0x46, 0x00, 0x00, // PHYSICAL_MAXIMUM (0)
0x81, 0x02, // INPUT (Data,Var,Abs) //Makes one, 16-bit IN packet field used for (USAGE) Y-coordinate input info. Valid values 0 to 32767.
0xb4, // POP
0x05, 0x0d, // USAGE_PAGE (Digitizers)
0x09, 0x30, // USAGE (Tip Pressure) //(byte[7] and byte[8])
0x81, 0x02, // INPUT (Data,Var,Abs) //Makes one, 16-bit IN packet field used for (USAGE) tip pressure input info. Valid values 0 to 32767
0x09, 0x3d, // USAGE (X Tilt) //(byte[9] and byte[10])
0x09, 0x3e, // USAGE (Y Tilt) //(byte[11] and byte[12])
0x16, 0x01, 0x80, // LOGICAL_MINIMUM (-32767)
0x95, 0x02, // REPORT_COUNT (2)
0x81, 0x02, // INPUT (Data,Var,Abs) //Makes two, 16-bit IN packet fields, used for (USAGE) X-Tilt and Y-Tilt. Valid values -32767 to 32767
0xc0, // END_COLLECTION
0xc0, // END_COLLECTION