65
78
.NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS
68
/** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage
69
* of the device in one of its supported configurations, including information about any device interfaces
70
* and endpoints. The descriptor is read out by the USB host during the enumeration process when selecting
71
* a configuration so that the host may correctly communicate with the USB device.
81
/** Configuration descriptor structure. This descriptor, located in FLASH
82
* memory, describes the usage of the device in one of its supported
83
* configurations, including information about any device interfaces and
84
* endpoints. The descriptor is read out by the USB host during the
85
* enumeration process when selecting a configuration so that the host may
86
* correctly communicate with the USB device.
73
88
const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
77
.Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
79
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
82
.ConfigurationNumber = 1,
83
.ConfigurationStrIndex = NO_DESCRIPTOR,
85
.ConfigAttributes = (USB_CONFIG_ATTR_RESERVED | USB_CONFIG_ATTR_SELFPOWERED),
87
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100)
93
.Size = sizeof(USB_Descriptor_Configuration_Header_t),
94
.Type = DTYPE_Configuration,
97
.TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t),
100
.ConfigurationNumber = 1,
101
.ConfigurationStrIndex = NO_DESCRIPTOR,
103
.ConfigAttributes = (USB_CONFIG_ATTR_RESERVED |
104
USB_CONFIG_ATTR_SELFPOWERED),
106
.MaxPowerConsumption = USB_CONFIG_POWER_MA(100),
90
109
.CDC_CCI_Interface =
92
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
95
.AlternateSetting = 0,
99
.Class = CDC_CSCP_CDCClass,
100
.SubClass = CDC_CSCP_ACMSubclass,
101
.Protocol = CDC_CSCP_ATCommandProtocol,
103
.InterfaceStrIndex = NO_DESCRIPTOR
112
.Size = sizeof(USB_Descriptor_Interface_t),
113
.Type = DTYPE_Interface,
116
.InterfaceNumber = 0,
117
.AlternateSetting = 0,
121
.Class = CDC_CSCP_CDCClass,
122
.SubClass = CDC_CSCP_ACMSubclass,
123
.Protocol = CDC_CSCP_ATCommandProtocol,
125
.InterfaceStrIndex = NO_DESCRIPTOR,
106
128
.CDC_Functional_Header =
108
.Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
109
.Subtype = CDC_DSUBTYPE_CSInterface_Header,
111
.CDCSpecification = VERSION_BCD(01.10),
131
.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t),
132
.Type = DTYPE_CSInterface,
135
.Subtype = CDC_DSUBTYPE_CSInterface_Header,
137
.CDCSpecification = VERSION_BCD(01.10),
114
140
.CDC_Functional_ACM =
116
.Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
117
.Subtype = CDC_DSUBTYPE_CSInterface_ACM,
119
.Capabilities = 0x06,
143
.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t),
144
.Type = DTYPE_CSInterface,
147
.Subtype = CDC_DSUBTYPE_CSInterface_ACM,
149
.Capabilities = 0x06,
122
152
.CDC_Functional_Union =
124
.Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
125
.Subtype = CDC_DSUBTYPE_CSInterface_Union,
127
.MasterInterfaceNumber = 0,
128
.SlaveInterfaceNumber = 1,
155
.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t),
156
.Type = DTYPE_CSInterface,
159
.Subtype = CDC_DSUBTYPE_CSInterface_Union,
161
.MasterInterfaceNumber = 0,
162
.SlaveInterfaceNumber = 1,
131
165
.CDC_NotificationEndpoint =
133
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
135
.EndpointAddress = CDC_NOTIFICATION_EPADDR,
136
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
137
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
138
.PollingIntervalMS = 0xFF
168
.Size = sizeof(USB_Descriptor_Endpoint_t),
169
.Type = DTYPE_Endpoint,
172
.EndpointAddress = CDC_NOTIFICATION_EPADDR,
173
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC |
174
ENDPOINT_USAGE_DATA),
175
.EndpointSize = CDC_NOTIFICATION_EPSIZE,
176
.PollingIntervalMS = 0xFF,
141
179
.CDC_DCI_Interface =
143
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
145
.InterfaceNumber = 1,
146
.AlternateSetting = 0,
150
.Class = CDC_CSCP_CDCDataClass,
151
.SubClass = CDC_CSCP_NoDataSubclass,
152
.Protocol = CDC_CSCP_NoDataProtocol,
154
.InterfaceStrIndex = NO_DESCRIPTOR
182
.Size = sizeof(USB_Descriptor_Interface_t),
183
.Type = DTYPE_Interface,
186
.InterfaceNumber = 1,
187
.AlternateSetting = 0,
191
.Class = CDC_CSCP_CDCDataClass,
192
.SubClass = CDC_CSCP_NoDataSubclass,
193
.Protocol = CDC_CSCP_NoDataProtocol,
195
.InterfaceStrIndex = NO_DESCRIPTOR,
157
198
.CDC_DataOutEndpoint =
159
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
161
.EndpointAddress = CDC_RX_EPADDR,
162
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
163
.EndpointSize = CDC_TXRX_EPSIZE,
164
.PollingIntervalMS = 0x05
201
.Size = sizeof(USB_Descriptor_Endpoint_t),
202
.Type = DTYPE_Endpoint,
205
.EndpointAddress = CDC_RX_EPADDR,
206
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC |
207
ENDPOINT_USAGE_DATA),
208
.EndpointSize = CDC_TXRX_EPSIZE,
209
.PollingIntervalMS = 0x05,
167
212
.CDC_DataInEndpoint =
169
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
215
.Size = sizeof(USB_Descriptor_Endpoint_t),
216
.Type = DTYPE_Endpoint,
171
.EndpointAddress = CDC_TX_EPADDR,
172
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
173
.EndpointSize = CDC_TXRX_EPSIZE,
174
.PollingIntervalMS = 0x05
219
.EndpointAddress = CDC_TX_EPADDR,
220
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC |
221
ENDPOINT_USAGE_DATA),
222
.EndpointSize = CDC_TXRX_EPSIZE,
223
.PollingIntervalMS = 0x05,
178
/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
179
* the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
180
* via the language ID table available at USB.org what languages the device supports for its string descriptors.
227
/** Language descriptor structure. This descriptor, located in FLASH memory,
228
* is returned when the host requests the string descriptor with index 0 (the
229
* first index). It is actually an array of 16-bit integers, which indicate
230
* via the language ID table available at USB.org what languages the device
231
* supports for its string descriptors.
182
233
const USB_Descriptor_String_t PROGMEM LanguageString =
184
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
236
.Size = USB_STRING_LEN(1),
237
.Type = DTYPE_String,
186
240
.UnicodeString = {LANGUAGE_ID_ENG}
189
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
190
* form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
243
/** Manufacturer descriptor string. This is a Unicode string containing the
244
* manufacturer's details in human readable form, and is read out upon request
245
* by the host when the appropriate string ID is requested, listed in the
193
248
const USB_Descriptor_String_t PROGMEM ManufacturerString =
195
.Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
251
.Size = USB_STRING_LEN(4),
252
.Type = DTYPE_String,
197
.UnicodeString = L"Dean Camera"
255
.UnicodeString = L"edam"
200
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
201
* and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
258
/** Product descriptor string. This is a Unicode string containing the
259
* product's details in human readable form, and is read out upon request by
260
* the host when the appropriate string ID is requested, listed in the Device
204
263
const USB_Descriptor_String_t PROGMEM ProductString =
206
.Header = {.Size = USB_STRING_LEN(13), .Type = DTYPE_String},
266
.Size = USB_STRING_LEN(14),
267
.Type = DTYPE_String,
208
.UnicodeString = L"LUFA CDC Demo"
270
.UnicodeString = L"Audio Switcher"
211
/** This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors"
212
* documentation) by the application code so that the address and size of a requested descriptor can be given
213
* to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function
214
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
273
/** This function is called by the library when in device mode, and must be
274
* overridden (see library "USB Descriptors" documentation) by the application
275
* code so that the address and size of a requested descriptor can be given to
276
* the USB library. When the device receives a Get Descriptor request on the
277
* control endpoint, this function is called so that the descriptor details
278
* can be passed back and the appropriate descriptor sent back to the USB
217
281
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
218
282
const uint8_t wIndex,