Changes in uspace/lib/usb/include/usb/classes/hid.h [1b29d6fa:0475e13] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/include/usb/classes/hid.h
r1b29d6fa r0475e13 27 27 */ 28 28 29 /** @addtogroup libusb usb29 /** @addtogroup libusb 30 30 * @{ 31 31 */ … … 37 37 38 38 #include <usb/usb.h> 39 #include <driver.h>40 39 #include <usb/classes/hidparser.h> 40 #include <usb/descriptor.h> 41 41 42 42 /** USB/HID device requests. */ … … 51 51 } usb_hid_request_t; 52 52 53 typedef enum { 54 USB_HID_REPORT_TYPE_INPUT = 1, 55 USB_HID_REPORT_TYPE_OUTPUT = 2, 56 USB_HID_REPORT_TYPE_FEATURE = 3 57 } usb_hid_report_type_t; 58 59 typedef enum { 60 USB_HID_PROTOCOL_BOOT = 0, 61 USB_HID_PROTOCOL_REPORT = 1 62 } usb_hid_protocol_t; 63 64 /** USB/HID subclass constants. */ 65 typedef enum { 66 USB_HID_SUBCLASS_NONE = 0, 67 USB_HID_SUBCLASS_BOOT = 1 68 } usb_hid_subclass_t; 69 53 70 /** USB/HID interface protocols. */ 54 71 typedef enum { … … 56 73 USB_HID_PROTOCOL_KEYBOARD = 1, 57 74 USB_HID_PROTOCOL_MOUSE = 2 58 } usb_hid_ protocol_t;75 } usb_hid_iface_protocol_t; 59 76 60 77 /** Part of standard USB HID descriptor specifying one class descriptor. … … 63 80 */ 64 81 typedef struct { 65 /** Type of class descriptor (Report or Physical). */66 uint8_t class_descriptor_type;67 /** Length of class descriptor. */68 uint16_t class_descriptor_length;69 } __attribute__ ((packed)) usb_standard_hid_ descriptor_class_item_t;82 /** Type of class-specific descriptor (Report or Physical). */ 83 uint8_t type; 84 /** Length of class-specific descriptor in bytes. */ 85 uint16_t length; 86 } __attribute__ ((packed)) usb_standard_hid_class_descriptor_info_t; 70 87 71 88 /** Standard USB HID descriptor. … … 73 90 * (See HID Specification, p.22) 74 91 * 75 * It is actually only the "header" of the descriptor, as it may have arbitrary 76 * length if more than one class descritor is provided. 92 * It is actually only the "header" of the descriptor, it does not contain 93 * the last two mandatory fields (type and length of the first class-specific 94 * descriptor). 77 95 */ 78 96 typedef struct { 79 /** Size of this descriptor in bytes. */ 97 /** Total size of this descriptor in bytes. 98 * 99 * This includes all class-specific descriptor info - type + length 100 * for each descriptor. 101 */ 80 102 uint8_t length; 81 103 /** Descriptor type (USB_DESCTYPE_HID). */ … … 85 107 /** Country code of localized hardware. */ 86 108 uint8_t country_code; 87 /** Total number of class (i.e. Report and Physical) descriptors. */ 88 uint8_t class_count; 89 /** First mandatory class descriptor info. */ 90 usb_standard_hid_descriptor_class_item_t class_descriptor; 109 /** Total number of class-specific (i.e. Report and Physical) 110 * descriptors. 111 * 112 * @note There is always only one Report descriptor. 113 */ 114 uint8_t class_desc_count; 115 /** First mandatory class descriptor (Report) info. */ 116 usb_standard_hid_class_descriptor_info_t report_desc_info; 91 117 } __attribute__ ((packed)) usb_standard_hid_descriptor_t; 92 118 93 94 /**95 * @brief USB/HID keyboard device type.96 *97 * Quite dummy right now.98 */99 typedef struct {100 device_t *device;101 usb_address_t address;102 usb_endpoint_t poll_endpoint;103 usb_hid_report_parser_t *parser;104 } usb_hid_dev_kbd_t;105 119 106 120 #endif
Note:
See TracChangeset
for help on using the changeset viewer.