Changeset 0588062e in mainline for uspace/lib/usb/include/usb/classes/hidparser.h
- Timestamp:
- 2011-03-03T18:56:11Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8e9becf6
- Parents:
- d3594362 (diff), e259d95 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/include/usb/classes/hidparser.h
rd3594362 r0588062e 37 37 38 38 #include <stdint.h> 39 #include <adt/list.h> 40 #include <usb/classes/hid_report_items.h> 41 42 /** 43 * Item prefix 44 */ 45 #define USB_HID_ITEM_SIZE(data) ((uint8_t)(data & 0x3)) 46 #define USB_HID_ITEM_TAG(data) ((uint8_t)((data & 0xF0) >> 4)) 47 #define USB_HID_ITEM_TAG_CLASS(data) ((uint8_t)((data & 0xC) >> 2)) 48 #define USB_HID_ITEM_IS_LONG(data) (data == 0xFE) 49 50 51 /** 52 * Input/Output/Feature Item flags 53 */ 54 #define USB_HID_ITEM_FLAG_CONSTANT(flags) (flags & 0x1) 55 #define USB_HID_ITEM_FLAG_VARIABLE(flags) (flags & 0x2) 56 #define USB_HID_ITEM_FLAG_RELATIVE(flags) (flags & 0x4) 57 #define USB_HID_ITEM_FLAG_WRAP(flags) (flags & 0x8) 58 #define USB_HID_ITEM_FLAG_LINEAR(flags) (flags & 0x10) 59 #define USB_HID_ITEM_FLAG_PREFERRED(flags) (flags & 0x20) 60 #define USB_HID_ITEM_FLAG_POSITION(flags) (flags & 0x40) 61 #define USB_HID_ITEM_FLAG_VOLATILE(flags) (flags & 0x80) 62 #define USB_HID_ITEM_FLAG_BUFFERED(flags) (flags & 0x100) 63 39 64 40 65 /** … … 42 67 */ 43 68 typedef struct { 69 int32_t id; 70 int32_t usage_page; 71 int32_t usage; 72 int32_t usage_minimum; 73 int32_t usage_maximum; 74 int32_t logical_minimum; 75 int32_t logical_maximum; 76 int32_t size; 77 int32_t count; 78 int32_t offset; 44 79 45 uint8_t usage_min; 46 uint8_t usage_max; 47 uint8_t logical_min; 48 uint8_t logical_max; 49 uint8_t size; 50 uint8_t count; 51 uint8_t offset; 80 int32_t unit_exponent; 81 int32_t unit; 52 82 83 /* 84 * some not yet used fields 85 */ 86 int32_t string_index; 87 int32_t string_minimum; 88 int32_t string_maximum; 89 int32_t designator_index; 90 int32_t designator_minimum; 91 int32_t designator_maximum; 92 int32_t physical_minimum; 93 int32_t physical_maximum; 94 95 uint8_t item_flags; 96 97 link_t link; 53 98 } usb_hid_report_item_t; 54 99 55 100 56 101 /** HID report parser structure. */ 57 typedef struct { 58 } usb_hid_report_parser_t; 102 typedef struct { 103 link_t input; 104 link_t output; 105 link_t feature; 106 } usb_hid_report_parser_t; 107 59 108 60 109 … … 127 176 int usb_hid_boot_keyboard_output_report(uint8_t leds, uint8_t *data, size_t size); 128 177 178 int usb_hid_parser_init(usb_hid_report_parser_t *parser); 129 179 int usb_hid_parse_report_descriptor(usb_hid_report_parser_t *parser, 130 180 const uint8_t *data, size_t size); … … 135 185 136 186 137 int usb_hid_free_report_parser(usb_hid_report_parser_t *parser); 187 void usb_hid_free_report_parser(usb_hid_report_parser_t *parser); 188 189 void usb_hid_descriptor_print(usb_hid_report_parser_t *parser); 138 190 139 191 #endif
Note:
See TracChangeset
for help on using the changeset viewer.