⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usb_descr.c

📁 Usb Host/Periphel Control TD1120 codes
💻 C
📖 第 1 页 / 共 2 页
字号:
/*------------------------------------------------------------------------------
$File: //tdi_sw/tdi/examples/usb/pcd/acm/usb_descr.c $
$DateTime: 2004/12/20 19:06:16 $
$Revision: #5 $
Purpose: All USB descriptors required by this test device
------------------------------------------------------------------------------*/

/*------------------------------------------------------------------------------
CONFIDENTIAL AND PROPRIETARY INFORMATION OF SOFTCONNEX TECHNOLOGIES, INC.

THIS NOTICE IS NOT TO BE DELETED, MODIFIED, MOVED OR CHANGED IN ANY WAY.

Copyright (c) 1999 - 2004 by SoftConnex Technologies, Inc. 

This software is protected by copyright laws and international copyright 
treaties, as well as other intellectual property laws and treaties.  This
software is a CONFIDENTIAL, unpublished work of authorship, and with portions 
constituting TRADE SECRETS of SoftConnex Technologies, Inc., a Delaware USA 
corporation.  Any unauthorized use, disclosure,	and/or reproduction of this 
software, or any part of this software; or distribution of this software in any 
form or by any means; or storage of this software in any database or retrieval 
system, without the express written consent of, and license from, SoftConnex 
Technologies, Inc. is strictly prohibited.  This software is protected under the
copyright and/or trade secret laws in other countries in addition to USA.  All 
Rights Reserved.  Failure to abide by the use, disclosure and/or reproduction 
restrictions may result in civil and /or criminal penalties, and will be 
prosecuted to the maximum extent of the law.
------------------------------------------------------------------------------*/
#include "sc_types.h"
#include "tdictrl.h"
#include "usbdesc.h"
#include "pcd_acm.h"

/******************************************************************************
 Include Files
******************************************************************************/

/* Following descriptors are defined for a mass storage device, This temporary. 
** We'll change this to use vendor-specific descriptors so that we can exercise 
** all types of transfers
*/

U8 fsDeviceDescriptor[18] =
   {
   0x12, 
   USB_DEVICE_DESCRIPTOR, 
   0x00,                   /* bcdUSB */
   0x02,                   /* USB 2.0 */
   0x02,                   /* bDeviceClass, interface will define */
   0x02,                   /* bDeviceSubClass, ... */
   0x00,                   /* bDeviceProtocol */
   FS_CTRL_MPS,            /* bMaxPacketSize0, 8 bytes */
   0x20,                   /* idVendor, TDI 0x0B20 */
   0x0B,
   0x06,                   /* idProduct */
   0x04,
   0x00,                   /* bcdDevice */
   0x01,
   0x01,                   /* iManufacturer */
   0x02,                   /* iProduct */
   0x00,                   /* iSerialNumber */
   0x01                    /* bNumConfigurations */
   };
   
U8 hsDeviceDescriptor[18] =
   {
   0x12, 
   USB_DEVICE_DESCRIPTOR, 
   0x00,                   /* bcdUSB */
   0x02,                   /* USB 2.0 */
   0x02,                   /* bDeviceClass, interface will define */
   0x02,                   /* bDeviceSubClass, ... */
   0x00,                   /* bDeviceProtocol */
   HS_CTRL_MPS,            /* bMaxPacketSize0, 64 bytes */
   0x20,                   /* idVendor, TDI 0x0B20 */
   0x0B,
   0x06,                   /* idProduct */
   0x04,
   0x00,                   /* bcdDevice */
   0x01,
   0x01,                   /* iManufacturer */
   0x02,                   /* iProduct */
   0x00,                   /* iSerialNumber */
   0x01                    /* bNumConfigurations */
   };

