tinyusb  0.4
Click here to lend your support to tinyusb donation and make a donation at pledgie.com
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
std_descriptors.h
Go to the documentation of this file.
1 /**************************************************************************/
37 /**************************************************************************/
38 
40 
45 #ifndef _TUSB_STD_DESCRIPTORS_H_
46 #define _TUSB_STD_DESCRIPTORS_H_
47 
48 #ifdef __cplusplus
49  extern "C" {
50 #endif
51 
52 //--------------------------------------------------------------------+
53 // STANDARD DESCRIPTORS
54 //--------------------------------------------------------------------+
56 typedef ATTR_PACKED_STRUCT(struct) {
57  uint8_t bLength ;
58  uint8_t bDescriptorType ;
59  uint16_t bcdUSB ;
60 
61  uint8_t bDeviceClass ;
62  uint8_t bDeviceSubClass ;
63  uint8_t bDeviceProtocol ;
64  uint8_t bMaxPacketSize0 ;
65 
66  uint16_t idVendor ;
67  uint16_t idProduct ;
68  uint16_t bcdDevice ;
69  uint8_t iManufacturer ;
70  uint8_t iProduct ;
71  uint8_t iSerialNumber ;
72 
73  uint8_t bNumConfigurations ;
75 
77 typedef ATTR_PACKED_STRUCT(struct) {
78  uint8_t bLength ;
79  uint8_t bDescriptorType ;
80  uint16_t wTotalLength ;
81 
82  uint8_t bNumInterfaces ;
84  uint8_t iConfiguration ;
85  uint8_t bmAttributes ;
86  uint8_t bMaxPower ;
88 
90 typedef ATTR_PACKED_STRUCT(struct) {
91  uint8_t bLength ;
92  uint8_t bDescriptorType ;
93 
94  uint8_t bInterfaceNumber ;
95  uint8_t bAlternateSetting ;
96  uint8_t bNumEndpoints ;
97  uint8_t bInterfaceClass ;
98  uint8_t bInterfaceSubClass ;
99  uint8_t bInterfaceProtocol ;
100  uint8_t iInterface ;
102 
104 typedef ATTR_PACKED_STRUCT(struct) {
105  uint8_t bLength ;
106  uint8_t bDescriptorType ;
107 
108  uint8_t bEndpointAddress ;
109 
110  ATTR_PACKED_STRUCT(struct) {
111  uint8_t xfer : 2;
112  uint8_t sync : 2;
113  uint8_t usage : 2;
114  uint8_t : 2;
115  } bmAttributes ;
116 
117  ATTR_PACKED_STRUCT(struct) {
118  uint16_t size : 11;
119  uint16_t hs_period_mult : 2;
120  uint16_t : 0;
121  }wMaxPacketSize;
122 
123  uint8_t bInterval ;
125 
127 typedef ATTR_PACKED_STRUCT(struct) {
128  uint8_t bLength ;
129  uint8_t bDescriptorType ;
130  uint16_t wTotalLength ;
131 
132  uint8_t bNumInterfaces ;
134  uint8_t IConfiguration ;
135  uint8_t bmAttributes ;
136  uint8_t bMaxPower ;
138 
140 typedef ATTR_PACKED_STRUCT(struct) {
141  uint8_t bLength ;
142  uint8_t bDescriptorType ;
143  uint16_t bcdUSB ;
144 
145  uint8_t bDeviceClass ;
146  uint8_t bDeviceSubClass ;
147  uint8_t bDeviceProtocol ;
148  uint8_t bMaxPacketSize0 ;
150  uint8_t bReserved ;
152 
154 typedef ATTR_PACKED_STRUCT(struct)
155 {
156  uint8_t bLength ;
157  uint8_t bDescriptorType ;
158 
159  uint8_t bFirstInterface ;
160  uint8_t bInterfaceCount ;
161 
162  uint8_t bFunctionClass ;
163  uint8_t bFunctionSubClass ;
164  uint8_t bFunctionProtocol ;
165 
166  uint8_t iFunction ;
168 
170 typedef ATTR_PACKED_STRUCT(struct)
171 {
172  uint8_t bLength ;
173  uint8_t bDescriptorType ;
175 
176 typedef ATTR_PACKED_STRUCT(struct)
177 {
178  uint8_t bLength ;
179  uint8_t bDescriptorType ;
180  uint16_t unicode_string[];
182 
183 #ifdef __cplusplus
184  }
185 #endif
186 
187 #endif /* _TUSB_STD_DESCRIPTORS_H_ */
188 
uint8_t bDescriptorType
Descriptor Type.
uint8_t bLength
Size of this descriptor in bytes.
uint8_t bFunctionClass
Interface class ID.
uint8_t bDescriptorType
INTERFACE Descriptor Type.
uint8_t bDeviceSubClass
Subclass code (assigned by the USB-IF). These codes are qualified by the value of the bDeviceClass fi...
uint8_t bConfigurationValue
Value to use to select configuration.
uint8_t bNumEndpoints
Number of endpoints used by this interface (excluding endpoint zero). If this value is zero...
USB Standard Interface Descriptor (section 9.6.1 table 9-12)
uint8_t bMaxPacketSize0
Maximum packet size for other speed.
uint8_t bInterfaceCount
Total number of associated interfaces.
uint8_t bNumInterfaces
Number of interfaces supported by this configuration.
USB Other Speed Configuration Descriptor (section 9.6.1 table 9-11)
uint8_t bInterfaceProtocol
Protocol code (assigned by the USB). These codes are qualified by the value of the bInterfaceClass ...
uint16_t idProduct
Product ID (assigned by the manufacturer).
uint8_t bDescriptorType
Other_speed_Configuration Type.
uint8_t bReserved
Reserved for future use, must be zero.
uint8_t bNumConfigurations
Number of Other-speed Configurations.
uint8_t iInterface
Index of string descriptor describing this interface.
uint16_t wTotalLength
Total length of data returned.
uint8_t bDeviceProtocol
Protocol code (assigned by the USB-IF). These codes are qualified by the value of the bDeviceClass an...
uint8_t bmAttributes
Configuration characteristics D7: Reserved (set to one) D6: Self-powered D5: Remote Wakeup D4...
uint8_t bLength
Size of this descriptor in bytes.
uint8_t bFirstInterface
Index of the first associated interface.
uint8_t bFunctionProtocol
Interface protocol ID.
uint8_t bLength
Size of descriptor.
uint8_t bMaxPacketSize0
Maximum packet size for endpoint zero (only 8, 16, 32, or 64 are valid). For HS devices is fixed to 6...
uint8_t iConfiguration
Index of string descriptor describing this configuration.
uint8_t bNumInterfaces
Number of interfaces supported by this speed configuration.
uint8_t iFunction
Index of the string descriptor describing the interface association.
uint8_t bLength
Size of this descriptor in bytes.
uint8_t bDeviceSubClass
SubClass Code.
uint16_t bcdUSB
USB specification version number (e.g., 0200H for V2.00)
USB Header Descriptor.
uint8_t bLength
Size of this descriptor in bytes.
uint16_t idVendor
Vendor ID (assigned by the USB-IF).
uint16_t bcdDevice
Device release number in binary-coded decimal.
uint8_t bDescriptorType
Other_speed_Configuration Type.
USB Standard Configuration Descriptor (section 9.6.1 table 9-10) */.
uint8_t bDescriptorType
ENDPOINT Descriptor Type.
uint8_t bInterfaceSubClass
Subclass code (assigned by the USB-IF). These codes are qualified by the value of the bInterfaceCla...
uint16_t wTotalLength
Total length of data returned for this configuration. Includes the combined length of all descriptors...
USB Standard Endpoint Descriptor (section 9.6.1 table 9-13)
uint8_t iManufacturer
Index of string descriptor describing manufacturer.
uint8_t bDescriptorType
DEVICE Descriptor Type.
uint8_t bMaxPower
Same as Configuration descriptor.
USB Interface Association Descriptor (IAD ECN)
uint8_t bMaxPower
Maximum power consumption of the USB device from the bus in this specific configuration when the devi...
uint8_t bInterfaceNumber
Number of this interface. Zero-based value identifying the index in the array of concurrent interface...
uint8_t bConfigurationValue
Value to use as an argument to the SetConfiguration() request to select this configuration.
uint8_t bLength
Size of this descriptor in bytes.
uint8_t bDescriptorType
CONFIGURATION Descriptor Type.
uint8_t bAlternateSetting
Value used to select this alternate setting for the interface identified in the prior field...
uint8_t bmAttributes
Same as Configuration descriptor.
uint8_t IConfiguration
Index of string descriptor.
uint8_t bFunctionSubClass
Interface subclass ID.
uint8_t bInterval
Interval for polling endpoint for data transfers. Expressed in frames or microframes depending on the...
uint16_t bcdUSB
BUSB Specification Release Number in Binary-Coded Decimal (i.e., 2.10 is 210H). This field identifies...
uint8_t iSerialNumber
Index of string descriptor describing the device's serial number.
uint8_t bDescriptorType
Descriptor Type.
uint8_t bLength
Size of descriptor.
uint8_t bNumConfigurations
Number of possible configurations.
uint8_t bLength
Size of descriptor.
uint8_t bLength
Size of this descriptor in bytes.
uint8_t bDeviceClass
Class code (assigned by the USB-IF).
uint8_t bInterfaceClass
Class code (assigned by the USB-IF).
USB Device Qualifier Descriptor (section 9.6.1 table 9-9)
uint8_t bDescriptorType
Device Qualifier Type.
USB Standard Device Descriptor (section 9.6.1, table 9-8)
uint8_t bDeviceProtocol
Protocol Code.
uint8_t bEndpointAddress
The address of the endpoint on the USB device described by this descriptor. The address is encoded as...
uint8_t iProduct
Index of string descriptor describing product.