Absolute Mouse HID Descriptor

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
mishel12
Posts: 1
Joined: Thu Mar 26, 2009 3:55 pm

Absolute Mouse HID Descriptor

Post by mishel12 » Thu Mar 26, 2009 4:13 pm

I was going through the example code given with the usbavr zip file,which is on usb mice. I am developing a mouse that uses absolute co-ordinates. Could any of you help me as to how I can convert the example file or give me some links which will help.

mschoeldgen
Posts: 6
Joined: Wed May 13, 2009 9:22 am

Re: Absolute Mouse HID Descriptor

Post by mschoeldgen » Wed May 13, 2009 9:31 am

I'd also be interested if someone was able to generate a descriptor for a HID device with absolute coordinates . I'm currently making a converter for a Tektronix 4957 tablet and would like to plug that without any drivers.

So far the standard mouse descriptor works but as soon as i'm changing to abs. data the device is only recognized as HID Input device without the ability to move the cursor.

Do common OS'es like Mac OSX or XP support absolute devices without drivers ? Anyone an example for that ? From what i know most of the tablet first emulate a mouse and then switch to abs. coordinates under the control of their own driver.

I'm also thinking about using one of the existing tablet drivers and fake my device but that wouldn't be as elegant as a plug&play device.

Edit: Those guys claimed they have made it. For them was an error in Report Size and Count .
http://www.tech-archive.net/Archive/Dev ... 00301.html

Unfortunately they don't post the working Descriptor :(
Edit2:
Ok, as i've managed to make it work here's the Descriptor i'm using:

Code: Select all

/* declare a digitzer device generated with HID Descriptor tool */
/* 4 buttons (reports only 3 for compatibility), absolute pointer , normally generates X/Y valus of max. 15 bits   
 * this represents an absolute pointer device with a resolution of 0.1 mm (2972 dots on a 29,7 cm tablet)
 * to the OS .
*/
PROGMEM char usbHidReportDescriptor[60] = {
    0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)
    0x09, 0x02,                    // USAGE (Mouse)
    0xa1, 0x01,                    // COLLECTION (Application)
    0x09, 0x01,                    //   USAGE (Pointer)
    0xa1, 0x00,                    //   COLLECTION (Physical)
    0x05, 0x09,                    //     USAGE_PAGE (Button)
    0x19, 0x01,                    //     USAGE_MINIMUM (Button 1)
    0x29, 0x03,                    //     USAGE_MAXIMUM (Button 3)
    0x15, 0x00,                    //     LOGICAL_MINIMUM (0)
    0x25, 0x01,                    //     LOGICAL_MAXIMUM (1)
    0x95, 0x03,                    //     REPORT_COUNT (3)
    0x75, 0x01,                    //     REPORT_SIZE (1)
    0x81, 0x02,                    //     INPUT (Data,Var,Abs)
    0x95, 0x01,                    //     REPORT_COUNT (1)
    0x75, 0x05,                    //     REPORT_SIZE (5)
    0x81, 0x03,                    //     INPUT (Cnst,Var,Abs)
    0x05, 0x01,                    //     USAGE_PAGE (Generic Desktop)
    0x09, 0x30,                    //     USAGE (X)
    0x09, 0x31,                    //     USAGE (Y)
    0x35, 0x00,                    //     PHYSICAL_MINIMUM (0)
    0x46, 0x9d, 0x0b,              //     PHYSICAL_MAXIMUM (2973)
    0x15, 0x00,                    //     LOGICAL_MINIMUM (0)
    0x26, 0x9d, 0x0b,              //     LOGICAL_MAXIMUM (2973)
    0x65, 0x11,                    //     UNIT (SI Lin:Distance)
    0x55, 0x0e,                    //     UNIT_EXPONENT (-2)
    0x75, 0x10,                    //     REPORT_SIZE (16)
    0x95, 0x02,                    //     REPORT_COUNT (2)
    0x81, 0x02,                    //     INPUT (Data,Var,Abs)
    0xc0,                          //   END_COLLECTION
    0xc0                           // END_COLLECTION
};

sid
Posts: 2
Joined: Thu Sep 17, 2009 8:56 pm

Re: Absolute Mouse HID Descriptor

Post by sid » Sat Oct 10, 2009 7:13 pm

Hi,

how has your project evolved? Is it working fine?
I am looking forward to create an own USB touchscreen controller based on an AVR. Because the ones you can buy simply do not fit into my case and require additional drivers.

You used an already existing absolute mouse driver? Is this driver also build into the linux kernel? Which one is it? Can you pass me your complete code? To be honest, until now I had only little success with the V-AVR lib. Somehow the lib does not like me ;)


Greetings and thx
Juergen

mschoeldgen
Posts: 6
Joined: Wed May 13, 2009 9:22 am

Re: Absolute Mouse HID Descriptor

Post by mschoeldgen » Fri Dec 18, 2009 6:36 pm

Sorry for answering so late but i was busy elsewhere.
Project is finished and working :
viewtopic.php?f=8&t=2765&p=9371#p9371
http://www.schoeldgen.de/avr/

I tested on Win XP and MacOS 10.5 . No drivers were required as the OS's recognize the tablet as-is as an absolute mouse.

utkarsh
Posts: 2
Joined: Fri Mar 16, 2012 10:53 am

Re: Absolute Mouse HID Descriptor

Post by utkarsh » Fri Mar 16, 2012 11:06 am

how do you implement absolute mouse coordinates?please explain.also,is it possible to read the coordinates of the mouse pointer on screen?

Post Reply