Reduced guard bit time in the AVRISP project PDI/TPI protocols to reduce the time...
[pub/USBasp.git] / Projects / Incomplete / StandaloneProgrammer / Descriptors.c
index 71198e0..3e57864 100644 (file)
@@ -9,13 +9,13 @@
 /*\r
   Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
 \r
 /*\r
   Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com)\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
@@ -37,6 +37,8 @@
 \r
 #include "Descriptors.h"\r
 \r
 \r
 #include "Descriptors.h"\r
 \r
+#if defined(USB_CAN_BE_DEVICE)\r
+\r
 /* On some devices, there is a factory set internal serial number which can be automatically sent to the host as\r
  * the device's serial number when the Device Descriptor's .SerialNumStrIndex entry is set to USE_INTERNAL_SERIAL.\r
  * This allows the host to track a device across insertions on different ports, allowing them to retain allocated\r
 /* On some devices, there is a factory set internal serial number which can be automatically sent to the host as\r
  * the device's serial number when the Device Descriptor's .SerialNumStrIndex entry is set to USE_INTERNAL_SERIAL.\r
  * This allows the host to track a device across insertions on different ports, allowing them to retain allocated\r
@@ -67,7 +69,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
                \r
        .VendorID               = 0x03EB,\r
        .ProductID              = 0x2063,\r
                \r
        .VendorID               = 0x03EB,\r
        .ProductID              = 0x2063,\r
-       .ReleaseNumber          = 0x0000,\r
+       .ReleaseNumber          = 0x0001,\r
                \r
        .ManufacturerStrIndex   = 0x01,\r
        .ProductStrIndex        = 0x02,\r
                \r
        .ManufacturerStrIndex   = 0x01,\r
        .ProductStrIndex        = 0x02,\r
@@ -88,7 +90,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .Header                 = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},\r
 \r
                        .TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},\r
 \r
                        .TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),\r
-                       .TotalInterfaces        = 3,\r
+                       .TotalInterfaces        = 1,\r
                                \r
                        .ConfigurationNumber    = 1,\r
                        .ConfigurationStrIndex  = NO_DESCRIPTOR,\r
                                \r
                        .ConfigurationNumber    = 1,\r
                        .ConfigurationStrIndex  = NO_DESCRIPTOR,\r
@@ -97,120 +99,12 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        \r
                        .MaxPowerConsumption    = USB_CONFIG_POWER_MA(100)\r
                },\r
                        \r
                        .MaxPowerConsumption    = USB_CONFIG_POWER_MA(100)\r
                },\r
-               \r
-       .CDC_IAD = \r
-               {\r
-                       .Header                 = {.Size = sizeof(USB_Descriptor_Interface_Association_t), .Type = DTYPE_InterfaceAssociation},\r
-\r
-                       .FirstInterfaceIndex    = 0,\r
-                       .TotalInterfaces        = 2,\r
-\r
-                       .Class                  = 0x02,\r
-                       .SubClass               = 0x02,\r
-                       .Protocol               = 0x01,\r
-\r
-                       .IADStrIndex            = NO_DESCRIPTOR\r
-               },\r
-\r
-       .CCI_Interface = \r
-               {\r
-                       .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},\r
-\r
-                       .InterfaceNumber        = 0,\r
-                       .AlternateSetting       = 0,\r
-                       \r
-                       .TotalEndpoints         = 1,\r
-                       \r
-                       .Class                  = 0x02,\r
-                       .SubClass               = 0x02,\r
-                       .Protocol               = 0x01,\r
-                       \r
-                       .InterfaceStrIndex      = NO_DESCRIPTOR\r
-               },\r
-\r
-       .CDC_Functional_IntHeader = \r
-               {\r
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},\r
-                       .SubType                = 0x00,\r
-                       \r
-                       .Data                   = {0x01, 0x10}\r
-               },\r
-\r
-       .CDC_Functional_CallManagement = \r
-               {\r
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},\r
-                       .SubType                = 0x01,\r
-                       \r
-                       .Data                   = {0x03, 0x01}\r
-               },\r
-\r
-       .CDC_Functional_AbstractControlManagement = \r
-               {\r
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},\r
-                       .SubType                = 0x02,\r
-                       \r
-                       .Data                   = {0x06}\r
-               },\r
-               \r
-       .CDC_Functional_Union = \r
-               {\r
-                       .Header                 = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},\r
-                       .SubType                = 0x06,\r
-                       \r
-                       .Data                   = {0x00, 0x01}\r
-               },\r
-\r
-       .ManagementEndpoint = \r
-               {\r
-                       .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-                       \r
-                       .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),\r
-                       .Attributes             = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),\r
-                       .EndpointSize           = CDC_NOTIFICATION_EPSIZE,\r
-                       .PollingIntervalMS      = 0xFF\r
-               },\r
-\r
-       .DCI_Interface = \r
-               {\r
-                       .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},\r
-\r
-                       .InterfaceNumber        = 1,\r
-                       .AlternateSetting       = 0,\r
-                       \r
-                       .TotalEndpoints         = 2,\r
-                               \r
-                       .Class                  = 0x0A,\r
-                       .SubClass               = 0x00,\r
-                       .Protocol               = 0x00,\r
-                               \r
-                       .InterfaceStrIndex      = NO_DESCRIPTOR\r
-               },\r
-\r
-       .DataOutEndpoint = \r
-               {\r
-                       .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-                       \r
-                       .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),\r
-                       .Attributes             = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),\r
-                       .EndpointSize           = CDC_TXRX_EPSIZE,\r
-                       .PollingIntervalMS      = 0x00\r
-               },\r
-               \r
-       .DataInEndpoint = \r
-               {\r
-                       .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-                       \r
-                       .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),\r
-                       .Attributes             = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),\r
-                       .EndpointSize           = CDC_TXRX_EPSIZE,\r
-                       .PollingIntervalMS      = 0x00\r
-               },\r
 \r
        .MSInterface = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},\r
 \r
 \r
        .MSInterface = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},\r
 \r
-                       .InterfaceNumber        = 2,\r
+                       .InterfaceNumber        = 0,\r
                        .AlternateSetting       = 0,\r
                        \r
                        .TotalEndpoints         = 2,\r
                        .AlternateSetting       = 0,\r
                        \r
                        .TotalEndpoints         = 2,\r
@@ -323,3 +217,5 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex,
        *DescriptorAddress = Address;\r
        return Size;\r
 }\r
        *DescriptorAddress = Address;\r
        return Size;\r
 }\r
+\r
+#endif\r