Blackbox device type 'file' (SITL) considered working when file handler is available
[inav.git] / src / main / vcp / usb_desc.c
blob72c24696ac266637e24f9092179a7088f42e0691
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[] = {
34 0x12, /* bLength */
35 USB_DEVICE_DESCRIPTOR_TYPE, /* bDescriptorType */
36 0x00, 0x02, /* bcdUSB = 2.00 */
37 0x02, /* bDeviceClass: CDC */
38 0x00, /* bDeviceSubClass */
39 0x00, /* bDeviceProtocol */
40 0x40, /* bMaxPacketSize0 */
41 0x83, 0x04, /* idVendor = 0x0483 */
42 0x40, 0x57, /* idProduct = 0x5740 */
43 0x00, 0x02, /* bcdDevice = 2.00 */
44 1, /* Index of string descriptor describing manufacturer */
45 2, /* Index of string descriptor describing product */
46 3, /* Index of string descriptor describing the device's serial number */
47 0x01 /* bNumConfigurations */
50 const uint8_t Virtual_Com_Port_ConfigDescriptor[] = {
51 /*Configuration Descriptor*/
52 0x09, /* bLength: Configuration Descriptor size */
53 USB_CONFIGURATION_DESCRIPTOR_TYPE, /* bDescriptorType: Configuration */
54 VIRTUAL_COM_PORT_SIZ_CONFIG_DESC, /* wTotalLength:no of returned bytes */
55 0x00, 0x02, /* bNumInterfaces: 2 interface */
56 0x01, /* bConfigurationValue: Configuration value */
57 0x00, /* iConfiguration: Index of string descriptor describing the configuration */
58 0xC0, /* bmAttributes: self powered */
59 0x32, /* MaxPower 0 mA */
60 /*Interface Descriptor*/
61 0x09, /* bLength: Interface Descriptor size */
62 USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType: Interface */
63 /* Interface descriptor type */
64 0x00, /* bInterfaceNumber: Number of Interface */
65 0x00, /* bAlternateSetting: Alternate setting */
66 0x01, /* bNumEndpoints: One endpoints used */
67 0x02, /* bInterfaceClass: Communication Interface Class */
68 0x02, /* bInterfaceSubClass: Abstract Control Model */
69 0x01, /* bInterfaceProtocol: Common AT commands */
70 0x00, /* iInterface: */
71 /*Header Functional Descriptor*/
72 0x05, /* bLength: Endpoint Descriptor size */
73 0x24, /* bDescriptorType: CS_INTERFACE */
74 0x00, /* bDescriptorSubtype: Header Func Desc */
75 0x10, /* bcdCDC: spec release number */
76 0x01,
77 /*Call Management Functional Descriptor*/
78 0x05, /* bFunctionLength */
79 0x24, /* bDescriptorType: CS_INTERFACE */
80 0x01, /* bDescriptorSubtype: Call Management Func Desc */
81 0x00, /* bmCapabilities: D0+D1 */
82 0x01, /* bDataInterface: 1 */
83 /*ACM Functional Descriptor*/
84 0x04, /* bFunctionLength */
85 0x24, /* bDescriptorType: CS_INTERFACE */
86 0x02, /* bDescriptorSubtype: Abstract Control Management desc */
87 0x02, /* bmCapabilities */
88 /*Union Functional Descriptor*/
89 0x05, /* bFunctionLength */
90 0x24, /* bDescriptorType: CS_INTERFACE */
91 0x06, /* bDescriptorSubtype: Union func desc */
92 0x00, /* bMasterInterface: Communication class interface */
93 0x01, /* bSlaveInterface0: Data Class Interface */
94 /*Endpoint 2 Descriptor*/
95 0x07, /* bLength: Endpoint Descriptor size */
96 USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: Endpoint */
97 0x82, /* bEndpointAddress: (IN2) */
98 0x03, /* bmAttributes: Interrupt */
99 VIRTUAL_COM_PORT_INT_SIZE, /* wMaxPacketSize: */
100 0x00, 0xFF, /* bInterval: */
101 /*Data class interface descriptor*/
102 0x09, /* bLength: Endpoint Descriptor size */
103 USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType: */
104 0x01, /* bInterfaceNumber: Number of Interface */
105 0x00, /* bAlternateSetting: Alternate setting */
106 0x02, /* bNumEndpoints: Two endpoints used */
107 0x0A, /* bInterfaceClass: CDC */
108 0x00, /* bInterfaceSubClass: */
109 0x00, /* bInterfaceProtocol: */
110 0x00, /* iInterface: */
111 /*Endpoint 3 Descriptor*/
112 0x07, /* bLength: Endpoint Descriptor size */
113 USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: Endpoint */
114 0x03, /* bEndpointAddress: (OUT3) */
115 0x02, /* bmAttributes: Bulk */
116 VIRTUAL_COM_PORT_DATA_SIZE, /* wMaxPacketSize: */
117 0x00, 0x00, /* bInterval: ignore for Bulk transfer */
118 /*Endpoint 1 Descriptor*/
119 0x07, /* bLength: Endpoint Descriptor size */
120 USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: Endpoint */
121 0x81, /* bEndpointAddress: (IN1) */
122 0x02, /* bmAttributes: Bulk */
123 VIRTUAL_COM_PORT_DATA_SIZE, /* wMaxPacketSize: */
124 0x00, 0x00 /* bInterval */
127 /* USB String Descriptors */
128 const uint8_t Virtual_Com_Port_StringLangID[VIRTUAL_COM_PORT_SIZ_STRING_LANGID] = {
129 VIRTUAL_COM_PORT_SIZ_STRING_LANGID,
130 USB_STRING_DESCRIPTOR_TYPE, 0x09, 0x04 /* LangID = 0x0409: U.S. English */
133 const uint8_t Virtual_Com_Port_StringVendor[VIRTUAL_COM_PORT_SIZ_STRING_VENDOR] = {
134 VIRTUAL_COM_PORT_SIZ_STRING_VENDOR, /* Size of Vendor string */
135 USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType*/
136 /* Manufacturer: "STMicroelectronics" */
137 '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 };
139 const uint8_t Virtual_Com_Port_StringProduct[VIRTUAL_COM_PORT_SIZ_STRING_PRODUCT] = {
140 VIRTUAL_COM_PORT_SIZ_STRING_PRODUCT, /* bLength */
141 USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */
142 /* Product name: "STM32 Virtual COM Port" */
143 '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 };
145 uint8_t Virtual_Com_Port_StringSerial[VIRTUAL_COM_PORT_SIZ_STRING_SERIAL] = {
146 VIRTUAL_COM_PORT_SIZ_STRING_SERIAL, /* bLength */
147 USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */
148 'S', 0, 'T', 0, 'M', 0, '3', 0, '2', 0 };
150 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/