📄 usb.lis
字号:
GAS LISTING C:\DOCUME~1\REF\LOCALS~1\Temp\cc001896.s page 1
1 ; ---------------------------------------------------------
2 ; ../src/usb.c
3 ; compiled with GCC 2.7.2 ST9+ Software Development Toolchain Version 6.1.3
4 ; Thu Oct 31 15:01:46 2002
5 ;
6 ; OPTIMIZATIONS: 1
7 ; omit-frame-pointer
8 ; OPTIONS: compact
9 ; ---------------------------------------------------------
10
11 gcc_compiled.:
12 .assume no-parmusp,no-fp-on,compact
40
41 .globl HUB_DeviceDescriptor
42
43 .section .rodata
45
46 .desc HUB_DeviceDescriptor, near
47 HUB_DeviceDescriptor:
48 0000 12 .byte 18
49 0001 01 .byte 1
50 0002 10 .byte 16
51 0003 01 .byte 1
52 0004 09 .byte 9
53 0005 00 .byte 0
54 0006 00 .byte 0
55 0007 08 .byte 8
56 0008 B7 .byte 183
57 0009 0E .byte 14
58 000a 15 .byte 21
59 000b 00 .byte 0
60 000c 06 .byte 6
61 000d 02 .byte 2
62 000e 01 .byte 1
63 000f 02 .byte 2
64 0010 00 .byte 0
65 0011 01 .byte 1
67
68 .desc UsbDeviceDesc, near
69 UsbDeviceDesc:
70 0012 12 .byte 18
71 0013 0000 .word HUB_DeviceDescriptor
72 0015 12 .byte 18
73 0016 0000 .word KEYBOARD_DeviceDescriptor
74 0018 12 .byte 18
75 0019 0000 .word MOUSE_DeviceDescriptor
76 001b 12 .byte 18
77 001c 0000 .word JOYSTICK_DeviceDescriptor
78
79 .globl HUB_ConfigDescriptor
81
82 .desc HUB_ConfigDescriptor, near
83 HUB_ConfigDescriptor:
84 001e 09 .byte 9
85 001f 02 .byte 2
86 0020 19 .byte 25
87 0021 00 .byte 0
GAS LISTING C:\DOCUME~1\REF\LOCALS~1\Temp\cc001896.s page 2
88 0022 01 .byte 1
89 0023 01 .byte 1
90 0024 00 .byte 0
91 0025 80 .byte 128
92 0026 32 .byte 50
93 0027 09 .byte 9
94 0028 04 .byte 4
95 0029 00 .byte 0
96 002a 00 .byte 0
97 002b 01 .byte 1
98 002c 09 .byte 9
99 002d 00 .byte 0
100 002e 00 .byte 0
101 002f 00 .byte 0
102 0030 07 .byte 7
103 0031 05 .byte 5
104 0032 81 .byte 129
105 0033 03 .byte 3
106 0034 01 .byte 1
107 0035 00 .byte 0
108 0036 FF .byte 255
110
111 .desc UsbConfigDesc, near
112 UsbConfigDesc:
113 0037 19 .byte 25
114 0038 001E .word HUB_ConfigDescriptor
115 003a 22 .byte 34
116 003b 0000 .word KEYBOARD_ConfigDescriptor
117 003d 22 .byte 34
118 003e 0000 .word MOUSE_ConfigDescriptor
119 0040 22 .byte 34
120 0041 0000 .word JOYSTICK_ConfigDescriptor
121
122 .globl HUB_ReportDescriptor
124
125 .desc HUB_ReportDescriptor, near
126 HUB_ReportDescriptor:
127 0043 09 .byte 9
128 0044 29 .byte 41
129 0045 03 .byte 3
130 0046 14 .byte 20
131 0047 00 .byte 0
132 0048 10 .byte 16
133 0049 64 .byte 100
134 004a 0F .byte 15
135 004b FF .byte 255
137
138 .desc UsbReportDesc, near
139 UsbReportDesc:
140 004c 09 .byte 9
141 004d 0043 .word HUB_ReportDescriptor
142 004f 3F .byte 63
143 0050 0000 .word KEYBOARD_ReportDescriptor
144 0052 38 .byte 56
145 0053 0000 .word MOUSE_ReportDescriptor
146 0055 3E .byte 62
147 0056 0000 .word JOYSTICK_ReportDescriptor
GAS LISTING C:\DOCUME~1\REF\LOCALS~1\Temp\cc001896.s page 3
148
149 .section .data
151
152 .desc main_device, near
153 main_device:
154 0000 00 .byte 0
155
156 .globl EP0RxAddr
157 .desc EP0RxAddr, 16bit register
158 EP0RxAddr= 4
159
160 .globl EP0RxCount
161 .desc EP0RxCount, 16bit register
162 EP0RxCount= 6
163
164 .globl EP0TxAddr
165 .desc EP0TxAddr, 16bit register
166 EP0TxAddr= 0
167
168 .globl EP0RA
169 .desc EP0RA, 8bit register
170 EP0RA= 240
171
172 .globl EP0RB
173 .desc EP0RB, 8bit register
174 EP0RB= 241
175
176 .globl ENDPR1_A
177 .desc ENDPR1_A, 8bit register
178 ENDPR1_A= 242
179
180 .globl ENDPR1_B
181 .desc ENDPR1_B, 8bit register
182 ENDPR1_B= 243
183
184 .globl DADDR0
185 .desc DADDR0, 8bit register
186 DADDR0= 240
187
188 .section .text
191
192 .globl HUB_reset
193
194 .desc HUB_reset, near
195 .proc HUB_reset
196 HUB_reset:
197 .Ltext0:
1:../src/usb.c **** #include <cpu.h>
2:../src/usb.c **** #include <kbd_desc.h>
3:../src/usb.c **** #include <mouse_desc.h>
4:../src/usb.c **** #include <joy_desc.h>
5:../src/usb.c **** #include <version.h>
6:../src/usb.c **** #include <usb.h>
7:../src/usb.c ****
8:../src/usb.c **** #define USB_bmRequestType 0
9:../src/usb.c **** #define USB_bRequest 1
10:../src/usb.c **** #define USB_wValue 2
GAS LISTING C:\DOCUME~1\REF\LOCALS~1\Temp\cc001896.s page 4
11:../src/usb.c **** #define USB_wValueHi 3
12:../src/usb.c **** #define USB_wIndex 4
13:../src/usb.c **** #define USB_wIndexHi 5
14:../src/usb.c **** #define USB_wLength 6
15:../src/usb.c **** #define USB_wLengthHi 7
16:../src/usb.c ****
17:../src/usb.c **** /* bmRequest constants */
18:../src/usb.c **** #define HOST_TO_DEVICE 0x00
19:../src/usb.c **** #define DEVICE_TO_HOST 0x80
20:../src/usb.c **** #define CLASS_REQUEST 0x20
21:../src/usb.c **** #define STANDARD_REQUEST 0x00
22:../src/usb.c **** #define DEVICE_RECIPIENT 0x00
23:../src/usb.c **** #define INTERFACE_RECIPIENT 0x01
24:../src/usb.c **** #define ENDPOINT_RECIPIENT 0x02
25:../src/usb.c **** #define OTHER_RECIPIENT 0x03
26:../src/usb.c ****
27:../src/usb.c **** /* bRequest constants */
28:../src/usb.c **** #define GET_STATUS 0
29:../src/usb.c **** #define CLEAR_FEATURE 1
30:../src/usb.c **** #define SET_FEATURE 3
31:../src/usb.c **** #define SET_ADDRESS 5
32:../src/usb.c **** #define GET_DESCRIPTOR 6
33:../src/usb.c **** #define SET_DESCRIPTOR 7
34:../src/usb.c **** #define GET_CONFIGURATION 8
35:../src/usb.c **** #define SET_CONFIGURATION 9
36:../src/usb.c **** #define GET_INTERFACE 10
37:../src/usb.c **** #define SET_INTERFACE 11
38:../src/usb.c **** #define SYNCH_FRAME 12
39:../src/usb.c ****
40:../src/usb.c **** #define INT_RESET 0x04
41:../src/usb.c **** #define INT_SUSP 0x08
42:../src/usb.c **** #define INT_ESUSP 0x10
43:../src/usb.c ****
44:../src/usb.c **** typedef enum PORT_FEATURE_SELECTOR {
45:../src/usb.c **** PORT_CONNECTION = 0,
46:../src/usb.c **** PORT_ENABLE,
47:../src/usb.c **** PORT_SUSPEND,
48:../src/usb.c **** PORT_OVER_CURRENT,
49:../src/usb.c **** PORT_RESET,
50:../src/usb.c **** PORT_POWER = 8,
51:../src/usb.c **** PORT_LOW_SPEED,
52:../src/usb.c **** C_PORT_CONNECTION = 16,
53:../src/usb.c **** C_PORT_ENABLE,
54:../src/usb.c **** C_PORT_SUSPEND,
55:../src/usb.c **** C_PORT_OVER_CURRENT,
56:../src/usb.c **** C_PORT_RESET
57:../src/usb.c **** } PORT_FEATURE_SELECTOR ;
58:../src/usb.c ****
59:../src/usb.c **** BYTE RxBuffer[ NUMBER_OF_DEVICE][ MAX_PACKET_SIZE] ;
60:../src/usb.c **** BYTE CurDevice ;
61:../src/usb.c **** BYTE *CurRxBuffer ;
62:../src/usb.c **** BYTE data_size[ NUMBER_OF_DEVICE] ;
63:../src/usb.c **** BYTE *data_ptr ;
64:../src/usb.c **** BYTE fsm_state[ NUMBER_OF_DEVICE] ;
65:../src/usb.c **** BYTE address[ NUMBER_OF_DEVICE] ;
66:../src/usb.c ****
67:../src/usb.c **** BYTE configuration_status[ NUMBER_OF_DEVICE] ;
GAS LISTING C:\DOCUME~1\REF\LOCALS~1\Temp\cc001896.s page 5
68:../src/usb.c **** BYTE remote_wakeup_status[ NUMBER_OF_DEVICE] ;
69:../src/usb.c **** BYTE endpoint_stall[ NUMBER_OF_DEVICE] ;
70:../src/usb.c **** static BYTE protocol_status ;
71:../src/usb.c **** static BYTE ep1_tx_ready ;
72:../src/usb.c ****
73:../src/usb.c **** #pragma register_file EP0TxAddr 0
74:../src/usb.c **** extern volatile void *EP0TxAddr ;
75:../src/usb.c **** #pragma register_file EP0TxCount 2
76:../src/usb.c **** extern volatile WORD EP0TxCount ;
77:../src/usb.c **** #pragma register_file EP0RxAddr 4
78:../src/usb.c **** extern volatile void *EP0RxAddr ;
79:../src/usb.c **** #pragma register_file EP0RxCount 6
80:../src/usb.c **** extern volatile WORD EP0RxCount ;
81:../src/usb.c **** #pragma register_file EP1TxAddr 8
82:../src/usb.c **** extern volatile void *EP1TxAddr ;
83:../src/usb.c **** #pragma register_file EP1TxCount 10
84:../src/usb.c **** extern volatile WORD EP1TxCount ;
85:../src/usb.c **** //#pragma register_file EP1RxAddr 12
86:../src/usb.c **** //extern volatile void *EP1RxAddr ;
87:../src/usb.c **** //#pragma register_file EP1RxCount 14
88:../src/usb.c **** //extern volatile WORD EP1RxCount ;
89:../src/usb.c ****
90:../src/usb.c **** #define HUB_SIZ_DEVICE_DESC 18
91:../src/usb.c **** const BYTE HUB_DeviceDescriptor[ HUB_SIZ_DEVICE_DESC] = {
92:../src/usb.c **** 0x12, // bLength
93:../src/usb.c **** 0x01, // bDescriptorType
94:../src/usb.c **** 0x10, 0x01, // bcdUSB (spec release # 1.10)
95:../src/usb.c **** 0x09, // bDeviceClass
96:../src/usb.c **** 0x00, // bDeviceSubClass
97:../src/usb.c **** 0x00, // bDeviceProtocol
98:../src/usb.c **** 0x08, // bMaxPacketSize0
99:../src/usb.c **** 0xB7, 0x0E, // idVendor
100:../src/usb.c **** 0x15, 0x00, // idProduct
101:../src/usb.c **** V_MINOR, V_MAJOR, // bcdDevice ex: 2.02
102:../src/usb.c **** 1, // Index of string Descriptor describing manufacturer
103:../src/usb.c **** 2, // Index of string Descriptor describing product
104:../src/usb.c **** 0, // Index of string Descriptor describing the device's serial number
105:../src/usb.c **** 0x01 // bNumConfigurations (Only one config)
106:../src/usb.c **** } ;
107:../src/usb.c ****
108:../src/usb.c **** static const struct {
109:../src/usb.c **** BYTE size ;
110:../src/usb.c **** const BYTE *desc ;
111:../src/usb.c **** } UsbDeviceDesc[] = {
112:../src/usb.c **** { sizeof HUB_DeviceDescriptor, HUB_DeviceDescriptor},
113:../src/usb.c **** { KEYBOARD_SIZ_DEVICE_DESC, KEYBOARD_DeviceDescriptor},
114:../src/usb.c **** { MOUSE_SIZ_DEVICE_DESC, MOUSE_DeviceDescriptor},
115:../src/usb.c **** { JOYSTICK_SIZ_DEVICE_DESC, JOYSTICK_DeviceDescriptor}
116:../src/usb.c **** } ;
117:../src/usb.c ****
118:../src/usb.c **** #define HUB_SIZ_CONFIG_DESC 25
119:../src/usb.c **** const BYTE HUB_ConfigDescriptor[ HUB_SIZ_CONFIG_DESC] = {
120:../src/usb.c **** // Configuration descriptor
121:../src/usb.c **** 0x09, // bLength: Configuration Descriptor size
122:../src/usb.c **** 0x02, // bDescriptorType: Configuration
123:../src/usb.c **** HUB_SIZ_CONFIG_DESC, // Length of configuration descriptor.
124:../src/usb.c **** 0, // MSB Length of configuration descriptor.
GAS LISTING C:\DOCUME~1\REF\LOCALS~1\Temp\cc001896.s page 6
125:../src/usb.c **** 0x01, // bNumInterfaces: 1 interfaces.
126:../src/usb.c **** 0x01, // bConfigurationValue: Configuration value = 1
127:../src/usb.c **** 0, // iConfiguration: Index of string descriptor describing the configuration (None)
128:../src/usb.c **** 0x80, // bmAttributes: Bus powered and NO Remote wakeup
129:../src/usb.c **** // 0xA0, // bmAttributes: Bus powered and Remote wakeup
130:../src/usb.c **** // 0xC0, // bmAttributes: Self powered and NO Remote wakeup
131:../src/usb.c **** // 0xE0, // bmAttributes: Self powered and Remote wakeup
132:../src/usb.c **** 0x32, // MaxPower 100 mA
133:../src/usb.c **** // Interface descriptor (Interface 0 = DemoKit)
134:../src/usb.c **** 0x09, // bLength: Interface Descriptor size
135:../src/usb.c **** 0x04, // bDescriptorType: Interface descriptor type
136:../src/usb.c **** 0x00, // bInterfaceNumber: Interface Number = 0
137:../src/usb.c **** 0x00, // bAlternateSetting: No Alternate setting
138:../src/usb.c **** 0x01, // bNumEndpoints: one endpoints used
139:../src/usb.c **** 0x09, // bInterfaceClass: HID
140:../src/usb.c **** 0x00, // bInterfaceSubClass: No subclass
141:../src/usb.c **** 0x00, // bInterfaceProtocol: none
142:../src/usb.c **** 0x00, // iInterface: Index of string descriptor (No string value)
143:../src/usb.c **** // 0x02, // iInterface: Index of string descriptor (No string value)
144:../src/usb.c **** // Endpoint 1 descriptor (Demokit)
145:../src/usb.c **** 0x07, // bLength: Endpoint Descriptor size
146:../src/usb.c **** 0x05, // bDescriptorType: Endpoint descriptor type
147:../src/usb.c **** 0x81, // bEndpointAddress: Endpoint 1 IN
148:../src/usb.c **** 0x03, // bmAttributes: Interrupt endpoint
149:../src/usb.c **** 0x01, // wMaxPacketSize(LSB): 1 Byte max (0x0001)
150:../src/usb.c **** 0x00, // wMaxPacketSize (MSB)
151:../src/usb.c **** 0xFF // bInterval: Polling Interval (10 ms = 0x0A)
152:../src/usb.c **** } ;
153:../src/usb.c ****
154:../src/usb.c **** static const struct {
155:../src/usb.c **** BYTE size ;
156:../src/usb.c **** const BYTE *desc ;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -