summaryrefslogtreecommitdiffhomepage
path: root/digital/zigbit/bitcloud/stack/Components/HAL/drivers/USBClasses/common/src/usbDescriptors.c
blob: 663beeee4ed4a3bc0494d7335918071ed2318ddb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
/****************************************************************************//**
  \file usbDescriptors.c

  \brief Virtual communication port descriptors.

  \author
    Atmel Corporation: http://www.atmel.com \n
    Support email: avr@atmel.com

  Copyright (c) 2008-2011, Atmel Corporation. All rights reserved.
  Licensed under Atmel's Limited License Agreement (BitCloudTM).

  \internal
  History:
    11/09/08 A. Khromykh - Created
    26/08/11 N. Fomin - Modified (MSD support)
*******************************************************************************/
/******************************************************************************
                   Includes section
******************************************************************************/
#include <usbDescriptors.h>

/******************************************************************************
                   Define(s) section
******************************************************************************/
// Descriptor's type definitions.
#define DESCRIPTOR_TYPE_DEVICE                0x01
#define DESCRIPTOR_TYPE_CONFIGURATION         0x02
#define DESCRIPTOR_TYPE_STRING                0x03
#define DESCRIPTOR_TYPE_INTERFACE             0x04
#define DESCRIPTOR_TYPE_CS_INTERFACE          0x24
#define DESCRIPTOR_TYPE_ENDPOINT              0x05
#define DESCRIPTOR_TYPE_DEVICE_QUALIFIER      0x06
#define DESCRIPTOR_TYPE_OTHER_SPEED_CFG       0x07
#define DESCRIPTOR_TYPE_INTERFACE_POWER       0x08
#define DESCRIPTOR_TYPE_INTERFACE_ASSOCIATION 0x0B
#define DESCRIPTOR_TYPE_DFU_FUNCTIONAL        0x21

// String definitions' indexes.
#define MANUFACTURER_STRING_INDEX     0
#define PRODUCT_STRING_INDEX          0
#define SERIAL_NUMBER_STRING_INDEX    0
#define CONFIGURATION_STRING_INDEX    0
#define FIRST_INTERFACE_STRING_INDEX  0
#define SECOND_INTERFACE_STRING_INDEX 0
#define THIRD_INTERFACE_STRING_INDEX  0
#define FOURTH_INTERFACE_STRING_INDEX 0

#define VENDOR_ID       0x03EB    // Atmel
#if (APP_INTERFACE == APP_INTERFACE_VCP)
  #if (MSD_SUPPORT == 1)
    #if (DFU_SUPPORT == 1)
      #define PRODUCT_ID      0x6122
    #else
      #define PRODUCT_ID      0x6121
    #endif // (DFU_SUPPORT == 1)
  #else // (MSD_SUPPORT == 1)
    #if (DFU_SUPPORT == 1)
      #define PRODUCT_ID      0x6120
    #else
      #define PRODUCT_ID      0x6119
    #endif // (DFU_SUPPORT == 1)
  #endif // (MSD_SUPPORT == 1)
#else // (APP_INTERFACE == APP_INTERFACE_VCP)
  #if (MSD_SUPPORT == 1)
    #if (DFU_SUPPORT == 1)
      #define PRODUCT_ID      0x6124
    #else
      #define PRODUCT_ID      0x6123
    #endif // (DFU_SUPPORT == 1)
  #else // (MSD_SUPPORT == 1)
    #define PRODUCT_ID        0x6119
  #endif // (MSD_SUPPORT == 1)
#endif // (APP_INTERFACE == APP_INTERFACE_VCP)

#define DEVICE_RELEASE  0x0001
#define USB_BUS_RELEASE 0x0200

// Number of possible configurations for the device.
#define NUMBER_OF_CONFIGURATIONS     0x01

// Class specification parameters of communication device.
#define CDC_DEVICE_CLASS       0x02
#define CDC_DEVICE_SUBCLASS    0x00
#define CDC_DEVICE_PROTOCOL    0x00

// Class specification parameters of mass storage device.
#define MSC_DEVICE_CLASS       0x00
#define MSC_DEVICE_SUBCLASS    0x00
#define MSC_DEVICE_PROTOCOL    0x00

