📄 usb.lis
字号:
157:../src/usb.c **** } UsbConfigDesc[] = {
158:../src/usb.c **** { sizeof HUB_ConfigDescriptor, HUB_ConfigDescriptor},
159:../src/usb.c **** { KEYBOARD_SIZ_CONFIG_DESC, KEYBOARD_ConfigDescriptor},
160:../src/usb.c **** { MOUSE_SIZ_CONFIG_DESC, MOUSE_ConfigDescriptor},
161:../src/usb.c **** { JOYSTICK_SIZ_CONFIG_DESC, JOYSTICK_ConfigDescriptor}
162:../src/usb.c **** } ;
163:../src/usb.c ****
164:../src/usb.c **** #define HUB_SIZ_REPORT_DESC 9
165:../src/usb.c **** const BYTE HUB_ReportDescriptor[ HUB_SIZ_REPORT_DESC] = {
166:../src/usb.c **** HUB_SIZ_REPORT_DESC, /* size */
167:../src/usb.c **** 0x29, /* Hub Descriptor */
168:../src/usb.c **** 0x03, /* Number of downstream ports */
169:../src/usb.c **** 0x14, /* LSB HUB Characteristic */
170:../src/usb.c **** 0x00, /* MSB */
171:../src/usb.c **** 0x10, /* PwrOn2PwrGood */
172:../src/usb.c **** 0x64, /* Max current */
173:../src/usb.c **** 0x0F, /* non removeable device on Port 1, 2 and 3 */
174:../src/usb.c **** 0xFF
175:../src/usb.c **** } ;
176:../src/usb.c ****
177:../src/usb.c **** static const struct {
178:../src/usb.c **** BYTE size ;
179:../src/usb.c **** const BYTE *desc ;
180:../src/usb.c **** } UsbReportDesc[] = {
181:../src/usb.c **** { sizeof HUB_ReportDescriptor, HUB_ReportDescriptor},
GAS LISTING C:\DOCUME~1\REF\LOCALS~1\Temp\cc001896.s page 7
182:../src/usb.c **** { KEYBOARD_SIZ_REPORT_DESC, KEYBOARD_ReportDescriptor},
183:../src/usb.c **** { MOUSE_SIZ_REPORT_DESC, MOUSE_ReportDescriptor},
184:../src/usb.c **** { JOYSTICK_SIZ_REPORT_DESC, JOYSTICK_ReportDescriptor}
185:../src/usb.c **** } ;
186:../src/usb.c ****
187:../src/usb.c **** static BYTE main_device = 0 ;
188:../src/usb.c ****
189:../src/usb.c **** void HUB_reset( BYTE active)
190:../src/usb.c **** {
199 .LMM2:
191:../src/usb.c **** EP0RxAddr = RxBuffer[ 0] ;
201 0000 BF040000 ldw @EP0RxAddr,#dpr:pof(@RxBuffer)
202 .LMM3:
192:../src/usb.c **** EP0RxCount = MAX_PACKET_SIZE ;
204 0004 BF060008 ldw @EP0RxCount,#8
205 .LMM4:
193:../src/usb.c **** EP0TxAddr = 0 ; /* Insure there is a valid Tx address in case of a STATUS IN */
207 0008 BF000000 ldw @EP0TxAddr,#0
208 .LMM5:
194:../src/usb.c **** configuration_status[ 0] = 0 ;
210 000c 90D1 clr r1
211 000e C5F10000 ld dpr:pof(@configuration_status),r1
212 .LMM6:
195:../src/usb.c ****
196:../src/usb.c **** spp( USB_EP0_PG) ;
214 ; #APP
215 0012 C712 spp #4
216 ; #NO_APP
217 .LMM7:
197:../src/usb.c **** EP0RA |= 0x02 ; /* EP0 is Control endpoint */
219 0014 05F002 or @EP0RA,#2
220 .LMM8:
198:../src/usb.c **** EP0RA &= ~0x30 ; /* EP0 TX STAT_DISABLED */
222 0017 15F0CF and @EP0RA,#207
223 .LMM9:
199:../src/usb.c **** EP0RB |= 0x30 ; /* EP0 RX STAT_VALID */
225 001a 05F130 or @EP0RB,#48
226 .LMM10:
200:../src/usb.c ****
201:../src/usb.c **** ENDPR1_A &= ~0x30 ; /* EP1 TX STAT_DISABLED */
228 001d 15F2CF and @ENDPR1_A,#207
229 .LMM11:
202:../src/usb.c **** ENDPR1_B &= ~0x30 ; /* EP1 RX STAT_DISABLED */
231 0020 15F3CF and @ENDPR1_B,#207
232 .LMM12:
203:../src/usb.c **** ENDPR1_B |= 0x1 ; /* EP1 is Device 0 Endpoint 1 */
234 0023 05F301 or @ENDPR1_B,#1
235 .LMM13:
204:../src/usb.c ****
205:../src/usb.c **** spp( USB_COMMON_PG) ;
237 ; #APP
238 0026 C73E spp #15
239 ; #NO_APP
240 .LMM14:
206:../src/usb.c **** DADDR0 = active ? (0 | 0x80) : 0 ; /* EP0 default address */
242 0028 0200 or r0,r0
243 002a 6B02 jxz .L2
GAS LISTING C:\DOCUME~1\REF\LOCALS~1\Temp\cc001896.s page 8
244 002c 1C80 ld r1,#128
245 .L2:
246 002e 19F0 ld @DADDR0,r1
247 .LMM15:
207:../src/usb.c ****
208:../src/usb.c **** }
249 0030 46 ret
250 .endproc
251 .Lscope0:
253
254 .globl ISTR
255 .desc ISTR, 8bit register
256 ISTR= 249
257
258 .globl IMR
259 .desc IMR, 8bit register
260 IMR= 250
261
262 .globl EIPR
263 .desc EIPR, 8bit register
264 EIPR= 243
265
266 .globl CTLR
267 .desc CTLR, 8bit register
268 CTLR= 252
269
270 .globl WU_WUPRH
271 .desc WU_WUPRH, 8bit register
272 WU_WUPRH= 254
273
274 .globl WU_WUPRL
275 .desc WU_WUPRL, 8bit register
276 WU_WUPRL= 255
277
278 .globl WU_WUTRH
279 .desc WU_WUTRH, 8bit register
280 WU_WUTRH= 252
281
282 .globl WU_WUMRH
283 .desc WU_WUMRH, 8bit register
284 WU_WUMRH= 250
285
286 .globl WU_CTLR
287 .desc WU_CTLR, 8bit register
288 WU_CTLR= 249
289
290 .globl CLK_FLAG
291 .desc CLK_FLAG, 8bit register
292 CLK_FLAG= 242
294
295 .globl usb_int
296
297 .desc usb_int, near
298 .desc usb_int, interrupt
299 .proc usb_int
300 usb_int:
209:../src/usb.c ****
GAS LISTING C:\DOCUME~1\REF\LOCALS~1\Temp\cc001896.s page 9
210:../src/usb.c **** #pragma INTERRUPT usb_int
211:../src/usb.c **** void usb_int( void)
212:../src/usb.c **** {
302 0031 66EA push R234
303 0033 74D6 pushw rr6
304 0035 74D4 pushw rr4
305 0037 74D2 pushw rr2
306 0039 74D0 pushw rr0
307 003b FE sdm
308 .LMM17:
213:../src/usb.c **** spp( USB_COMMON_PG) ;
310 .LBB2:
311 ; #APP
312 003c C73E spp #15
313 ; #NO_APP
314 .LMM18:
214:../src/usb.c **** if( ISTR & IMR & INT_RESET)
316 003e 08FA ld r0,@IMR
317 0040 14F9D0 and r0,@ISTR
318 0043 AF501B btjxf r0.2,.L5
319 .LMM19:
215:../src/usb.c **** {
216:../src/usb.c **** if( main_device == 0)
321 .LBB3:
322 0046 2F910000 cp dpr:pof(@main_device),#0
322 00
323 004b EB07 jxnz .L6
324 .LMM20:
217:../src/usb.c **** HUB_reset( 1) ;
326 004d 0C01 ld r0,#1
327 004f D20000 call @HUB_reset
328 0052 8B03 jxt .L7
329 .L6:
330 .LMM21:
218:../src/usb.c **** else
219:../src/usb.c **** MOUSE_reset() ;
332 0054 D20000 call @MOUSE_reset
333 .L7:
334 .LMM22:
220:../src/usb.c ****
221:../src/usb.c **** // KEYBOARD_reset() ;
222:../src/usb.c **** // MOUSE_reset() ;
223:../src/usb.c **** // JOYSTICK_reset() ;
224:../src/usb.c **** spp( USB_COMMON_PG) ;
336 ; #APP
337 0057 C73E spp #15
338 ; #NO_APP
339 .LMM23:
225:../src/usb.c **** IMR = INT_RESET | INT_SUSP | INT_ESUSP ;
341 0059 F5FA1C ld @IMR,#28
342 .LMM24:
226:../src/usb.c **** ISTR = 0 ;
344 005c F5F900 ld @ISTR,#0
345 .LMM25:
227:../src/usb.c **** }
347 .LBE3:
348 005f 8B76 jxt .L8
GAS LISTING C:\DOCUME~1\REF\LOCALS~1\Temp\cc001896.s page 10
349 .L5:
350 .LMM26:
228:../src/usb.c **** else
229:../src/usb.c **** {
230:../src/usb.c **** if( (ISTR & IMR & (INT_SUSP | INT_ESUSP)) == (INT_SUSP | INT_ESUSP))
352 0061 08FA ld r0,@IMR
353 0063 14F9D0 and r0,@ISTR
354 0066 15D018 and r0,#24
355 0069 95D018 cp r0,#24
356 006c EB01 jxnz .L9
357 .LMM27:
231:../src/usb.c **** {
232:../src/usb.c **** nop() ;
359 ; #APP
360 006e FF nop
361 ; #NO_APP
362 .L9:
363 .LMM28:
233:../src/usb.c **** }
234:../src/usb.c ****
235:../src/usb.c **** if( ISTR & IMR & INT_SUSP)
365 006f 08FA ld r0,@IMR
366 0071 14F9D0 and r0,@ISTR
367 0074 AF704E btjxf r0.3,.L10
368 .LMM29:
236:../src/usb.c **** {
237:../src/usb.c **** do
370 0077 90D0 clr r0
371 0079 2C80 ld r2,#128
372 007b 1C05 ld r1,#5
373 .L11:
374 .LMM30:
238:../src/usb.c **** {
239:../src/usb.c **** spp( EXINT_PG) ;
376 ; #APP
377 007d C702 spp #0
378 ; #NO_APP
379 .LMM31:
240:../src/usb.c **** EIPR = 0x0 ; /* Clear pending bits */
381 007f 09F3 ld @EIPR,r0
382 .LMM32:
241:../src/usb.c ****
242:../src/usb.c **** spp( USB_COMMON_PG) ;
384 ; #APP
385 0081 C73E spp #15
386 ; #NO_APP
387 .LMM33:
243:../src/usb.c **** CTLR |= 0x40 ; /* set TIM_SUSP */
389 0083 05FC40 or @CTLR,#64
390 .LMM34:
244:../src/usb.c ****
245:../src/usb.c **** spp( WU_PG) ;
392 ; #APP
393 0086 C7E6 spp #57
394 ; #NO_APP
395 .LMM35:
246:../src/usb.c **** WU_WUPRH = 0 ; /* Clear pending bits */
GAS LISTING C:\DOCUME~1\REF\LOCALS~1\Temp\cc001896.s page 11
397 0088 09FE ld @WU_WUPRH,r0
398 .LMM36:
247:../src/usb.c **** WU_WUPRL = 0 ;
400 008a 09FF ld @WU_WUPRL,r0
401 .LMM37:
248:../src/usb.c **** WU_WUTRH = 0x80 ; /* Trigger on raising edge */
403 008c 29FC ld @WU_WUTRH,r2
404 .LMM38:
249:../src/usb.c **** WU_WUMRH = 0x80 ;
406 008e 29FA ld @WU_WUMRH,r2
407 .LMM39:
250:../src/usb.c ****
251:../src/usb.c **** spp( USB_COMMON_PG) ;
409 ; #APP
410 0090 C73E spp #15
411 ; #NO_APP
412 .LMM40:
252:../src/usb.c **** CTLR |= 0x02 ; /* set LP_SUSP */
414 0092 05FC02 or @CTLR,#2
415 .LMM41:
253:../src/usb.c ****
254:../src/usb.c **** spp( WU_PG) ;
417 ; #APP
418 0095 C7E6 spp #57
419 ; #NO_APP
420 .LMM42:
255:../src/usb.c **** WU_CTLR = 0x05 ; /* Set STOP, IDS1 and WKUP-INT bits */
422 0097 19F9 ld @WU_CTLR,r1
423 .LMM43:
256:../src/usb.c **** WU_CTLR = 0x01 ; /* Set IDS1 and WKUP-INT bit */
425 0099 F5F901 ld @WU_CTLR,#1
426 .LMM44:
257:../src/usb.c **** WU_CTLR = 0x05 ; /* Set STOP, IDS1 and WKUP-INT bits */
428 009c 19F9 ld @WU_CTLR,r1
429 .LMM45:
258:../src/usb.c ****
259:../src/usb.c **** nop() ;
431 ; #APP
432 009e FF nop
433 ; #NO_APP
434 .LMM46:
260:../src/usb.c **** nop() ;
436 ; #APP
437 009f FF nop
438 ; #NO_APP
439 .LMM47:
261:../src/usb.c **** nop() ;
441 ; #APP
442 00a0 FF nop
443 ; #NO_APP
444 .LMM48:
262:../src/usb.c **** nop() ;
446 ; #APP
447 00a1 FF nop
448 ; #NO_APP
449 .LMM49:
263:../src/usb.c **** nop() ;
GAS LISTING C:\DOCUME~1\REF\LOCALS~1\Temp\cc001896.s page 12
451 ; #APP
452 00a2 FF nop
453 ; #NO_APP
454 .LMM50:
264:../src/usb.c **** nop() ;
456 ; #APP
457 00a3 FF nop
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -