Changeset f3b39b4 in mainline for uspace/lib/usbhid/include
- Timestamp:
- 2011-05-26T20:43:26Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d861c22
- Parents:
- 14e1bcc
- Location:
- uspace/lib/usbhid/include/usb/hid
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhid/include/usb/hid/hid_report_items.h
r14e1bcc rf3b39b4 96 96 #define USB_HID_ITEM_FLAG_RELATIVE(flags) ((flags & 0x4) == 0x4) 97 97 98 /** 99 * Indicates whether the data “rolls over” when reaching either the extreme 98 /** Indicates whether the data “rolls over” when reaching either the extreme 100 99 * high or low value. For example, a dial that can spin freely 360 degrees 101 100 * might output values from 0 to 10. If Wrap is indicated, the next value -
uspace/lib/usbhid/include/usb/hid/hiddescriptor.h
r14e1bcc rf3b39b4 43 43 44 44 int usb_hid_parse_report_descriptor(usb_hid_report_t *report, 45 45 const uint8_t *data, size_t size); 46 46 47 47 void usb_hid_free_report(usb_hid_report_t *report); … … 51 51 int usb_hid_report_init(usb_hid_report_t *report); 52 52 53 int usb_hid_report_append_fields(usb_hid_report_t *report, 54 53 int usb_hid_report_append_fields(usb_hid_report_t *report, 54 usb_hid_report_item_t *report_item); 55 55 56 usb_hid_report_description_t * usb_hid_report_find_description(const usb_hid_report_t *report, uint8_t report_id, usb_hid_report_type_t type); 56 usb_hid_report_description_t * usb_hid_report_find_description( 57 const usb_hid_report_t *report, uint8_t report_id, 58 usb_hid_report_type_t type); 57 59 58 int usb_hid_report_parse_tag(uint8_t tag, uint8_t class, const uint8_t *data, size_t item_size, 59 usb_hid_report_item_t *report_item, usb_hid_report_path_t *usage_path); 60 int usb_hid_report_parse_tag(uint8_t tag, uint8_t class, const uint8_t *data, 61 size_t item_size, usb_hid_report_item_t *report_item, 62 usb_hid_report_path_t *usage_path); 60 63 61 int usb_hid_report_parse_main_tag(uint8_t tag, const uint8_t *data, size_t item_size, 62 usb_hid_report_item_t *report_item, usb_hid_report_path_t *usage_path); 64 int usb_hid_report_parse_main_tag(uint8_t tag, const uint8_t *data, 65 size_t item_size, usb_hid_report_item_t *report_item, 66 usb_hid_report_path_t *usage_path); 63 67 64 int usb_hid_report_parse_global_tag(uint8_t tag, const uint8_t *data, size_t item_size, 65 usb_hid_report_item_t *report_item, usb_hid_report_path_t *usage_path); 68 int usb_hid_report_parse_global_tag(uint8_t tag, const uint8_t *data, 69 size_t item_size, usb_hid_report_item_t *report_item, 70 usb_hid_report_path_t *usage_path); 66 71 67 int usb_hid_report_parse_local_tag(uint8_t tag, const uint8_t *data, size_t item_size, 68 usb_hid_report_item_t *report_item, usb_hid_report_path_t *usage_path); 72 int usb_hid_report_parse_local_tag(uint8_t tag, const uint8_t *data, 73 size_t item_size, usb_hid_report_item_t *report_item, 74 usb_hid_report_path_t *usage_path); 69 75 70 76 void usb_hid_descriptor_print_list(link_t *head); … … 74 80 void usb_hid_free_report_list(link_t *head); 75 81 76 usb_hid_report_item_t *usb_hid_report_item_clone(const usb_hid_report_item_t *item); 82 usb_hid_report_item_t *usb_hid_report_item_clone( 83 const usb_hid_report_item_t *item); 77 84 78 85 uint32_t usb_hid_report_tag_data_uint32(const uint8_t *data, size_t size); 79 86 80 usb_hid_report_path_t *usb_hid_report_path_try_insert(usb_hid_report_t *report, usb_hid_report_path_t *cmp_path); 87 usb_hid_report_path_t *usb_hid_report_path_try_insert(usb_hid_report_t*report, 88 usb_hid_report_path_t *cmp_path); 81 89 82 90 -
uspace/lib/usbhid/include/usb/hid/hidparser.h
r14e1bcc rf3b39b4 47 47 * Input report parser functions 48 48 */ 49 /** */ 50 int usb_hid_parse_report(const usb_hid_report_t *report, const uint8_t *data, 51 size_t size, uint8_t *report_id); 49 int usb_hid_parse_report(const usb_hid_report_t *report, const uint8_t *data, 50 size_t size, uint8_t *report_id); 52 51 53 52 /* 54 53 * Output report parser functions 55 54 */ 56 /** Allocates output report buffer*/57 55 uint8_t *usb_hid_report_output(usb_hid_report_t *report, size_t *size, 58 56 uint8_t report_id); 59 57 60 /** Frees output report buffer*/61 58 void usb_hid_report_output_free(uint8_t *output); 62 59 63 /** Returns size of report in items */ 64 size_t usb_hid_report_size(usb_hid_report_t *report, uint8_t report_id, 65 usb_hid_report_type_t type); 60 size_t usb_hid_report_size(usb_hid_report_t *report, uint8_t report_id, 61 usb_hid_report_type_t type); 66 62 67 size_t usb_hid_report_byte_size(usb_hid_report_t *report, uint8_t report_id, 68 63 size_t usb_hid_report_byte_size(usb_hid_report_t *report, uint8_t report_id, 64 usb_hid_report_type_t type); 69 65 70 66 71 /** Makes the output report buffer by translated given data */ 72 int usb_hid_report_output_translate(usb_hid_report_t *report, uint8_t report_id, 73 uint8_t *buffer, size_t size); 67 int usb_hid_report_output_translate(usb_hid_report_t *report, 68 uint8_t report_id, uint8_t *buffer, size_t size); 74 69 75 70 76 /* * */77 usb_hid_report_field_t *usb_hid_report_get_sibling(usb_hid_report_t *report, 78 usb_hid_report_field_t *field,79 usb_hid_report_path_t *path, 80 int flags, 81 71 /* 72 * Report descriptor structure observing functions 73 */ 74 usb_hid_report_field_t *usb_hid_report_get_sibling(usb_hid_report_t *report, 75 usb_hid_report_field_t *field, usb_hid_report_path_t *path, 76 int flags, usb_hid_report_type_t type); 82 77 83 /** */84 78 uint8_t usb_hid_get_next_report_id(usb_hid_report_t *report, 85 uint8_t report_id, 86 usb_hid_report_type_t type); 79 uint8_t report_id, usb_hid_report_type_t type); 87 80 88 81 #endif -
uspace/lib/usbhid/include/usb/hid/hidpath.h
r14e1bcc rf3b39b4 42 42 43 43 /*---------------------------------------------------------------------------*/ 44 /* *44 /* 45 45 * Flags of usage paths comparison modes. 46 46 * 47 47 */ 48 /** Wanted usage path must be exactly the same as the searched one. 49 * Thisoption cannot be combined with the others.48 /** Wanted usage path must be exactly the same as the searched one. This 49 * option cannot be combined with the others. 50 50 */ 51 51 #define USB_HID_PATH_COMPARE_STRICT 0 … … 57 57 58 58 /** 59 * Only usage page are compared along the usage path. 60 * This option can becombined with others.59 * Only usage page are compared along the usage path. This option can be 60 * combined with others. 61 61 */ 62 62 #define USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY 2 … … 101 101 int depth; 102 102 103 /** Report id. Zero is reserved and means that report id is not used. */ 103 /** Report id. Zero is reserved and means that report id is not used. 104 * */ 104 105 uint8_t report_id; 105 106 … … 117 118 void usb_hid_report_path_free(usb_hid_report_path_t *path); 118 119 119 int usb_hid_report_path_set_report_id(usb_hid_report_path_t *usage_path, 120 120 int usb_hid_report_path_set_report_id(usb_hid_report_path_t *usage_path, 121 uint8_t report_id); 121 122 122 123 int usb_hid_report_path_append_item(usb_hid_report_path_t *usage_path, 123 124 int32_t usage_page, int32_t usage); 124 125 125 126 void usb_hid_report_remove_last_item(usb_hid_report_path_t *usage_path); … … 128 129 129 130 void usb_hid_report_set_last_item(usb_hid_report_path_t *usage_path, 130 131 int32_t tag, int32_t data); 131 132 132 int usb_hid_report_compare_usage_path(usb_hid_report_path_t *report_path, 133 133 int usb_hid_report_compare_usage_path(usb_hid_report_path_t *report_path, 134 usb_hid_report_path_t *path, int flags); 134 135 135 usb_hid_report_path_t *usb_hid_report_path_clone(usb_hid_report_path_t *usage_path); 136 usb_hid_report_path_t *usb_hid_report_path_clone( 137 usb_hid_report_path_t *usage_path); 136 138 137 139 void usb_hid_print_usage_path(usb_hid_report_path_t *path); -
uspace/lib/usbhid/include/usb/hid/hidtypes.h
r14e1bcc rf3b39b4 72 72 73 73 /** 74 * Report type74 * Enum of report types 75 75 */ 76 76 typedef enum { 77 /** Input report. Data are sent from device to system */ 77 78 USB_HID_REPORT_TYPE_INPUT = 1, 79 80 /** Output report. Data are sent from system to device */ 78 81 USB_HID_REPORT_TYPE_OUTPUT = 2, 82 83 /** Feature report. Describes device configuration information that 84 * can be sent to the device */ 79 85 USB_HID_REPORT_TYPE_FEATURE = 3 80 86 } usb_hid_report_type_t;
Note:
See TracChangeset
for help on using the changeset viewer.