📄 u08desc.c
字号:
//============================================================================
// File: U08DESC.C
// Func: Device-, Configuration- and String-Descriptors for
// USB08 Demo Application (all const Data, placed in Flash-ROM)
// Ver.: 1.01
// Auth: (C)2000,2001 by Oliver Thamm, MCT Elektronikladen GbR
// http://hc08web.de/usb08
// Rem.: View/Edit this File with TAB-Size=4
//============================================================================
#pragma CONST_SEG ConstData
//----------------------------------------------------------------------------
const device_descriptor DeviceDesc =
{ // Size of this Descriptor in Bytes
sizeof(device_descriptor),
DT_DEVICE, // Descriptor Type (=1)
{0x10, 0x01}, // USB Spec Release Number in BCD = 1.10
0, // Device Class Code (none)
0, // Device Subclass Code (none)
0, // Device Protocol Code (none)
8, // Maximum Packet Size for EP0
{0x70, 0x0c}, // Vendor ID = MCT Elektronikladen
{0x00, 0x00}, // Product ID = Generic Demo
{0x00, 0x01}, // Device Release Number in BCD
1, // Index of String Desc for Manufacturer
2, // Index of String Desc for Product
0, // Index of String Desc for SerNo
1 // Number of possible Configurations
}; // end of DeviceDesc
//----------------------------------------------------------------------------
const configuration_descriptor ConfigDesc =
{ // Size of this Descriptor in Bytes
sizeof(configuration_descriptor),
DT_CONFIGURATION, // Descriptor Type (=2)
{sizeof(configuration_descriptor) + sizeof(interface_descriptor) +
sizeof(endpoint_descriptor) + sizeof(endpoint_descriptor),
0x00}, // Total Length of Data for this Conf
1, // No of Interfaces supported by this Conf
1, // Designator Value for *this* Configuration
0, // Index of String Desc for this Conf
0xc0, // Self-powered, no Remote-Wakeup
0 // Max. Power Consumption in this Conf (*2mA)
}; // end of ConfigDesc
//----------------------------------------------------------------------------
const interface_descriptor InterfaceDesc =
{ // Size of this Descriptor in Bytes
sizeof(interface_descriptor),
DT_INTERFACE, // Descriptor Type (=4)
0, // Number of *this* Interface (0..)
0, // Alternative for this Interface (if any)
2, // No of EPs used by this IF (excl. EP0)
0xff, // IF Class Code (0xff = Vendor specific)
0x01, // Interface Subclass Code
0xff, // IF Protocol Code (0xff = Vendor specific)
0 // Index of String Desc for this Interface
}; // end of InterfaceDesc
//----------------------------------------------------------------------------
const endpoint_descriptor Endpoint1Desc =
{ // Size of this Descriptor in Bytes
sizeof(endpoint_descriptor),
DT_ENDPOINT, // Descriptor Type (=5)
0x81, // Endpoint Address (EP1, IN)
0x03, // Interrupt
{0x08, 0x00}, // Max. Endpoint Packet Size
10 // Polling Interval (Interrupt) in ms
}; // end of Endpoint1Desc
//----------------------------------------------------------------------------
const endpoint_descriptor Endpoint2Desc =
{ // Size of this Descriptor in Bytes
sizeof(endpoint_descriptor),
DT_ENDPOINT, // Descriptor Type (=5)
0x02, // Endpoint Address (EP2, OUT)
0x03, // Interrupt
{0x08, 0x00}, // Max. Endpoint Packet Size
10 // Polling Interval (Interrupt) in ms
}; // end of Endpoint2Desc
//----------------------------------------------------------------------------
// Language IDs
//--------------
#define SD0LEN 4
//--------------
const uchar String0Desc[SD0LEN] = {
// Size, Type
SD0LEN, DT_STRING,
// LangID Codes
0x09, 0x04
};
// Manufacturer String
//--------------------------------------------
#define SD1LEN sizeof("MCT Elektronikladen")*2
//--------------------------------------------
const uchar String1Desc[SD1LEN] = {
// Size, Type
SD1LEN, DT_STRING,
// Unicode String
'M', 0,
'C', 0,
'T', 0,
' ', 0,
'E', 0,
'l', 0,
'e', 0,
'k', 0,
't', 0,
'r', 0,
'o', 0,
'n', 0,
'i', 0,
'k', 0,
'l', 0,
'a', 0,
'd', 0,
'e', 0,
'n', 0
};
// Product String
//-----------------------------------------------
#define SD2LEN sizeof("USB08 Evaluation Board")*2
//-----------------------------------------------
const uchar String2Desc[SD2LEN] = {
// Size, Type
SD2LEN, DT_STRING,
// Unicode String
'U', 0,
'S', 0,
'B', 0,
'0', 0,
'8', 0,
' ', 0,
'E', 0,
'v', 0,
'a', 0,
'l', 0,
'u', 0,
'a', 0,
't', 0,
'i', 0,
'o', 0,
'n', 0,
' ', 0,
'B', 0,
'o', 0,
'a', 0,
'r', 0,
'd', 0
};
// Table of String Descriptors
//
const uchar * const StringDescTable[] = {
String0Desc,
String1Desc,
String2Desc
};
#pragma CONST_SEG default
//============================================================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -