Update UC3 platform driver support to use the bitmasks defined in the header files...
[pub/USBasp.git] / Demos / Device / LowLevel / DualVirtualSerial / Descriptors.c
index ca5af27..8265a16 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2010.
+     Copyright (C) Dean Camera, 2011.
 
   dean [at] fourwalledcubicle [dot] com
-      www.fourwalledcubicle.com
+           www.lufa-lib.org
 */
 
 /*
-  Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com)
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
  *  number of device configurations. The descriptor is read out by the USB host when the enumeration
  *  process begins.
  */
-USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
+const USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
 {
        .Header                 = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
 
        .USBSpecification       = VERSION_BCD(01.10),
-       .Class                  = 0xEF,
-       .SubClass               = 0x02,
-       .Protocol               = 0x01,
+       .Class                  = USB_CSCP_IADDeviceClass,
+       .SubClass               = USB_CSCP_IADDeviceSubclass,
+       .Protocol               = USB_CSCP_IADDeviceProtocol,
 
        .Endpoint0Size          = FIXED_CONTROL_ENDPOINT_SIZE,
 
@@ -81,7 +81,7 @@ USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
  *  and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
  *  a configuration so that the host may correctly communicate with the USB device.
  */
-USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
+const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 {
        .Config =
                {
@@ -105,9 +105,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .FirstInterfaceIndex    = 0,
                        .TotalInterfaces        = 2,
 
-                       .Class                  = 0x02,
-                       .SubClass               = 0x02,
-                       .Protocol               = 0x01,
+                       .Class                  = CDC_CSCP_CDCClass,
+                       .SubClass               = CDC_CSCP_ACMSubclass,
+                       .Protocol               = CDC_CSCP_ATCommandProtocol,
 
                        .IADStrIndex            = NO_DESCRIPTOR
                },
@@ -121,33 +121,33 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
                        .TotalEndpoints         = 1,
 
-                       .Class                  = 0x02,
-                       .SubClass               = 0x02,
-                       .Protocol               = 0x01,
+                       .Class                  = CDC_CSCP_CDCClass,
+                       .SubClass               = CDC_CSCP_ACMSubclass,
+                       .Protocol               = CDC_CSCP_ATCommandProtocol,
 
                        .InterfaceStrIndex      = NO_DESCRIPTOR
                },
 
        .CDC1_Functional_Header =
                {
-                       .Header                 = {.Size = sizeof(USB_Descriptor_CDC_FunctionalHeader_t), .Type = DTYPE_CSInterface},
-                       .Subtype                = 0x00,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_Header,
 
                        .CDCSpecification       = VERSION_BCD(01.10),
                },
 
        .CDC1_Functional_ACM =
                {
-                       .Header                 = {.Size = sizeof(USB_Descriptor_CDC_FunctionalACM_t), .Type = DTYPE_CSInterface},
-                       .Subtype                = 0x02,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_ACM,
 
                        .Capabilities           = 0x06,
                },
 
        .CDC1_Functional_Union =
                {
-                       .Header                 = {.Size = sizeof(USB_Descriptor_CDC_FunctionalUnion_t), .Type = DTYPE_CSInterface},
-                       .Subtype                = 0x06,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_Union,
 
                        .MasterInterfaceNumber  = 0,
                        .SlaveInterfaceNumber   = 1,
@@ -172,9 +172,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
                        .TotalEndpoints         = 2,
 
-                       .Class                  = 0x0A,
-                       .SubClass               = 0x00,
-                       .Protocol               = 0x00,
+                       .Class                  = CDC_CSCP_CDCDataClass,
+                       .SubClass               = CDC_CSCP_NoDataSubclass,
+                       .Protocol               = CDC_CSCP_NoDataProtocol,
 
                        .InterfaceStrIndex      = NO_DESCRIPTOR
                },
@@ -186,7 +186,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC1_RX_EPNUM),
                        .Attributes             = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
                        .EndpointSize           = CDC_TXRX_EPSIZE,
-                       .PollingIntervalMS      = 0x00
+                       .PollingIntervalMS      = 0x01
                },
 
        .CDC1_DataInEndpoint =
@@ -196,7 +196,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC1_TX_EPNUM),
                        .Attributes             = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
                        .EndpointSize           = CDC_TXRX_EPSIZE,
-                       .PollingIntervalMS      = 0x00
+                       .PollingIntervalMS      = 0x01
                },
 
        .CDC2_IAD =
