Subversion Repositories NaviCtrl

Rev

Rev 275 | Details | Compare with Previous | Last modification | View Log | RSS feed

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