#define ALIGN4 __align(4) #endif ALIGN4 const uint8_t HID_ReportDescriptor[] = { HID_UsagePageVendor( 0x00 ), HID_Usage ( 0x01 ), HID_Collection ( HID_Application ), HID_LogicalMin ( 0 ), /* value range: 0 - 0xFF */ HID_LogicalMaxS ( 0xFF ), HID_ReportSize ( 8 ), /* 8 bits */ HID_ReportCount ( HID_INPUT_REPORT_BYTES ), HID_Usage ( 0x01 ), HID_Input ( HID_Data | HID_Variable | HID_Absolute ), HID_ReportCount ( HID_OUTPUT_REPORT_BYTES ), HID_Usage ( 0x01 ), HID_Output ( HID_Data | HID_Variable | HID_Absolute ), HID_ReportCount ( HID_FEATURE_REPORT_BYTES ), HID_Usage ( 0x01 ), HID_Feature ( HID_Data | HID_Variable | HID_Absolute ), HID_EndCollection, }; const uint16_t HID_ReportDescSize = sizeof(HID_ReportDescriptor); #if (USE_HID_DESC) /* USB Standard Device Descriptor */ ALIGN4 const uint8_t USB_DeviceDescriptor[] = { USB_DEVICE_DESC_SIZE, /* bLength */ USB_DEVICE_DESCRIPTOR_TYPE, /* bDescriptorType */ WBVAL(0x0200), /* 2.00 */ /* bcdUSB */
HID_LogicalMax ( 1 ), HID_ReportCount ( 8 ), /* 8 bits */ HID_ReportSize ( 1 ), HID_Input ( HID_Data | HID_Variable | HID_Absolute ), /* maskable modifier key */ HID_ReportCount ( 1 ), HID_ReportSize ( 8 ), HID_Input (HID_Constant ), /* reserved */ HID_UsagePage ( HID_USAGE_PAGE_LED ), HID_UsageMin (1 ), HID_UsageMax (5 ), HID_ReportCount (5 ), HID_ReportSize (1 ), HID_Output ( HID_Data | HID_Variable | HID_Absolute ), /* 5-bit Led report */ HID_ReportCount ( 1 ), HID_ReportSize (3 ), /* led padding */ HID_Output (HID_Constant ), HID_UsagePage (HID_USAGE_PAGE_KEYBOARD), HID_UsageMin (0 ), HID_UsageMax (101 ), HID_LogicalMin (0 ), HID_LogicalMax (101 ), HID_ReportCount (6 ), HID_ReportSize (8 ), HID_Input (HID_Data | HID_Array | HID_Absolute ), /* keycodes array 6 items */ HID_EndCollection,
HID_UsageMax(0x40), HID_LogicalMin(0), HID_LogicalMax(0x40), HID_ReportCount(0x40), HID_ReportSize(0x08), HID_Input(HID_Data), // HID_ReportCount(1), // HID_ReportSize(6), //HID_Input(HID_Constant), // HID_UsagePage(HID_USAGE_PAGE_LED), // HID_Usage(HID_USAGE_LED_GENERIC_INDICATOR), HID_UsageMin(0), HID_UsageMax(0x40), // HID_ReportCount(8), //HID_ReportSize(1), HID_Output(HID_Data), HID_EndCollection, }; const WORD HID_ReportDescSize = sizeof(HID_ReportDescriptor); /* USB Standard Device Descriptor */ const BYTE USB_DeviceDescriptor[] = { USB_DEVICE_DESC_SIZE, /* bLength */ USB_DEVICE_DESCRIPTOR_TYPE, /* bDescriptorType */ WBVAL(0x0200), /* 2.20 */ /* bcdUSB */ 0x00, /* bDeviceClass */ 0x00, /* bDeviceSubClass */ 0x00, /* bDeviceProtocol */ USB_MAX_PACKET0, /* bMaxPacketSize0 */
HID_UsageMin(224), HID_UsageMax(231), HID_LogicalMin(0), HID_LogicalMax(1), HID_ReportSize(1), HID_ReportCount(8), HID_Input(HID_Data | HID_Variable | HID_Absolute), HID_ReportCount(1), HID_ReportSize(8), HID_Input(HID_Constant), HID_ReportCount(5), HID_ReportSize(1), HID_UsagePage(HID_USAGE_PAGE_LED), HID_UsageMin(1), HID_UsageMax(5), HID_Output(HID_Data | HID_Variable | HID_Absolute), HID_ReportCount(1), HID_ReportSize(3), HID_Output(HID_Constant), HID_ReportCount(6), HID_ReportSize(8), HID_LogicalMin(0), HID_LogicalMax(101), HID_UsagePage(HID_USAGE_PAGE_KEYBOARD), HID_UsageMin(0), HID_UsageMax(101), HID_Input(HID_Array), HID_EndCollection, }; const uint16_t Keyboard_ReportDescSize = sizeof(Keyboard_ReportDescriptor);