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

📄 stddesc.h

📁 凌阳MP3 spSPCA755yuanma
💻 H
字号:
/*++

Copyright (c) 2001 Sunplus Technology Co., Ltd.

Module Name:

        stddesc.h

Abstract:

        Header file related to standard descriptor

Environment:

        Keil C51 Compiler

Revision History:

        08/28/2001      Chi-Yeh Tsai    created                 

--*/

//------------------------------------------------------------------------------
//Constant
//------------------------------------------------------------------------------
//version4.0 richie@ps0503
//#define K_INTERFACE4    0
//#define K_VendorDevice    1
//
//Descriptor Content
//---- Device Descriptor ----
//#if (K_VendorDevice)
//Descriptor Content
//---- Device Descriptor ----
#define K_VendorDEVICE_DESCRIPTOR_SIZE        0x0012
code    UCHAR   K_VendorDeviceDescriptor[] =
{
        //-------------------------------------------------------------------
        //TotalLength = 0x0012 byte
        //-------------------------------------------------------------------

        //Device (0x12 byte)
        0x12,                   //bLength: 0x12 byte
        0x01,                   //bDescriptorType: DEVICE
        0x10, 0x01,             //bcdUSB: version 1.10
        0x00,                   //bDeviceClass: independent interfaces
        0x00,                   //bDeviceSubClass: 0
        0x00,                   //bDeviceProtocol: class specific protocols NOT used on device basis
        0x08,                   //bMaxPacketSize0: maximum packet size for endpoint zero
        0xfc, 0x04,             //idVendor: vendor ID
        0x50, 0x75,             //idProduct: product ID
        0x00, 0x01,             //bcdDevice: device release number in BCD
        0x01,                   //iManufacturer: index of string
        0x02,                   //iProduct: index of string 
        0x03,                   //iSerialNumber: index of string  //patch4.3@cytsai@0606
        0x01,                   //bNumConfigurations: 1 configuration
};
//---- Configuration Descriptor ---- //cytsai@0312
#define K_VendorCONFIGURATION_DESCRIPTOR_SIZE 0x0027
code    UCHAR   K_VendorConfigurationDescriptor[] =
{
        //-------------------------------------------------------------------
        //TotalLength = 0x0027 byte
        //-------------------------------------------------------------------
        //-------------------------------------------------------------------
        //SubLength = 0x0009 byte 
        //-------------------------------------------------------------------

        //Configuration (0x09 byte)
        0x09,                   //bLength: 0x09 byte
        0x02,                   //bDescriptorType: CONFIGURATION        
        0x27, 0x00,             //wTotalLength:
        0x01,                   //bNumInterfaces: 1 interfaces
        0x01,                   //bConfigurationValue: configuration 1
        0x00,                   //iConfiguration: index of string
        0x80,                   //bmAttributes: bus powered, Not Support Remote-Wakeup
        0x32,                   //MaxPower: 100 mA     

        //-------------------------------------------------------------------
        //SubLength = 0x001e byte
        //-------------------------------------------------------------------

        //Interface 1 (0x09 byte)
        0x09,                   //bLength: 0x09 byte
        0x04,                   //bDescriptorType: INTERFACE
        0x00,                   //bInterfaceNumber: interface 0
        0x00,                   //bAlternateSetting: alternate setting 0
        0x03,                   //bNumEndpoints: 3 endpoints
        0xFF,                   //bInterfaceClass: Vendor Devices Class
        0xFF,                   //bInterfaceSubClass:
        0xFF,                   //bInterfaceProtocol
        0x00,                   //iInterface: index of string

        //Endpoint 2 (0x07 byte)
        0x07,                   //bLength: 0x07 byte
        0x05,                   //bDescriptorType: ENDPOINT
        0x81,                   //bEndpointAddress: IN endpoint 1 --Chamber For PA8591
        0x02,                   //bmAttributes: Bulk
        0x40, 0x00,             //wMaxPacketSize: 64 byte
        0x00,                   //bInterval: ignored

        //Endpoint 3 (0x07 byte)
        0x07,                   //bLength: 0x07 byte
        0x05,                   //bDescriptorType: ENDPOINT
        0x02,                   //bEndpointAddress: OUT endpoint 2 -- Chamber For PA8591
        0x02,                   //bmAttributes: Bulk
        0x40, 0x00,             //wMaxPacketSize: 64 byte
        0x00,                   //bInterval: ignored

        //Endpoint 4 (0x07 byte)
        0x07,                   //bLength: 0x07 byte
        0x05,                   //bDescriptorType: ENDPOINT
        0x83,                   //bEndpointAddress: IN endpoint 3 -- Chamber For PA8591
        0x03,                   //bmAttributes: Interrupt
        0x40, 0x00,             //wMaxPacketSize: 64 byte
        0x01,                   //bInterval: polling interval is 1 ms

};

