📄 resource.lst
字号:
C51 COMPILER V6.12 RESOURCE 07/10/2003 20:51:33 PAGE 1
C51 COMPILER V6.12, COMPILATION OF MODULE RESOURCE
OBJECT MODULE PLACED IN .\resource.OBJ
COMPILER INVOKED BY: f:\Keil\C51\BIN\C51.EXE .\resource.h LARGE DEBUG OBJECTEXTEND
stmt level source
1 ////////////resource.h
2 #define D12_DATA 0XFF02
3 #define D12_COMMAND 0XFF03
4
5 #define USB_IDLE 0
6 #define USB_TRANSMIT 1
7 #define USB_RECEIVE 2
8
9 #define MAXIMUM_USB_STRING_LENGTH 255
10
11 // values for the bits returned by the USB GET_STATUS command
12 #define USB_GETSTATUS_SELF_POWERED 0x01
13 #define USB_GETSTATUS_REMOTE_WAKEUP_ENABLED 0x02
14
15 #define USB_DEVICE_DESCRIPTOR_TYPE 0x01
16 #define USB_CONFIGURATION_DESCRIPTOR_TYPE 0x02
17 #define USB_STRING_DESCRIPTOR_TYPE 0x03
18 #define USB_INTERFACE_DESCRIPTOR_TYPE 0x04
19 #define USB_ENDPOINT_DESCRIPTOR_TYPE 0x05
20 #define USB_POWER_DESCRIPTOR_TYPE 0x06
21
22 #define USB_DESCRIPTOR_MAKE_TYPE_AND_INDEX(d, i) ((USHORT)((USHORT)d<<8 | i))
23
24 // Values for bmAttributes field of an
25 // endpoint descriptor
26 #define USB_ENDPOINT_TYPE_MASK 0x03
27 #define USB_ENDPOINT_TYPE_CONTROL 0x00
28 #define USB_ENDPOINT_TYPE_ISOCHRONOUS 0x01
29 #define USB_ENDPOINT_TYPE_BULK 0x02
30 #define USB_ENDPOINT_TYPE_INTERRUPT 0x03
31
32 // definitions for bits in the bmAttributes field of a
33 // configuration descriptor.
34 #define USB_CONFIG_POWERED_MASK 0xc0
35 #define USB_CONFIG_BUS_POWERED 0x80
36 #define USB_CONFIG_SELF_POWERED 0x40
37 #define USB_CONFIG_REMOTE_WAKEUP 0x20
38
39 //
40 // Endpoint direction bit, stored in address
41 //
42 #define USB_ENDPOINT_DIRECTION_MASK 0x80
43
44 // test direction bit in the bEndpointAddress field of
45 // an endpoint descriptor.
46 #define USB_ENDPOINT_DIRECTION_OUT(addr) (!((addr) & USB_ENDPOINT_DIRECTION_MASK))
47 #define USB_ENDPOINT_DIRECTION_IN(addr) ((addr) & USB_ENDPOINT_DIRECTION_MASK)
48
49 //
50 // USB defined request codes
51 // see chapter 9 of the USB 1.0 specifcation for
52 // more information.
53
54 // These are the correct values based on the USB 1.0
55 // specification
C51 COMPILER V6.12 RESOURCE 07/10/2003 20:51:33 PAGE 2
56
57 #define USB_REQUEST_GET_STATUS 0x00
58 #define USB_REQUEST_CLEAR_FEATURE 0x01
59
60 #define USB_REQUEST_SET_FEATURE 0x03
61
62 #define USB_REQUEST_SET_ADDRESS 0x05
63 #define USB_REQUEST_GET_DESCRIPTOR 0x06
64 #define USB_REQUEST_SET_DESCRIPTOR 0x07
65 #define USB_REQUEST_GET_CONFIGURATION 0x08
66 #define USB_REQUEST_SET_CONFIGURATION 0x09
67 #define USB_REQUEST_GET_INTERFACE 0x0A
68 #define USB_REQUEST_SET_INTERFACE 0x0B
69 #define USB_REQUEST_SYNC_FRAME 0x0C
70
71
72 //
73 // defined USB device classes
74 //
75
76
77 #define USB_DEVICE_CLASS_RESERVED 0x00
78 #define USB_DEVICE_CLASS_AUDIO 0x01
79 #define USB_DEVICE_CLASS_COMMUNICATIONS 0x02
80 #define USB_DEVICE_CLASS_HUMAN_INTERFACE 0x03
81 #define USB_DEVICE_CLASS_MONITOR 0x04
82 #define USB_DEVICE_CLASS_PHYSICAL_INTERFACE 0x05
83 #define USB_DEVICE_CLASS_POWER 0x06
84 #define USB_DEVICE_CLASS_PRINTER 0x07
85 #define USB_DEVICE_CLASS_STORAGE 0x08
86 #define USB_DEVICE_CLASS_HUB 0x09
87 #define USB_DEVICE_CLASS_VENDOR_SPECIFIC 0xFF
88
89 //
90 // USB defined Feature selectors
91 //
92 #define USB_FEATURE_ENDPOINT_STALL 0x0000
93 #define USB_FEATURE_REMOTE_WAKEUP 0x0001
94 #define USB_FEATURE_POWER_D0 0x0002
95 #define USB_FEATURE_POWER_D1 0x0003
96 #define USB_FEATURE_POWER_D2 0x0004
97 #define USB_FEATURE_POWER_D3 0x0005
98
99
100 //
101 // values for bmAttributes Field in
102 // USB_CONFIGURATION_DESCRIPTOR
103 //
104
105 #define BUS_POWERED 0x80
106 #define SELF_POWERED 0x40
107 #define REMOTE_WAKEUP 0x20
108
109 //
110 // USB power descriptor added to core specification
111 //
112
113 #define USB_SUPPORT_D0_COMMAND 0x01
114 #define USB_SUPPORT_D1_COMMAND 0x02
115 #define USB_SUPPORT_D2_COMMAND 0x04
116 #define USB_SUPPORT_D3_COMMAND 0x08
117
C51 COMPILER V6.12 RESOURCE 07/10/2003 20:51:33 PAGE 3
118 #define USB_SUPPORT_D1_WAKEUP 0x10
119 #define USB_SUPPORT_D2_WAKEUP 0x20
120
121
122 //*************************************************************************
123 // basic #defines
124 //*************************************************************************
125 #define MAX_ENDPOINTS (unsigned char)0x3
126
127 #define EP0_TX_FIFO_SIZE 16
128 #define EP0_RX_FIFO_SIZE 16
129 #define EP0_PACKET_SIZE 16
130
131 #define EP1_TX_FIFO_SIZE 4
132 #define EP1_RX_FIFO_SIZE 4
133 #define EP1_PACKET_SIZE 4
134
135 #define EP2_TX_FIFO_SIZE 64
136 #define EP2_RX_FIFO_SIZE 64
137 #define EP2_PACKET_SIZE 64
138
139
140 #define USB_IDLE 0
141 #define USB_TRANSMIT 1
142 #define USB_RECEIVE 2
143
144 #define USB_CLASS_CODE_TEST_CLASS_DEVICE 0xdc
145 #define USB_SUBCLASS_CODE_TEST_CLASS_D12 0xA0
146 #define USB_PROTOCOL_CODE_TEST_CLASS_D12 0xB0
147
148 //*************************************************************************
149 // masks
150 //*************************************************************************
151 #define USB_RECIPIENT (unsigned char)0x1F
152 #define USB_RECIPIENT_DEVICE (unsigned char)0x00
153 #define USB_RECIPIENT_INTERFACE (unsigned char)0x01
154 #define USB_RECIPIENT_ENDPOINT (unsigned char)0x02
155
156 #define USB_REQUEST_TYPE_MASK (unsigned char)0x60
157 #define USB_STANDARD_REQUEST (unsigned char)0x00
158 #define USB_CLASS_REQUEST (unsigned char)0x20
159 #define USB_VENDOR_REQUEST (unsigned char)0x40
160
161 #define USB_REQUEST_MASK (unsigned char)0x0F
162
163 #define DEVICE_ADDRESS_MASK 0x7F
164
165 /*
166 //*************************************************************************
167 // macros
168 //*************************************************************************
169 */
170 #define SWAP(x) ((((x) & 0xFF) << 8) | (((x) >> 8) & 0xFF))
171
172 #define MSB(x) (((x) >> 8) & 0xFF)
173 #define LSB(x) ((x) & 0xFF)
174
175
176 /*
177 //*************************************************************************
178 // USB utility functions
179 //*************************************************************************
C51 COMPILER V6.12 RESOURCE 07/10/2003 20:51:33 PAGE 4
180 */
181
182 void fn_usb_isr();
183
184 extern void suspend_change(void);
185 extern void stall_ep0(void);
186 extern void disconnect_USB(void);
187 extern void connect_USB(void);
188 extern void reconnect_USB(void);
189 extern void init_unconfig(void);
190 extern void init_config(void);
191 extern void single_transmit(unsigned char * pData, unsigned char len);
192 extern void code_transmit(unsigned char code * pRomData, unsigned short len);
193
194 extern void control_handler();
195 extern void check_key_LED(void);
196 extern void setup_dma();
197
198 void dma_start(PIO_REQUEST);
199
200 #define IN_TOKEN_DMA 1
201 #define OUT_TOKEN_DMA 0
202
203 #define DMA_BUFFER_SIZE 256
204
205 #define DMA_IDLE 0
206 #define DMA_RUNNING 1
207 #define DMA_PENDING 2
208
209 #define SETUP_DMA_REQUEST 0x0471
210 #define GET_FIRMWARE_VERSION 0x0472
211 #define GET_SET_TWAIN_REQUEST 0x0473
212 #define GET_BUFFER_SIZE 0x0474
213
214 #define D12_STALL 0x02
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = ---- ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -