Subversion Repositories NaviCtrl

Rev

Rev 1 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 ingob 1
/******************** (C) COPYRIGHT 2006 STMicroelectronics ********************
2
* File Name          : usb_desc.c
3
* Author             : MCD Application Team
4
* Date First Issued  : 10/01/2006 : V1.0
5
* Description        : Descriptors for Virtual Com Port Demo
6
********************************************************************************
7
* History:
8
* 10/01/2006 : V1.0
9
********************************************************************************
10
* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
11
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
12
* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
13
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
14
* CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
15
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
16
*******************************************************************************/
17
/* Includes ------------------------------------------------------------------*/
41 ingob 18
#include "usb_lib.h"
19
#include "usb_desc.h"
1 ingob 20
/* Private typedef -----------------------------------------------------------*/
21
/* Private define ------------------------------------------------------------*/
22
/* Private macro -------------------------------------------------------------*/
23
/* Private variables ---------------------------------------------------------*/
41 ingob 24
/* Extern  variables ---------------------------------------------------------*/
1 ingob 25
/* Private function prototypes -----------------------------------------------*/
26
/* Private functions ---------------------------------------------------------*/
27
/* USB Standard Device Descriptor */
28
const u8 Virtual_Com_Port_DeviceDescriptor[] = {
29
        0x12,   /* bLength */
30
        USB_DEVICE_DESCRIPTOR_TYPE,     /* bDescriptorType */
31
        0x00,
32
        0x02,   /* bcdUSB = 2.00 */
33
        0x02,   /* bDeviceClass: CDC */
34
        0x00,   /* bDeviceSubClass */
35
        0x00,   /* bDeviceProtocol */
36
        0x40,   /* bMaxPacketSize0 */
37
        0x83,
38
        0x04,   /* idVendor = 0x0483 */
39
        0x40,
40
        0x57,   /* idProduct = 0x7540 */
41
        0x00,
42
        0x01,   /* bcdDevice = 1.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 */
47
};
48
 
49
 
50
const u8 Virtual_Com_Port_ConfigDescriptor[] = {
51
/*Configuation Descriptor*/
52
        0x09,   /* bLength: Configuation Descriptor size */
53
        USB_CONFIGURATION_DESCRIPTOR_TYPE,      /* bDescriptorType: Configuration */
54
        VIRTUAL_COM_PORT_SIZ_CONFIG_DESC,       /* wTotalLength:no of returned bytes */
55
        0x00,
56
        0x02,   /* bNumInterfaces: 2 interface */
57
        0x01,   /* bConfigurationValue: Configuration value */
58
        0x00,   /* iConfiguration: Index of string descriptor describing the configuration */
59
        0xC0,   /* bmAttributes: self powered */
60
        0x00,   /* MaxPower 0 mA */
61
/*Interface Descriptor*/
62
        0x09,   /* bLength: Interface Descriptor size */
63
        USB_INTERFACE_DESCRIPTOR_TYPE,  /* bDescriptorType: Interface */
64
                        /* Interface descriptor type */
65
        0x00,   /* bInterfaceNumber: Number of Interface */
66
        0x00,   /* bAlternateSetting: Alternate setting */
67
        0x01,   /* bNumEndpoints: One endpoints used */
68
        0x02,   /* bInterfaceClass: Communication Interface Class */
69
        0x02,   /* bInterfaceSubClass: Abstract Control Model */
70
        0x01,   /* bInterfaceProtocol: Common AT commands */
71
        0x00,   /* iInterface: */
72
/*Header Functional Descriptor*/
73
        0x05,   /* bLength: Endpoint Descriptor size */
74
        0x24,   /* bDescriptorType: CS_INTERFACE */
75
        0x00,   /* bDescriptorSubtype: Header Func Desc */
76
        0x10,   /* bcdCDC: spec release number */
77
        0x01,
78
/*Call Managment Functional Descriptor*/
79
        0x05,   /* bFunctionLength */
80
        0x24,   /* bDescriptorType: CS_INTERFACE */
81
        0x01,   /* bDescriptorSubtype: Call Management Func Desc */
82
        0x00,   /* bmCapabilities: D0+D1 */
83
        0x01,   /* bDataInterface: 1 */
84
/*ACM Functional Descriptor*/
85
        0x04,   /* bFunctionLength */
86
        0x24,   /* bDescriptorType: CS_INTERFACE */
87
        0x02,   /* bDescriptorSubtype: Abstract Control Management desc */
88
        0x02,   /* bmCapabilities */
89
/*Union Functional Descriptor*/
90
        0x05,   /* bFunctionLength */
91
        0x24,   /* bDescriptorType: CS_INTERFACE */
92
        0x06,   /* bDescriptorSubtype: Union func desc */
93
        0x00,   /* bMasterInterface: Communication class interface */
94
        0x01,   /* bSlaveInterface0: Data Class Interface */
95
/*Endpoint 2 Descriptor*/
96
        0x07,   /* bLength: Endpoint Descriptor size */
97
        USB_ENDPOINT_DESCRIPTOR_TYPE,   /* bDescriptorType: Endpoint */
98
        0x82,   /* bEndpointAddress: (IN2) */
99
        0x03,   /* bmAttributes: Interrupt */
100
        VIRTUAL_COM_PORT_INT_SIZE,      /* wMaxPacketSize: */
101
        0x00,
102
        0xFF,   /* bInterval: */
103
/*Data class interface descriptor*/
104
        0x09,   /* bLength: Endpoint Descriptor size */
105
        USB_INTERFACE_DESCRIPTOR_TYPE,  /* bDescriptorType: */
106
        0x01,   /* bInterfaceNumber: Number of Interface */
107
        0x00,   /* bAlternateSetting: Alternate setting */
108
        0x02,   /* bNumEndpoints: Two endpoints used */
109
        0x0A,   /* bInterfaceClass: CDC */
110
        0x00,   /* bInterfaceSubClass: */
111
        0x00,   /* bInterfaceProtocol: */
112
        0x00,   /* iInterface: */
113
/*Endpoint 3 Descriptor*/
114
        0x07,   /* bLength: Endpoint Descriptor size */
115
        USB_ENDPOINT_DESCRIPTOR_TYPE,   /* bDescriptorType: Endpoint */
116
        0x03,   /* bEndpointAddress: (OUT3) */
117
        0x02,   /* bmAttributes: Bulk */
118
        VIRTUAL_COM_PORT_DATA_SIZE,             /* wMaxPacketSize: */
119
        0x00,
120
        0x00,   /* bInterval: ignore for Bulk transfer */
121
/*Endpoint 1 Descriptor*/
122
        0x07,   /* bLength: Endpoint Descriptor size */
123
        USB_ENDPOINT_DESCRIPTOR_TYPE,   /* bDescriptorType: Endpoint */
124
        0x81,   /* bEndpointAddress: (IN1) */
125
        0x02,   /* bmAttributes: Bulk */
126
        VIRTUAL_COM_PORT_DATA_SIZE,             /* wMaxPacketSize: */
127
        0x00,
128
        0x00    /* bInterval */
129
};
130
 