// Class specification parameters of composite device with CDC.
#define COMB_DEVICE_CLASS       0xef
#define COMB_DEVICE_SUBCLASS    0x02
#define COMB_DEVICE_PROTOCOL    0x01

// Endpoint definitions' sizes.
#if defined(AT91SAM7X256)
  #define SZ_CONTROL_ENDPOINT      0x08      // endpoint 0 is control pipe
#elif defined(AT90USB1287) || defined(AT91SAM3S4C)
  #define SZ_CONTROL_ENDPOINT      0x40      // endpoint 0 is control pipe
#endif
#define SZ_ACM_INT_ENDPOINT      0x0008    // endpoint 3 is interrupt pipe for abstraction control model
#define SZ_CDC_BULKIN_ENDPOINT   BULK_SIZE // endpoint 2 is bulk pipe for input communication data
#define SZ_CDC_BULKOUT_ENDPOINT  BULK_SIZE // endpoint 1 is bulk pipe for output communication data
#define SZ_MSC_BULKIN_ENDPOINT   BULK_SIZE // endpoint 2 is bulk pipe for input communication data
#define SZ_MSC_BULKOUT_ENDPOINT  BULK_SIZE // endpoint 1 is bulk pipe for output communication data

// Configuration descriptor parameters.
// Common size of all descriptors in the vcp configuration besides configuration descriptor
#define COMMON_VCP_CFG_SIZE (sizeof(InterfaceDescriptor_t) + \
                             sizeof(HeaderFunctionalDescriptor_t) + \
                             sizeof(CallManagmentFunctionalDescriptor_t) + \
                             sizeof(AbstractControlManagmentDescriptor_t) + \
                             sizeof(UnionFunctionalDescriptor_t) + \
                             sizeof(HAL_UsbEndPointDescptr_t) + \
                             sizeof(InterfaceDescriptor_t) + \
                             sizeof(HAL_UsbEndPointDescptr_t) + \
                             sizeof(HAL_UsbEndPointDescptr_t))
// Common size of all descriptors in the msd configuration besides configuration descriptor
#define COMMON_MSD_CFG_SIZE (sizeof(InterfaceDescriptor_t) + \
                             sizeof(HAL_UsbEndPointDescptr_t) + \
                             sizeof(HAL_UsbEndPointDescptr_t))
// Commom size of all descriptors for DFU besides configuration descriptor 
#define COMMON_DFU_CFG_SIZE (sizeof(InterfaceDescriptor_t) + \
                             sizeof(DfuFunctionalDescriptor_t))

#if (APP_INTERFACE == APP_INTERFACE_VCP)
  #if (MSD_SUPPORT == 1)
    #if (DFU_SUPPORT == 1)
      #define CFG_SIZE (COMMON_DFU_CFG_SIZE + COMMON_MSD_CFG_SIZE + COMMON_VCP_CFG_SIZE + sizeof(ConfigurationDescriptor_t) + \
                        sizeof(InterfaceAssociationDescriptor_t))
    #else // (DFU_SUPPORT == 1)
      #define CFG_SIZE (COMMON_MSD_CFG_SIZE + COMMON_VCP_CFG_SIZE + sizeof(ConfigurationDescriptor_t) + \
                        sizeof(InterfaceAssociationDescriptor_t))
    #endif // (DFU_SUPPORT == 1)
  #else // (MSD_SUPPORT == 1)
    #if (DFU_SUPPORT == 1)
      #define CFG_SIZE (COMMON_DFU_CFG_SIZE + COMMON_VCP_CFG_SIZE + sizeof(ConfigurationDescriptor_t) + \
                        sizeof(InterfaceAssociationDescriptor_t))
    #else // (DFU_SUPPORT == 1)
      #define CFG_SIZE (COMMON_VCP_CFG_SIZE + sizeof(ConfigurationDescriptor_t))
    #endif // (DFU_SUPPORT == 1)
  #endif
#else // (APP_INTERFACE == APP_INTERFACE_VCP)
  #if (DFU_SUPPORT == 1)
    #define CFG_SIZE (COMMON_DFU_CFG_SIZE + COMMON_MSD_CFG_SIZE + sizeof(ConfigurationDescriptor_t))
  #else // (DFU_SUPPORT == 1)
    #define CFG_SIZE (COMMON_MSD_CFG_SIZE + sizeof(ConfigurationDescriptor_t))
  #endif // (DFU_SUPPORT == 1)
