I also found that the avr stores 16bit numbers in the low byte/high byte format, so you'll have to swap them. I just tested this with the statement below.
yes, I also came to this conclusion. the bytes need the same order as in a 16bit hid report descriptor item (like logical_maximum(1024)).
first low, then high. I think this depends more on the HID protocol spec beeing little endian than on the atmel endianness.
I played with many different descrpitor settings now, some had a physical_min/max together with logical_min/max set to 65535 setting, some only a single report_count and input for X and Y, like you suggested above.
When I set my decriptor like yours (one report_count , 16 bit size and logical_min/max per Usage) it looks like 16bit values are transmitted.
BUT, now the alignment and scaling seems wrong....
I get allways the maximum mouse coordinates 1023 and 767 as X/Y till I send values below 0x03b2...
(edit: note I lowered the maximas in my descriptor by 1 to be 1023 and 767)
When I do:
Code: Select all
//X
reportBuffer[1] = 0xb2; //low byte
reportBuffer[2] = 0x03; //high byte
//Y
reportBuffer[3] = 0xc5;
reportBuffer[4] = 0x02;
Thats the first value where I get 1022/766 and below as actual mouse pointer locations. Can you verify this in your code?
Maybe the main problem is is now just a HID descriptor issue?
And if I make logical_max bigger, the usable range gets even worse = smaller.
edit: It looks like the difference is always 25% on each axis. Strange....
Rukus, thank you very much, so far!
I hope we get this figgured out,
Oli