diff options
-rw-r--r-- | usb/descriptors.h | 16 | ||||
-rw-r--r-- | usb/hid.h | 19 |
2 files changed, 18 insertions, 17 deletions
diff --git a/usb/descriptors.h b/usb/descriptors.h index 122ba5c..df603a5 100644 --- a/usb/descriptors.h +++ b/usb/descriptors.h @@ -92,12 +92,12 @@ _Static_assert(sizeof ds_conf == DS_CONF_SIZE, "sizeof ds_conf != DS_CONF_SIZE") /* HID Report descriptor */ unsigned char ds_hidrep[] = { - HR_USAGE_PAGE(1), HR_GENERIC_DESKTOP, - HR_USAGE(1), HR_MOUSE, + HR_USAGE_PAGE(1), HR_PAGE_GENERIC_DESKTOP, + HR_USAGE(1), HR_GD_MOUSE, HR_COLLECTION(1), HR_APPLICATION, - HR_USAGE(1), HR_POINTER, + HR_USAGE(1), HR_GD_POINTER, HR_COLLECTION(1), HR_PHYSICAL, - HR_USAGE_PAGE(1), HR_BUTTON, + HR_USAGE_PAGE(1), HR_PAGE_BUTTON, HR_USAGE_MINIMUM(1), 1, HR_USAGE_MAXIMUM(1), 5, HR_LOGICAL_MINIMUM(1), 0, @@ -108,10 +108,10 @@ unsigned char ds_hidrep[] = { HR_REPORT_COUNT(1), 1, HR_REPORT_SIZE(1), 3, HR_INPUT(1), HR_CONSTANT | HR_ARRAY | HR_ABSOLUTE | HR_BIT_FIELD, - HR_USAGE_PAGE(1), HR_GENERIC_DESKTOP, - HR_USAGE(1), HR_X, - HR_USAGE(1), HR_Y, - HR_USAGE(1), HR_WHEEL, + HR_USAGE_PAGE(1), HR_PAGE_GENERIC_DESKTOP, + HR_USAGE(1), HR_GD_X, + HR_USAGE(1), HR_GD_Y, + HR_USAGE(1), HR_GD_WHEEL, HR_LOGICAL_MINIMUM(1), -127, HR_LOGICAL_MAXIMUM(1), 127, HR_REPORT_SIZE(1), 8, @@ -65,15 +65,16 @@ #define HR_USAGE_SWITCH 0x05 #define HR_USAGE_MODIFIER 0x06 -#define HR_GENERIC_DESKTOP 0x01 -#define HR_POINTER 0x01 -#define HR_MOUSE 0x02 -#define HR_KEYBOARD 0x06 -#define HR_X 0x30 -#define HR_Y 0x31 -#define HR_WHEEL 0x38 - -#define HR_BUTTON 0x09 +#define HR_PAGE_GENERIC_DESKTOP 0x01 +#define HR_GD_POINTER 0x01 +#define HR_GD_MOUSE 0x02 +#define HR_GD_KEYBOARD 0x06 +#define HR_GD_X 0x30 +#define HR_GD_Y 0x31 +#define HR_GD_WHEEL 0x38 + +#define HR_PAGE_KEYBOARD 0x07 +#define HR_PAGE_BUTTON 0x09 #define HR_DATA (0) #define HR_CONSTANT (1 << 0) |