|
ginnOS
The reference: libc, the libraries and the kernel
|
a small HID report descriptor parser for pointing devices. More...
#include "common/stdint.h"Go to the source code of this file.
Data Structures | |
| struct | hid_field_t |
| struct | hid_pointer_t |
Functions | |
| bool | hid_parse_pointer (const uint8_t *descriptor, uint32_t length, hid_pointer_t *out) |
| find the pointer fields in a report descriptor. | |
| int32_t | hid_field_value (const hid_field_t *field, const uint8_t *report, uint32_t length) |
| read a field from a report (the report id byte already skipped). | |
a small HID report descriptor parser for pointing devices.
a USB mouse in the boot protocol sends a fixed report (buttons, x, y); other pointing devices (QEMU's tablet, graphics tablets, touch screens in mouse mode) describe their report in a report descriptor. this parser finds the buttons, x, y and the wheel in it: their bit offset, size and range, and whether x and y are absolute.
| bool hid_parse_pointer | ( | const uint8_t * | descriptor, |
| uint32_t | length, | ||
| hid_pointer_t * | out ) |
find the pointer fields in a report descriptor.
| int32_t hid_field_value | ( | const hid_field_t * | field, |
| const uint8_t * | report, | ||
| uint32_t | length ) |
read a field from a report (the report id byte already skipped).
| length | the bytes in the report. |