X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/c1a1b6eeecb375259968ef6d989833312047f2d8..57fe6b4fb97668eb15c4fa56095c0abd746d6c99:/Bootloaders/TeensyHID/Descriptors.h diff --git a/Bootloaders/TeensyHID/Descriptors.h b/Bootloaders/TeensyHID/Descriptors.h index 24a0cdaa8..8ef964d2a 100644 --- a/Bootloaders/TeensyHID/Descriptors.h +++ b/Bootloaders/TeensyHID/Descriptors.h @@ -1,21 +1,21 @@ /* LUFA Library - Copyright (C) Dean Camera, 2009. + Copyright (C) Dean Camera, 2010. dean [at] fourwalledcubicle [dot] com www.fourwalledcubicle.com */ /* - Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) - Permission to use, copy, modify, and distribute this software - and its documentation for any purpose and without fee is hereby - granted, provided that the above copyright notice appear in all - copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaim all warranties with regard to this @@ -50,7 +50,7 @@ uint16_t HIDSpec; uint8_t CountryCode; - uint8_t TotalHIDReports; + uint8_t TotalHIDDescriptors; uint8_t HIDReportType; uint16_t HIDReportLength; @@ -66,9 +66,9 @@ typedef struct { USB_Descriptor_Configuration_Header_t Config; - USB_Descriptor_Interface_t Interface; - USB_Descriptor_HID_t HIDDescriptor; - USB_Descriptor_Endpoint_t HIDEndpoint; + USB_Descriptor_Interface_t HID_Interface; + USB_Descriptor_HID_t HID_VendorHID; + USB_Descriptor_Endpoint_t HID_ReportINEndpoint; } USB_Descriptor_Configuration_t; /* Macros: */ @@ -83,9 +83,33 @@ /** Descriptor header type value, to indicate a HID class HID report descriptor. */ #define DTYPE_Report 0x22 + + /** Vendor usage page for the Teensy 1.0 board */ + #define TEENSY_USAGEPAGE_10 0x19 + + /** Vendor usage page for the Teensy++ 1.0 board */ + #define TEENSY_USAGEPAGE_10PP 0x1A + + /** Vendor usage page for the Teensy 2.0 board */ + #define TEENSY_USAGEPAGE_20 0x1B + + /** Vendor usage page for the Teensy++ 2.0 board */ + #define TEENSY_USAGEPAGE_20PP 0x1C + + #if (defined(__AVR_AT90USB162__) || defined(__AVR_ATmega16U2__)) + #define TEENSY_USAGEPAGE TEENSY_USAGEPAGE_10 + #elif defined(__AVR_ATmega32U4__) + #define TEENSY_USAGEPAGE TEENSY_USAGEPAGE_20 + #elif (defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__)) + #define TEENSY_USAGEPAGE TEENSY_USAGEPAGE_10PP + #elif (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__)) + #define TEENSY_USAGEPAGE TEENSY_USAGEPAGE_20PP + #else + #error The selected AVR model is not currently supported by the TeensyHID bootloader. + #endif /* Function Prototypes: */ - uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress) - ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); + uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress) + ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); #endif