Changes in uspace/lib/usbhid/include/usb/hid/hidpath.h [f3b39b4:160b75e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhid/include/usb/hid/hidpath.h
rf3b39b4 r160b75e 27 27 */ 28 28 29 /** @addtogroup libusb 29 /** @addtogroup libusbhid 30 30 * @{ 31 31 */ … … 33 33 * USB HID report descriptor and report data parser 34 34 */ 35 #ifndef LIBUSB _HIDPATH_H_36 #define LIBUSB _HIDPATH_H_35 #ifndef LIBUSBHID_HIDPATH_H_ 36 #define LIBUSBHID_HIDPATH_H_ 37 37 38 38 #include <usb/hid/hidparser.h> … … 40 40 #include <adt/list.h> 41 41 42 43 /*---------------------------------------------------------------------------*/ 44 /* 45 * Flags of usage paths comparison modes. 46 * 42 /** 43 * Description of path of usage pages and usages in report descriptor 47 44 */ 48 /** Wanted usage path must be exactly the same as the searched one. This 49 * option cannot be combined with the others. 50 */ 45 /** Wanted usage path must be exactly the same as the searched one */ 51 46 #define USB_HID_PATH_COMPARE_STRICT 0 52 53 /** 54 * Wanted usage path must be the suffix in the searched one. 55 */ 47 /** Wanted usage path must be the suffix in the searched one */ 56 48 #define USB_HID_PATH_COMPARE_END 1 57 58 /** 59 * Only usage page are compared along the usage path. This option can be 60 * combined with others. 61 */ 49 /** */ 62 50 #define USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY 2 63 64 /** 65 * Searched usage page must be prefix of the other one. 66 */ 51 /** Searched usage page must be prefix of the other one */ 67 52 #define USB_HID_PATH_COMPARE_BEGIN 4 68 69 /** 70 * Searched couple of usage page and usage can be anywhere in usage path. 71 * This option is deprecated. 72 */ 53 /** Searched couple of usage page and usage can be anywhere in usage path */ 73 54 #define USB_HID_PATH_COMPARE_ANYWHERE 8 74 55 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 */ 56 57 /** Collection usage path structure */ 81 58 typedef struct { 82 /** Usage page of report item. Zero when usage page can be changed.*/59 /** */ 83 60 uint32_t usage_page; 84 /** Usage of report item. Zero when usage can be changed.*/61 /** */ 85 62 uint32_t usage; 86 63 87 /** Attribute of Collection tag in report descriptor*/88 64 uint8_t flags; 89 90 /** Linked list structure*/ 65 /** */ 91 66 link_t link; 92 67 } usb_hid_report_usage_path_t; 93 68 94 95 /*---------------------------------------------------------------------------*/ 96 /** 97 * USB HID usage path structure. 98 * */ 69 /** */ 99 70 typedef struct { 100 /** Length of usage path*/71 /** */ 101 72 int depth; 102 103 /** Report id. Zero is reserved and means that report id is not used.104 * */105 73 uint8_t report_id; 106 74 107 /** Linked list structure.*/75 /** */ 108 76 link_t link; /* list */ 109 77 110 /** Head of the list of usage path items. */ 111 link_t head; 78 link_t head; /* head of list of usage paths */ 112 79 113 80 } usb_hid_report_path_t; 114 81 115 /* ---------------------------------------------------------------------------*/82 /** */ 116 83 usb_hid_report_path_t *usb_hid_report_path(void); 117 84 85 /** */ 118 86 void usb_hid_report_path_free(usb_hid_report_path_t *path); 119 87 120 int usb_hid_report_path_set_report_id(usb_hid_report_path_t *usage_path, 121 uint8_t report_id); 88 /** */ 89 int usb_hid_report_path_set_report_id(usb_hid_report_path_t *usage_path, 90 uint8_t report_id); 122 91 92 /** */ 123 93 int usb_hid_report_path_append_item(usb_hid_report_path_t *usage_path, 124 94 int32_t usage_page, int32_t usage); 125 95 96 /** */ 126 97 void usb_hid_report_remove_last_item(usb_hid_report_path_t *usage_path); 127 98 99 /** */ 128 100 void usb_hid_report_null_last_item(usb_hid_report_path_t *usage_path); 129 101 102 /** */ 130 103 void usb_hid_report_set_last_item(usb_hid_report_path_t *usage_path, 131 104 int32_t tag, int32_t data); 132 105 133 int usb_hid_report_compare_usage_path(usb_hid_report_path_t *report_path, 134 usb_hid_report_path_t *path, int flags); 106 /** */ 107 int usb_hid_report_compare_usage_path(usb_hid_report_path_t *report_path, 108 usb_hid_report_path_t *path, int flags); 135 109 136 usb_hid_report_path_t *usb_hid_report_path_clone( 137 110 /** */ 111 usb_hid_report_path_t *usb_hid_report_path_clone(usb_hid_report_path_t *usage_path); 138 112 139 113 void usb_hid_print_usage_path(usb_hid_report_path_t *path);
Note:
See TracChangeset
for help on using the changeset viewer.