#endif

#if (APP_INTERFACE == APP_INTERFACE_VCP)
  #if (MSD_SUPPORT == 1)
    #if (DFU_SUPPORT == 1)
      #define NUMBER_OF_INTERFACES      0x04
    #else
      #define NUMBER_OF_INTERFACES      0x03
    #endif
  #else
    #define NUMBER_OF_INTERFACES      0x02
  #endif
#else
  #if (DFU_SUPPORT == 1)
    #define NUMBER_OF_INTERFACES      0x02
  #else
    #define NUMBER_OF_INTERFACES      0x01
  #endif
#endif

#define CFG_SELECTING_VALUE       0x01
#define CFG_CHARACTERISTICS       0x80  // D7 is reserved and must be set to one for historical reasons.
#define MAXIMUM_POWER_CONSUMPTION 0x32  // Step is 2 mA.

// Parameters for interfaces descriptors
#define ALTERNATIVE_SETTING                0x00
#define NUMBER_USING_ENDPOINTS_FIRST_IFC   0x01
#define NUMBER_USING_ENDPOINTS_SECOND_IFC  0x02
#define NUMBER_USING_ENDPOINTS_THIRD_IFC   0x02
#define NUMBER_USING_ENDPOINTS_FOURTH_IFC  0x00
#define FIRST_IFC_CLASS        0x02
#define FIRST_IFC_SUBCLASS     0x02
#define FIRST_IFC_PROTOCOL     0x00
#define SECOND_IFC_CLASS       0x0A
#define SECOND_IFC_SUBCLASS    0x00
#define SECOND_IFC_PROTOCOL    0x00
#define THIRD_IFC_CLASS        0x08
#define THIRD_IFC_SUBCLASS     0x06
#define THIRD_IFC_PROTOCOL     0x50
#define FOURTH_IFC_CLASS       0xFE
#define FOURTH_IFC_SUBCLASS    0x01
#define FOURTH_IFC_PROTOCOL    0x01

// Header descriptor parameters.
#define HEADER_SUBTYPE        0x00
#define CDC_CLASS_DEFINITION  0x0110

// call management functional descriptor parameters.
#define CALL_MNGMT_SUBTYPE       0x01
#define CALL_MNGMT_CAPABILITIES  0x01  // See cdc specification.
#define NUMBER_OF_CALL_MNGMT     0x00

// abstract control management functional descriptor parameters.
#define ACM_SUBTYPE              0x02
#define ACM_CAPABILITIES         0x02  // see cdc specification

// Union functional descriptor parameters.
#define UNION_SUBTYPE            0x06
#define MASTER_IFC_TYPE          0x00
#define SLAVE0_IFC_TYPE          0x01

// Endpoints descriptor parameters.
#define ADDRESS_CDC_INTERRUPT_PIPE   0x83
#define ADDRESS_CDC_BULKIN_PIPE      0x82
#define ADDRESS_CDC_BULKOUT_PIPE     0x01
#define INTERRUPT_TYPE_PIPE          0x03
#define BULK_TYPE_PIPE               0x02
#define INTERRUPT_PIPE_POLLING       0x0A  // step is 1 ms
#define BULK_MAX_SPEED               0x00

// dfu functional descriptor parameters
#define DFU_ATTRIBUTES     0x01
#define DFU_DETACH_TIMEOUT 0xFFFF
#define DFU_TRANSFER_SIZE  SZ_CONTROL_ENDPOINT
#define DFU_VERSION        0x0101

