Skip to content

Commit 3fd369e

Browse files
authored
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
1 parent dc99cd2 commit 3fd369e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

cores/arduino/USB/USBAPI.h

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ class Serial_ : public arduino::HardwareSerial, arduino::PluggableUSBModule
117117
operator bool();
118118

119119
size_t readBytes(char *buffer, size_t length);
120+
size_t readBytes( uint8_t *buffer, size_t length) { return readBytes((char *)buffer, length); }
120121

121122
// This method allows processing "SEND_BREAK" requests sent by
122123
// the USB host. Those requests indicate that the host wants to

libraries/HID/HID.h

+5
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@
5454
#define HID_BOOT_PROTOCOL 0
5555
#define HID_REPORT_PROTOCOL 1
5656

57+
// HID Request Type HID1.11 Page 51 7.2.1 Get_Report Request
58+
#define HID_REPORT_TYPE_INPUT 1
59+
#define HID_REPORT_TYPE_OUTPUT 2
60+
#define HID_REPORT_TYPE_FEATURE 3
61+
5762
typedef struct
5863
{
5964
uint8_t len; // 9

0 commit comments

Comments
 (0)