Changeset a76b01b4 in mainline for uspace/lib/usbhid
- Timestamp:
- 2012-02-24T19:11:23Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a2bd8822
- Parents:
- 76fbd9a
- Location:
- uspace/lib/usbhid
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhid/include/usb/hid/hid_report_items.h
r76fbd9a ra76b01b4 38 38 #include <stdint.h> 39 39 40 /*---------------------------------------------------------------------------*/ 40 41 41 /* 42 42 * Item prefix … … 56 56 #define USB_HID_ITEM_IS_LONG(data) (data == 0xFE) 57 57 58 /*---------------------------------------------------------------------------*/ 58 59 59 /* 60 60 * Extended usage macros … … 70 70 #define USB_HID_EXTENDED_USAGE(usage) (usage & 0xFFFF) 71 71 72 /*---------------------------------------------------------------------------*/ 72 73 73 /* 74 74 * Input/Output/Feature Item flags … … 142 142 #define USB_HID_ITEM_FLAG_BUFFERED(flags) ((flags & 0x100) == 0x100) 143 143 144 /*---------------------------------------------------------------------------*/ 144 145 145 146 146 /* MAIN ITEMS */ … … 185 185 #define USB_HID_REPORT_TAG_END_COLLECTION 0xC 186 186 187 /*---------------------------------------------------------------------------*/ 187 188 188 189 189 /* GLOBAL ITEMS */ … … 272 272 #define USB_HID_REPORT_TAG_POP 0xB 273 273 274 /*---------------------------------------------------------------------------*/ 274 275 275 276 276 /* LOCAL ITEMS */ … … 347 347 #define USB_HID_REPORT_TAG_DELIMITER 0xA 348 348 349 /*---------------------------------------------------------------------------*/ 349 350 350 351 351 #endif -
uspace/lib/usbhid/include/usb/hid/hidpath.h
r76fbd9a ra76b01b4 41 41 42 42 43 /*---------------------------------------------------------------------------*/ 43 44 44 /* 45 45 * Flags of usage paths comparison modes. … … 73 73 #define USB_HID_PATH_COMPARE_ANYWHERE 8 74 74 75 /*----------------------------------------------------------------------------*/ 75 76 76 /** 77 77 * Item of usage path structure. Last item of linked list describes one item … … 93 93 94 94 95 /*---------------------------------------------------------------------------*/ 95 96 96 /** 97 97 * USB HID usage path structure. … … 112 112 } usb_hid_report_path_t; 113 113 114 /*---------------------------------------------------------------------------*/ 114 115 115 usb_hid_report_path_t *usb_hid_report_path(void); 116 116 -
uspace/lib/usbhid/include/usb/hid/hidtypes.h
r76fbd9a ra76b01b4 39 39 #include <adt/list.h> 40 40 41 /*---------------------------------------------------------------------------*/ 41 42 42 43 43 /** … … 69 69 (((x) < 0 ) ? ((1 << (size)) + (x)) : (x)) 70 70 71 /*---------------------------------------------------------------------------*/ 71 72 72 73 73 /** … … 86 86 } usb_hid_report_type_t; 87 87 88 /*---------------------------------------------------------------------------*/ 88 89 89 90 90 /** … … 111 111 112 112 } usb_hid_report_t; 113 /*---------------------------------------------------------------------------*/ 113 114 114 115 115 /** … … 135 135 link_t reports_link; 136 136 } usb_hid_report_description_t; 137 /*---------------------------------------------------------------------------*/ 137 138 138 139 139 /** … … 202 202 } usb_hid_report_field_t; 203 203 204 /*---------------------------------------------------------------------------*/ 204 205 205 206 206 /** … … 287 287 int in_delimiter; 288 288 } usb_hid_report_item_t; 289 /*---------------------------------------------------------------------------*/ 289 290 290 /** 291 291 * Enum of the keyboard modifiers … … 314 314 USB_HID_MOD_RGUI 315 315 }; 316 /*---------------------------------------------------------------------------*/ 316 317 317 318 318 -
uspace/lib/usbhid/include/usb/hid/request.h
r76fbd9a ra76b01b4 42 42 #include <usb/dev/pipes.h> 43 43 44 /*----------------------------------------------------------------------------*/ 44 45 45 46 46 int usbhid_req_set_report(usb_pipe_t *ctrl_pipe, int iface_no, … … 61 61 int usbhid_req_get_idle(usb_pipe_t *ctrl_pipe, int iface_no, uint8_t *duration); 62 62 63 /*----------------------------------------------------------------------------*/ 63 64 64 65 65 #endif /* USB_KBD_HIDREQ_H_ */ -
uspace/lib/usbhid/src/hiddescriptor.c
r76fbd9a ra76b01b4 41 41 #include <assert.h> 42 42 43 /*---------------------------------------------------------------------------*/ 43 44 44 /* 45 45 * Constants defining current parsing mode for correct parsing of the set of … … 61 61 #define INSIDE_DELIMITER_SET 2 62 62 63 /*---------------------------------------------------------------------------*/ 63 64 64 65 65 /** The new report item flag. Used to determine when the item is completly … … 78 78 #define USB_HID_UNKNOWN_TAG -99 79 79 80 /*---------------------------------------------------------------------------*/ 80 81 81 /** 82 82 * Checks if given collection path is already present in report structure and … … 124 124 } 125 125 126 /*---------------------------------------------------------------------------*/ 126 127 127 /** 128 128 * Initialize the report descriptor parser structure … … 147 147 } 148 148 149 /*---------------------------------------------------------------------------*/ 149 150 150 151 151 /** … … 314 314 return EOK; 315 315 } 316 /*---------------------------------------------------------------------------*/ 316 317 317 /** 318 318 * Finds description of report with given report_id and of given type in … … 348 348 return NULL; 349 349 } 350 /*---------------------------------------------------------------------------*/ 350 351 351 352 352 /** Parse HID report descriptor. … … 536 536 } 537 537 538 /*---------------------------------------------------------------------------*/ 538 539 539 540 540 /** … … 871 871 return EOK; 872 872 } 873 /*---------------------------------------------------------------------------*/ 873 874 874 875 875 /** … … 892 892 return result; 893 893 } 894 /*---------------------------------------------------------------------------*/ 894 895 895 896 896 /** … … 941 941 942 942 } 943 /*---------------------------------------------------------------------------*/ 943 944 944 945 945 /** … … 972 972 } 973 973 } 974 /*---------------------------------------------------------------------------*/ 974 975 975 976 976 … … 1022 1022 return; 1023 1023 } 1024 /*---------------------------------------------------------------------------*/ 1024 1025 1025 1026 1026 /** -
uspace/lib/usbhid/src/hidparser.c
r76fbd9a ra76b01b4 41 41 #include <assert.h> 42 42 43 /*---------------------------------------------------------------------------*/ 43 44 44 /* 45 45 * Data translation private functions … … 52 52 int32_t value); 53 53 54 /*---------------------------------------------------------------------------*/ 54 55 55 56 56 static int usb_pow(int a, int b) … … 68 68 } 69 69 } 70 /*---------------------------------------------------------------------------*/ 70 71 71 72 72 /** Returns size of report of specified report id and type in items … … 117 117 } 118 118 } 119 /*---------------------------------------------------------------------------*/ 119 120 120 121 121 /** Parse and act upon a HID report. … … 192 192 } 193 193 194 /*---------------------------------------------------------------------------*/ 194 195 195 /** 196 196 * Translate data from the report as specified in report descriptor item … … 274 274 } 275 275 276 /*---------------------------------------------------------------------------*/ 276 277 277 /* OUTPUT API */ 278 278 … … 431 431 } 432 432 433 /*---------------------------------------------------------------------------*/ 433 434 434 /** 435 435 * Translate given data for putting them into the outoput report … … 476 476 } 477 477 478 /*---------------------------------------------------------------------------*/ 478 479 479 /** 480 480 * Clones given state table … … 497 497 } 498 498 499 /*---------------------------------------------------------------------------*/ 499 500 500 /** 501 501 * Function for sequence walking through the report. Returns next field in the … … 552 552 } 553 553 554 /*---------------------------------------------------------------------------*/ 554 555 555 /** 556 556 * Returns next report_id of report of specified type. If zero is given than … … 600 600 } 601 601 602 /*---------------------------------------------------------------------------*/ 602 603 603 /** 604 604 * Reset all local items in given state table -
uspace/lib/usbhid/src/hidpath.c
r76fbd9a ra76b01b4 41 41 #include <assert.h> 42 42 43 /*---------------------------------------------------------------------------*/ 43 44 44 /** 45 45 * Compares two usages if they are same or not or one of the usages is not … … 63 63 ((page1 == page2) || (page1 == 0) || (page2 == 0)) 64 64 65 /*---------------------------------------------------------------------------*/ 65 66 66 /** 67 67 * Appends one item (couple of usage_path and usage) into the usage path … … 93 93 } 94 94 95 /*---------------------------------------------------------------------------*/ 95 96 96 /** 97 97 * Removes last item from the usage path structure … … 114 114 } 115 115 116 /*---------------------------------------------------------------------------*/ 116 117 117 /** 118 118 * Nulls last item of the usage path structure. … … 133 133 } 134 134 135 /*---------------------------------------------------------------------------*/ 135 136 136 /** 137 137 * Modifies last item of usage path structure by given usage page or usage … … 164 164 } 165 165 166 /*---------------------------------------------------------------------------*/ 166 167 167 /** 168 168 * … … 188 188 } 189 189 190 /*---------------------------------------------------------------------------*/ 190 191 191 /** 192 192 * Compares two usage paths structures … … 354 354 } 355 355 356 /*---------------------------------------------------------------------------*/ 356 357 357 /** 358 358 * Allocates and initializes new usage path structure. … … 376 376 } 377 377 378 /*---------------------------------------------------------------------------*/ 378 379 379 /** 380 380 * Releases given usage path structure. … … 395 395 } 396 396 397 /*---------------------------------------------------------------------------*/ 397 398 398 /** 399 399 * Clone content of given usage path to the new one … … 441 441 } 442 442 443 /*---------------------------------------------------------------------------*/ 443 444 444 /** 445 445 * Sets report id in usage path structure -
uspace/lib/usbhid/src/hidreport.c
r76fbd9a ra76b01b4 161 161 } 162 162 163 /*----------------------------------------------------------------------------*/ 163 164 164 165 165 int usb_hid_process_report_descriptor(usb_device_t *dev, -
uspace/lib/usbhid/src/hidreq.c
r76fbd9a ra76b01b4 45 45 #include <usb/hid/request.h> 46 46 47 /*----------------------------------------------------------------------------*/ 47 48 48 /** 49 49 * Send Set Report request to the HID device. … … 97 97 } 98 98 99 /*----------------------------------------------------------------------------*/ 99 100 100 /** 101 101 * Send Set Protocol request to the HID device. … … 145 145 } 146 146 147 /*----------------------------------------------------------------------------*/ 147 148 148 /** 149 149 * Send Set Idle request to the HID device. … … 195 195 } 196 196 197 /*----------------------------------------------------------------------------*/ 197 198 198 /** 199 199 * Send Get Report request to the HID device. … … 251 251 } 252 252 253 /*----------------------------------------------------------------------------*/ 253 254 254 /** 255 255 * Send Get Protocol request to the HID device. … … 310 310 } 311 311 312 /*----------------------------------------------------------------------------*/ 312 313 313 /** 314 314 * Send Get Idle request to the HID device. … … 373 373 } 374 374 375 /*----------------------------------------------------------------------------*/ 375 376 376 377 377 /**
Note:
See TracChangeset
for help on using the changeset viewer.