/******************************************************************************
                   Constants section
******************************************************************************/
const DeviceDescriptor_t deviceDescr = {
  sizeof(DeviceDescriptor_t), // Size of this descriptor in bytes
  DESCRIPTOR_TYPE_DEVICE,     // Descriptor type
  USB_BUS_RELEASE,            // USB specification release number in BCD format
#if (APP_INTERFACE == APP_INTERFACE_VCP)
  #if (MSD_SUPPORT != 1) && (DFU_SUPPORT != 1)
  CDC_DEVICE_CLASS,           // Device class code
  CDC_DEVICE_SUBCLASS,        // Device subclass code
  CDC_DEVICE_PROTOCOL,        // Device protocol code
  #else // (MSD_SUPPORT != 1) && (DFU_SUPPORT != 1)
  COMB_DEVICE_CLASS,          // Device class code
  COMB_DEVICE_SUBCLASS,       // Device subclass code
  COMB_DEVICE_PROTOCOL,       // Device protocol code
  #endif // (MSD_SUPPORT != 1) && (DFU_SUPPORT != 1)
#else // (APP_INTERFACE == APP_INTERFACE_VCP)
  MSC_DEVICE_CLASS,           // Device class code
  MSC_DEVICE_SUBCLASS,        // Device subclass code
  MSC_DEVICE_PROTOCOL,        // Device protocol code
#endif // (APP_INTERFACE == APP_INTERFACE_VCP)
  SZ_CONTROL_ENDPOINT,        // Maximum packet size of endpoint 0 (in bytes)
  VENDOR_ID,                  // Vendor ID
  PRODUCT_ID,                 // Product ID
  DEVICE_RELEASE,             // Device release number in BCD format
  MANUFACTURER_STRING_INDEX,  // Index of the manufacturer string descriptor
  PRODUCT_STRING_INDEX,       // Index of the product string descriptor
  SERIAL_NUMBER_STRING_INDEX, // Index of the serial number string descriptor
  NUMBER_OF_CONFIGURATIONS    // Number of possible configurations for the device
};