U8 fsConfigDescriptor[67] =
  {
  9,
  USB_CONFIG_DESCRIPTOR,   /* bDescriptorType, configuration */
  0x43,                    /* wTotalLength */
  0x00,
  0x02,                    /* bNumInterfaces */
  1,                       /* bConfigurationValue */
  0x04,                    /* iConfiguration */
  0xC0,                    /* bmAttributes, self powered */
  0x0A,                    /* bMaxPower */
   
  USBDESC_INTF_DESCRIPTOR_SIZE,
  USB_INTERFACE_DESCRIPTOR,   /* bDescriptorType, interface */
  0x00,                       /* bInterfaceNumber */
  0x00,                       /* bAlternateSetting */
  0x01,                       /* bNumEndpoints: Interrupt endpoint 3 */
  0x02,                       /* bInterfaceClass, Communication Interface Class */
  0x02,                       /* bInterfaceSubClass, Abstract Control Model (ACM) */
  0x01,                       /* bInterfaceProtocol, V.25ter (Common AT) commands */
  0x04,                       /* String index for string describing this iInterface */
  CDC_HDR_FUNC_DESCRIPTOR,    /* Header Functional Descriptor */
  CS_INTERFACE,               /* bDescriptorType, CS_INTERFACE */
  CDC_HDR_FUNC_DESCRIPTOR,    /* bDescriptorsubtype: Header Functional Descriptor. 
                              ** Beginning of the concatenated set of functional 
                              ** descriptors for the interface 
                              */
   0x01,                      /* bcdCDC 0x0101 */
   0x01,
   
   /* Call Management Functional Descriptor */
   USBDESC_UNION_FUNC_DESCRIPTOR_SIZE, /* bfunction length */
   CS_INTERFACE,                       /* bDescriptorType CS_INTERFACE */
   CDC_CALL_MGMT_FUNC_DESCRIPTOR,      /* Functional descriptor, Call Management */
   0x03,                               /* bmCapabilities: 
                                       ** Device handles call management 
                                       ** itself and it can send/receive call 
                                       ** management information over a data class 
                                       ** interface 
                                       */
   0x01,                               /* bDataInterface: interface number of data class 
                                       ** interface 
                                       */
   
   /* Union Functional Descriptor */
   USBDESC_UNION_FUNC_DESCRIPTOR_SIZE, /* bfunction length */
   CS_INTERFACE,                       /* bDescriptorType CS_INTERFACE */
   CDC_UNION_FUNC_DESCRIPTOR,          /* Union descriptor Functional descriptor subtype */
   0x00,                               /* bMasterInterface: Master or controlling interface is interface 0 */
   0x01,                               /* bSlaveInterface0: Interface 1 is first slave interface */

   /* Abstract Control Management Functional Descriptor */   
   USBDESC_ACM_FUNC_DESCRIPTOR_SIZE,   /* bfunction length, CDC */
   CS_INTERFACE,                       /* bDescriptorType CS_INTERFACE */
   CDC_ACM_FUNC_DESCRIPTOR,            /* ACM Functional descriptor subtype */
   0x02,                               /* bmCapabilities: Device supports the request 
                                       ** combination of SET_LINE_CODING, SET_CONTROL_LINE_STATE, 
                                       ** GET_LINE_CODING and the notification SERIAL_STATE 
                                       */
   
   USBDESC_EP_DESCRIPTOR_SIZE,
   USB_ENDPOINT_DESCRIPTOR,            /* bDescriptorType, endpoint */
   0x83,                               /* bEndpointAddress */
   USB_INT_ENDPOINT,                   /* bmAttributes: Interrupt endpoint */
   0x10,                               /* wMaxPacketSize */
   0x00,
   0x0A,                               /* bInterval: 10ms */
   
   USBDESC_INTF_DESCRIPTOR_SIZE,
   USB_INTERFACE_DESCRIPTOR,           /* bDescriptorType, interface */
   0x01,                               /* bInterfaceNumber */
   0x00,                               /* bAlternateSetting */
   0x02,                               /* bNumEndpoints: Bulk IN and Bulk OUT */
   0x0A,                               /* bInterfaceClass, Data Interface Class */
   0x00,                               /* bInterfaceSubClass, Abstract Control Model (ACM) */
   0x00,                               /* bInterfaceProtocol, V.25ter (Common AT) commands */
   0x05,                               /* string index for string describing this iInterface */

   USBDESC_EP_DESCRIPTOR_SIZE,
   USB_ENDPOINT_DESCRIPTOR,            /* bDescriptorType, endpoint */
   0x01,                               /* bEndpointAddress */
   USB_BULK_ENDPOINT,                  /* bmAttributes: Bulk endpoint */
   0x20,                               /* wMaxPacketSize */
   0x00,
   0x00,                               /* bInterval, not used */
      
   USBDESC_EP_DESCRIPTOR_SIZE,
   USB_ENDPOINT_DESCRIPTOR,            /* bDescriptorType, endpoint */
   0x82,                               /* bEndpointAddress */
   USB_BULK_ENDPOINT,                  /* bmAttributes: Bulk endpoint */
   0x20,                               /* wMaxPacketSize */
   0x00,
   
   0x00                                /* bInterval, not used */
   };
   
