Changeset fcbcaae9 in mainline for uspace/lib/usbhid/include/usb/hid/hidpath.h
- Timestamp:
- 2011-05-23T14:55:46Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fb2de0a
- Parents:
- 563ead9 (diff), c9256c5 (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/usbhid/include/usb/hid/hidpath.h
r563ead9 rfcbcaae9 27 27 */ 28 28 29 /** @addtogroup libusb hid29 /** @addtogroup libusb 30 30 * @{ 31 31 */ … … 33 33 * USB HID report descriptor and report data parser 34 34 */ 35 #ifndef LIBUSB HID_HIDPATH_H_36 #define LIBUSB HID_HIDPATH_H_35 #ifndef LIBUSB_HIDPATH_H_ 36 #define LIBUSB_HIDPATH_H_ 37 37 38 38 #include <usb/hid/hidparser.h> … … 40 40 #include <adt/list.h> 41 41 42 43 /*---------------------------------------------------------------------------*/ 42 44 /** 43 * Description of path of usage pages and usages in report descriptor 45 * Flags of usage paths comparison modes. 46 * 44 47 */ 45 /** Wanted usage path must be exactly the same as the searched one */ 48 /** Wanted usage path must be exactly the same as the searched one. 49 * This option cannot be combined with the others. 50 */ 46 51 #define USB_HID_PATH_COMPARE_STRICT 0 47 /** Wanted usage path must be the suffix in the searched one */ 52 53 /** 54 * Wanted usage path must be the suffix in the searched one. 55 */ 48 56 #define USB_HID_PATH_COMPARE_END 1 49 /** */ 57 58 /** 59 * Only usage page are compared along the usage path. 60 * This option can be combined with others. 61 */ 50 62 #define USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY 2 51 /** Searched usage page must be prefix of the other one */ 63 64 /** 65 * Searched usage page must be prefix of the other one. 66 */ 52 67 #define USB_HID_PATH_COMPARE_BEGIN 4 53 /** Searched couple of usage page and usage can be anywhere in usage path */ 68 69 /** 70 * Searched couple of usage page and usage can be anywhere in usage path. 71 * This option is deprecated. 72 */ 54 73 #define USB_HID_PATH_COMPARE_ANYWHERE 8 55 74 56 57 /** Collection usage path structure */ 75 /*----------------------------------------------------------------------------*/ 76 /** 77 * Item of usage path structure. Last item of linked list describes one item 78 * in report, the others describe superior Collection tags. Usage and Usage 79 * page of report item can be changed due to data in report. 80 */ 58 81 typedef struct { 59 /** */82 /** Usage page of report item. Zero when usage page can be changed. */ 60 83 uint32_t usage_page; 61 /** */84 /** Usage of report item. Zero when usage can be changed. */ 62 85 uint32_t usage; 63 86 87 /** Attribute of Collection tag in report descriptor*/ 64 88 uint8_t flags; 65 /** */ 89 90 /** Linked list structure*/ 66 91 link_t link; 67 92 } usb_hid_report_usage_path_t; 68 93 69 /** */ 94 95 /*---------------------------------------------------------------------------*/ 96 /** 97 * USB HID usage path structure. 98 * */ 70 99 typedef struct { 71 /** */100 /** Length of usage path */ 72 101 int depth; 102 103 /** Report id. Zero is reserved and means that report id is not used. */ 73 104 uint8_t report_id; 74 105 75 /** */106 /** Linked list structure. */ 76 107 link_t link; /* list */ 77 108 78 link_t head; /* head of list of usage paths */ 109 /** Head of the list of usage path items. */ 110 link_t head; 79 111 80 112 } usb_hid_report_path_t; 81 113 82 /* **/114 /*---------------------------------------------------------------------------*/ 83 115 usb_hid_report_path_t *usb_hid_report_path(void); 84 116 85 /** */86 117 void usb_hid_report_path_free(usb_hid_report_path_t *path); 87 118 88 /** */89 119 int usb_hid_report_path_set_report_id(usb_hid_report_path_t *usage_path, 90 120 uint8_t report_id); 91 121 92 /** */93 122 int usb_hid_report_path_append_item(usb_hid_report_path_t *usage_path, 94 123 int32_t usage_page, int32_t usage); 95 124 96 /** */97 125 void usb_hid_report_remove_last_item(usb_hid_report_path_t *usage_path); 98 126 99 /** */100 127 void usb_hid_report_null_last_item(usb_hid_report_path_t *usage_path); 101 128 102 /** */103 129 void usb_hid_report_set_last_item(usb_hid_report_path_t *usage_path, 104 130 int32_t tag, int32_t data); 105 131 106 /** */107 132 int usb_hid_report_compare_usage_path(usb_hid_report_path_t *report_path, 108 133 usb_hid_report_path_t *path, int flags); 109 134 110 /** */111 135 usb_hid_report_path_t *usb_hid_report_path_clone(usb_hid_report_path_t *usage_path); 112 136
Note:
See TracChangeset
for help on using the changeset viewer.