USB Digitizer/Mouse descriptors

USB PICs and the UBW

Moderator: phalanx

Post Reply
Matdor
Posts: 1
Joined: Wed Feb 27, 2013 6:51 am

USB Digitizer/Mouse descriptors

Post by Matdor » Wed Feb 27, 2013 7:06 am

Hi,

This is the first time I write in this forum but I am a bit desperate.

I am working with the teensy2++ (AVR AT90USB1286) and I want to move the mouse in the computer. From the Teensy webpage I downloaded a example program for a mouse which worked, however I dont want to move it like a mouse but like a digitizer. I mean, I want to pass the computer the absolutes coordinates for the pointer, not the relatives one.

My first try was to change the INPUT and the LOGICAL MAX/MIN in the mouse report from:

Code: Select all

...
Usage Page (Generic Desktop)
  Usage (X)
  Usage (Y)
  Logical min (-127)
  Logical max (127)
  Report Size (8)
  Report Count (2)
  INPUT(Data, Var, Relative)
to

Code: Select all

...
Usage Page (Generic Desktop)
  Usage (X)
  Usage (Y)
  Logical min (0)
  Logical max (255)
  Report Size (8)
  Report Count (2)
  INPUT(Data, Var, Abs)
With this new descriptor the program keep working without any other change. But the resolution was too bad ( the X and Y coordinate only take up to 127 even the logical max is 255) so I tried adding more values to the logical max

Code: Select all

...
Usage Page (Generic Desktop)
  Usage (X)
  Usage (Y)
  Logical min (0)
  Logical max (1024)
  Report Size (16)
  Report Count (2)
  INPUT(Data, Var, Abs)
Then I also increment the wMaxPacketSize in the endpoint descriptor and add the extra bytes in the send funtion, but the program stop working. I think it is all about descriptors, I am missing something... If you need more code just ask for it.

Thank you!

Post Reply