This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

HID USB support 16 bit X-axis and Y-axis

I came across the SDK document below:
For the mouse protocol, one 4-byte input report is defined:
BYTE[0]: Button state bit field.
BYTE[1]: Signed 8-bit X-axis offset since the last position.
BYTE[2]: Signed 8-bit Y-axis offset since the last position.
BYTE[3]: signed 8-bit Wheel offset since the last position.

By using the Generic HID USB instance how do I extend this 4 bytes to 6 bytes reporting to support 16 bit X-axis and Y-axis?

Parents
  • It does not quite help, what I need is for the X-axis and Y-axis of mouse reporting to be 16 bits instead of the default 8 bits. This 16 bits are reported count (upper and lower bytes) and not like in your document left X-axis and right X-axis. 

    Further more build is ok but when running it on the nRF52840 dongle, the USB still reports 4 bytes (button, X-axis, Y-axis and z-wheel). Each one byte making up the 4 bytes.

Reply
  • It does not quite help, what I need is for the X-axis and Y-axis of mouse reporting to be 16 bits instead of the default 8 bits. This 16 bits are reported count (upper and lower bytes) and not like in your document left X-axis and right X-axis. 

    Further more build is ok but when running it on the nRF52840 dongle, the USB still reports 4 bytes (button, X-axis, Y-axis and z-wheel). Each one byte making up the 4 bytes.

Children
  • Hi Bernard

    There is an inconsistency in your report between the comments and the data:

    0x75, 0x08, /* Report Size (16), */ \
    0x95, 0x03, /* Report Count (2), */ \

    Assuming the comment is correct it should be:

    0x75, 0x10, /* Report Size (16), */ \
    0x95, 0x02, /* Report Count (2), */ \

    Best regards
    Torbjørn