Go to the documentation of this file.
18#ifndef __VSF_USBD_HID_DESC_H__
19#define __VSF_USBD_HID_DESC_H__
28#define USB_HID_SUBCLASS_NONE 0
29#define USB_HID_SUBCLASS_BOOT 1
31#define USB_HID_PROTOCOL_NONE 0
32#define USB_HID_PROTOCOL_KEYBOARD 1
33#define USB_HID_PROTOCOL_MOUSE 2
35#define USB_DT_HID_SIZE 9
36#define USB_DESC_HID(__IFS, __I_FUNC, __SUBCLASS, __PROTOCOL, \
37 __VERSION_BCD, __COUNTRY_CODE, __REPORT_DESC_LEN, \
38 __EP_IN, __EP_IN_SIZE, __EP_IN_INTERVAL, \
39 __EP_OUT, __EP_OUT_SIZE, __EP_OUT_INTERVAL) \
40 USB_DESC_IFS((__IFS), 0, 2, USB_CLASS_HID, (__SUBCLASS), (__PROTOCOL), (__I_FUNC))\
43 USB_DESC_WORD(__VERSION_BCD), \
47 USB_DESC_WORD(__REPORT_DESC_LEN), \
48 USB_DESC_EP(USB_DIR_IN | (__EP_IN), USB_ENDPOINT_XFER_INT, __EP_IN_SIZE, __EP_IN_INTERVAL)\
49 USB_DESC_EP(USB_DIR_OUT | (__EP_OUT), USB_ENDPOINT_XFER_INT, __EP_OUT_SIZE, __EP_OUT_INTERVAL)
50#define USB_DESC_HID_LEN (USB_DESC_IFS_LEN + USB_DT_HID_SIZE + 2 * USB_DESC_EP_LEN)
52#define USB_DESC_HID_IAD(__IFS, __I_FUNC, __SUBCLASS, __PROTOCOL, __VERSION_BCD, __COUNTRY_CODE, __REPORT_DESC_LEN,\
53 __EP_IN, __EP_IN_SIZE, __EP_IN_INTERVAL, \
54 __EP_OUT, __EP_OUT_SIZE, __EP_OUT_INTERVAL) \
55 USB_DESC_IAD((__IFS), 1, USB_CLASS_HID, (__SUBCLASS), (__PROTOCOL), (__I_FUNC))\
56 USB_DESC_HID((__IFS), (__I_FUNC), (__SUBCLASS), (__PROTOCOL), (__VERSION_BCD), (__COUNTRY_CODE), (__REPORT_DESC_LEN),\
57 (__EP_IN), (__EP_IN_SIZE), (__EP_IN_INTERVAL), \
58 (__EP_OUT), (__EP_OUT_SIZE), (__EP_OUT_INTERVAL))
59#define USB_DESC_HID_IAD_LEN (USB_DESC_IAD_LEN + USB_DESC_HID_LEN)