Don't cast the line encoding baud rate to a uint16_t before performing the baud rate...
[pub/USBasp.git] / Bootloaders / TeensyHID / Descriptors.h
index 24a0cda..8ef964d 100644 (file)
@@ -1,21 +1,21 @@
 /*\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  Dean Camera (dean [at] fourwalledcubicle [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
@@ -50,7 +50,7 @@
                        uint16_t                HIDSpec;\r
                        uint8_t                 CountryCode;\r
                \r
                        uint16_t                HIDSpec;\r
                        uint8_t                 CountryCode;\r
                \r
-                       uint8_t                 TotalHIDReports;\r
+                       uint8_t                 TotalHIDDescriptors;\r
 \r
                        uint8_t                 HIDReportType;\r
                        uint16_t                HIDReportLength;\r
 \r
                        uint8_t                 HIDReportType;\r
                        uint16_t                HIDReportLength;\r
@@ -66,9 +66,9 @@
                typedef struct\r
                {\r
                        USB_Descriptor_Configuration_Header_t Config;\r
                typedef struct\r
                {\r
                        USB_Descriptor_Configuration_Header_t Config;\r
-                       USB_Descriptor_Interface_t            Interface;\r
-                       USB_Descriptor_HID_t                  HIDDescriptor;\r
-               USB_Descriptor_Endpoint_t             HIDEndpoint;\r
+                       USB_Descriptor_Interface_t            HID_Interface;\r
+                       USB_Descriptor_HID_t                  HID_VendorHID;\r
+               USB_Descriptor_Endpoint_t             HID_ReportINEndpoint;\r
                } USB_Descriptor_Configuration_t;\r
                                        \r
        /* Macros: */\r
                } USB_Descriptor_Configuration_t;\r
                                        \r
        /* Macros: */\r
                \r
                /** Descriptor header type value, to indicate a HID class HID report descriptor. */\r
                #define DTYPE_Report              0x22\r
                \r
                /** Descriptor header type value, to indicate a HID class HID report descriptor. */\r
                #define DTYPE_Report              0x22\r
+               \r
+               /** Vendor usage page for the Teensy 1.0 board */\r
+               #define TEENSY_USAGEPAGE_10       0x19\r
+\r
+               /** Vendor usage page for the Teensy++ 1.0 board */\r
+               #define TEENSY_USAGEPAGE_10PP     0x1A\r
+\r
+               /** Vendor usage page for the Teensy 2.0 board */\r
+               #define TEENSY_USAGEPAGE_20       0x1B\r
+               \r
+               /** Vendor usage page for the Teensy++ 2.0 board */\r
+               #define TEENSY_USAGEPAGE_20PP     0x1C\r
+               \r
+               #if (defined(__AVR_AT90USB162__) || defined(__AVR_ATmega16U2__))\r
+                       #define TEENSY_USAGEPAGE      TEENSY_USAGEPAGE_10\r
+               #elif defined(__AVR_ATmega32U4__)\r
+                       #define TEENSY_USAGEPAGE      TEENSY_USAGEPAGE_20\r
+               #elif (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__))\r
+                       #define TEENSY_USAGEPAGE      TEENSY_USAGEPAGE_10PP\r
+               #elif (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__))\r
+                       #define TEENSY_USAGEPAGE      TEENSY_USAGEPAGE_20PP\r
+               #else\r
+                       #error The selected AVR model is not currently supported by the TeensyHID bootloader.\r
+               #endif\r
 \r
        /* Function Prototypes: */\r
 \r
        /* Function Prototypes: */\r
-               uint16_t 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
+               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
 \r
 #endif\r
 \r
 #endif\r