aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/Incomplete/StandaloneProgrammer/Descriptors.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-11-23 12:40:14 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-11-23 12:40:14 +0000
commitaaa0bed556d0fa424b831418a7ce2531653a8b03 (patch)
tree53cbc38a5510a8a769e8ad0078c1e1124290554d /Projects/Incomplete/StandaloneProgrammer/Descriptors.c
parent6e867f7d9bc279a118fc774ab1ee05e99b4d8b7c (diff)
downloadlufa-aaa0bed556d0fa424b831418a7ce2531653a8b03.tar.gz
lufa-aaa0bed556d0fa424b831418a7ce2531653a8b03.tar.bz2
lufa-aaa0bed556d0fa424b831418a7ce2531653a8b03.zip
The incomplete StandaloneProgrammer project now uses Host and Device Mass storage classes, so that program data can either be loaded onto the device's Dataflash storage, or read off an attached USB memory stick.
The USB target family and allowable USB mode tokens are now public and documented (USB_CAN_BE_*, USB_SERIES_*_AVR). The SCSI_Request_Sense_Response_t and SCSI_Inquiry_Response_t type defines are now part of the Mass Storage Class driver common defines, rather than being defined in the Host mode Class driver section only. The USB_MODE_HOST token is now defined even when host mode is not available. Added missing CDC_Host_CreateBlockingStream() function code to the CDC Host Class driver.
Diffstat (limited to 'Projects/Incomplete/StandaloneProgrammer/Descriptors.c')
-rw-r--r--Projects/Incomplete/StandaloneProgrammer/Descriptors.c118
1 files changed, 7 insertions, 111 deletions
diff --git a/Projects/Incomplete/StandaloneProgrammer/Descriptors.c b/Projects/Incomplete/StandaloneProgrammer/Descriptors.c
index 71198e082..abc981426 100644
--- a/Projects/Incomplete/StandaloneProgrammer/Descriptors.c
+++ b/Projects/Incomplete/StandaloneProgrammer/Descriptors.c
@@ -37,6 +37,8 @@
#include "Descriptors.h"
+#if defined(USB_CAN_BE_DEVICE)
+
/* On some devices, there is a factory set internal serial number which can be automatically sent to the host as
* the device's serial number when the Device Descriptor's .SerialNumStrIndex entry is set to USE_INTERNAL_SERIAL.
* This allows the host to track a device across insertions on different ports, allowing them to retain allocated
@@ -67,7 +69,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
.VendorID = 0x03EB,
.ProductID = 0x2063,
- .ReleaseNumber = 0x0000,
+ .ReleaseNumber = 0x0001,
.ManufacturerStrIndex = 0x01,
.ProductStrIndex = 0x02,
@@ -88,7 +90,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
- .TotalInterfaces = 3,
+ .TotalInterfaces = 1,
.ConfigurationNumber = 1,
.ConfigurationStrIndex = NO_DESCRIPTOR,
@@ -97,120 +99,12 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
},
-
- .CDC_IAD =
- {
- .Header = {.Size = sizeof(USB_Descriptor_Interface_Association_t), .Type = DTYPE_InterfaceAssociation},
-
- .FirstInterfaceIndex = 0,
- .TotalInterfaces = 2,
-
- .Class = 0x02,
- .SubClass = 0x02,
- .Protocol = 0x01,
-
- .IADStrIndex = NO_DESCRIPTOR
- },
-
- .CCI_Interface =
- {
- .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
-
- .InterfaceNumber = 0,
- .AlternateSetting = 0,
-
- .TotalEndpoints = 1,
-
- .Class = 0x02,
- .SubClass = 0x02,
- .Protocol = 0x01,
-
- .InterfaceStrIndex = NO_DESCRIPTOR
- },
-
- .CDC_Functional_IntHeader =
- {
- .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
- .SubType = 0x00,
-
- .Data = {0x01, 0x10}
- },
-
- .CDC_Functional_CallManagement =
- {
- .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
- .SubType = 0x01,
-
- .Data = {0x03, 0x01}
- },
-
- .CDC_Functional_AbstractControlManagement =
- {
- .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(1)), .Type = 0x24},
- .SubType = 0x02,
-
- .Data = {0x06}
- },
-
- .CDC_Functional_Union =
- {
- .Header = {.Size = sizeof(CDC_FUNCTIONAL_DESCRIPTOR(2)), .Type = 0x24},
- .SubType = 0x06,
-
- .Data = {0x00, 0x01}
- },
-
- .ManagementEndpoint =
- {
- .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
-
- .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_NOTIFICATION_EPNUM),
- .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
- .EndpointSize = CDC_NOTIFICATION_EPSIZE,
- .PollingIntervalMS = 0xFF
- },
-
- .DCI_Interface =
- {
- .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
-
- .InterfaceNumber = 1,
- .AlternateSetting = 0,
-
- .TotalEndpoints = 2,
-
- .Class = 0x0A,
- .SubClass = 0x00,
- .Protocol = 0x00,
-
- .InterfaceStrIndex = NO_DESCRIPTOR
- },
-
- .DataOutEndpoint =
- {
- .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
-
- .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC_RX_EPNUM),
- .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
- .EndpointSize = CDC_TXRX_EPSIZE,
- .PollingIntervalMS = 0x00
- },
-
- .DataInEndpoint =
- {
- .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
-
- .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC_TX_EPNUM),
- .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
- .EndpointSize = CDC_TXRX_EPSIZE,
- .PollingIntervalMS = 0x00
- },
.MSInterface =
{
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
- .InterfaceNumber = 2,
+ .InterfaceNumber = 0,
.AlternateSetting = 0,
.TotalEndpoints = 2,
@@ -323,3 +217,5 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex,
*DescriptorAddress = Address;
return Size;
}
+
+#endif