//#endif
/////////////////////////////////////////////////////////////////////////////
//Descriptor Content of MSDC
//---- Device Descriptor ----
#define K_MSDC_DEVICE_DESCRIPTOR_SIZE        0x0012
code    UCHAR   K_MSDC_DeviceDescriptor[] =
{
        //-------------------------------------------------------------------
        //TotalLength = 0x0012 byte
        //-------------------------------------------------------------------

        //Device (0x12 byte)
        0x12,                   //bLength: 0x12 byte
        0x01,                   //bDescriptorType: DEVICE
        0x10, 0x01,             //bcdUSB: version 1.10
        0x00,                   //bDeviceClass: independent interfaces
        0x00,                   //bDeviceSubClass: 0
        0x00,                   //bDeviceProtocol: class specific protocols NOT used on device basis
        0x08,                   //bMaxPacketSize0: maximum packet size for endpoint zero
        0xfc, 0x04,             //idVendor: vendor ID
        0x7A, 0x75,             //idProduct: product ID (for MSDC)
        0x00, 0x01,             //bcdDevice: device release number in BCD
        0x01,                   //iManufacturer: index of string
        0x02,                   //iProduct: index of string 
        0x03,                   //iSerialNumber: index of string
        0x01,                   //bNumConfigurations: 1 configuration
};

//---- Configuration Descriptor of MSDC ----
#define K_MSDC_CONFIGURATION_DESCRIPTOR_SIZE 0x0027

code    UCHAR   K_MSDC_ConfigurationDescriptor[] =
{
        //-------------------------------------------------------------------
        //SubLength = 0x0009 byte 
        //-------------------------------------------------------------------

        //Configuration (0x09 byte)
        0x09,                   //bLength: 0x09 byte
        0x02,                   //bDescriptorType: CONFIGURATION        
        0x27, 0x00,             //wTotalLength:
        0x01,                   //bNumInterfaces: 1 interfaces
        0x01,                   //bConfigurationValue: configuration 1
        0x00,                   //iConfiguration: index of string
        0x80,                   //bmAttributes: bus powered, Not Support Remote-Wakeup
        0x32,                   //MaxPower: 100 mA     

        //-------------------------------------------------------------------
        //SubLength = 0x001e byte
        //-------------------------------------------------------------------

        //Interface 1 (0x09 byte)
        0x09,                   //bLength: 0x09 byte
        0x04,                   //bDescriptorType: INTERFACE
        0x00,                   //bInterfaceNumber: interface 0
        0x00,                   //bAlternateSetting: alternate setting 0
        0x03,                   //bNumEndpoints: 3 endpoints
        0x08,                   //bInterfaceClass: Mass Storage Devices Class
        0x06,                   //bInterfaceSubClass:
        0x50,                   //Bulk Only
        0x00,                   //iInterface: index of string

        //Endpoint 2 (0x07 byte)
        0x07,                   //bLength: 0x07 byte
        0x05,                   //bDescriptorType: ENDPOINT
        0x81,                   //bEndpointAddress: IN endpoint 1 --Chamber For PA8591
        0x02,                   //bmAttributes: Bulk
        0x40, 0x00,             //wMaxPacketSize: 64 byte
        0x00,                   //bInterval: ignored

        //Endpoint 3 (0x07 byte)
        0x07,                   //bLength: 0x07 byte
        0x05,                   //bDescriptorType: ENDPOINT
        0x02,                   //bEndpointAddress: OUT endpoint 2 -- Chamber For PA8591
        0x02,                   //bmAttributes: Bulk
        0x40, 0x00,             //wMaxPacketSize: 64 byte
        0x00,                   //bInterval: ignored

        //Endpoint 4 (0x07 byte)
        0x07,                   //bLength: 0x07 byte
        0x05,                   //bDescriptorType: ENDPOINT
        0x83,                   //bEndpointAddress: IN endpoint 3 -- Chamber For PA8591
        0x03,                   //bmAttributes: Interrupt
        0x40, 0x00,             //wMaxPacketSize: 64 byte
        0x01,                   //bInterval: polling interval is 1 ms
};


⌨️ 快捷键说明

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