@@ -206,9 +206,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .FirstInterfaceIndex    = 2,
                        .TotalInterfaces        = 2,
 
-                       .Class                  = 0x02,
-                       .SubClass               = 0x02,
-                       .Protocol               = 0x01,
+                       .Class                  = CDC_CSCP_CDCClass,
+                       .SubClass               = CDC_CSCP_ACMSubclass,
+                       .Protocol               = CDC_CSCP_ATCommandProtocol,
 
                        .IADStrIndex            = NO_DESCRIPTOR
                },
@@ -222,33 +222,33 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
                        .TotalEndpoints         = 1,
 
-                       .Class                  = 0x02,
-                       .SubClass               = 0x02,
-                       .Protocol               = 0x01,
+                       .Class                  = CDC_CSCP_CDCClass,
+                       .SubClass               = CDC_CSCP_ACMSubclass,
+                       .Protocol               = CDC_CSCP_ATCommandProtocol,
 
                        .InterfaceStrIndex      = NO_DESCRIPTOR
                },
 
        .CDC2_Functional_Header =
                {
-                       .Header                 = {.Size = sizeof(USB_Descriptor_CDC_FunctionalHeader_t), .Type = DTYPE_CSInterface},
-                       .Subtype                = 0x00,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_Header,
 
                        .CDCSpecification       = VERSION_BCD(01.10),
                },
 
        .CDC2_Functional_ACM =
                {
-                       .Header                 = {.Size = sizeof(USB_Descriptor_CDC_FunctionalACM_t), .Type = DTYPE_CSInterface},
-                       .Subtype                = 0x02,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_ACM,
 
                        .Capabilities           = 0x06,
                },
 
        .CDC2_Functional_Union =
                {
-                       .Header                 = {.Size = sizeof(USB_Descriptor_CDC_FunctionalUnion_t), .Type = DTYPE_CSInterface},
-                       .Subtype                = 0x06,
+                       .Header                 = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
+                       .Subtype                = CDC_DSUBTYPE_CSInterface_Union,
 
                        .MasterInterfaceNumber  = 2,
                        .SlaveInterfaceNumber   = 3,
@@ -273,9 +273,9 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
 
                        .TotalEndpoints         = 2,
 
-                       .Class                  = 0x0A,
-                       .SubClass               = 0x00,
-                       .Protocol               = 0x00,
+                       .Class                  = CDC_CSCP_CDCDataClass,
+                       .SubClass               = CDC_CSCP_NoDataSubclass,
+                       .Protocol               = CDC_CSCP_NoDataProtocol,
 
                        .InterfaceStrIndex      = NO_DESCRIPTOR
                },
@@ -287,7 +287,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_OUT | CDC2_RX_EPNUM),
                        .Attributes             = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
                        .EndpointSize           = CDC_TXRX_EPSIZE,
-                       .PollingIntervalMS      = 0x00
+                       .PollingIntervalMS      = 0x01
                },
 
        .CDC2_DataInEndpoint =
@@ -297,7 +297,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_IN | CDC2_TX_EPNUM),
                        .Attributes             = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
                        .EndpointSize           = CDC_TXRX_EPSIZE,
-                       .PollingIntervalMS      = 0x00
+                       .PollingIntervalMS      = 0x01
                }
 };
 
@@ -305,7 +305,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
  *  the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
  *  via the language ID table available at USB.org what languages the device supports for its string descriptors.
  */
-USB_Descriptor_String_t PROGMEM LanguageString =
+const USB_Descriptor_String_t PROGMEM LanguageString =
 {
        .Header                 = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
 
@@ -316,7 +316,7 @@ USB_Descriptor_String_t PROGMEM LanguageString =
  *  form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
  *  Descriptor.
  */
-USB_Descriptor_String_t PROGMEM ManufacturerString =
+const USB_Descriptor_String_t PROGMEM ManufacturerString =
 {
        .Header                 = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
 
@@ -327,7 +327,7 @@ USB_Descriptor_String_t PROGMEM ManufacturerString =
  *  and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
  *  Descriptor.
  */
-USB_Descriptor_String_t PROGMEM ProductString =
+const USB_Descriptor_String_t PROGMEM ProductString =
 {
        .Header                 = {.Size = USB_STRING_LEN(13), .Type = DTYPE_String},