|
19 | 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
20 | 20 | */
|
21 | 21 |
|
22 |
| -#if defined(USBCON) |
| 22 | +#if 1 |
23 | 23 |
|
24 | 24 | #include "HID.h"
|
25 | 25 | #include "Keyboard.h"
|
@@ -47,6 +47,39 @@ void Keyboard_::sendReport(KeyReport* keys)
|
47 | 47 | HID_SendReport(2,keys,sizeof(KeyReport));
|
48 | 48 | }
|
49 | 49 |
|
| 50 | +const u8 _hidReportDescriptor[] PROGMEM = { |
| 51 | + |
| 52 | + // Keyboard |
| 53 | + 0x05, 0x01, // USAGE_PAGE (Generic Desktop) // 47 |
| 54 | + 0x09, 0x06, // USAGE (Keyboard) |
| 55 | + 0xa1, 0x01, // COLLECTION (Application) |
| 56 | + 0x85, 0x02, // REPORT_ID (2) |
| 57 | + 0x05, 0x07, // USAGE_PAGE (Keyboard) |
| 58 | + |
| 59 | + 0x19, 0xe0, // USAGE_MINIMUM (Keyboard LeftControl) |
| 60 | + 0x29, 0xe7, // USAGE_MAXIMUM (Keyboard Right GUI) |
| 61 | + 0x15, 0x00, // LOGICAL_MINIMUM (0) |
| 62 | + 0x25, 0x01, // LOGICAL_MAXIMUM (1) |
| 63 | + 0x75, 0x01, // REPORT_SIZE (1) |
| 64 | + |
| 65 | + 0x95, 0x08, // REPORT_COUNT (8) |
| 66 | + 0x81, 0x02, // INPUT (Data,Var,Abs) |
| 67 | + 0x95, 0x01, // REPORT_COUNT (1) |
| 68 | + 0x75, 0x08, // REPORT_SIZE (8) |
| 69 | + 0x81, 0x03, // INPUT (Cnst,Var,Abs) |
| 70 | + |
| 71 | + 0x95, 0x06, // REPORT_COUNT (6) |
| 72 | + 0x75, 0x08, // REPORT_SIZE (8) |
| 73 | + 0x15, 0x00, // LOGICAL_MINIMUM (0) |
| 74 | + 0x25, 0x65, // LOGICAL_MAXIMUM (101) |
| 75 | + 0x05, 0x07, // USAGE_PAGE (Keyboard) |
| 76 | + |
| 77 | + 0x19, 0x00, // USAGE_MINIMUM (Reserved (no event indicated)) |
| 78 | + 0x29, 0x65, // USAGE_MAXIMUM (Keyboard Application) |
| 79 | + 0x81, 0x00, // INPUT (Data,Ary,Abs) |
| 80 | + 0xc0, // END_COLLECTION |
| 81 | +}; |
| 82 | + |
50 | 83 | extern
|
51 | 84 | const uint8_t _asciimap[128] PROGMEM;
|
52 | 85 |
|
@@ -184,6 +217,14 @@ const uint8_t _asciimap[128] =
|
184 | 217 | 0 // DEL
|
185 | 218 | };
|
186 | 219 |
|
| 220 | +size_t getsizeof_hidReportDescriptor() { |
| 221 | + return sizeof(_hidReportDescriptor); |
| 222 | +} |
| 223 | + |
| 224 | +void WEAK setupUSB() { |
| 225 | + HID.begin(); |
| 226 | +} |
| 227 | + |
187 | 228 | uint8_t USBPutChar(uint8_t c);
|
188 | 229 |
|
189 | 230 | // press() adds the specified key (printing, non-printing, or modifier)
|
|
0 commit comments