Get rid of the redundant ATTR_NEVER_INLINE macro which translated to the same as...
[pub/USBasp.git] / LUFA / Drivers / USB / Core / StdDescriptors.h
index 031e01d..d7f0ca3 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2012.
+     Copyright (C) Dean Camera, 2013.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
-  Copyright 2012  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2013  Dean Camera (dean [at] fourwalledcubicle [dot] com)
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
@@ -18,7 +18,7 @@
   advertising or publicity pertaining to distribution of the
   software without specific, written prior permission.
 
-  The author disclaim all warranties with regard to this
+  The author disclaims all warranties with regard to this
   software, including all implied warranties of merchantability
   and fitness.  In no event shall the author be liable for any
   special, indirect or consequential damages or any damages
                        {
                                USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */
 
-                               uint16_t USBSpecification; /**< BCD of the supported USB specification. */
+                               uint16_t USBSpecification; /**< BCD of the supported USB specification.
+                                                           *
+                                                           *   \see \ref VERSION_BCD() utility macro.
+                                                           */
                                uint8_t  Class; /**< USB device class. */
                                uint8_t  SubClass; /**< USB device subclass. */
                                uint8_t  Protocol; /**< USB device protocol. */
 
                                uint16_t VendorID; /**< Vendor ID for the USB product. */
                                uint16_t ProductID; /**< Unique product ID for the USB product. */
-                               uint16_t ReleaseNumber; /**< Product release (version) number. */
-
+                               uint16_t ReleaseNumber; /**< Product release (version) number.
+                                                        *
+                                                        *   \see \ref VERSION_BCD() utility macro.
+                                                        */
                                uint8_t  ManufacturerStrIndex; /**< String index for the manufacturer's name. The
                                                                *   host will request this string via a separate
                                                                *   control request for the string descriptor.
                                                             *
                                                             *  \note On some microcontroller models, there is an embedded serial number
                                                             *        in the chip which can be used for the device serial number.
-                                                            *        To use this serial number, set this to USE_INTERNAL_SERIAL.
-                                                            *        On unsupported devices, this will evaluate to 0 and will cause
-                                                            *        the host to generate a pseudo-unique value for the device upon
-                                                            *        insertion.
+                                                            *        To use this serial number, set this to \c USE_INTERNAL_SERIAL.
+                                                            *        On unsupported devices, this will evaluate to \ref NO_DESCRIPTOR
+                                                            *        and will cause the host to generate a pseudo-unique value for the
+                                                            *        device upon insertion.
                                                             *
-                                                            *  \see ManufacturerStrIndex structure entry.
+                                                            *  \see \c ManufacturerStrIndex structure entry.
                                                             */
                                uint8_t  NumberOfConfigurations; /**< Total number of configurations supported by
                                                                  *   the device.
                                uint8_t  bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
                                                              *   given by the specific class.
                                                              */
-                               uint16_t bcdUSB; /**< BCD of the supported USB specification. */
+                               uint16_t bcdUSB; /**< BCD of the supported USB specification.
+                                                 *
+                                                 *   \see \ref VERSION_BCD() utility macro.
+                                                 */
                                uint8_t  bDeviceClass; /**< USB device class. */
                                uint8_t  bDeviceSubClass; /**< USB device subclass. */
                                uint8_t  bDeviceProtocol; /**< USB device protocol. */
                                uint8_t  bMaxPacketSize0; /**< Size of the control (address 0) endpoint's bank in bytes. */
                                uint16_t idVendor; /**< Vendor ID for the USB product. */
                                uint16_t idProduct; /**< Unique product ID for the USB product. */
-                               uint16_t bcdDevice; /**< Product release (version) number. */
+                               uint16_t bcdDevice; /**< Product release (version) number.
+                                                    *
+                                                    *   \see \ref VERSION_BCD() utility macro.
+                                                    */
                                uint8_t  iManufacturer; /**< String index for the manufacturer's name. The
                                                         *   host will request this string via a separate
                                                         *   control request for the string descriptor.
                                                        *
                                                        *  \note On some microcontroller models, there is an embedded serial number
                                                        *        in the chip which can be used for the device serial number.
-                                                       *        To use this serial number, set this to USE_INTERNAL_SERIAL.
-                                                       *        On unsupported devices, this will evaluate to 0 and will cause
-                                                       *        the host to generate a pseudo-unique value for the device upon
-                                                       *        insertion.
+                                                       *        To use this serial number, set this to \c USE_INTERNAL_SERIAL.
+                                                       *        On unsupported devices, this will evaluate to \ref NO_DESCRIPTOR
+                                                       *        and will cause the host to generate a pseudo-unique value for the
+                                                       *        device upon insertion.
                                                        *
-                                                       *  \see ManufacturerStrIndex structure entry.
+                                                       *  \see \c ManufacturerStrIndex structure entry.
                                                        */
                                uint8_t  bNumConfigurations; /**< Total number of configurations supported by
                                                              *   the device.
                        {
                                USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */
 
-                               uint16_t USBSpecification; /**< BCD of the supported USB specification. */
+                               uint16_t USBSpecification; /**< BCD of the supported USB specification.
+                                                           *
+                                                           *   \see \ref VERSION_BCD() utility macro.
+                                                           */
                                uint8_t  Class; /**< USB device class. */
                                uint8_t  SubClass; /**< USB device subclass. */
                                uint8_t  Protocol; /**< USB device protocol. */
                        {
                                uint8_t  bLength; /**< Size of the descriptor, in bytes. */
                                uint8_t  bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
-                                                             *   given by the specific class.
-                                                             */
-                               uint16_t bcdUSB; /**< BCD of the supported USB specification. */
+                                                          *   given by the specific class.
+                                                          */
+                               uint16_t bcdUSB; /**< BCD of the supported USB specification.
+                                                 *
+                                                 *   \see \ref VERSION_BCD() utility macro.
+                                                 */
                                uint8_t  bDeviceClass; /**< USB device class. */
                                uint8_t  bDeviceSubClass; /**< USB device subclass. */
                                uint8_t  bDeviceProtocol; /**< USB device protocol. */
                        {
                                uint8_t  bLength; /**< Size of the descriptor, in bytes. */
                                uint8_t  bDescriptorType; /**< Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
-                                                             *   given by the specific class.
-                                                             */
+                                                          *   given by the specific class.
+                                                          */
                                uint16_t wTotalLength; /**< Size of the configuration descriptor header,
                                                           *   and all sub descriptors inside the configuration.
                                                           */
                /* Macros: */
                        #define VERSION_TENS(x)                   (int)((int)(x) / 10)
                        #define VERSION_ONES(x)                   (int)((int)(x) % 10)
-                       #define VERSION_TENTHS(x)                 (int)(((x *  1) - ((int)(x *  1))) * 10)
-                       #define VERSION_HUNDREDTHS(x)             (int)(((x * 10) - ((int)(x * 10))) * 10)
+                       #define VERSION_TENTHS(x)                 (int)((x - (int)x) * 10)
+                       #define VERSION_HUNDREDTHS(x)             (int)((x * 100) - ((int)(x * 10) * 10))
        #endif
 
        /* Disable C linkage for C++ Compilers: */