const ConfigurationFrameResponse_t usbConfigDescr = {
  { // configuration
    sizeof(ConfigurationDescriptor_t),  // Size of the descriptor in bytes
    DESCRIPTOR_TYPE_CONFIGURATION,      // Descriptor type
    CFG_SIZE,                           // Length of all descriptors returned along with this configuration descriptor
    NUMBER_OF_INTERFACES,               // Number of interfaces in this configuration
    CFG_SELECTING_VALUE,                // Value for selecting this configuration
    CONFIGURATION_STRING_INDEX,         // Index of the configuration string descriptor
    CFG_CHARACTERISTICS,                // Configuration characteristics
    MAXIMUM_POWER_CONSUMPTION           // Maximum power consumption of the device when in this configuration
  },
#if (APP_INTERFACE == APP_INTERFACE_VCP)
  #if (MSD_SUPPORT == 1) || (DFU_SUPPORT == 1)
  { // cdcIAD
    sizeof(InterfaceAssociationDescriptor_t), // Size of this descriptor in bytes
    DESCRIPTOR_TYPE_INTERFACE_ASSOCIATION,    // Descriptor type
    NUMBER_OF_FIRST_INTERFACE,                // Interface number of the first interface that is associated with this function
    2,                                        // Number of contiguous interfaces that are associated with this function
    CDC_DEVICE_CLASS,                         // Class code
    CDC_DEVICE_SUBCLASS,                      // Subclass code
    CDC_DEVICE_PROTOCOL,                      // Protocol code
    FIRST_INTERFACE_STRING_INDEX              //Index of string descriptor describing this function
  },
  #endif // (MSD_SUPPORT == 1) || (DFU_SUPPORT == 1) 
  { // interface 1
    sizeof(InterfaceDescriptor_t),      // Size of the descriptor in bytes
    DESCRIPTOR_TYPE_INTERFACE,          // Descriptor type
    NUMBER_OF_FIRST_INTERFACE,          // Number of the interface in its configuration
    ALTERNATIVE_SETTING,                // Value to select this alternate interface setting
    NUMBER_USING_ENDPOINTS_FIRST_IFC,   // Number of endpoints used by the interface (excluding endpoint 0)
    FIRST_IFC_CLASS,                    // Interface class code
    FIRST_IFC_SUBCLASS,                 // Interface subclass code
    FIRST_IFC_PROTOCOL,                 // Interface protocol code
    FIRST_INTERFACE_STRING_INDEX        // Index of the interface string descriptor
  },
  { // header functional descriptor
    sizeof(HeaderFunctionalDescriptor_t),  // Size of the descriptor in bytes
    DESCRIPTOR_TYPE_CS_INTERFACE,          // Descriptor type
    HEADER_SUBTYPE,                        // Header functional descriptor subtype
    CDC_CLASS_DEFINITION                   // USB Class Definitions for Communication
  },
  { // Call Management Functional Descriptor
    sizeof(CallManagmentFunctionalDescriptor_t), // Size of the descriptor in bytes
    DESCRIPTOR_TYPE_CS_INTERFACE,                // Descriptor type
    CALL_MNGMT_SUBTYPE,                          // bDescriptor subtype: Call Management Func
    CALL_MNGMT_CAPABILITIES,                     // bmCapabilities: D1 + D0
    NUMBER_OF_CALL_MNGMT                         // bDataInterface: Data Class Interface 1
  },
  { // Abstract Control Management Functional Descriptor
    sizeof(AbstractControlManagmentDescriptor_t),  // Size of the descriptor in bytes
    DESCRIPTOR_TYPE_CS_INTERFACE,                  // Descriptor type
    ACM_SUBTYPE,                                   // Abstract Control Management Functional descriptor subtype
    ACM_CAPABILITIES                               // bmCapabilities: see cdc specification (support command type)
  },
  { // Union Functional Descriptor
    sizeof(UnionFunctionalDescriptor_t),  // Size of the descriptor in bytes
    DESCRIPTOR_TYPE_CS_INTERFACE,         // Descriptor type
    UNION_SUBTYPE,                        // Union Functional descriptor subtype
    MASTER_IFC_TYPE,                      // bMasterInterface: CDC Interface
    SLAVE0_IFC_TYPE                       // bSlaveInterface0: Data Class Interface
  },
  { // endpoint 3
    sizeof(HAL_UsbEndPointDescptr_t),   // Size of the descriptor in bytes
    DESCRIPTOR_TYPE_ENDPOINT,           // Descriptor type
    ADDRESS_CDC_INTERRUPT_PIPE,         // Address and direction of the endpoint
    INTERRUPT_TYPE_PIPE,                // Endpoint type and additional characteristics (for isochronous endpoints)
    SZ_ACM_INT_ENDPOINT,                // Maximum packet size (in bytes) of the endpoint
    INTERRUPT_PIPE_POLLING              // Polling rate of the endpoint
  },
  { // interface 2
    sizeof(InterfaceDescriptor_t),      // Size of the descriptor in bytes
    DESCRIPTOR_TYPE_INTERFACE,          // Descriptor type
    NUMBER_OF_SECOND_INTERFACE,         // Number of the interface in its configuration
    ALTERNATIVE_SETTING,                // Value to select this alternate interface setting
    NUMBER_USING_ENDPOINTS_SECOND_IFC,  // Number of endpoints used by the interface (excluding endpoint 0)
    SECOND_IFC_CLASS,                   // Interface class code
    SECOND_IFC_SUBCLASS,                // Interface subclass code
    SECOND_IFC_PROTOCOL,                // Interface protocol code
    SECOND_INTERFACE_STRING_INDEX       // Index of the interface string descriptor
  },
  {{ // endpoint 1
    sizeof(HAL_UsbEndPointDescptr_t),   // Size of the descriptor in bytes
    DESCRIPTOR_TYPE_ENDPOINT,           // Descriptor type
    ADDRESS_CDC_BULKOUT_PIPE,           // Address and direction of the endpoint
    BULK_TYPE_PIPE,                     // Endpoint type and additional characteristics (for isochronous endpoints)
    SZ_CDC_BULKOUT_ENDPOINT,            // Maximum packet size (in bytes) of the endpoint
    BULK_MAX_SPEED                      // Polling rate of the endpoint
  },
  { // endpoint 2
    sizeof(HAL_UsbEndPointDescptr_t),   // Size of the descriptor in bytes
    DESCRIPTOR_TYPE_ENDPOINT,           // Descriptor type
    ADDRESS_CDC_BULKIN_PIPE,            // Address and direction of the endpoint
    BULK_TYPE_PIPE,                     // Endpoint type and additional characteristics (for isochronous endpoints)
    SZ_CDC_BULKIN_ENDPOINT,             // Maximum packet size (in bytes) of the endpoint
    BULK_MAX_SPEED                      // Polling rate of the endpoint
  }},
#endif // (APP_INTERFACE == APP_INTERFACE_VCP)
#if (MSD_SUPPORT == 1)
  { // interface 3
    sizeof(InterfaceDescriptor_t),      // Size of the descriptor in bytes
    DESCRIPTOR_TYPE_INTERFACE,          // Descriptor type
#if (APP_INTERFACE == APP_INTERFACE_VCP)
    NUMBER_OF_THIRD_INTERFACE,          // Number of the interface in its configuration
#else
    NUMBER_OF_FIRST_INTERFACE,          // Number of the interface in its configuration
#endif
    ALTERNATIVE_SETTING,                // Value to select this alternate interface setting
    NUMBER_USING_ENDPOINTS_THIRD_IFC,   // Number of endpoints used by the interface (excluding endpoint 0)
    THIRD_IFC_CLASS,                    // Interface class code
    THIRD_IFC_SUBCLASS,                 // Interface subclass code
    THIRD_IFC_PROTOCOL,                 // Interface protocol code
    THIRD_INTERFACE_STRING_INDEX        // Index of the interface string descriptor
  },
    {{ // endpoint 6
    sizeof(HAL_UsbEndPointDescptr_t),   // Size of the descriptor in bytes
    DESCRIPTOR_TYPE_ENDPOINT,           // Descriptor type
    ADDRESS_MSC_BULKOUT_PIPE,           // Address and direction of the endpoint
    BULK_TYPE_PIPE,                     // Endpoint type and additional characteristics (for isochronous endpoints)
    SZ_MSC_BULKOUT_ENDPOINT,            // Maximum packet size (in bytes) of the endpoint
    BULK_MAX_SPEED                      // Polling rate of the endpoint
  },
  { // endpoint 5
    sizeof(HAL_UsbEndPointDescptr_t),   // Size of the descriptor in bytes
    DESCRIPTOR_TYPE_ENDPOINT,           // Descriptor type
    ADDRESS_MSC_BULKIN_PIPE,            // Address and direction of the endpoint
    BULK_TYPE_PIPE,                     // Endpoint type and additional characteristics (for isochronous endpoints)
    SZ_MSC_BULKIN_ENDPOINT,             // Maximum packet size (in bytes) of the endpoint
    BULK_MAX_SPEED                      // Polling rate of the endpoint
  }},
#endif // (MSD_SUPPORT == 1)
#if (DFU_SUPPORT == 1)
  { // interface 4
    sizeof(InterfaceDescriptor_t),      // Size of the descriptor in bytes
    DESCRIPTOR_TYPE_INTERFACE,          // Descriptor type
#if (APP_INTERFACE == APP_INTERFACE_VCP)
  #if (MSD_SUPPORT == 1)
    NUMBER_OF_FOURTH_INTERFACE,         // Number of the interface in its configuration
  #else
    NUMBER_OF_THIRD_INTERFACE,          // Number of the interface in its configuration
  #endif // (MSD_SUPPORT == 1)
#else
  #if (MSD_SUPPORT == 1)
    NUMBER_OF_SECOND_INTERFACE,         // Number of the interface in its configuration
  #else
    #error
  #endif // (MSD_SUPPORT == 1)
#endif // (APP_INTERFACE == APP_INTERFACE_VCP)
    ALTERNATIVE_SETTING,                // Value to select this alternate interface setting
    NUMBER_USING_ENDPOINTS_FOURTH_IFC,  // Number of endpoints used by the interface (excluding endpoint 0)
    FOURTH_IFC_CLASS,                   // Interface class code
    FOURTH_IFC_SUBCLASS,                // Interface subclass code
    FOURTH_IFC_PROTOCOL,                // Interface protocol code
    FOURTH_INTERFACE_STRING_INDEX       // Index of the interface string descriptor
  },
  { // Functional descriptor
    sizeof(DfuFunctionalDescriptor_t),  // Size of the descriptor in bytes
    DESCRIPTOR_TYPE_DFU_FUNCTIONAL,     // Descriptor type
    DFU_ATTRIBUTES,                     // Descriptor attributes
    DFU_DETACH_TIMEOUT,                 // Wait timeout of USB reset after DFU_DETACH request recieption
    DFU_TRANSFER_SIZE,                  // Maximum number of bytes that the device can accept per control-write transaction
    DFU_VERSION                         // DFU Version
  }
#endif // (DFU_SUPPORT == 1)
};

// eof usbDescriptors.c