From a12111ba558707d6b303c01ab0e79f9249bae854 Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Wed, 17 Jan 2024 12:28:47 +0000 Subject: [PATCH] Include control interface descriptor in cfgDesc_Audio2 when USB_CONTROL_DESCS is defined --- .../src/core/endpoint0/xua_ep0_descriptors.h | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h index d830682e..97797f10 100644 --- a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h +++ b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h @@ -772,6 +772,11 @@ typedef struct unsigned char configDesc_DFU[DFU_LENGTH]; #endif +#ifdef USB_CONTROL_DESCS + /* Inferface descriptor for control */ + unsigned char itfDesc_control[9]; +#endif + #ifdef IAP USB_Descriptor_Interface_t iAP_Interface; USB_Descriptor_Endpoint_t iAP_Out_Endpoint; @@ -2104,6 +2109,21 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2= #endif #endif /* (XUA_DFU_EN == 1) */ +#ifdef USB_CONTROL_DESCS + { + /* Control interface descriptor */ + 0x09, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */ + 0x04, /* 1 bDescriptorType : INTERFACE descriptor. (field size 1 bytes) */ + (INTERFACE_NUMBER_MISC_CONTROL), /* 2 bInterfaceNumber */ + 0x00, /* 3 bAlternateSetting : Index of this setting. (field size 1 bytes) */ + 0x00, /* 4 bNumEndpoints : 0 endpoints. (field size 1 bytes) */ + USB_CLASS_VENDOR_SPECIFIC, /* 5 bInterfaceClass : Vendor specific. (field size 1 bytes) */ + 0xFF, /* 6 bInterfaceSubclass : (field size 1 bytes) */ + 0xFF, /* 7 bInterfaceProtocol : Unused. (field size 1 bytes) */ + offsetof(StringDescTable_t, ctrlStr)/sizeof(char *), /* 8 iInterface */ + }, +#endif + #ifdef IAP /* Interface descriptor */ .iAP_Interface =