131
/* USB String Descriptors*/
132
const u8 Virtual_Com_Port_StringLangID[VIRTUAL_COM_PORT_SIZ_STRING_LANGID] = {
133
        VIRTUAL_COM_PORT_SIZ_STRING_LANGID,
134
        USB_STRING_DESCRIPTOR_TYPE,
135
        0x09,
136
        0x04
137
};      /* LangID = 0x0409: U.S. English */
138
 
139
const u8 Virtual_Com_Port_StringVendor[VIRTUAL_COM_PORT_SIZ_STRING_VENDOR] = {
140
        VIRTUAL_COM_PORT_SIZ_STRING_VENDOR,     /* Size of Vendor string */
141
        USB_STRING_DESCRIPTOR_TYPE,             /* bDescriptorType*/
142
        /* Manufacturer: "STMicroelectronics" */
143
        'w',0, 'w',0, 'w',0, '.',0, 'M',0, 'i',0, 'k',0, 'r',0,
144
        'o',0, 'K',0, 'o',0, 'p',0, 't',0, 'e',0, 'r',0, '.',0,
145
        'd',0, 'e',0
146
};
147
 
148
const u8 Virtual_Com_Port_StringProduct[VIRTUAL_COM_PORT_SIZ_STRING_PRODUCT] = {
149
        VIRTUAL_COM_PORT_SIZ_STRING_PRODUCT,          /* bLength */
150
        USB_STRING_DESCRIPTOR_TYPE,        /* bDescriptorType */
151
        /* Product name: "STR91x Virtual COM Port" */
152
     'M',0, 'i',0, 'k',0, 'r',0,'o',0, 'K',0, 'o',0, 'p',0, 't',0, 'e',0, 'r',0,
153
         ' ',0, 'V',0,  'i',0, 'r',0, 't',0, 'u',0, 'a',0, 'l',0, ' ',0,
154
         'C',0, 'O',0, 'M',0, ' ',0, 'P',0, 'o',0, 'r',0, 't',0, ' ',0,
155
};
156
const u8 Virtual_Com_Port_StringSerial[VIRTUAL_COM_PORT_SIZ_STRING_SERIAL] = {
157
        VIRTUAL_COM_PORT_SIZ_STRING_SERIAL,           /* bLength */
158
        USB_STRING_DESCRIPTOR_TYPE,        /* bDescriptorType */
159
        'M',0, 'K',0, ' ',0, ' ',0, ' ',0, '1',0, '.',0, '0',0,
160
        '0',0, '0',0
161
};
162
/******************* (C) COPYRIGHT 2006 STMicroelectronics *****END OF FILE****/
163