1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
24
29
34
39
44
45
46
47
50
51
53
54
55
56
57
58
60
61
62
63
64
65
66
67
68
69
70
71
72
77
78
79
80
81
82
83
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
125
126
127
128
129
130
131
132
133
134
135
136
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
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
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
277
278
279
280
281
282
283
288
289
290
296
297
298
299
300
301
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
391
392
393
399
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
440
441
442
443
444
445
446
447
453
454
455
456
457
458
459
460
461
462
463
464
465
466
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
532
533
534
535
536
537
543
544
545
546
547
548
557
558
559
560
561
562
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
/* ... */
#include "ux_device_descriptors.h"
Includes
Private includes
Private typedef
Private define
Private macro
USBD_DevClassHandleTypeDef USBD_Device_FS, USBD_Device_HS;
uint8_t UserClassInstance[USBD_MAX_CLASS_INTERFACES] = {
CLASS_TYPE_CDC_ECM,
...};
/* ... */
#if defined ( __ICCARM__ )
#pragma data_alignment=4
#endif
__ALIGN_BEGIN static uint8_t DevFrameWorkDesc_FS[USBD_FRAMEWORK_MAX_DESC_SZ] __ALIGN_END = {0};
/* ... */
#if defined ( __ICCARM__ )
#pragma data_alignment=4
#endif
__ALIGN_BEGIN static uint8_t DevFrameWorkDesc_HS[USBD_FRAMEWORK_MAX_DESC_SZ] __ALIGN_END = {0};
static uint8_t *pDevFrameWorkDesc_FS = DevFrameWorkDesc_FS;
static uint8_t *pDevFrameWorkDesc_HS = DevFrameWorkDesc_HS;
/* ... */
#if defined ( __ICCARM__ )
#pragma data_alignment=4
#endif
__ALIGN_BEGIN UCHAR USBD_string_framework[USBD_STRING_FRAMEWORK_MAX_LENGTH]
__ALIGN_END = {0};
/* ... */
#if defined ( __ICCARM__ )
#pragma data_alignment=4
#endif
UCHAR USBD_language_id_framework[LANGUAGE_ID_MAX_LENGTH] = {0};
Private variables
static void USBD_Desc_GetString(uint8_t *desc, uint8_t *Buffer, uint16_t *len);
static uint8_t USBD_Desc_GetLen(uint8_t *buf);
static uint8_t *USBD_Device_Framework_Builder(USBD_DevClassHandleTypeDef *pdev,
uint8_t *pDevFrameWorkDesc,
uint8_t *UserClassInstance,
uint8_t Speed);
static uint8_t USBD_FrameWork_AddToConfDesc(USBD_DevClassHandleTypeDef *pdev,
uint8_t Speed,
uint8_t *pCmpstConfDesc);
static uint8_t USBD_FrameWork_AddClass(USBD_DevClassHandleTypeDef *pdev,
USBD_CompositeClassTypeDef class,
uint8_t cfgidx, uint8_t Speed,
uint8_t *pCmpstConfDesc);
static uint8_t USBD_FrameWork_FindFreeIFNbr(USBD_DevClassHandleTypeDef *pdev);
static void USBD_FrameWork_AddConfDesc(uint32_t Conf, uint32_t *pSze);
static void USBD_FrameWork_AssignEp(USBD_DevClassHandleTypeDef *pdev, uint8_t Add,
uint8_t Type, uint32_t Sze);
#if USBD_CDC_ECM_CLASS_ACTIVATED == 1U
static void USBD_FrameWork_CDCECMDesc(USBD_DevClassHandleTypeDef *pdev,
uint32_t pConf, uint32_t *Sze);/* ... */
#endif
Private function prototypes
/* ... */
uint8_t *USBD_Get_Device_Framework_Speed(uint8_t Speed, ULONG *Length)
{
uint8_t *pFrameWork = NULL;
if (USBD_FULL_SPEED == Speed)
{
USBD_Device_Framework_Builder(&USBD_Device_FS, pDevFrameWorkDesc_FS,
UserClassInstance, Speed);
*Length = (ULONG)(USBD_Device_FS.CurrDevDescSz + USBD_Device_FS.CurrConfDescSz);
pFrameWork = pDevFrameWorkDesc_FS;
}if (USBD_FULL_SPEED == Speed) { ... }
else
{
USBD_Device_Framework_Builder(&USBD_Device_HS, pDevFrameWorkDesc_HS,
UserClassInstance, Speed);
*Length = (ULONG)(USBD_Device_HS.CurrDevDescSz + USBD_Device_HS.CurrConfDescSz);
pFrameWork = pDevFrameWorkDesc_HS;
}else { ... }
return pFrameWork;
}{ ... }
/* ... */
uint8_t *USBD_Get_String_Framework(ULONG *Length)
{
uint16_t len = 0U;
uint8_t count = 0U;
USBD_string_framework[count++] = USBD_LANGID_STRING & 0xFF;
USBD_string_framework[count++] = USBD_LANGID_STRING >> 8;
USBD_string_framework[count++] = USBD_IDX_MFC_STR;
USBD_Desc_GetString((uint8_t *)USBD_MANUFACTURER_STRING, USBD_string_framework + count, &len);
count += len + 1;
USBD_string_framework[count++] = USBD_LANGID_STRING & 0xFF;
USBD_string_framework[count++] = USBD_LANGID_STRING >> 8;
USBD_string_framework[count++] = USBD_IDX_PRODUCT_STR;
USBD_Desc_GetString((uint8_t *)USBD_PRODUCT_STRING, USBD_string_framework + count, &len);
count += len + 1;
USBD_string_framework[count++] = USBD_LANGID_STRING & 0xFF;
USBD_string_framework[count++] = USBD_LANGID_STRING >> 8;
USBD_string_framework[count++] = USBD_IDX_SERIAL_STR;
USBD_Desc_GetString((uint8_t *)USBD_SERIAL_NUMBER, USBD_string_framework + count, &len);
#if USBD_CDC_ECM_CLASS_ACTIVATED
count += len + 1;
USBD_string_framework[count++] = USBD_LANGID_STRING & 0xFF;
USBD_string_framework[count++] = USBD_LANGID_STRING >> 8;
USBD_string_framework[count++] = CDC_ECM_MAC_STRING_INDEX;
USBD_Desc_GetString((uint8_t *)CDC_ECM_MAC_STR_DESC, USBD_string_framework + count, &len);
/* ... */
#endif
*Length = strlen((const char *)USBD_string_framework);
return USBD_string_framework;
}{ ... }
/* ... */
uint8_t *USBD_Get_Language_Id_Framework(ULONG *Length)
{
uint8_t count = 0U;
USBD_language_id_framework[count++] = USBD_LANGID_STRING & 0xFF;
USBD_language_id_framework[count++] = USBD_LANGID_STRING >> 8;
*Length = strlen((const char *)USBD_language_id_framework);
return USBD_language_id_framework;
}{ ... }
/* ... */
static void USBD_Desc_GetString(uint8_t *desc, uint8_t *unicode, uint16_t *len)
{
uint8_t idx = 0U;
uint8_t *pdesc;
if (desc == NULL)
{
return;
}if (desc == NULL) { ... }
pdesc = desc;
*len = (uint16_t)USBD_Desc_GetLen(pdesc);
unicode[idx++] = *(uint8_t *)len;
while (*pdesc != (uint8_t)'\0')
{
unicode[idx++] = *pdesc;
pdesc++;
}while (*pdesc != (uint8_t)'\0') { ... }
}{ ... }
/* ... */
static uint8_t USBD_Desc_GetLen(uint8_t *buf)
{
uint8_t len = 0U;
uint8_t *pbuff = buf;
while (*pbuff != (uint8_t)'\0')
{
len++;
pbuff++;
}while (*pbuff != (uint8_t)'\0') { ... }
return len;
}{ ... }
/* ... */
static uint8_t *USBD_Device_Framework_Builder(USBD_DevClassHandleTypeDef *pdev,
uint8_t *pDevFrameWorkDesc,
uint8_t *UserClassInstance,
uint8_t Speed)
{
static USBD_DeviceDescTypedef *pDevDesc;
static USBD_DevQualiDescTypedef *pDevQualDesc;
uint8_t Idx_Instance = 0U;
uint8_t NumberClass = 1U;
pdev->CurrConfDescSz = 0U;
pdev->CurrDevDescSz = 0U;
pDevDesc = (USBD_DeviceDescTypedef *)pDevFrameWorkDesc;
pDevDesc->bLength = (uint8_t)sizeof(USBD_DeviceDescTypedef);
pDevDesc->bDescriptorType = UX_DEVICE_DESCRIPTOR_ITEM;
pDevDesc->bcdUSB = USB_BCDUSB;
pDevDesc->bDeviceClass = 0x00;
pDevDesc->bDeviceSubClass = 0x00;
pDevDesc->bDeviceProtocol = 0x00;
pDevDesc->bMaxPacketSize = USBD_MAX_EP0_SIZE;
pDevDesc->idVendor = USBD_VID;
pDevDesc->idProduct = USBD_PID;
pDevDesc->bcdDevice = 0x0200;
pDevDesc->iManufacturer = USBD_IDX_MFC_STR;
pDevDesc->iProduct = USBD_IDX_PRODUCT_STR;
pDevDesc->iSerialNumber = USBD_IDX_SERIAL_STR;
pDevDesc->bNumConfigurations = USBD_MAX_NUM_CONFIGURATION;
pdev->CurrDevDescSz += (uint32_t)sizeof(USBD_DeviceDescTypedef);
if (Speed == USBD_HIGH_SPEED)
{
pDevQualDesc = (USBD_DevQualiDescTypedef *)(pDevFrameWorkDesc + pdev->CurrDevDescSz);
pDevQualDesc->bLength = (uint8_t)sizeof(USBD_DevQualiDescTypedef);
pDevQualDesc->bDescriptorType = UX_DEVICE_QUALIFIER_DESCRIPTOR_ITEM;
pDevQualDesc->bcdDevice = 0x0200;
pDevQualDesc->Class = 0x00;
pDevQualDesc->SubClass = 0x00;
pDevQualDesc->Protocol = 0x00;
pDevQualDesc->bMaxPacketSize = 0x40;
pDevQualDesc->bNumConfigurations = 0x01;
pDevQualDesc->bReserved = 0x00;
pdev->CurrDevDescSz += (uint32_t)sizeof(USBD_DevQualiDescTypedef);
}if (Speed == USBD_HIGH_SPEED) { ... }
while (Idx_Instance < USBD_MAX_SUPPORTED_CLASS)
{
if ((pdev->classId < USBD_MAX_SUPPORTED_CLASS) &&
(pdev->NumClasses < USBD_MAX_SUPPORTED_CLASS))
{
(void)USBD_FrameWork_AddClass(pdev,
(USBD_CompositeClassTypeDef)UserClassInstance[Idx_Instance],
0, Speed, (pDevFrameWorkDesc + pdev->CurrDevDescSz));
pdev->classId ++;
pdev->NumClasses ++;
}if ((pdev->classId < USBD_MAX_SUPPORTED_CLASS) && (pdev->NumClasses < USBD_MAX_SUPPORTED_CLASS)) { ... }
Idx_Instance++;
if (UserClassInstance[Idx_Instance] != CLASS_TYPE_NONE)
{
NumberClass++;
}if (UserClassInstance[Idx_Instance] != CLASS_TYPE_NONE) { ... }
}while (Idx_Instance < USBD_MAX_SUPPORTED_CLASS) { ... }
if (NumberClass > 1)
{
pDevDesc->bDeviceClass = 0xEF;
pDevDesc->bDeviceSubClass = 0x02;
pDevDesc->bDeviceProtocol = 0x01;
}if (NumberClass > 1) { ... }
else
{
if (UserClassInstance[0] == CLASS_TYPE_CDC_ACM)
{
pDevDesc->bDeviceClass = 0x02;
pDevDesc->bDeviceSubClass = 0x02;
pDevDesc->bDeviceProtocol = 0x00;
}if (UserClassInstance[0] == CLASS_TYPE_CDC_ACM) { ... }
}else { ... }
return pDevFrameWorkDesc;
}{ ... }
/* ... */
uint8_t USBD_FrameWork_AddClass(USBD_DevClassHandleTypeDef *pdev,
USBD_CompositeClassTypeDef class,
uint8_t cfgidx, uint8_t Speed,
uint8_t *pCmpstConfDesc)
{
if ((pdev->classId < USBD_MAX_SUPPORTED_CLASS) &&
(pdev->tclasslist[pdev->classId].Active == 0U))
{
pdev->tclasslist[pdev->classId].ClassId = pdev->classId;
pdev->tclasslist[pdev->classId].Active = 1U;
pdev->tclasslist[pdev->classId].ClassType = class;
if (USBD_FrameWork_AddToConfDesc(pdev, Speed, pCmpstConfDesc) != UX_SUCCESS)
{
return UX_ERROR;
}if (USBD_FrameWork_AddToConfDesc(pdev, Speed, pCmpstConfDesc) != UX_SUCCESS) { ... }
}if ((pdev->classId < USBD_MAX_SUPPORTED_CLASS) && (pdev->tclasslist[pdev->classId].Active == 0U)) { ... }
UNUSED(cfgidx);
return UX_SUCCESS;
}{ ... }
/* ... */
uint8_t USBD_FrameWork_AddToConfDesc(USBD_DevClassHandleTypeDef *pdev, uint8_t Speed,
uint8_t *pCmpstConfDesc)
{
uint8_t interface = 0U;
pdev->Speed = Speed;
if (pdev->classId == 0U)
{
USBD_FrameWork_AddConfDesc((uint32_t)pCmpstConfDesc, &pdev->CurrConfDescSz);
}if (pdev->classId == 0U) { ... }
switch (pdev->tclasslist[pdev->classId].ClassType)
{
#if USBD_CDC_ECM_CLASS_ACTIVATED == 1
case CLASS_TYPE_CDC_ECM:
interface = USBD_FrameWork_FindFreeIFNbr(pdev);
pdev->tclasslist[pdev->classId].NumIf = 2U;
pdev->tclasslist[pdev->classId].Ifs[0] = interface;
pdev->tclasslist[pdev->classId].Ifs[1] = (uint8_t)(interface + 1U);
pdev->tclasslist[pdev->classId].NumEps = 3U;
if (Speed == USBD_HIGH_SPEED)
{
USBD_FrameWork_AssignEp(pdev, USBD_CDCECM_EPOUT_ADDR, USBD_EP_TYPE_BULK,
USBD_CDCECM_EPOUT_HS_MPS);
USBD_FrameWork_AssignEp(pdev, USBD_CDCECM_EPIN_ADDR, USBD_EP_TYPE_BULK,
USBD_CDCECM_EPIN_HS_MPS);
USBD_FrameWork_AssignEp(pdev, USBD_CDCECM_EPINCMD_ADDR, USBD_EP_TYPE_INTR,
USBD_CDCECM_EPINCMD_HS_MPS);
}if (Speed == USBD_HIGH_SPEED) { ... }
else
{
USBD_FrameWork_AssignEp(pdev, USBD_CDCECM_EPOUT_ADDR, USBD_EP_TYPE_BULK,
USBD_CDCECM_EPOUT_FS_MPS);
USBD_FrameWork_AssignEp(pdev, USBD_CDCECM_EPIN_ADDR, USBD_EP_TYPE_BULK,
USBD_CDCECM_EPIN_FS_MPS);
USBD_FrameWork_AssignEp(pdev, USBD_CDCECM_EPINCMD_ADDR, USBD_EP_TYPE_INTR,
USBD_CDCECM_EPINCMD_FS_MPS);
}else { ... }
USBD_FrameWork_CDCECMDesc(pdev, (uint32_t)pCmpstConfDesc, &pdev->CurrConfDescSz);
break;/* ... */
#endif
case CLASS_TYPE_CDC_ECM:
default:
break;default
}switch (pdev->tclasslist[pdev->classId].ClassType) { ... }
return UX_SUCCESS;
}{ ... }
/* ... */
static uint8_t USBD_FrameWork_FindFreeIFNbr(USBD_DevClassHandleTypeDef *pdev)
{
uint32_t idx = 0U;
for (uint32_t i = 0U; i < pdev->NumClasses; i++)
{
for (uint32_t j = 0U; j < pdev->tclasslist[i].NumIf; j++)
{
idx++;
}for (uint32_t j = 0U; j < pdev->tclasslist[i].NumIf; j++) { ... }
}for (uint32_t i = 0U; i < pdev->NumClasses; i++) { ... }
return (uint8_t)idx;
}{ ... }
/* ... */
static void USBD_FrameWork_AddConfDesc(uint32_t Conf, uint32_t *pSze)
{
USBD_ConfigDescTypedef *ptr = (USBD_ConfigDescTypedef *)Conf;
ptr->bLength = (uint8_t)sizeof(USBD_ConfigDescTypedef);
ptr->bDescriptorType = USB_DESC_TYPE_CONFIGURATION;
ptr->wDescriptorLength = 0U;
ptr->bNumInterfaces = 0U;
ptr->bConfigurationValue = 1U;
ptr->iConfiguration = USBD_CONFIG_STR_DESC_IDX;
ptr->bmAttributes = USBD_CONFIG_BMATTRIBUTES;
ptr->bMaxPower = USBD_CONFIG_MAXPOWER;
*pSze += sizeof(USBD_ConfigDescTypedef);
}{ ... }
/* ... */
static void USBD_FrameWork_AssignEp(USBD_DevClassHandleTypeDef *pdev,
uint8_t Add, uint8_t Type, uint32_t Sze)
{
uint32_t idx = 0U;
while (((idx < (pdev->tclasslist[pdev->classId]).NumEps) && \
((pdev->tclasslist[pdev->classId].Eps[idx].is_used) != 0U)))
{
idx++;
}while (((idx < (pdev->tclasslist[pdev->classId]).NumEps) && \ ((pdev->tclasslist[pdev->classId].Eps[idx].is_used) != 0U))) { ... }
pdev->tclasslist[pdev->classId].Eps[idx].add = Add;
pdev->tclasslist[pdev->classId].Eps[idx].type = Type;
pdev->tclasslist[pdev->classId].Eps[idx].size = (uint16_t) Sze;
pdev->tclasslist[pdev->classId].Eps[idx].is_used = 1U;
}{ ... }
#if USBD_CDC_ECM_CLASS_ACTIVATED
/* ... */
static void USBD_FrameWork_CDCECMDesc(USBD_DevClassHandleTypeDef *pdev,
uint32_t pConf, uint32_t *Sze)
{
static USBD_IfDescTypedef *pIfDesc;
static USBD_EpDescTypedef *pEpDesc;
static USBD_ECMFuncDescTypedef *pFuncDesc;
static USBD_CDCHeaderFuncDescTypedef *pHeadDesc;
static USBD_CDCUnionFuncDescTypedef *pUnionDesc;
#if USBD_COMPOSITE_USE_IAD == 1
static USBD_IadDescTypedef *pIadDesc;
#endif
#if USBD_COMPOSITE_USE_IAD == 1
pIadDesc = ((USBD_IadDescTypedef *)(pConf + *Sze));
pIadDesc->bLength = (uint8_t)sizeof(USBD_IadDescTypedef);
pIadDesc->bDescriptorType = USB_DESC_TYPE_IAD;
pIadDesc->bFirstInterface = pdev->tclasslist[pdev->classId].Ifs[0];
pIadDesc->bInterfaceCount = 2;
pIadDesc->bFunctionClass = 0x02;
pIadDesc->bFunctionSubClass = 0x06;
pIadDesc->bFunctionProtocol = 0x00;
pIadDesc->iFunction = 0;
*Sze += (uint32_t)sizeof(USBD_IadDescTypedef);/* ... */
#endif
__USBD_FRAMEWORK_SET_IF(pdev->tclasslist[pdev->classId].Ifs[0], 0U, 1U, 0x02U,
0x06U, 0U, 0U);
pHeadDesc = ((USBD_CDCHeaderFuncDescTypedef *)(pConf + *Sze));
pHeadDesc->bLength = (uint8_t)sizeof(USBD_CDCHeaderFuncDescTypedef);
pHeadDesc->bDescriptorType = 0x24;
pHeadDesc->bDescriptorSubtype = 0x00;
pHeadDesc->bcdCDC = USBD_DESC_ECM_BCD;
*Sze += (uint32_t)sizeof(USBD_CDCHeaderFuncDescTypedef);
pFuncDesc = ((USBD_ECMFuncDescTypedef *)(pConf + *Sze));
pFuncDesc->bFunctionLength = (uint8_t)sizeof(USBD_ECMFuncDescTypedef);
pFuncDesc->bDescriptorType = 0x24;
pFuncDesc->bDescriptorSubType = USBD_DESC_SUBTYPE_ACM;
pFuncDesc->iMacAddress = CDC_ECM_MAC_STRING_INDEX;
pFuncDesc->bEthernetStatistics3 = CDC_ECM_ETH_STATS_BYTE3;
pFuncDesc->bEthernetStatistics2 = CDC_ECM_ETH_STATS_BYTE2;
pFuncDesc->bEthernetStatistics1 = CDC_ECM_ETH_STATS_BYTE1;
pFuncDesc->bEthernetStatistics0 = CDC_ECM_ETH_STATS_BYTE0;
pFuncDesc->wMaxSegmentSize = CDC_ECM_ETH_MAX_SEGSZE;
pFuncDesc->bNumberMCFiltes = CDC_ECM_ETH_NBR_MACFILTERS;
pFuncDesc->bNumberPowerFiltes = CDC_ECM_ETH_NBR_PWRFILTERS;
*Sze += (uint32_t)sizeof(USBD_ECMFuncDescTypedef);
pUnionDesc = ((USBD_CDCUnionFuncDescTypedef *)((uint32_t)pConf + *Sze));
pUnionDesc->bLength = (uint8_t)sizeof(USBD_CDCUnionFuncDescTypedef);
pUnionDesc->bDescriptorType = 0x24;
pUnionDesc->bDescriptorSubtype = 0x06;
pUnionDesc->bMasterInterface = pdev->tclasslist[pdev->classId].Ifs[0];
pUnionDesc->bSlaveInterface = pdev->tclasslist[pdev->classId].Ifs[1];
*Sze += (uint32_t)sizeof(USBD_CDCUnionFuncDescTypedef);
__USBD_FRAMEWORK_SET_EP(pdev->tclasslist[pdev->classId].Eps[2].add,
USBD_EP_TYPE_INTR,
(uint16_t)pdev->tclasslist[pdev->classId].Eps[2].size,
USBD_CDCECM_EPINCMD_HS_BINTERVAL,
USBD_CDCECM_EPINCMD_FS_BINTERVAL);
__USBD_FRAMEWORK_SET_IF(pdev->tclasslist[pdev->classId].Ifs[1], 0U, 2U, 0x0AU, 0U,
0U, 0U);
__USBD_FRAMEWORK_SET_EP((pdev->tclasslist[pdev->classId].Eps[0].add),
(USBD_EP_TYPE_BULK),
(uint16_t)(pdev->tclasslist[pdev->classId].Eps[0].size),
USBD_CDCECM_EPINCMD_HS_BINTERVAL,
USBD_CDCECM_EPINCMD_FS_BINTERVAL);
__USBD_FRAMEWORK_SET_EP((pdev->tclasslist[pdev->classId].Eps[1].add),
(USBD_EP_TYPE_BULK),
(uint16_t)(pdev->tclasslist[pdev->classId].Eps[1].size),
USBD_CDCECM_EPINCMD_HS_BINTERVAL,
USBD_CDCECM_EPINCMD_FS_BINTERVAL);
((USBD_ConfigDescTypedef*)pConf)->bNumInterfaces += 2U;
((USBD_ConfigDescTypedef*)pConf)->wDescriptorLength = *Sze;
}{ ... }
#endif/* ... */
Private user code