Changeset 09ab0a9a in mainline for uspace/lib/usbhid/src
- Timestamp:
- 2018-09-13T12:05:53Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cc74cb5
- Parents:
- b2aaaa0
- git-author:
- Jiri Svoboda <jiri@…> (2018-09-13 07:09:46)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-09-13 12:05:53)
- Location:
- uspace/lib/usbhid/src
- Files:
-
- 5 edited
-
hiddescriptor.c (modified) (12 diffs)
-
hidparser.c (modified) (12 diffs)
-
hidpath.c (modified) (8 diffs)
-
hidreport.c (modified) (1 diff)
-
hidreq.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhid/src/hiddescriptor.c
rb2aaaa0 r09ab0a9a 42 42 #include <stdlib.h> 43 43 44 45 44 /* 46 45 * Constants defining current parsing mode for correct parsing of the set of … … 62 61 #define INSIDE_DELIMITER_SET 2 63 62 64 65 66 63 /** The new report item flag. Used to determine when the item is completly 67 64 * configured and should be added to the report structure … … 79 76 /** Unknown tag was founded in report descriptor data*/ 80 77 #define USB_HID_UNKNOWN_TAG -99 81 82 78 83 79 /** … … 125 121 } 126 122 127 128 123 /** 129 124 * Initialize the report descriptor parser structure … … 147 142 return EOK; 148 143 } 149 150 151 144 152 145 /** … … 329 322 } 330 323 331 332 324 /** Parse HID report descriptor. 333 325 * … … 510 502 } 511 503 512 513 504 } 514 505 515 506 return EOK; 516 507 } 517 518 519 508 520 509 /** … … 759 748 usb_hid_report_tag_data_uint32(data, item_size)); 760 749 761 762 750 report_item->usage_minimum = 763 751 USB_HID_EXTENDED_USAGE( … … 867 855 return result; 868 856 } 869 870 857 871 858 /** … … 909 896 } 910 897 911 912 898 /** 913 899 * Prints content of given report descriptor in human readable format. … … 936 922 } 937 923 938 939 940 924 /** Frees the HID report descriptor parser structure 941 925 * … … 986 970 } 987 971 988 989 972 /** 990 973 * @} -
uspace/lib/usbhid/src/hidparser.c
rb2aaaa0 r09ab0a9a 44 44 #include <macros.h> 45 45 46 47 46 /* 48 47 * Data translation private functions … … 54 53 uint32_t usb_hid_translate_data_reverse(usb_hid_report_field_t *item, 55 54 int32_t value); 56 57 58 55 59 56 static int usb_pow(int a, int b) … … 72 69 } 73 70 74 75 71 /** Returns size of report of specified report id and type in items 76 72 * … … 120 116 } 121 117 } 122 123 118 124 119 /** Parse and act upon a HID report. … … 192 187 } 193 188 194 195 189 /** 196 190 * Translate data from the report as specified in report descriptor item … … 258 252 item->physical_minimum); 259 253 } 260 261 254 262 255 /* OUTPUT API */ … … 299 292 } 300 293 } 301 302 294 303 295 /** Frees output report buffer … … 410 402 } 411 403 412 413 404 /** 414 405 * Translate given data for putting them into the outoput report … … 455 446 } 456 447 457 458 448 /** 459 449 * Clones given state table … … 475 465 return new_report_item; 476 466 } 477 478 467 479 468 /** … … 531 520 } 532 521 533 534 522 /** 535 523 * Returns next report_id of report of specified type. If zero is given than … … 578 566 return 0; 579 567 } 580 581 568 582 569 /** -
uspace/lib/usbhid/src/hidpath.c
rb2aaaa0 r09ab0a9a 41 41 #include <assert.h> 42 42 43 44 43 /** 45 44 * Compares two usages if they are same or not or one of the usages is not … … 62 61 #define USB_HID_SAME_USAGE_PAGE(page1, page2) \ 63 62 ((page1 == page2) || (page1 == 0) || (page2 == 0)) 64 65 63 66 64 /** … … 92 90 return EOK; 93 91 } 94 95 92 96 93 /** … … 114 111 } 115 112 116 117 113 /** 118 114 * Nulls last item of the usage path structure. … … 132 128 } 133 129 } 134 135 130 136 131 /** … … 350 345 } 351 346 352 353 347 /** 354 348 * Releases given usage path structure. … … 369 363 } 370 364 371 372 365 /** 373 366 * Clone content of given usage path to the new one … … 413 406 } 414 407 415 416 408 /** 417 409 * Sets report id in usage path structure -
uspace/lib/usbhid/src/hidreport.c
rb2aaaa0 r09ab0a9a 161 161 } 162 162 163 164 165 163 errno_t usb_hid_process_report_descriptor(usb_device_t *dev, 166 164 usb_hid_report_t *report, uint8_t **report_desc, size_t *report_size) -
uspace/lib/usbhid/src/hidreq.c
rb2aaaa0 r09ab0a9a 45 45 #include <usb/hid/request.h> 46 46 47 48 47 /** 49 48 * Send Set Report request to the HID device. … … 97 96 } 98 97 99 100 98 /** 101 99 * Send Set Protocol request to the HID device. … … 144 142 return EOK; 145 143 } 146 147 144 148 145 /** … … 194 191 return EOK; 195 192 } 196 197 193 198 194 /** … … 251 247 } 252 248 253 254 249 /** 255 250 * Send Get Protocol request to the HID device. … … 310 305 } 311 306 312 313 307 /** 314 308 * Send Get Idle request to the HID device. … … 374 368 } 375 369 376 377 378 370 /** 379 371 * @}
Note:
See TracChangeset
for help on using the changeset viewer.
