StringDescriptorId_Language = 0, StringDescriptorId_Manufacturer = 1, StringDescriptorId_Product = 2 }; /* Note that the key report is split into several similar items, because: An item field cannot span more than 4 bytes in a report. For example, a 32-bit item must start on a byte boundary to satisfy this condition. - USB HID 1.11 Specification, p. 57 */ local const u8 PROGMEM NkroKeyboardReportDescriptor[] = { HID_USAGE_PAGE (8, HID_USAGE_PAGE_GENERIC_DESKTOP_CONTROLS), HID_USAGE (8, HID_DESKTOP_KEYBOARD), HID_COLLECTION (8, HID_COLLECTION_APPLICATION), HID_USAGE_PAGE (8, HID_USAGE_PAGE_KEYBOARD_KEYPAD), HID_LOGICAL_MINIMUM (8, 0x00), HID_LOGICAL_MAXIMUM (8, 0x01), HID_REPORT_SIZE (8, 0x01), HID_REPORT_COUNT (8, 0x20), HID_USAGE_MINIMUM (8, 0x00), HID_USAGE_MAXIMUM (8, 0x1F), HID_INPUT (8, HID_DATA | HID_VARIABLE | HID_ABSOLUTE), HID_USAGE_MINIMUM (8, 0x20), HID_USAGE_MAXIMUM (8, 0x3F), HID_INPUT (8, HID_DATA | HID_VARIABLE | HID_ABSOLUTE), HID_USAGE_MINIMUM (8, 0x40),
.bDeviceProtocol = 0, .bMaxPacketSize0 = USBDEV_EP0_MAX_SIZE, .idVendor = 0x04d8, .idProduct = 0x003e, .bcdDevice = 0x0100, .iManufacturer = 1, .iProduct = 2, .iSerialNumber = 0, .bNumConfigurations = 1 }; unsigned char mouse_report[] = { HID_USAGE_PAGE_1B (HUP_GENERIC_DESKTOP), HID_USAGE_1B (HU_MOUSE), HID_COLLECTION (HID_APPLICATION), HID_USAGE_1B (HU_POINTER), HID_COLLECTION (HID_PHYSICAL), HID_USAGE_PAGE_1B (HUP_BUTTONS), HID_USAGE_MINIMUM (1), HID_USAGE_MAXIMUM (3), HID_LOGICAL_MINIMUM_1B (0), HID_LOGICAL_MAXIMUM_1B (1), HID_REPORT_COUNT (3), HID_REPORT_SIZE (1), HID_INPUT (HID_DATA | HID_VARIABLE | HID_ABSOLUTE), HID_REPORT_COUNT (1), HID_REPORT_SIZE (5), HID_INPUT (HID_CONSTANT), HID_USAGE_PAGE_1B (HUP_GENERIC_DESKTOP), HID_USAGE_1B (HU_X),
#define RED_LED_OFF() (RED_LED_PORT |= (1 << RED_LED)) #define RED_LED_ON() (RED_LED_PORT &= ~(1 << RED_LED)) #define RED_LED_TOGGLE() (RED_LED_PORT ^= (1 << RED_LED)) #define GREEN_LED_OUT() (GREEN_LED_DDR |= (1 << GREEN_LED)) #define GREEN_LED_OFF() (GREEN_LED_PORT |= (1 << GREEN_LED)) #define GREEN_LED_ON() (GREEN_LED_PORT &= ~(1 << GREEN_LED)) #define GREEN_LED_TOGGLE() (GREEN_LED_PORT ^= (1 << GREEN_LED)) // 3D Gyrometer PROGMEM const char usbHidReportDescriptor[USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH] = { HID_USAGE_PAGE_SENSOR, HID_USAGE_SENSOR_TYPE_MOTION_GYROMETER_3D, HID_COLLECTION(Physical), //feature reports (xmit/receive) HID_USAGE_PAGE_SENSOR, HID_USAGE_SENSOR_PROPERTY_SENSOR_CONNECTION_TYPE, // NAry HID_LOGICAL_MIN_8(0), HID_LOGICAL_MAX_8(2), HID_REPORT_SIZE(8), HID_REPORT_COUNT(1), HID_COLLECTION(Logical), HID_USAGE_SENSOR_PROPERTY_CONNECTION_TYPE_PC_INTEGRATED_SEL, HID_USAGE_SENSOR_PROPERTY_CONNECTION_TYPE_PC_ATTACHED_SEL_SEL, HID_USAGE_SENSOR_PROPERTY_CONNECTION_TYPE_PC_EXTERNAL_SEL_SEL, HID_FEATURE(Data_Arr_Abs), HID_END_COLLECTION,