More AVR32 achitecture ports.
[pub/USBasp.git] / Projects / Magstripe / Descriptors.h
index 9948085..6dbdd25 100644 (file)
@@ -1,22 +1,22 @@
 /*\r
              LUFA Library\r
 /*\r
              LUFA Library\r
-     Copyright (C) Dean Camera, 2009.\r
+     Copyright (C) Dean Camera, 2010.\r
               \r
   dean [at] fourwalledcubicle [dot] com\r
       www.fourwalledcubicle.com\r
 */\r
 \r
 /*\r
               \r
   dean [at] fourwalledcubicle [dot] com\r
       www.fourwalledcubicle.com\r
 */\r
 \r
 /*\r
-  Copyright 2009  Denver Gingerich (denver [at] ossguy [dot] com)\r
-  Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
+  Copyright 2010  Denver Gingerich (denver [at] ossguy [dot] com)\r
+  Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
 \r
 \r
-  Permission to use, copy, modify, and distribute this software\r
-  and its documentation for any purpose and without fee is hereby\r
-  granted, provided that the above copyright notice appear in all\r
-  copies and that both that the copyright notice and this\r
-  permission notice and warranty disclaimer appear in supporting\r
-  documentation, and that the name of the author not be used in\r
-  advertising or publicity pertaining to distribution of the\r
+  Permission to use, copy, modify, distribute, and sell this \r
+  software and its documentation for any purpose is hereby granted\r
+  without fee, provided that the above copyright notice appear in \r
+  all copies and that both that the copyright notice and this\r
+  permission notice and warranty disclaimer appear in supporting \r
+  documentation, and that the name of the author not be used in \r
+  advertising or publicity pertaining to distribution of the \r
   software without specific, written prior permission.\r
 \r
   The author disclaim all warranties with regard to this\r
   software without specific, written prior permission.\r
 \r
   The author disclaim all warranties with regard to this\r
 #define _DESCRIPTORS_H_\r
 \r
        /* Includes: */\r
 #define _DESCRIPTORS_H_\r
 \r
        /* Includes: */\r
-               #include <LUFA/Drivers/USB/USB.h>\r
-\r
                #include <avr/pgmspace.h>\r
 \r
                #include <avr/pgmspace.h>\r
 \r
-       /* Type Defines: */\r
-               /** Type define for the HID class specific HID descriptor. A HID descriptor is used in HID class devices\r
-                *  to give information about the HID device, including the HID specification used, and the report descriptors\r
-                *  the device contains to describe how the HID device should be controlled.\r
-                */\r
-               typedef struct\r
-               {\r
-                       USB_Descriptor_Header_t Header; /**< Standard USB descriptor header */\r
-                               \r
-                       uint16_t                HIDSpec; /**< HID specification implemented by the device, in BCD form */\r
-                       uint8_t                 CountryCode; /**< Country code for the country the HID device is localised for */\r
-               \r
-                       uint8_t                 TotalHIDDescriptors; /**< Total number of HID reports linked to this HID interface */\r
-\r
-                       uint8_t                 HIDReportType; /**< Type of the first HID report descriptor */\r
-                       uint16_t                HIDReportLength; /**< Length of the first HID report descriptor */\r
-               } USB_Descriptor_HID_t;\r
-\r
-               /** Type define for the data type used for the HID Report descriptor data elements. A HID report\r
-                *  descriptor contains an array of this data type, indicating how the reports from and to the\r
-                *  device are formatted and how the report data is to be used by the host.\r
-                */\r
-               typedef uint8_t USB_Descriptor_HIDReport_Datatype_t;\r
+               #include <LUFA/Drivers/USB/USB.h>\r
+               #include <LUFA/Drivers/USB/Class/HID.h>\r
 \r
 \r
+       /* Type Defines: */\r
                /** Type define for the device configuration descriptor structure. This must be defined in the\r
                 *  application code, as the configuration descriptor contains several sub-descriptors which\r
                 *  vary between devices, and which describe the device's usage to the host.\r
                /** Type define for the device configuration descriptor structure. This must be defined in the\r
                 *  application code, as the configuration descriptor contains several sub-descriptors which\r
                 *  vary between devices, and which describe the device's usage to the host.\r
@@ -74,7 +52,7 @@
                {\r
                        USB_Descriptor_Configuration_Header_t Config; /**< Configuration descriptor header structure */\r
                        USB_Descriptor_Interface_t            Interface; /**< Keyboard interface descriptor */\r
                {\r
                        USB_Descriptor_Configuration_Header_t Config; /**< Configuration descriptor header structure */\r
                        USB_Descriptor_Interface_t            Interface; /**< Keyboard interface descriptor */\r
-                       USB_Descriptor_HID_t                  KeyboardHID; /**< Keyboard HID descriptor */\r
+                       USB_HID_Descriptor_t                  KeyboardHID; /**< Keyboard HID descriptor */\r
                USB_Descriptor_Endpoint_t             KeyboardEndpoint; /**< Keyboard key report endpoint descriptor */\r
                } USB_Descriptor_Configuration_t;\r
                                        \r
                USB_Descriptor_Endpoint_t             KeyboardEndpoint; /**< Keyboard key report endpoint descriptor */\r
                } USB_Descriptor_Configuration_t;\r
                                        \r
                /** Size of the keyboard report endpoints, in bytes. */\r
                #define KEYBOARD_EPSIZE              8\r
 \r
                /** Size of the keyboard report endpoints, in bytes. */\r
                #define KEYBOARD_EPSIZE              8\r
 \r
-               /** Descriptor type value for a HID descriptor. */\r
-               #define DTYPE_HID                    0x21\r
-\r
-               /** Descriptor type value for a HID report. */\r
-               #define DTYPE_Report                 0x22\r
-\r
        /* Function Prototypes: */\r
                uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)\r
        /* Function Prototypes: */\r
                uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)\r
-                                                                                       ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);\r
+                                                   ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);\r
 \r
 #endif\r
 \r
 #endif\r