Exemplo n.º 1
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),
            HID_USAGE_1B (HU_Y),
            HID_LOGICAL_MINIMUM_1B (-127),
            HID_LOGICAL_MAXIMUM_1B (127),
            HID_REPORT_SIZE (8),
            HID_REPORT_COUNT (2),
            HID_INPUT (HID_DATA | HID_VARIABLE | HID_RELATIVE),
        HID_END_COLLECTION,
    HID_END_COLLECTION
Exemplo n.º 2
0
  .bcdDevice = 0x0100,
  .iManufacturer = 1,
  .iProduct = 2,
  .iSerialNumber = 3,
  .bNumConfigurations = 1,
};

static const uint8_t hid_report_descriptor[] = {
  0x06, 0x00, 0xff,
  HID_USAGE   (0x01),
  HID_COLLECTION    (HID_COLLECTION_APPLICATION),
    HID_REPORT_ID(1),
    HID_LOGICAL_MINIMUM     (0),
    HID_LOGICAL_MAXIMUM     (255),
    HID_REPORT_SIZE   (8),
    HID_REPORT_COUNT  (9),
    HID_USAGE   (0x01),
    HID_INPUT (0x02),
  HID_END_COLLECTION,
  0x06, 0x00, 0xff,
  HID_USAGE   (0x01),
  HID_COLLECTION    (HID_COLLECTION_APPLICATION),
    HID_REPORT_ID(2),
    HID_LOGICAL_MINIMUM     (0),
    HID_LOGICAL_MAXIMUM     (255),
    HID_REPORT_SIZE   (8),
    HID_REPORT_COUNT  (MAX_PACKET_SIZE),
    HID_USAGE   (0x01),
    HID_INPUT (0x02),
  HID_END_COLLECTION,
};
Exemplo n.º 3
0
	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),
	HID_USAGE_MAXIMUM   (8, 0x5F),
	HID_INPUT           (8, HID_DATA | HID_VARIABLE | HID_ABSOLUTE),

	HID_USAGE_MINIMUM   (8, 0x60),
	HID_USAGE_MAXIMUM   (8, 0x7F),
	HID_INPUT           (8, HID_DATA | HID_VARIABLE | HID_ABSOLUTE),
Exemplo n.º 4
0

// 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,
	
	HID_USAGE_SENSOR_PROPERTY_REPORTING_STATE,
	HID_LOGICAL_MIN_8(0),
	HID_LOGICAL_MAX_8(5),
			HID_REPORT_SIZE(8),
			HID_REPORT_COUNT(1),
		HID_COLLECTION(Logical),
	HID_USAGE_SENSOR_PROPERTY_REPORTING_STATE_NO_EVENTS_SEL_SEL, 
	HID_USAGE_SENSOR_PROPERTY_REPORTING_STATE_ALL_EVENTS_SEL_SEL,