3 Copyright (C) Dean Camera, 2010.
5 dean [at] fourwalledcubicle [dot] com
6 www.fourwalledcubicle.com
10 Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
21 The author disclaim all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
31 /** \ingroup Group_USB
32 * @defgroup Group_Descriptors USB Descriptors
34 * Standard USB device descriptor defines and retrieval routines, for USB devices. This module contains
35 * structures and macros for the easy creation of standard USB descriptors in USB device projects.
40 #ifndef __USBDESCRIPTORS_H__
41 #define __USBDESCRIPTORS_H__
44 #if defined(__AVR32__)
49 #elif defined(__AVR__)
50 #include <avr/pgmspace.h>
55 #include "../../../Common/Common.h"
59 #if defined(USB_CAN_BE_DEVICE)
60 #include "../LowLevel/Device.h"
63 /* Enable C linkage for C++ Compilers: */
64 #if defined(__cplusplus)
68 /* Preprocessor Checks: */
69 #if !defined(__INCLUDE_FROM_USB_DRIVER)
70 #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
73 /* Public Interface - May be used in end-application: */
75 /** Indicates that a given descriptor does not exist in the device. This can be used inside descriptors
76 * for string descriptor indexes, or may be use as a return value for GetDescriptor when the specified
77 * descriptor does not exist.
79 #define NO_DESCRIPTOR 0
81 #if (!defined(NO_INTERNAL_SERIAL) && (defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR))) || defined(__DOXYGEN__)
82 /** String descriptor index for the device's unique serial number string descriptor within the device.
83 * This unique serial number is used by the host to associate resources to the device (such as drivers or COM port
84 * number allocations) to a device regardless of the port it is plugged in to on the host. Some USB AVRs contain
85 * a unique serial number internally, and setting the device descriptors serial number string index to this value
86 * will cause it to use the internal serial number.
88 * On unsupported devices, this will evaluate to NO_DESCRIPTOR and so will force the host to create a pseudo-serial
89 * number for the device.
91 #define USE_INTERNAL_SERIAL 0xDC
93 #define USE_INTERNAL_SERIAL NO_DESCRIPTOR
96 /** Macro to calculate the power value for the device descriptor, from a given number of milliamps. */
97 #define USB_CONFIG_POWER_MA(mA) ((mA) >> 1)
99 /** Macro to calculate the Unicode length of a string with a given number of Unicode characters.
100 * Should be used in string descriptor's headers for giving the string descriptor's byte length.
102 #define USB_STRING_LEN(str) (sizeof(USB_Descriptor_Header_t) + ((str) << 1))
104 /** Macro to encode a given four digit floating point version number (e.g. 01.23) into Binary Coded
105 * Decimal format for descriptor fields requiring BCD encoding, such as the USB version number in the
106 * standard device descriptor.
108 #define VERSION_BCD(x) ((((VERSION_TENS(x) << 4) | VERSION_ONES(x)) << 8) | \
109 ((VERSION_TENTHS(x) << 4) | VERSION_HUNDREDTHS(x)))
111 /** String language ID for the English language. Should be used in \ref USB_Descriptor_String_t descriptors
112 * to indicate that the English language is supported by the device in its string descriptors.
114 #define LANGUAGE_ID_ENG 0x0409
116 /** Can be masked with an endpoint address for a \ref USB_Descriptor_Endpoint_t endpoint descriptor's
117 * EndpointAddress value to indicate to the host that the endpoint is of the IN direction (i.e, from
120 #define ENDPOINT_DESCRIPTOR_DIR_IN 0x80
122 /** Can be masked with an endpoint address for a \ref USB_Descriptor_Endpoint_t endpoint descriptor's
123 * EndpointAddress value to indicate to the host that the endpoint is of the OUT direction (i.e, from
126 #define ENDPOINT_DESCRIPTOR_DIR_OUT 0x00
128 /** Can be masked with other configuration descriptor attributes for a \ref USB_Descriptor_Configuration_Header_t
129 * descriptor's ConfigAttributes value to indicate that the specified configuration can draw its power
130 * from the host's VBUS line.
132 #define USB_CONFIG_ATTR_BUSPOWERED 0x80
135 /** Can be masked with other configuration descriptor attributes for a \ref USB_Descriptor_Configuration_Header_t
136 * descriptor's ConfigAttributes value to indicate that the specified configuration can draw its power
137 * from the device's own power source.
139 #define USB_CONFIG_ATTR_SELFPOWERED 0x40
141 /** Can be masked with other configuration descriptor attributes for a \ref USB_Descriptor_Configuration_Header_t
142 * descriptor's ConfigAttributes value to indicate that the specified configuration supports the
143 * remote wakeup feature of the USB standard, allowing a suspended USB device to wake up the host upon
146 #define USB_CONFIG_ATTR_REMOTEWAKEUP 0x20
148 /** Can be masked with other endpoint descriptor attributes for a \ref USB_Descriptor_Endpoint_t descriptor's
149 * Attributes value to indicate that the specified endpoint is not synchronized.
151 * \see The USB specification for more details on the possible Endpoint attributes.
153 #define ENDPOINT_ATTR_NO_SYNC (0 << 2)
155 /** Can be masked with other endpoint descriptor attributes for a \ref USB_Descriptor_Endpoint_t descriptor's
156 * Attributes value to indicate that the specified endpoint is asynchronous.
158 * \see The USB specification for more details on the possible Endpoint attributes.
160 #define ENDPOINT_ATTR_ASYNC (1 << 2)
162 /** Can be masked with other endpoint descriptor attributes for a \ref USB_Descriptor_Endpoint_t descriptor's
163 * Attributes value to indicate that the specified endpoint is adaptive.
165 * \see The USB specification for more details on the possible Endpoint attributes.
167 #define ENDPOINT_ATTR_ADAPTIVE (2 << 2)
169 /** Can be masked with other endpoint descriptor attributes for a \ref USB_Descriptor_Endpoint_t descriptor's
170 * Attributes value to indicate that the specified endpoint is synchronized.
172 * \see The USB specification for more details on the possible Endpoint attributes.
174 #define ENDPOINT_ATTR_SYNC (3 << 2)
176 /** Can be masked with other endpoint descriptor attributes for a \ref USB_Descriptor_Endpoint_t descriptor's
177 * Attributes value to indicate that the specified endpoint is used for data transfers.
179 * \see The USB specification for more details on the possible Endpoint usage attributes.
181 #define ENDPOINT_USAGE_DATA (0 << 4)
183 /** Can be masked with other endpoint descriptor attributes for a \ref USB_Descriptor_Endpoint_t descriptor's
184 * Attributes value to indicate that the specified endpoint is used for feedback.
186 * \see The USB specification for more details on the possible Endpoint usage attributes.
188 #define ENDPOINT_USAGE_FEEDBACK (1 << 4)
190 /** Can be masked with other endpoint descriptor attributes for a \ref USB_Descriptor_Endpoint_t descriptor's
191 * Attributes value to indicate that the specified endpoint is used for implicit feedback.
193 * \see The USB specification for more details on the possible Endpoint usage attributes.
195 #define ENDPOINT_USAGE_IMPLICIT_FEEDBACK (2 << 4)
198 /** Enum for the possible standard descriptor types, as given in each descriptor's header. */
199 enum USB_DescriptorTypes_t
201 DTYPE_Device
= 0x01, /**< Indicates that the descriptor is a device descriptor. */
202 DTYPE_Configuration
= 0x02, /**< Indicates that the descriptor is a configuration descriptor. */
203 DTYPE_String
= 0x03, /**< Indicates that the descriptor is a string descriptor. */
204 DTYPE_Interface
= 0x04, /**< Indicates that the descriptor is an interface descriptor. */
205 DTYPE_Endpoint
= 0x05, /**< Indicates that the descriptor is an endpoint descriptor. */
206 DTYPE_DeviceQualifier
= 0x06, /**< Indicates that the descriptor is a device qualifier descriptor. */
207 DTYPE_Other
= 0x07, /**< Indicates that the descriptor is of other type. */
208 DTYPE_InterfacePower
= 0x08, /**< Indicates that the descriptor is an interface power descriptor. */
209 DTYPE_InterfaceAssociation
= 0x0B, /**< Indicates that the descriptor is an interface association descriptor. */
213 /** Type define for all descriptors standard header, indicating the descriptor's length and type. This structure
214 * uses LUFA-specific element names to make each element's purpose clearer.
216 * \see \ref USB_StdDescriptor_Header_t for the version of this define with standard element names
220 uint8_t Size
; /**< Size of the descriptor, in bytes. */
221 uint8_t Type
; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
222 * given by the specific class.
224 } USB_Descriptor_Header_t
;
226 /** Type define for all descriptors standard header, indicating the descriptor's length and type. This structure
227 * uses the relevant standard's given element names to ensure compatibility with the standard.
229 * \see \ref USB_Descriptor_Header_t for the version of this define with non-standard LUFA specific element names
233 uint8_t bLength
; /**< Size of the descriptor, in bytes. */
234 uint8_t bDescriptorType
; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
235 * given by the specific class.
237 } USB_StdDescriptor_Header_t
;
239 /** Type define for a standard Device Descriptor. This structure uses LUFA-specific element names to make each
240 * element's purpose clearer.
242 * \see \ref USB_StdDescriptor_Device_t for the version of this define with standard element names
246 USB_Descriptor_Header_t Header
; /**< Descriptor header, including type and size. */
248 uint16_t USBSpecification
; /**< BCD of the supported USB specification. */
249 uint8_t Class
; /**< USB device class. */
250 uint8_t SubClass
; /**< USB device subclass. */
251 uint8_t Protocol
; /**< USB device protocol. */
253 uint8_t Endpoint0Size
; /**< Size of the control (address 0) endpoint's bank in bytes. */
255 uint16_t VendorID
; /**< Vendor ID for the USB product. */
256 uint16_t ProductID
; /**< Unique product ID for the USB product. */
257 uint16_t ReleaseNumber
; /**< Product release (version) number. */
259 uint8_t ManufacturerStrIndex
; /**< String index for the manufacturer's name. The
260 * host will request this string via a separate
261 * control request for the string descriptor.
263 * \note If no string supplied, use \ref NO_DESCRIPTOR.
265 uint8_t ProductStrIndex
; /**< String index for the product name/details.
267 * \see ManufacturerStrIndex structure entry.
269 uint8_t SerialNumStrIndex
; /**< String index for the product's globally unique hexadecimal
270 * serial number, in uppercase Unicode ASCII.
272 * \note On some AVR models, there is an embedded serial number
273 * in the chip which can be used for the device serial number.
274 * To use this serial number, set this to USE_INTERNAL_SERIAL.
275 * On unsupported devices, this will evaluate to 0 and will cause
276 * the host to generate a pseudo-unique value for the device upon
279 * \see ManufacturerStrIndex structure entry.
281 uint8_t NumberOfConfigurations
; /**< Total number of configurations supported by
284 } USB_Descriptor_Device_t
;
286 /** Type define for a standard Device Descriptor. This structure uses the relevant standard's given element names
287 * to ensure compatibility with the standard.
289 * \see \ref USB_Descriptor_Device_t for the version of this define with non-standard LUFA specific element names
293 uint8_t bLength
; /**< Size of the descriptor, in bytes. */
294 uint8_t bDescriptorType
; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
295 * given by the specific class.
297 uint16_t bcdUSB
; /**< BCD of the supported USB specification. */
298 uint8_t bDeviceClass
; /**< USB device class. */
299 uint8_t bDeviceSubClass
; /**< USB device subclass. */
300 uint8_t bDeviceProtocol
; /**< USB device protocol. */
301 uint8_t bMaxPacketSize0
; /**< Size of the control (address 0) endpoint's bank in bytes. */
302 uint16_t idVendor
; /**< Vendor ID for the USB product. */
303 uint16_t idProduct
; /**< Unique product ID for the USB product. */
304 uint16_t bcdDevice
; /**< Product release (version) number. */
305 uint8_t iManufacturer
; /**< String index for the manufacturer's name. The
306 * host will request this string via a separate
307 * control request for the string descriptor.
309 * \note If no string supplied, use \ref NO_DESCRIPTOR.
311 uint8_t iProduct
; /**< String index for the product name/details.
313 * \see ManufacturerStrIndex structure entry.
315 uint8_t iSerialNumber
; /**< String index for the product's globally unique hexadecimal
316 * serial number, in uppercase Unicode ASCII.
318 * \note On some AVR models, there is an embedded serial number
319 * in the chip which can be used for the device serial number.
320 * To use this serial number, set this to USE_INTERNAL_SERIAL.
321 * On unsupported devices, this will evaluate to 0 and will cause
322 * the host to generate a pseudo-unique value for the device upon
325 * \see ManufacturerStrIndex structure entry.
327 uint8_t bNumConfigurations
; /**< Total number of configurations supported by
330 } USB_StdDescriptor_Device_t
;
332 /** Type define for a standard Configuration Descriptor header. This structure uses LUFA-specific element names
333 * to make each element's purpose clearer.
335 * \see \ref USB_StdDescriptor_Configuration_Header_t for the version of this define with standard element names
339 USB_Descriptor_Header_t Header
; /**< Descriptor header, including type and size. */
341 uint16_t TotalConfigurationSize
; /**< Size of the configuration descriptor header,
342 * and all sub descriptors inside the configuration.
344 uint8_t TotalInterfaces
; /**< Total number of interfaces in the configuration. */
346 uint8_t ConfigurationNumber
; /**< Configuration index of the current configuration. */
347 uint8_t ConfigurationStrIndex
; /**< Index of a string descriptor describing the configuration. */
349 uint8_t ConfigAttributes
; /**< Configuration attributes, comprised of a mask of zero or
350 * more USB_CONFIG_ATTR_* masks.
353 uint8_t MaxPowerConsumption
; /**< Maximum power consumption of the device while in the
354 * current configuration, calculated by the \ref USB_CONFIG_POWER_MA()
357 } USB_Descriptor_Configuration_Header_t
;
359 /** Type define for a standard Configuration Descriptor header. This structure uses the relevant standard's given element names
360 * to ensure compatibility with the standard.
362 * \see \ref USB_Descriptor_Device_t for the version of this define with non-standard LUFA specific element names
366 uint8_t bLength
; /**< Size of the descriptor, in bytes. */
367 uint8_t bDescriptorType
; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
368 * given by the specific class.
370 uint16_t wTotalLength
; /**< Size of the configuration descriptor header,
371 * and all sub descriptors inside the configuration.
373 uint8_t bNumInterfaces
; /**< Total number of interfaces in the configuration. */
374 uint8_t bConfigurationValue
; /**< Configuration index of the current configuration. */
375 uint8_t iConfiguration
; /**< Index of a string descriptor describing the configuration. */
376 uint8_t bmAttributes
; /**< Configuration attributes, comprised of a mask of zero or
377 * more USB_CONFIG_ATTR_* masks.
379 uint8_t bMaxPower
; /**< Maximum power consumption of the device while in the
380 * current configuration, calculated by the \ref USB_CONFIG_POWER_MA()
383 } USB_StdDescriptor_Configuration_Header_t
;
385 /** Type define for a standard Interface Descriptor. This structure uses LUFA-specific element names
386 * to make each element's purpose clearer.
388 * \see \ref USB_StdDescriptor_Interface_t for the version of this define with standard element names
392 USB_Descriptor_Header_t Header
; /**< Descriptor header, including type and size. */
394 uint8_t InterfaceNumber
; /**< Index of the interface in the current configuration. */
395 uint8_t AlternateSetting
; /**< Alternate setting for the interface number. The same
396 * interface number can have multiple alternate settings
397 * with different endpoint configurations, which can be
398 * selected by the host.
400 uint8_t TotalEndpoints
; /**< Total number of endpoints in the interface. */
402 uint8_t Class
; /**< Interface class ID. */
403 uint8_t SubClass
; /**< Interface subclass ID. */
404 uint8_t Protocol
; /**< Interface protocol ID. */
406 uint8_t InterfaceStrIndex
; /**< Index of the string descriptor describing the
409 } USB_Descriptor_Interface_t
;
411 /** Type define for a standard Interface Descriptor. This structure uses the relevant standard's given element names
412 * to ensure compatibility with the standard.
414 * \see \ref USB_Descriptor_Interface_t for the version of this define with non-standard LUFA specific element names
418 uint8_t bLength
; /**< Size of the descriptor, in bytes. */
419 uint8_t bDescriptorType
; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
420 * given by the specific class.
422 uint8_t bInterfaceNumber
; /**< Index of the interface in the current configuration. */
423 uint8_t bAlternateSetting
; /**< Alternate setting for the interface number. The same
424 * interface number can have multiple alternate settings
425 * with different endpoint configurations, which can be
426 * selected by the host.
428 uint8_t bNumEndpoints
; /**< Total number of endpoints in the interface. */
429 uint8_t bInterfaceClass
; /**< Interface class ID. */
430 uint8_t bInterfaceSubClass
; /**< Interface subclass ID. */
431 uint8_t bInterfaceProtocol
; /**< Interface protocol ID. */
432 uint8_t iInterface
; /**< Index of the string descriptor describing the
435 } USB_StdDescriptor_Interface_t
;
437 /** Type define for a standard Interface Association Descriptor. This structure uses LUFA-specific element names
438 * to make each element's purpose clearer.
440 * This descriptor has been added as a supplement to the USB2.0 standard, in the ECN located at
441 * <a>http://www.usb.org/developers/docs/InterfaceAssociationDescriptor_ecn.pdf</a>. It allows compound
442 * devices with multiple interfaces related to the same function to have the multiple interfaces bound
443 * together at the point of enumeration, loading one generic driver for all the interfaces in the single
444 * function. Read the ECN for more information.
446 * \see \ref USB_StdDescriptor_Interface_Association_t for the version of this define with standard element names
450 USB_Descriptor_Header_t Header
; /**< Descriptor header, including type and size. */
452 uint8_t FirstInterfaceIndex
; /**< Index of the first associated interface. */
453 uint8_t TotalInterfaces
; /** Total number of associated interfaces. */
455 uint8_t Class
; /**< Interface class ID. */
456 uint8_t SubClass
; /**< Interface subclass ID. */
457 uint8_t Protocol
; /**< Interface protocol ID. */
459 uint8_t IADStrIndex
; /**< Index of the string descriptor describing the
460 * interface association.
462 } USB_Descriptor_Interface_Association_t
;
464 /** Type define for a standard Interface Association Descriptor. This structure uses the relevant standard's given
465 * element names to ensure compatibility with the standard.
467 * This descriptor has been added as a supplement to the USB2.0 standard, in the ECN located at
468 * <a>http://www.usb.org/developers/docs/InterfaceAssociationDescriptor_ecn.pdf</a>. It allows compound
469 * devices with multiple interfaces related to the same function to have the multiple interfaces bound
470 * together at the point of enumeration, loading one generic driver for all the interfaces in the single
471 * function. Read the ECN for more information.
473 * \see \ref USB_Descriptor_Interface_Association_t for the version of this define with non-standard LUFA specific
478 uint8_t bLength
; /**< Size of the descriptor, in bytes. */
479 uint8_t bDescriptorType
; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
480 * given by the specific class.
482 uint8_t bFirstInterface
; /**< Index of the first associated interface. */
483 uint8_t bInterfaceCount
; /** Total number of associated interfaces. */
484 uint8_t bFunctionClass
; /**< Interface class ID. */
485 uint8_t bFunctionSubClass
; /**< Interface subclass ID. */
486 uint8_t bFunctionProtocol
; /**< Interface protocol ID. */
487 uint8_t iFunction
; /**< Index of the string descriptor describing the
488 * interface association.
490 } USB_StdDescriptor_Interface_Association_t
;
492 /** Type define for a standard Endpoint Descriptor. This structure uses LUFA-specific element names
493 * to make each element's purpose clearer.
495 * \see \ref USB_StdDescriptor_Endpoint_t for the version of this define with standard element names
499 USB_Descriptor_Header_t Header
; /**< Descriptor header, including type and size. */
501 uint8_t EndpointAddress
; /**< Logical address of the endpoint within the device
502 * for the current configuration, including direction
505 uint8_t Attributes
; /**< Endpoint attributes, comprised of a mask of the
506 * endpoint type (EP_TYPE_*) and attributes (ENDPOINT_ATTR_*)
509 uint16_t EndpointSize
; /**< Size of the endpoint bank, in bytes. This indicates the
510 * maximum packet size that the endpoint can receive at a time.
513 uint8_t PollingIntervalMS
; /**< Polling interval in milliseconds for the endpoint
514 * if it is an INTERRUPT or ISOCHRONOUS type.
516 } USB_Descriptor_Endpoint_t
;
518 /** Type define for a standard Endpoint Descriptor. This structure uses the relevant standard's given
519 * element names to ensure compatibility with the standard.
521 * \see \ref USB_Descriptor_Endpoint_t for the version of this define with non-standard LUFA specific
526 uint8_t bLength
; /**< Size of the descriptor, in bytes. */
527 uint8_t bDescriptorType
; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
528 * given by the specific class.
530 uint8_t bEndpointAddress
; /**< Logical address of the endpoint within the device
531 * for the current configuration, including direction
534 uint8_t bmAttributes
; /**< Endpoint attributes, comprised of a mask of the
535 * endpoint type (EP_TYPE_*) and attributes (ENDPOINT_ATTR_*)
538 uint16_t wMaxPacketSize
; /**< Size of the endpoint bank, in bytes. This indicates the
539 * maximum packet size that the endpoint can receive at a time.
541 uint8_t bInterval
; /**< Polling interval in milliseconds for the endpoint
542 * if it is an INTERRUPT or ISOCHRONOUS type.
544 } USB_StdDescriptor_Endpoint_t
;
546 /** Type define for a standard string descriptor. Unlike other standard descriptors, the length
547 * of the descriptor for placement in the descriptor header must be determined by the \ref USB_STRING_LEN()
548 * macro rather than by the size of the descriptor structure, as the length is not fixed.
550 * This structure should also be used for string index 0, which contains the supported language IDs for
551 * the device as an array.
553 * This structure uses LUFA-specific element names to make each element's purpose clearer.
555 * \see \ref USB_StdDescriptor_String_t for the version of this define with standard element names
559 USB_Descriptor_Header_t Header
; /**< Descriptor header, including type and size. */
561 wchar_t UnicodeString
[]; /**< String data, as unicode characters (alternatively,
562 * string language IDs). If normal ASCII characters are
563 * to be used, they must be added as an array of characters
564 * rather than a normal C string so that they are widened to
567 * Under GCC, strings prefixed with the "L" character (before
568 * the opening string quotation mark) are considered to be
569 * Unicode strings, and may be used instead of an explicit
570 * array of ASCII characters.
572 } USB_Descriptor_String_t
;
574 /** Type define for a standard string descriptor. Unlike other standard descriptors, the length
575 * of the descriptor for placement in the descriptor header must be determined by the \ref USB_STRING_LEN()
576 * macro rather than by the size of the descriptor structure, as the length is not fixed.
578 * This structure should also be used for string index 0, which contains the supported language IDs for
579 * the device as an array.
581 * This structure uses the relevant standard's given element names to ensure compatibility with the standard.
583 * \see \ref USB_Descriptor_String_t for the version of this define with with non-standard LUFA specific
588 uint8_t bLength
; /**< Size of the descriptor, in bytes. */
589 uint8_t bDescriptorType
; /**< Type of the descriptor, either a value in
590 * \ref USB_DescriptorTypes_t or a value
591 * given by the specific class.
593 int16_t bString
[]; /**< String data, as unicode characters (alternatively,
594 * string language IDs). If normal ASCII characters are
595 * to be used, they must be added as an array of characters
596 * rather than a normal C string so that they are widened to
599 * Under GCC, strings prefixed with the "L" character (before
600 * the opening string quotation mark) are considered to be
601 * Unicode strings, and may be used instead of an explicit
602 * array of ASCII characters.
604 } USB_StdDescriptor_String_t
;
606 /* Private Interface - For use in library only: */
607 #if !defined(__DOXYGEN__)
609 #define VERSION_TENS(x) (int)((x) / 10)
610 #define VERSION_ONES(x) (int)((x) - (10 * VERSION_TENS(x)))
611 #define VERSION_TENTHS(x) (int)(((x) - (int)(x)) * 10)
612 #define VERSION_HUNDREDTHS(x) (int)((((x) - (int)(x)) * 100) - (10 * VERSION_TENTHS(x)))
615 /* Disable C linkage for C++ Compilers: */
616 #if defined(__cplusplus)