📄 main.ls1
字号:
404 ; The demo code provided is considered beta. It provides a good example of the
405 ; uPSD32xx operating as a low speed, HID class device performing IAP features.
406 ; The firmware is for the uPSD32xx device on a DK3200 for IAP communicating
407 ; over USB to a Windows application.
408 ;
409 ; USB Compliance:
410 ; This beta code passes the Chapter 9 and HID tests provided by the USB Command
411 ; Verifier program (USBCV R1.2.1). USBCV is available from the USB IF website at:
412 ; http://www.usb.org/developers/developers/tools/
413 ;
414 ; The Passing test result reports for the Chapter 9 and HID tests run on this
415 ; firmware in the DK3200 are included in the "..\USBCV Test Reports" subdirectory.
416 ; Regarding the warnings in the test reports, see the known limitations listed
417 ; below.
418 ;
419 ; Known Limitations:
420 ; 1. The uPSD32xx hardware does not support remote wakeup but does support host
421 ; resume.
422 ;
423 ; 2. This version of the demo code doesn't support the GetIdle and SetIdle
424 ; commands.
425 ;
426 ; 3. This version of the demo code passes the Chapter 9 EnumerateTest the majority
427 ; of the time but on occasion fails.
428 ;
429 ;
430 ;
431 ;
432 ; Important !!!
A51 MACRO ASSEMBLER MAIN 04/30/2004 12:57:59 PAGE 8
433 ; =============
434 ; If you have a previous beta version, please replace all parts
435 ; of your SW with this new version, there are many small but
436 ; important changes that are not
437 ; obvious for the first look.
438 ;
439 ;
440 ;
441 ; Notes:
442 ; ======
443 ; supports USB SUSPEND and RESUME features
444 ; supports USB DisconnectOndemand feature
445 ;
446 ;
447 ; - Version >= Beta 1.0 - DDC int only
448 ;
449 ; - this version of USB demo was designed for uPSD3234A. Check your type of uPSD.
450 ;
451 ; - be sure you have jumpers PB0-PB3 present on your DK3200 kit
452 ; to avoid some false detect of button press.
453 ; This version supports DisconnectOnDemand feature and tests PB port.
454 ;
455 ; - We recommend to design your USB-isr to be as shortest as possible,
456 ; make your USB ISR part as short as possible if you add something
457 ;
458 ; - set the USB priority to the max.level (bit 0 of IPA, see uPSD323X datasheet).
459 ;
460 ; - This version uses relative register addressing,
461 ; use #pragma NOAREGS directive in your applications ...
462 ;
463 ; - Use data directive or place your variables to data area directly
464 ; (data variables are executed faster than xdata, but their amount is more limited.)
465 ;
466 ; - use 36MHz xtal (or 24MHz if not posssible) oscillator freq.only
467 ;
468 ; - be careful of using <string.h> and other routines in USB ISRs
469 ;
470 ; Tested on DK3200 board. Rev.0.1.
471 ;
472 ;
473 ;
474 ;
475 ;
476 ;
477 ; ..........................
478 ; . .
479 ; . ****************** .
480 ; . **PPPPPPPPPPPPPPPP .
481 ; . *PPPP*******PP**** .
482 ; . **PPP********PP*** .
483 ; . ***PPP******PP**** .
484 ; . *****PPP****PP**** .
485 ; . *****PPP****PP**** .
486 ; . PPPPPPPP****PP**** (R) .
487 ; . .
488 ; ..........................
489 ;
490 ;
491 ; =-=-=-=-=-=
492 ; =-=-=-=-=-=-=-=-=-=-=-=-=
493 ; =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
494 ;
495 ; Copyright 2004 ST Microelectronics
496 ;
497 ; This code/file is provided as is and has no warranty,
498 ; implied or otherwise. You are free to use/modify any of the provided
A51 MACRO ASSEMBLER MAIN 04/30/2004 12:57:59 PAGE 9
499 ; code at your own risk in your applications with the expressed limitation
500 ; of liability (see below) so long as your product using the code
501 ; contains at least one uPSD products (device).
502 ;
503 ; LIMITATION OF LIABILITY:
504 ; ========================
505 ; NEITHER STMicroelectronics NOR ITS VENDORS OR AGENTS
506 ; SHALL BE LIABLE FOR ANY LOSS OF PROFITS, LOSS OF USE, LOSS OF DATA,
507 ; INTERRUPTION OF BUSINESS, NOR FOR INDIRECT, SPECIAL, INCIDENTAL OR
508 ; CONSEQUENTIAL DAMAGES OF ANY KIND WHETHER UNDER THIS AGREEMENT OR
509 ; OTHERWISE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
510 ;
511 ; =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
512 ; =-=-=-=-=-=-=-=-=-=-=-=-=
513 ; =-=-=-=-=-=
514 ;
515 ; For current information on uPSD products,
516 ; please consult our pages on the World Wide Web:
517 ;
518 ; www.st.com/psm
519 ;
520 ; - - - - - - - - - - - -
521 ;
522 ; STMicroelectronics GROUP OF COMPANIES
523 ; Australia - Brazil - China - Czech Republic - Finland - France - Germany
524 ; Hong Kong - India - Italy - Japan - Malaysia - Malta - Morocco - Singapore
525 ; Spain - Sweden - Switzerland - United Kingdom - U.S.A.
526 ;
527 ; http://www.st.com
528 ;
529 ;
530 ; `========================================================================` */
531 ;
532 ;
533 ; #pragma NOAREGS //this source must use relative registers !!!
534 ;
535 ; #include <string.h>
536 ; #include "upsd3200.h"
537 ; #include "upsd_usb.h"
538 ; #include "lcd_3200.h"
539 ; #include "app_intr.h"
540 ;
541 ;
542 ; /*========= Prototypes =========*/
543 ;
544 ; extern uchar flash_write_with_poll(volatile uchar xdata *addr, uchar dat);
545 ; extern uchar flash_boot_write_with_poll(volatile uchar xdata *addr, uchar dat);
546 ; extern uchar flash_erase_sector(volatile uchar xdata* addr);
547 ; extern uchar flash_boot_erase_sector(volatile uchar xdata* addr);
548 ; extern void flash_reset();
549 ; extern void flash_boot_reset();
550 ;
551 ; extern void initXREG();
552 ;
553 ;
554 ; //extern
555 ; extern PSD_REGS UPSD_xreg; // UPSD registers (upsd_cfg.c)
556 ; extern data uchar LCD_buffer[]; // LCD mirror buffer (lcd_32xx.c)
557 ;
558 ;
559 ;
560 ;
561 ;
562 ;
563 ; /*=========== Globals ===========*/
564 ;
A51 MACRO ASSEMBLER MAIN 04/30/2004 12:57:59 PAGE 10
565 ; // uncomment the following line to enable DisconnectOndemand feature
566 ; //#define DisconnectOnDemand
567 ;
568 ; /*
569 ; Enable this DisconnectOnDemand define in case of usage of Disconnect-on-demand
570 ; feature ONLY. Be sure that all hardware modifications are present !!!
571 ; */
572 ;
573 ; unsigned char DDCCONintc = 0;
574 ;
575 ;
576 ;
577 ; data int counter; // Incremented in do_timer0 (timer_func.c)
578 ;
579 ; MCU_CMD status; // Status from last command executed
580 ; data uchar returnStatus; // Set TRUE if we should return status record to host
581 ; MCU_CMD currentCmd; // Current command we're working on
582 ; MCU_CMD rcvReport; // Incoming report
583 ; data uchar rcvIndex; // Current byte position in incoming report
584 ; MCU_CMD txReport; // Outgoing report
585 ; data uchar txIndex;
586 ; // Current byte position in outgoing report, but be a byte only !!!
587 ;
588 ;
589 ; xdata char AuxTXBuf[8]; //Aux. buffer for TXing of LCD content
590 ; data uchar LCDBufTXIndex; //current position of LCD buffer for USB TX
591 ;
592 ;
593 ; data unsigned int g_debugUSB_INT_CNT = 0;
594 ; data unsigned char g_debugTimer2_INT_CNT = 0;
595 ;
596 ;
597 ;
598 ;
599 ;
600 ;
601 ;
602 ;
603 ; void initXREG(void)
604
---- 605 RSEG ?PR?initXREG?MAIN
0000 606 initXREG:
607 ; SOURCE LINE # 209
608 ; /******************************************************************************
609 ; Function : void initXREG()
610 ; Parameters : (void)
611 ; Description: Init of uPSD's xregs
612 ; ******************************************************************************/
613 ; {
614 ; SOURCE LINE # 215
615 ;
616 ; /************ VM ************/
617 ; UPSD_xreg.VM |= 0x80;
618 ; SOURCE LINE # 218
0000 900000 F 619 MOV DPTR,#UPSD_xreg+0E2H
0003 E0 620 MOVX A,@DPTR
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -