📄 descriptor.lst
字号:
C51 COMPILER V7.02b DESCRIPTOR 02/01/2007 10:35:43 PAGE 1
C51 COMPILER V7.02b, COMPILATION OF MODULE DESCRIPTOR
OBJECT MODULE PLACED IN .\Output\Descriptor.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE Descriptor.c OPTIMIZE(9,SPEED) BROWSE INCDIR(Include) DEFINE(READER) DEBUG
-OBJECTEXTEND PRINT(.\Output\Descriptor.lst) OBJECT(.\Output\Descriptor.obj)
stmt level source
1 /*
2 **********************************************************************************************
3 * Project: TK7821
4 * File: Descriptor.c
5 * Contents:
6 *
7 *
8 * $Date: 02/25/05 Jason v0.1
9 * 05/12/05 Mingo v0.2 www.fameg.com
10 * 12/08/05 Jason v0.3 Modify the PID and VID
11 *
12 * Copyright (c) 2005 Fameg, Inc. All rights reserved
13 ***********************************************************************************************
14 */
15
16 #include <reg51.h>
17 #include <stdio.h>
18 #include <string.h>
19 #include "sotatype.h"
20 #include "usbdisk.h"
21 #include "device.h"
22 #include "ScsiCmd.h"
23 #include "Descriptor.h"
24
25 xdata UINT16 CtrlXferLen = 0;
26
27 #define DESC_BASE 0x7f00
28
29 code BYTE DeviceDesc[] //_at_ DESC_BASE
30 = { 0x12, // Size of this descriptor in bytes
31 0x01, // DEVICE descriptor type
32 0x00, 0x02, // USB Version 2.00
33 0x00, // Class is specified in the interface desc.
34 0x00, // Subclass is specified in the interface desc.
35 0x00, // Protocol is specified in the interface desc.
36 CTRL_PKT_SIZE, // Max packet size for endpoint 0
37 0x21, 0x51, // Vendor ID (5121h)
38 0x03, 0x10, // Device ID (1003h)
39 0x00, 0x01, // Device release number (1000h)
40 STR_DESC_VENDOR_INDEX, // string index = 1
41 STR_DESC_PRODUCT_INDEX, // string index = 2
42 STR_DESC_SERIALNUM_INDEX, // string index = 3
43 0x01 // Number of possible configurations
44 };
45
46 code BYTE ConfigDesc[] //_at_ DESC_BASE + 0x20
47 = { // Configuration Descriptor
48 0x09, // Size of this descriptor in bytes
49 0x02, // CONFIGURATION descriptor type
50 0x20, 0x00, // Total data length for this config. (0020h)
51 0x01, // Number of interface supported
52 0x01, // bConfigurationValue
53 0x00, // string index = 0
54 0x80, // No self-powerd, and no Remote Wakeup
C51 COMPILER V7.02b DESCRIPTOR 02/01/2007 10:35:43 PAGE 2
55 0x32, // Max power = 100mA
56 // Interface Descriptor
57 0x09, // Size of this descriptor in bytes
58 0x04, // INTERFACE descriptor type
59 0x00, // bInterfaceNumber
60 0x00, // bAlternateSetting
61 0x02, // bNumEndpoints (excluding endpoint 0)
62 0x08, // MASS STORAGE Class
63 0x06, // SCSI transparent command set
64 0x50, // BULK-ONLY TRANSPORT
65 0x00, // string index = 0
66 // Endpoint Descriptor for EP1
67 0x07, // Size of this descriptor in bytes
68 0x05, // ENDPOINT descriptor type
69 EP1IN_NUMBER, // IN, endpoint num = 1
70 0x02, // Bulk endpoint
71 0x40, 0x00, // max packet size (64 bytes)
72 0x00,
73 // Endpoint Descriptor for EP2
74 0x07, // Size of this descriptor in bytes
75 0x05, // ENDPOINT descriptor type
76 EP2OUT_NUMBER, // OUT, endpoint num = 1
77 0x02, // Bulk endpoint
78 0x40, 0x00, // max packet size (64 bytes)
79 0x00 };
80
81 code BYTE Str0Desc[] //_at_ DESC_BASE + 0x40
82 = { 0x04, // Size of this descriptor in bytes
83 0x03, // STRING+ descriptor type
84 0x09,
85 0x04 };
86
87 code BYTE Str1Desc[] //_at_ DESC_BASE + 0x50
88 = { 0x04,
89 0x03,
90 ' ', 0x00 };
91
92 code BYTE Str2Desc[] //_at_ DESC_BASE + 0x60
93 = { 0x1a,
94 0x03,
95 'U', 0x00,
96 'S', 0x00,
97 'B', 0x00,
98 ' ', 0x00,
99 '2', 0x00,
100 '.', 0x00,
101 '0', 0x00,
102 ' ', 0x00,
103 'D', 0x00,
104 'i', 0x00,
105 's', 0x00,
106 'k', 0x00 };
107
108 code BYTE Str3Desc[] //_at_ DESC_BASE + 0x80
109 = { 0x16,
110 0x03,
111 '0', 0x00,
112 '0', 0x00,
113 '0', 0x00,
114 '0', 0x00,
115 '0', 0x00,
116 '0', 0x00,
C51 COMPILER V7.02b DESCRIPTOR 02/01/2007 10:35:43 PAGE 3
117 '0', 0x00,
118 '0', 0x00,
119 '0', 0x00,
120 '1', 0x00 };
121
122 code BYTE DeviceQualifierDesc[] //_at_ DESC_BASE + 0xa0
123 = { 0x0a, // Size of this descriptor in bytes
124 0x06, // Device Qualifier descriptor type
125 0x00, 0x02, // USB version
126 0x08, // MASS STORAGE Class
127 0x06, // SCSI transparent command set
128 0x50, // BULK-ONLY TRANSPORT
129 0x40, // Max packet size for other speed
130 0x01, // Number of Other-speed Configuration
131 0x00 };
132
133 code PBYTE StrDescPtr[4] = { Str0Desc,
134 Str1Desc,
135 Str2Desc,
136 Str3Desc };
137 code BYTE StrCtrlXferLen[4] = { sizeof(Str0Desc),
138 sizeof(Str1Desc),
139 sizeof(Str2Desc),
140 sizeof(Str3Desc) };
141 code BYTE DeviceDescLen = sizeof(DeviceDesc);
142 code BYTE ConfigDescLen = sizeof(ConfigDesc);
143 code BYTE DeviceQualifierDescLen = sizeof(DeviceQualifierDesc);
144
145 /*--------------------------------------------------------------------
146 code BYTE OtherSpeedConfigDesc[] _at_ DESC_BASE + 0xb0
147 = { 0x09, // Size of this descriptor in bytes
148 0x07, // Other_Speed_Configuration descriptor type
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -