Create set-home.md
[u360gts.git] / src / main / vcp / usb_desc.c
blob64ead56f6283c7922a5316b110d4c1a9d67db5c4
1 /**
2 ******************************************************************************
3 * @file usb_desc.c
4 * @author MCD Application Team
5 * @version V4.0.0
6 * @date 21-January-2013
7 * @brief Descriptors for Virtual Com Port Demo
8 ******************************************************************************
9 * @attention
11 * <h2><center>&copy; COPYRIGHT 2013 STMicroelectronics</center></h2>
13 * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
14 * You may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at:
17 * http://www.st.com/software_license_agreement_liberty_v2
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
25 ******************************************************************************
28 /* Includes ------------------------------------------------------------------*/
29 #include "usb_lib.h"
30 #include "usb_desc.h"
32 /* USB Standard Device Descriptor */
33 const uint8_t Virtual_Com_Port_DeviceDescriptor[] = { 0x12, /* bLength */
34 USB_DEVICE_DESCRIPTOR_TYPE, /* bDescriptorType */
35 0x00, 0x02, /* bcdUSB = 2.00 */
36 0x02, /* bDeviceClass: CDC */
37 0x00, /* bDeviceSubClass */
38 0x00, /* bDeviceProtocol */
39 0x40, /* bMaxPacketSize0 */
40 0x83, 0x04, /* idVendor = 0x0483 */
41 0x40, 0x57, /* idProduct = 0x7540 */
42 0x00, 0x02, /* bcdDevice = 2.00 */
43 1, /* Index of string descriptor describing manufacturer */
44 2, /* Index of string descriptor describing product */
45 3, /* Index of string descriptor describing the device's serial number */
46 0x01 /* bNumConfigurations */
49 const uint8_t Virtual_Com_Port_ConfigDescriptor[] = {
50 /*Configuration Descriptor*/
51 0x09, /* bLength: Configuration Descriptor size */
52 USB_CONFIGURATION_DESCRIPTOR_TYPE, /* bDescriptorType: Configuration */
53 VIRTUAL_COM_PORT_SIZ_CONFIG_DESC, /* wTotalLength:no of returned bytes */
54 0x00, 0x02, /* bNumInterfaces: 2 interface */
55 0x01, /* bConfigurationValue: Configuration value */
56 0x00, /* iConfiguration: Index of string descriptor describing the configuration */
57 0xC0, /* bmAttributes: self powered */
58 0x32, /* MaxPower 0 mA */
59 /*Interface Descriptor*/
60 0x09, /* bLength: Interface Descriptor size */
61 USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType: Interface */
62 /* Interface descriptor type */
63 0x00, /* bInterfaceNumber: Number of Interface */
64 0x00, /* bAlternateSetting: Alternate setting */
65 0x01, /* bNumEndpoints: One endpoints used */
66 0x02, /* bInterfaceClass: Communication Interface Class */
67 0x02, /* bInterfaceSubClass: Abstract Control Model */
68 0x01, /* bInterfaceProtocol: Common AT commands */
69 0x00, /* iInterface: */
70 /*Header Functional Descriptor*/
71 0x05, /* bLength: Endpoint Descriptor size */
72 0x24, /* bDescriptorType: CS_INTERFACE */
73 0x00, /* bDescriptorSubtype: Header Func Desc */
74 0x10, /* bcdCDC: spec release number */
75 0x01,
76 /*Call Management Functional Descriptor*/
77 0x05, /* bFunctionLength */
78 0x24, /* bDescriptorType: CS_INTERFACE */
79 0x01, /* bDescriptorSubtype: Call Management Func Desc */
80 0x00, /* bmCapabilities: D0+D1 */
81 0x01, /* bDataInterface: 1 */
82 /*ACM Functional Descriptor*/
83 0x04, /* bFunctionLength */
84 0x24, /* bDescriptorType: CS_INTERFACE */
85 0x02, /* bDescriptorSubtype: Abstract Control Management desc */
86 0x02, /* bmCapabilities */
87 /*Union Functional Descriptor*/
88 0x05, /* bFunctionLength */
89 0x24, /* bDescriptorType: CS_INTERFACE */
90 0x06, /* bDescriptorSubtype: Union func desc */
91 0x00, /* bMasterInterface: Communication class interface */
92 0x01, /* bSlaveInterface0: Data Class Interface */
93 /*Endpoint 2 Descriptor*/
94 0x07, /* bLength: Endpoint Descriptor size */
95 USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: Endpoint */
96 0x82, /* bEndpointAddress: (IN2) */
97 0x03, /* bmAttributes: Interrupt */
98 VIRTUAL_COM_PORT_INT_SIZE, /* wMaxPacketSize: */
99 0x00, 0xFF, /* bInterval: */
100 /*Data class interface descriptor*/
101 0x09, /* bLength: Endpoint Descriptor size */
102 USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType: */
103 0x01, /* bInterfaceNumber: Number of Interface */
104 0x00, /* bAlternateSetting: Alternate setting */
105 0x02, /* bNumEndpoints: Two endpoints used */
106 0x0A, /* bInterfaceClass: CDC */
107 0x00, /* bInterfaceSubClass: */
108 0x00, /* bInterfaceProtocol: */
109 0x00, /* iInterface: */
110 /*Endpoint 3 Descriptor*/
111 0x07, /* bLength: Endpoint Descriptor size */
112 USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: Endpoint */
113 0x03, /* bEndpointAddress: (OUT3) */
114 0x02, /* bmAttributes: Bulk */
115 VIRTUAL_COM_PORT_DATA_SIZE, /* wMaxPacketSize: */
116 0x00, 0x00, /* bInterval: ignore for Bulk transfer */
117 /*Endpoint 1 Descriptor*/
118 0x07, /* bLength: Endpoint Descriptor size */
119 USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: Endpoint */
120 0x81, /* bEndpointAddress: (IN1) */
121 0x02, /* bmAttributes: Bulk */
122 VIRTUAL_COM_PORT_DATA_SIZE, /* wMaxPacketSize: */
123 0x00, 0x00 /* bInterval */
126 /* USB String Descriptors */
127 const uint8_t Virtual_Com_Port_StringLangID[VIRTUAL_COM_PORT_SIZ_STRING_LANGID] = {
128 VIRTUAL_COM_PORT_SIZ_STRING_LANGID,
129 USB_STRING_DESCRIPTOR_TYPE, 0x09, 0x04 /* LangID = 0x0409: U.S. English */
132 const uint8_t Virtual_Com_Port_StringVendor[VIRTUAL_COM_PORT_SIZ_STRING_VENDOR] = {
133 VIRTUAL_COM_PORT_SIZ_STRING_VENDOR, /* Size of Vendor string */
134 USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType*/
135 /* Manufacturer: "STMicroelectronics" */
136 'S', 0, 'T', 0, 'M', 0, 'i', 0, 'c', 0, 'r', 0, 'o', 0, 'e', 0, 'l', 0, 'e', 0, 'c', 0, 't', 0, 'r', 0, 'o', 0, 'n', 0, 'i', 0, 'c', 0, 's', 0 };
138 const uint8_t Virtual_Com_Port_StringProduct[VIRTUAL_COM_PORT_SIZ_STRING_PRODUCT] = {
139 VIRTUAL_COM_PORT_SIZ_STRING_PRODUCT, /* bLength */
140 USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */
141 /* Product name: "STM32 Virtual COM Port" */
142 'S', 0, 'T', 0, 'M', 0, '3', 0, '2', 0, ' ', 0, 'V', 0, 'i', 0, 'r', 0, 't', 0, 'u', 0, 'a', 0, 'l', 0, ' ', 0, 'C', 0, 'O', 0, 'M', 0, ' ', 0, 'P', 0, 'o', 0, 'r', 0, 't', 0, ' ', 0, ' ', 0 };
144 uint8_t Virtual_Com_Port_StringSerial[VIRTUAL_COM_PORT_SIZ_STRING_SERIAL] = {
145 VIRTUAL_COM_PORT_SIZ_STRING_SERIAL, /* bLength */
146 USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */
147 'S', 0, 'T', 0, 'M', 0, '3', 0, '2', 0 };
149 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/