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 #include <avr/pgmspace.h>
48 #include "../../../Common/Common.h"
52 #if defined(USB_CAN_BE_DEVICE)
53 #include "../LowLevel/Device.h"
56 /* Enable C linkage for C++ Compilers: */
57 #if defined(__cplusplus)
61 /* Preprocessor Checks: */
62 #if !defined(__INCLUDE_FROM_USB_DRIVER)
63 #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
66 /* Public Interface - May be used in end-application: */
68 /** Indicates that a given descriptor does not exist in the device. This can be used inside descriptors
69 * for string descriptor indexes, or may be use as a return value for GetDescriptor when the specified
70 * descriptor does not exist.
72 #define NO_DESCRIPTOR 0
74 #if (!defined(NO_INTERNAL_SERIAL) && (defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR))) || defined(__DOXYGEN__)
75 /** String descriptor index for the device's unique serial number string descriptor within the device.
76 * This unique serial number is used by the host to associate resources to the device (such as drivers or COM port
77 * number allocations) to a device regardless of the port it is plugged in to on the host. Some USB AVRs contain
78 * a unique serial number internally, and setting the device descriptors serial number string index to this value
79 * will cause it to use the internal serial number.
81 * On unsupported devices, this will evaluate to NO_DESCRIPTOR and so will force the host to create a pseudo-serial
82 * number for the device.
84 #define USE_INTERNAL_SERIAL 0xDC
86 #define USE_INTERNAL_SERIAL NO_DESCRIPTOR
89 /** Macro to calculate the power value for the configuration descriptor, from a given number of milliamps. */
90 #define USB_CONFIG_POWER_MA(mA) ((mA) >> 1)
92 /** Macro to calculate the Unicode length of a string with a given number of Unicode characters.
93 * Should be used in string descriptor's headers for giving the string descriptor's byte length.
95 #define USB_STRING_LEN(str) (sizeof(USB_Descriptor_Header_t) + ((str) << 1))
97 /** Macro to encode a given four digit floating point version number (e.g. 01.23) into Binary Coded
98 * Decimal format for descriptor fields requiring BCD encoding, such as the USB version number in the
99 * standard device descriptor.
101 #define VERSION_BCD(x) ((((VERSION_TENS(x) << 4) | VERSION_ONES(x)) << 8) | \
102 ((VERSION_TENTHS(x) << 4) | VERSION_HUNDREDTHS(x)))
104 /** String language ID for the English language. Should be used in \ref USB_Descriptor_String_t descriptors
105 * to indicate that the English language is supported by the device in its string descriptors.
107 #define LANGUAGE_ID_ENG 0x0409
109 /** Can be masked with an endpoint address for a \ref USB_Descriptor_Endpoint_t endpoint descriptor's
110 * EndpointAddress value to indicate to the host that the endpoint is of the IN direction (i.e, from
113 #define ENDPOINT_DESCRIPTOR_DIR_IN 0x80
115 /** Can be masked with an endpoint address for a \ref USB_Descriptor_Endpoint_t endpoint descriptor's
116 * EndpointAddress value to indicate to the host that the endpoint is of the OUT direction (i.e, from
119 #define ENDPOINT_DESCRIPTOR_DIR_OUT 0x00
121 /** Can be masked with other configuration descriptor attributes for a \ref USB_Descriptor_Configuration_Header_t
122 * descriptor's ConfigAttributes value to indicate that the specified configuration can draw its power
123 * from the host's VBUS line.
125 #define USB_CONFIG_ATTR_BUSPOWERED 0x80
127 /** Can be masked with other configuration descriptor attributes for a \ref USB_Descriptor_Configuration_Header_t
128 * descriptor's ConfigAttributes value to indicate that the specified configuration can draw its power
129 * from the device's own power source.
131 #define USB_CONFIG_ATTR_SELFPOWERED 0x40
133 /** Can be masked with other configuration descriptor attributes for a \ref USB_Descriptor_Configuration_Header_t
134 * descriptor's ConfigAttributes value to indicate that the specified configuration supports the
135 * remote wakeup feature of the USB standard, allowing a suspended USB device to wake up the host upon
138 #define USB_CONFIG_ATTR_REMOTEWAKEUP 0x20
140 /** Can be masked with other endpoint descriptor attributes for a \ref USB_Descriptor_Endpoint_t descriptor's
141 * Attributes value to indicate that the specified endpoint is not synchronized.
143 * \see The USB specification for more details on the possible Endpoint attributes.
145 #define ENDPOINT_ATTR_NO_SYNC (0 << 2)
147 /** Can be masked with other endpoint descriptor attributes for a \ref USB_Descriptor_Endpoint_t descriptor's
148 * Attributes value to indicate that the specified endpoint is asynchronous.
150 * \see The USB specification for more details on the possible Endpoint attributes.
152 #define ENDPOINT_ATTR_ASYNC (1 << 2)
154 /** Can be masked with other endpoint descriptor attributes for a \ref USB_Descriptor_Endpoint_t descriptor's
155 * Attributes value to indicate that the specified endpoint is adaptive.
157 * \see The USB specification for more details on the possible Endpoint attributes.
159 #define ENDPOINT_ATTR_ADAPTIVE (2 << 2)
161 /** Can be masked with other endpoint descriptor attributes for a \ref USB_Descriptor_Endpoint_t descriptor's
162 * Attributes value to indicate that the specified endpoint is synchronized.
164 * \see The USB specification for more details on the possible Endpoint attributes.
166 #define ENDPOINT_ATTR_SYNC (3 << 2)
168 /** Can be masked with other endpoint descriptor attributes for a \ref USB_Descriptor_Endpoint_t descriptor's
169 * Attributes value to indicate that the specified endpoint is used for data transfers.
171 * \see The USB specification for more details on the possible Endpoint usage attributes.
173 #define ENDPOINT_USAGE_DATA (0 << 4)
175 /** Can be masked with other endpoint descriptor attributes for a \ref USB_Descriptor_Endpoint_t descriptor's
176 * Attributes value to indicate that the specified endpoint is used for feedback.
178 * \see The USB specification for more details on the possible Endpoint usage attributes.
180 #define ENDPOINT_USAGE_FEEDBACK (1 << 4)
182 /** Can be masked with other endpoint descriptor attributes for a \ref USB_Descriptor_Endpoint_t descriptor's
183 * Attributes value to indicate that the specified endpoint is used for implicit feedback.
185 * \see The USB specification for more details on the possible Endpoint usage attributes.
187 #define ENDPOINT_USAGE_IMPLICIT_FEEDBACK (2 << 4)
190 /** Enum for the possible standard descriptor types, as given in each descriptor's header. */
191 enum USB_DescriptorTypes_t
193 DTYPE_Device
= 0x01, /**< Indicates that the descriptor is a device descriptor. */
194 DTYPE_Configuration
= 0x02, /**< Indicates that the descriptor is a configuration descriptor. */
195 DTYPE_String
= 0x03, /**< Indicates that the descriptor is a string descriptor. */
196 DTYPE_Interface
= 0x04, /**< Indicates that the descriptor is an interface descriptor. */
197 DTYPE_Endpoint
= 0x05, /**< Indicates that the descriptor is an endpoint descriptor. */
198 DTYPE_DeviceQualifier
= 0x06, /**< Indicates that the descriptor is a device qualifier descriptor. */
199 DTYPE_Other
= 0x07, /**< Indicates that the descriptor is of other type. */
200 DTYPE_InterfacePower
= 0x08, /**< Indicates that the descriptor is an interface power descriptor. */
201 DTYPE_InterfaceAssociation
= 0x0B, /**< Indicates that the descriptor is an interface association descriptor. */
205 /** Type define for all descriptors standard header, indicating the descriptor's length and type. This structure
206 * uses LUFA-specific element names to make each element's purpose clearer.
208 * \see \ref USB_StdDescriptor_Header_t for the version of this define with standard element names
212 uint8_t Size
; /**< Size of the descriptor, in bytes. */
213 uint8_t Type
; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
214 * given by the specific class.
216 } USB_Descriptor_Header_t
;
218 /** Type define for all descriptors standard header, indicating the descriptor's length and type. This structure
219 * uses the relevant standard's given element names to ensure compatibility with the standard.
221 * \see \ref USB_Descriptor_Header_t for the version of this define with non-standard LUFA specific element names
225 uint8_t bLength
; /**< Size of the descriptor, in bytes. */
226 uint8_t bDescriptorType
; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
227 * given by the specific class.
229 } USB_StdDescriptor_Header_t
;
231 /** Type define for a standard Device Descriptor. This structure uses LUFA-specific element names to make each
232 * element's purpose clearer.
234 * \see \ref USB_StdDescriptor_Device_t for the version of this define with standard element names
238 USB_Descriptor_Header_t Header
; /**< Descriptor header, including type and size. */
240 uint16_t USBSpecification
; /**< BCD of the supported USB specification. */
241 uint8_t Class
; /**< USB device class. */
242 uint8_t SubClass
; /**< USB device subclass. */
243 uint8_t Protocol
; /**< USB device protocol. */
245 uint8_t Endpoint0Size
; /**< Size of the control (address 0) endpoint's bank in bytes. */
247 uint16_t VendorID
; /**< Vendor ID for the USB product. */
248 uint16_t ProductID
; /**< Unique product ID for the USB product. */
249 uint16_t ReleaseNumber
; /**< Product release (version) number. */
251 uint8_t ManufacturerStrIndex
; /**< String index for the manufacturer's name. The
252 * host will request this string via a separate
253 * control request for the string descriptor.
255 * \note If no string supplied, use \ref NO_DESCRIPTOR.
257 uint8_t ProductStrIndex
; /**< String index for the product name/details.
259 * \see ManufacturerStrIndex structure entry.
261 uint8_t SerialNumStrIndex
; /**< String index for the product's globally unique hexadecimal
262 * serial number, in uppercase Unicode ASCII.
264 * \note On some AVR models, there is an embedded serial number
265 * in the chip which can be used for the device serial number.
266 * To use this serial number, set this to USE_INTERNAL_SERIAL.
267 * On unsupported devices, this will evaluate to 0 and will cause
268 * the host to generate a pseudo-unique value for the device upon
271 * \see ManufacturerStrIndex structure entry.
273 uint8_t NumberOfConfigurations
; /**< Total number of configurations supported by
276 } USB_Descriptor_Device_t
;
278 /** Type define for a standard Device Descriptor. This structure uses the relevant standard's given element names
279 * to ensure compatibility with the standard.
281 * \see \ref USB_Descriptor_Device_t for the version of this define with non-standard LUFA specific element names
285 uint8_t bLength
; /**< Size of the descriptor, in bytes. */
286 uint8_t bDescriptorType
; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
287 * given by the specific class.
289 uint16_t bcdUSB
; /**< BCD of the supported USB specification. */
290 uint8_t bDeviceClass
; /**< USB device class. */
291 uint8_t bDeviceSubClass
; /**< USB device subclass. */
292 uint8_t bDeviceProtocol
; /**< USB device protocol. */
293 uint8_t bMaxPacketSize0
; /**< Size of the control (address 0) endpoint's bank in bytes. */
294 uint16_t idVendor
; /**< Vendor ID for the USB product. */
295 uint16_t idProduct
; /**< Unique product ID for the USB product. */
296 uint16_t bcdDevice
; /**< Product release (version) number. */
297 uint8_t iManufacturer
; /**< String index for the manufacturer's name. The
298 * host will request this string via a separate
299 * control request for the string descriptor.
301 * \note If no string supplied, use \ref NO_DESCRIPTOR.
303 uint8_t iProduct
; /**< String index for the product name/details.
305 * \see ManufacturerStrIndex structure entry.
307 uint8_t iSerialNumber
; /**< String index for the product's globally unique hexadecimal
308 * serial number, in uppercase Unicode ASCII.
310 * \note On some AVR models, there is an embedded serial number
311 * in the chip which can be used for the device serial number.
312 * To use this serial number, set this to USE_INTERNAL_SERIAL.
313 * On unsupported devices, this will evaluate to 0 and will cause
314 * the host to generate a pseudo-unique value for the device upon
317 * \see ManufacturerStrIndex structure entry.
319 uint8_t bNumConfigurations
; /**< Total number of configurations supported by
322 } USB_StdDescriptor_Device_t
;
324 /** Type define for a standard Configuration Descriptor header. This structure uses LUFA-specific element names
325 * to make each element's purpose clearer.
327 * \see \ref USB_StdDescriptor_Configuration_Header_t for the version of this define with standard element names
331 USB_Descriptor_Header_t Header
; /**< Descriptor header, including type and size. */
333 uint16_t TotalConfigurationSize
; /**< Size of the configuration descriptor header,
334 * and all sub descriptors inside the configuration.
336 uint8_t TotalInterfaces
; /**< Total number of interfaces in the configuration. */
338 uint8_t ConfigurationNumber
; /**< Configuration index of the current configuration. */
339 uint8_t ConfigurationStrIndex
; /**< Index of a string descriptor describing the configuration. */
341 uint8_t ConfigAttributes
; /**< Configuration attributes, comprised of a mask of zero or
342 * more USB_CONFIG_ATTR_* masks.
345 uint8_t MaxPowerConsumption
; /**< Maximum power consumption of the device while in the
346 * current configuration, calculated by the \ref USB_CONFIG_POWER_MA()
349 } USB_Descriptor_Configuration_Header_t
;
351 /** Type define for a standard Configuration Descriptor header. This structure uses the relevant standard's given element names
352 * to ensure compatibility with the standard.
354 * \see \ref USB_Descriptor_Device_t for the version of this define with non-standard LUFA specific element names
358 uint8_t bLength
; /**< Size of the descriptor, in bytes. */
359 uint8_t bDescriptorType
; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
360 * given by the specific class.
362 uint16_t wTotalLength
; /**< Size of the configuration descriptor header,
363 * and all sub descriptors inside the configuration.
365 uint8_t bNumInterfaces
; /**< Total number of interfaces in the configuration. */
366 uint8_t bConfigurationValue
; /**< Configuration index of the current configuration. */
367 uint8_t iConfiguration
; /**< Index of a string descriptor describing the configuration. */
368 uint8_t bmAttributes
; /**< Configuration attributes, comprised of a mask of zero or
369 * more USB_CONFIG_ATTR_* masks.
371 uint8_t bMaxPower
; /**< Maximum power consumption of the device while in the
372 * current configuration, calculated by the \ref USB_CONFIG_POWER_MA()
375 } USB_StdDescriptor_Configuration_Header_t
;
377 /** Type define for a standard Interface Descriptor. This structure uses LUFA-specific element names
378 * to make each element's purpose clearer.
380 * \see \ref USB_StdDescriptor_Interface_t for the version of this define with standard element names
384 USB_Descriptor_Header_t Header
; /**< Descriptor header, including type and size. */
386 uint8_t InterfaceNumber
; /**< Index of the interface in the current configuration. */
387 uint8_t AlternateSetting
; /**< Alternate setting for the interface number. The same
388 * interface number can have multiple alternate settings
389 * with different endpoint configurations, which can be
390 * selected by the host.
392 uint8_t TotalEndpoints
; /**< Total number of endpoints in the interface. */
394 uint8_t Class
; /**< Interface class ID. */
395 uint8_t SubClass
; /**< Interface subclass ID. */
396 uint8_t Protocol
; /**< Interface protocol ID. */
398 uint8_t InterfaceStrIndex
; /**< Index of the string descriptor describing the
401 } USB_Descriptor_Interface_t
;
403 /** Type define for a standard Interface Descriptor. This structure uses the relevant standard's given element names
404 * to ensure compatibility with the standard.
406 * \see \ref USB_Descriptor_Interface_t for the version of this define with non-standard LUFA specific element names
410 uint8_t bLength
; /**< Size of the descriptor, in bytes. */
411 uint8_t bDescriptorType
; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
412 * given by the specific class.
414 uint8_t bInterfaceNumber
; /**< Index of the interface in the current configuration. */
415 uint8_t bAlternateSetting
; /**< Alternate setting for the interface number. The same
416 * interface number can have multiple alternate settings
417 * with different endpoint configurations, which can be
418 * selected by the host.
420 uint8_t bNumEndpoints
; /**< Total number of endpoints in the interface. */
421 uint8_t bInterfaceClass
; /**< Interface class ID. */
422 uint8_t bInterfaceSubClass
; /**< Interface subclass ID. */
423 uint8_t bInterfaceProtocol
; /**< Interface protocol ID. */
424 uint8_t iInterface
; /**< Index of the string descriptor describing the
427 } USB_StdDescriptor_Interface_t
;
429 /** Type define for a standard Interface Association Descriptor. This structure uses LUFA-specific element names
430 * to make each element's purpose clearer.
432 * This descriptor has been added as a supplement to the USB2.0 standard, in the ECN located at
433 * <a>http://www.usb.org/developers/docs/InterfaceAssociationDescriptor_ecn.pdf</a>. It allows compound
434 * devices with multiple interfaces related to the same function to have the multiple interfaces bound
435 * together at the point of enumeration, loading one generic driver for all the interfaces in the single
436 * function. Read the ECN for more information.
438 * \see \ref USB_StdDescriptor_Interface_Association_t for the version of this define with standard element names
442 USB_Descriptor_Header_t Header
; /**< Descriptor header, including type and size. */
444 uint8_t FirstInterfaceIndex
; /**< Index of the first associated interface. */
445 uint8_t TotalInterfaces
; /** Total number of associated interfaces. */
447 uint8_t Class
; /**< Interface class ID. */
448 uint8_t SubClass
; /**< Interface subclass ID. */
449 uint8_t Protocol
; /**< Interface protocol ID. */
451 uint8_t IADStrIndex
; /**< Index of the string descriptor describing the
452 * interface association.
454 } USB_Descriptor_Interface_Association_t
;
456 /** Type define for a standard Interface Association Descriptor. This structure uses the relevant standard's given
457 * element names to ensure compatibility with the standard.
459 * This descriptor has been added as a supplement to the USB2.0 standard, in the ECN located at
460 * <a>http://www.usb.org/developers/docs/InterfaceAssociationDescriptor_ecn.pdf</a>. It allows compound
461 * devices with multiple interfaces related to the same function to have the multiple interfaces bound
462 * together at the point of enumeration, loading one generic driver for all the interfaces in the single
463 * function. Read the ECN for more information.
465 * \see \ref USB_Descriptor_Interface_Association_t for the version of this define with non-standard LUFA specific
470 uint8_t bLength
; /**< Size of the descriptor, in bytes. */
471 uint8_t bDescriptorType
; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
472 * given by the specific class.
474 uint8_t bFirstInterface
; /**< Index of the first associated interface. */
475 uint8_t bInterfaceCount
; /** Total number of associated interfaces. */
476 uint8_t bFunctionClass
; /**< Interface class ID. */
477 uint8_t bFunctionSubClass
; /**< Interface subclass ID. */
478 uint8_t bFunctionProtocol
; /**< Interface protocol ID. */
479 uint8_t iFunction
; /**< Index of the string descriptor describing the
480 * interface association.
482 } USB_StdDescriptor_Interface_Association_t
;
484 /** Type define for a standard Endpoint Descriptor. This structure uses LUFA-specific element names
485 * to make each element's purpose clearer.
487 * \see \ref USB_StdDescriptor_Endpoint_t for the version of this define with standard element names
491 USB_Descriptor_Header_t Header
; /**< Descriptor header, including type and size. */
493 uint8_t EndpointAddress
; /**< Logical address of the endpoint within the device
494 * for the current configuration, including direction
497 uint8_t Attributes
; /**< Endpoint attributes, comprised of a mask of the
498 * endpoint type (EP_TYPE_*) and attributes (ENDPOINT_ATTR_*)
501 uint16_t EndpointSize
; /**< Size of the endpoint bank, in bytes. This indicates the
502 * maximum packet size that the endpoint can receive at a time.
505 uint8_t PollingIntervalMS
; /**< Polling interval in milliseconds for the endpoint
506 * if it is an INTERRUPT or ISOCHRONOUS type.
508 } USB_Descriptor_Endpoint_t
;
510 /** Type define for a standard Endpoint Descriptor. This structure uses the relevant standard's given
511 * element names to ensure compatibility with the standard.
513 * \see \ref USB_Descriptor_Endpoint_t for the version of this define with non-standard LUFA specific
518 uint8_t bLength
; /**< Size of the descriptor, in bytes. */
519 uint8_t bDescriptorType
; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
520 * given by the specific class.
522 uint8_t bEndpointAddress
; /**< Logical address of the endpoint within the device
523 * for the current configuration, including direction
526 uint8_t bmAttributes
; /**< Endpoint attributes, comprised of a mask of the
527 * endpoint type (EP_TYPE_*) and attributes (ENDPOINT_ATTR_*)
530 uint16_t wMaxPacketSize
; /**< Size of the endpoint bank, in bytes. This indicates the
531 * maximum packet size that the endpoint can receive at a time.
533 uint8_t bInterval
; /**< Polling interval in milliseconds for the endpoint
534 * if it is an INTERRUPT or ISOCHRONOUS type.
536 } USB_StdDescriptor_Endpoint_t
;
538 /** Type define for a standard string descriptor. Unlike other standard descriptors, the length
539 * of the descriptor for placement in the descriptor header must be determined by the \ref USB_STRING_LEN()
540 * macro rather than by the size of the descriptor structure, as the length is not fixed.
542 * This structure should also be used for string index 0, which contains the supported language IDs for
543 * the device as an array.
545 * This structure uses LUFA-specific element names to make each element's purpose clearer.
547 * \see \ref USB_StdDescriptor_String_t for the version of this define with standard element names
551 USB_Descriptor_Header_t Header
; /**< Descriptor header, including type and size. */
553 wchar_t UnicodeString
[]; /**< String data, as unicode characters (alternatively,
554 * string language IDs). If normal ASCII characters are
555 * to be used, they must be added as an array of characters
556 * rather than a normal C string so that they are widened to
559 * Under GCC, strings prefixed with the "L" character (before
560 * the opening string quotation mark) are considered to be
561 * Unicode strings, and may be used instead of an explicit
562 * array of ASCII characters.
564 } USB_Descriptor_String_t
;
566 /** Type define for a standard string descriptor. Unlike other standard descriptors, the length
567 * of the descriptor for placement in the descriptor header must be determined by the \ref USB_STRING_LEN()
568 * macro rather than by the size of the descriptor structure, as the length is not fixed.
570 * This structure should also be used for string index 0, which contains the supported language IDs for
571 * the device as an array.
573 * This structure uses the relevant standard's given element names to ensure compatibility with the standard.
575 * \see \ref USB_Descriptor_String_t for the version of this define with with non-standard LUFA specific
580 uint8_t bLength
; /**< Size of the descriptor, in bytes. */
581 uint8_t bDescriptorType
; /**< Type of the descriptor, either a value in
582 * \ref USB_DescriptorTypes_t or a value
583 * given by the specific class.
585 int16_t bString
[]; /**< String data, as unicode characters (alternatively,
586 * string language IDs). If normal ASCII characters are
587 * to be used, they must be added as an array of characters
588 * rather than a normal C string so that they are widened to
591 * Under GCC, strings prefixed with the "L" character (before
592 * the opening string quotation mark) are considered to be
593 * Unicode strings, and may be used instead of an explicit
594 * array of ASCII characters.
596 } USB_StdDescriptor_String_t
;
598 /* Private Interface - For use in library only: */
599 #if !defined(__DOXYGEN__)
601 #define VERSION_TENS(x) (int)((x) / 10)
602 #define VERSION_ONES(x) (int)((x) - (10 * VERSION_TENS(x)))
603 #define VERSION_TENTHS(x) (int)(((x) - (int)(x)) * 10)
604 #define VERSION_HUNDREDTHS(x) (int)((((x) - (int)(x)) * 100) - (10 * VERSION_TENTHS(x)))
607 /* Disable C linkage for C++ Compilers: */
608 #if defined(__cplusplus)