-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusb_hid_standard.h
24 lines (19 loc) · 998 Bytes
/
usb_hid_standard.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef HID_USB_HID_STANDARDS_H_
#define HID_USB_HID_STANDARDS_H_
#include "usb_hid.h"
#include "usb_hid_usage_button.h"
#include "usb_hid_usage_desktop.h"
#define USB_DESCRIPTOR_TYPE_HID 0x21
#define USB_DESCRIPTOR_TYPE_HID_REPORT 0x22
#define USB_HID_COUNTRY_NONE 0
/** \brief USB HID descriptor. */
typedef struct {
uint8_t bLength; /**<\brief Size of the descriptor (bytes). */
uint8_t bDescriptorType; /**<\brief Type of the descriptor. */
uint16_t bcdHID; /**<\brief BCD encoded version that the HID descriptor and device complies to. */
uint8_t bCountryCode; /**<\brief Country code of the localized device. */
uint8_t bNumDescriptors; /**<\brief Total number of HID report descriptors for the interface. */
uint8_t bDescriptorType0; /**<\brief First HID report descriptor type. */
uint16_t wDescriptorLength0; /**<\brief First HID report descriptor length (bytes). */
} __attribute__((__packed__)) UsbHidDescriptor;
#endif /* HID_USB_HID_STANDARDS_H_ */