From 3fd369e14e7508927f4b4c2c278e3d94356a4782 Mon Sep 17 00:00:00 2001 From: Spegs21 Date: Tue, 22 Feb 2022 05:18:08 -0500 Subject: [PATCH] Update HID.h with report types (#602) Add missing #define statements when compared to AVR library. Support for readbytes with a byte/uint8_t buffer --- cores/arduino/USB/USBAPI.h | 1 + libraries/HID/HID.h | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/cores/arduino/USB/USBAPI.h b/cores/arduino/USB/USBAPI.h index d14944a32..cfd3eb856 100644 --- a/cores/arduino/USB/USBAPI.h +++ b/cores/arduino/USB/USBAPI.h @@ -117,6 +117,7 @@ class Serial_ : public arduino::HardwareSerial, arduino::PluggableUSBModule operator bool(); size_t readBytes(char *buffer, size_t length); + size_t readBytes( uint8_t *buffer, size_t length) { return readBytes((char *)buffer, length); } // This method allows processing "SEND_BREAK" requests sent by // the USB host. Those requests indicate that the host wants to diff --git a/libraries/HID/HID.h b/libraries/HID/HID.h index 0148daeaf..698c4a0a7 100644 --- a/libraries/HID/HID.h +++ b/libraries/HID/HID.h @@ -54,6 +54,11 @@ #define HID_BOOT_PROTOCOL 0 #define HID_REPORT_PROTOCOL 1 +// HID Request Type HID1.11 Page 51 7.2.1 Get_Report Request +#define HID_REPORT_TYPE_INPUT 1 +#define HID_REPORT_TYPE_OUTPUT 2 +#define HID_REPORT_TYPE_FEATURE 3 + typedef struct { uint8_t len; // 9