mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-18 12:54:25 +01:00
Added official HID definitions
Since the HID library adds some general HID definitions and structs, it is very useful to also include this in a custom library. If you dupe the information you have problems of redeclaration. Having those defintions inside the official HID library is essential for a good working additional HID API.
This commit is contained in:
parent
2cc3bb605b
commit
14ddc8b0bf
@ -30,7 +30,7 @@ int HID_::getInterface(uint8_t* interfaceCount)
|
||||
{
|
||||
*interfaceCount += 1; // uses 1
|
||||
HIDDescriptor hidInterface = {
|
||||
D_INTERFACE(pluggedInterface, 1, 3, 0, 0),
|
||||
D_INTERFACE(pluggedInterface, 1, USB_DEVICE_CLASS_HUMAN_INTERFACE, HID_SUBCLASS_NONE, HID_PROTOCOL_NONE),
|
||||
D_HIDREPORT(descriptorSize),
|
||||
D_ENDPOINT(USB_ENDPOINT_IN(pluggedEndpoint), USB_ENDPOINT_TYPE_INTERRUPT, USB_EP_SIZE, 0x01)
|
||||
};
|
||||
|
@ -40,6 +40,20 @@
|
||||
#define HID_REPORT_DESCRIPTOR_TYPE 0x22
|
||||
#define HID_PHYSICAL_DESCRIPTOR_TYPE 0x23
|
||||
|
||||
// HID subclass HID1.11 Page 8 4.2 Subclass
|
||||
#define HID_SUBCLASS_NONE 0
|
||||
#define HID_SUBCLASS_BOOT_INTERFACE 1
|
||||
|
||||
// HID Keyboard/Mouse bios compatible protocols HID1.11 Page 9 4.3 Protocols
|
||||
#define HID_PROTOCOL_NONE 0
|
||||
#define HID_PROTOCOL_KEYBOARD 1
|
||||
#define HID_PROTOCOL_MOUSE 2
|
||||
|
||||
// Normal or bios protocol (Keyboard/Mouse) HID1.11 Page 54 7.2.5 Get_Protocol Request
|
||||
// "protocol" variable is used for this purpose.
|
||||
#define HID_BOOT_PROTOCOL 0
|
||||
#define HID_REPORT_PROTOCOL 1
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t len; // 9
|
||||
|
Loading…
x
Reference in New Issue
Block a user