U8 hsConfigDescriptor[67] =
   {
   9,
   USB_CONFIG_DESCRIPTOR,              /* bDescriptorType, configuration */
   0x43,                               /* wTotalLength */
   0x00,
   0x02,                               /* bNumInterfaces */
   1,                                  /* bConfigurationValue */
   0x04,                               /* iConfiguration */
   0xC0,                               /* bmAttributes, self powered */
   0x0A,                               /* bMaxPower */
   
   USBDESC_INTF_DESCRIPTOR_SIZE,
   USB_INTERFACE_DESCRIPTOR,           /* bDescriptorType, interface */
   0x00,                               /* bInterfaceNumber */
   0x00,                               /* bAlternateSetting */
   0x01,                               /* bNumEndpoints: Interrupt endpoint 3 */
   0x02,                               /* bInterfaceClass, Communication Interface Class */
   0x02,                               /* bInterfaceSubClass, Abstract Control Model (ACM) */
   0x01,                               /* bInterfaceProtocol, V.25ter (Common AT) commands */
   0x04,                               /* String index for string describing this iInterface */
    /* Header Functional Descriptor */
   USBDESC_HDR_FUNC_DESCRIPTOR_SIZE,
   CS_INTERFACE,                       /* bDescriptorType, CS_INTERFACE */
   CDC_HDR_FUNC_DESCRIPTOR,            /* bDescriptorsubtype: Header Functional Descriptor. 
                                       ** Beginning of the concatenated set of functional 
                                       ** descriptors for the interface 
                                       */
   0x01,                               /* bcdCDC 0x0101 */
   0x01,
   
   /* Call Management Functional Descriptor */
   USBDESC_UNION_FUNC_DESCRIPTOR_SIZE, /* bfunction length */
   CS_INTERFACE,                       /* bDescriptorType CS_INTERFACE */
   CDC_CALL_MGMT_FUNC_DESCRIPTOR,      /* Functional descriptor, Call Management */
   0x03,                               /* bmCapabilities: Device handles call management 
                                       ** itself and it can send/receive call management 
                                       ** information over a data class interface 
                                       */
   0x01,                               /* bDataInterface: interface number of data 
                                       ** class interface 
                                       */
   
   /* Union Functional Descriptor */
   USBDESC_UNION_FUNC_DESCRIPTOR_SIZE, /* bfunction length */
   CS_INTERFACE,                       /* bDescriptorType CS_INTERFACE */
   CDC_UNION_FUNC_DESCRIPTOR,          /* Union descriptor Functional descriptor subtype */
   0x00,                               /* bMasterInterface: Master or controlling interface is interface 0 */
   0x01,                               /* bSlaveInterface0: Interface 1 is first slave interface */

   /* Abstract Control Management Functional Descriptor */   
   USBDESC_ACM_FUNC_DESCRIPTOR_SIZE,   /* bfunction length, CDC */
   CS_INTERFACE,                       /* bDescriptorType CS_INTERFACE */
   CDC_ACM_FUNC_DESCRIPTOR,            /* ACM Functional descriptor subtype */
   0x02,                               /* bmCapabilities: Device supports the request 
                                       ** combination of SET_LINE_CODING, SET_CONTROL_LINE_STATE, 
                                       ** GET_LINE_CODING and the notification SERIAL_STATE 
                                       */
   
   USBDESC_EP_DESCRIPTOR_SIZE,
   USB_ENDPOINT_DESCRIPTOR,            /* bDescriptorType, endpoint */
   0x83,                               /* bEndpointAddress */
   0x03,                               /* bmAttributes: Interrupt endpoint */
   0x10,                               /* wMaxPacketSize */
   0x00,
   0x0A,                               /* bInterval: 10ms */
   
   USBDESC_INTF_DESCRIPTOR_SIZE,
   USB_INTERFACE_DESCRIPTOR,           /* bDescriptorType, interface */
   0x01,                               /* bInterfaceNumber */
   0x00,                               /* bAlternateSetting */
   0x02,                               /* bNumEndpoints: Bulk IN and Bulk OUT */
   0x0A,                               /* bInterfaceClass, Data Interface Class */
   0x00,                               /* bInterfaceSubClass, Abstract Control Model (ACM) */
   0x00,                               /* bInterfaceProtocol, V.25ter (Common AT) commands */
   0x05,                               /* string index for string describing this iInterface */

   USBDESC_EP_DESCRIPTOR_SIZE,
   USB_ENDPOINT_DESCRIPTOR,            /* bDescriptorType, endpoint */
   0x01,                               /* bEndpointAddress */
   0x02,                               /* bmAttributes: Bulk endpoint */
   0x20,                               /* wMaxPacketSize */
   0x00,
   0x00,                               /* bInterval, not used */
     
   USBDESC_EP_DESCRIPTOR_SIZE,
   USB_ENDPOINT_DESCRIPTOR,            /* bDescriptorType, endpoint */
   0x82,                               /* bEndpointAddress */
   0x02,                               /* bmAttributes: Bulk endpoint */
   0x10,                               /* wMaxPacketSize */
   0x00,
   
   0x00                                /* bInterval, not used */
   };
   
/* USB 2.0 specific descriptor */
U8  fsDeviceQualifierDescriptor[10] =
   {
   10,                                 /* bLength Length of this descriptor */
   USB_DEVICE_QUALIFIER_DESCRIPTOR,    /* bDescType This is a DEVICE Qualifier descr */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -