hid.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * File : hid.h
  3. * COPYRIGHT (C) 2008 - 2016, RT-Thread Development Team
  4. *
  5. * Change Logs:
  6. * Date Author Notes
  7. * 2017Äê3ÔÂ13ÈÕ Urey the first version
  8. */
  9. #ifndef _USBDEVICE_CLASS_HID_H_
  10. #define _USBDEVICE_CLASS_HID_H_
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. #define HID_DESCRIPTOR_TYPE 0x21
  15. #define HID_DESCRIPTOR_SIZE 0x09
  16. #define HID_OFF_HID_DESC 0x12
  17. #define USB_HID_SUBCLASS_BOOT 0x01
  18. #define USB_HID_SUBCLASS_NOBOOT 0x00
  19. #define USB_HID_PROTOCOL_NONE 0x00
  20. #define USB_HID_PROTOCOL_KEYBOARD 0x01
  21. #define USB_HID_PROTOCOL_MOUSE 0x02
  22. #define USB_HID_REQ_GET_REPORT 0x01
  23. #define USB_HID_REQ_GET_IDLE 0x02
  24. #define USB_HID_REQ_GET_PROTOCOL 0x03
  25. #define USB_HID_REQ_SET_REPORT 0x09
  26. #define USB_HID_REQ_SET_IDLE 0x0a
  27. #define USB_HID_REQ_SET_PROTOCOL 0x0b
  28. #define MAX_REPORT_SIZE 8
  29. #define HID_RX_BUFSIZE 64
  30. struct uhid_comm_descriptor
  31. {
  32. #ifdef RT_USB_DEVICE_COMPOSITE
  33. struct uiad_descriptor iad_desc;
  34. #endif
  35. struct uinterface_descriptor intf_desc;
  36. struct uhid_descriptor hid_desc;
  37. struct uendpoint_descriptor ep_in_desc;
  38. struct uendpoint_descriptor ep_out_desc;
  39. };
  40. typedef struct uhid_comm_descriptor* uhid_comm_desc_t;
  41. #ifdef __cplusplus
  42. }
  43. #endif
  44. #endif /* _USBDEVICE_CLASS_HID_H_ */