00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00035 #ifndef LIBUSB_DESCRIPTOR_H_
00036 #define LIBUSB_DESCRIPTOR_H_
00037
00038 #include <async.h>
00039
00041 typedef enum {
00042 USB_DESCTYPE_DEVICE = 1,
00043 USB_DESCTYPE_CONFIGURATION = 2,
00044 USB_DESCTYPE_STRING = 3,
00045 USB_DESCTYPE_INTERFACE = 4,
00046 USB_DESCTYPE_ENDPOINT = 5,
00047 USB_DESCTYPE_HID = 0x21,
00048 USB_DESCTYPE_HID_REPORT = 0x22,
00049 USB_DESCTYPE_HID_PHYSICAL = 0x23,
00050 USB_DESCTYPE_HUB = 0x29,
00051
00052 } usb_descriptor_type_t;
00053
00056 typedef struct {
00058 uint8_t length;
00060 uint8_t descriptor_type;
00064 uint16_t usb_spec_version;
00066 uint8_t device_class;
00068 uint8_t device_subclass;
00070 uint8_t device_protocol;
00074 uint8_t max_packet_size;
00076 uint16_t vendor_id;
00078 uint16_t product_id;
00080 uint16_t device_version;
00082 uint8_t str_manufacturer;
00084 uint8_t str_product;
00086 uint8_t str_serial_number;
00088 uint8_t configuration_count;
00089 } __attribute__ ((packed)) usb_standard_device_descriptor_t;
00090
00093 typedef struct {
00095 uint8_t length;
00097 uint8_t descriptor_type;
00103 uint16_t total_length;
00105 uint8_t interface_count;
00107 uint8_t configuration_number;
00109 uint8_t str_configuration;
00111 uint8_t attributes;
00115 uint8_t max_power;
00116 } __attribute__ ((packed)) usb_standard_configuration_descriptor_t;
00117
00120 typedef struct {
00122 uint8_t length;
00124 uint8_t descriptor_type;
00128 uint8_t interface_number;
00130 uint8_t alternate_setting;
00135 uint8_t endpoint_count;
00137 uint8_t interface_class;
00139 uint8_t interface_subclass;
00141 uint8_t interface_protocol;
00143 uint8_t str_interface;
00144 } __attribute__ ((packed)) usb_standard_interface_descriptor_t;
00145
00148 typedef struct {
00150 uint8_t length;
00152 uint8_t descriptor_type;
00154 uint8_t endpoint_address;
00158 uint8_t attributes;
00160 uint16_t max_packet_size;
00166 uint8_t poll_interval;
00167 } __attribute__ ((packed)) usb_standard_endpoint_descriptor_t;
00168
00173 typedef struct {
00175 uint8_t type;
00177 uint16_t length;
00178 } __attribute__ ((packed)) usb_standard_hid_class_descriptor_info_t;
00179
00188 typedef struct {
00194 uint8_t length;
00196 uint8_t descriptor_type;
00198 uint16_t spec_release;
00200 uint8_t country_code;
00206 uint8_t class_desc_count;
00208 usb_standard_hid_class_descriptor_info_t report_desc_info;
00209 } __attribute__ ((packed)) usb_standard_hid_descriptor_t;
00210
00211 #endif
00212