diff --git a/include/libopencm3/usb/hid.h b/include/libopencm3/usb/hid.h index 87f4924d..f33c480c 100644 --- a/include/libopencm3/usb/hid.h +++ b/include/libopencm3/usb/hid.h @@ -42,8 +42,39 @@ LGPL License Terms @ref lgpl_license #define USB_CLASS_HID 3 -#define USB_DT_HID 0x21 -#define USB_DT_REPORT 0x22 +/* USB HID 4.2 */ +#define USB_HID_SUBCLASS_NO 0 +#define USB_HID_SUBCLASS_BOOT_INTERFACE 1 + +/* USB HID 4.3 */ +#define USB_HID_INTERFACE_PROTOCOL_NONE 0 +#define USB_HID_INTERFACE_PROTOCOL_KEYBOARD 1 +#define USB_HID_INTERFACE_PROTOCOL_MOUSE 2 + +/* USB HID 7.1 */ +#define USB_HID_DT_HID 0x21 +#define USB_HID_DT_REPORT 0x22 +#define USB_HID_DT_PHYSICAL 0x23 +/* old names without USB_HID_ prefix */ +#define USB_DT_HID USB_HID_DT_HID +#define USB_DT_REPORT USB_HID_DT_REPORT + +/* USB HID 7.2 */ +#define USB_HID_REQ_TYPE_GET_REPORT 0x01 +#define USB_HID_REQ_TYPE_GET_IDLE 0x02 +#define USB_HID_REQ_TYPE_GET_PROTOCOL 0x03 +#define USB_HID_REQ_TYPE_SET_REPORT 0x09 +#define USB_HID_REQ_TYPE_SET_IDLE 0x0A +#define USB_HID_REQ_TYPE_SET_PROTOCOL 0x0B + +/* USB HID 7.2.1 */ +#define USB_HID_REPORT_TYPE_INPUT 1 +#define USB_HID_REPORT_TYPE_OUTPUT 2 +#define USB_HID_REPORT_TYPE_FEATURE 3 + +/* USB HID 7.2.5 */ +#define USB_HID_PROTOCOL_BOOT 0 +#define USB_HID_PROTOCOL_REPORT 1 struct usb_hid_descriptor { uint8_t bLength;