⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usbsm.lst

📁 Cypress 的(鼠标+键盘)复合设备汇编源程序
💻 LST
📖 第 1 页 / 共 5 页
字号:
CYASM Version 1.81
(C) 2000 Cypress Semiconductor Corp.

0000                    CPU 63413
0000            label:          XPAGEON
0000            
0000            ;========================================================================
0000            ;   FILE: usbsm.asm 
0000            ;
0000            ;   This file includes all the files necessary to build a 
0000            ;   usb keyboard with slave mouse.
0000            ;========================================================================
0000            
0000            
0000            ;include all "inc" files used by the code
0000            
0000            ;========================================================================
0000            ;   FILE: regs.inc
0000            ;
0000            ;   This file contains the chip register definitions
0000            ;
0000            ;========================================================================
0000            ; I/O ports
0000            Port0_Data:             equ   00h       ; GPIO data port 0
0000            Port1_Data:             equ   01h       ; GPIO data port 1
0000            Port2_Data:             equ   02h       ; GPIO data port 2
0000            Port3_Data:                     equ   03h       ; GPIO data port 3
0000            
0000            Port0_Interrupt:        equ   04h       ; Interrupt enable for port 0
0000            Port1_Interrupt:        equ   05h       ; Interrupt enable for port 1
0000            Port2_Interrupt:                equ   06h       ; Interrupt enable for port 2
0000            Port3_Interrupt:                equ   07h       ; Interrupt enable for port 3
0000            
0000            GPIO_Config:            equ   08h       ; General purpose I/O configuration
0000            
0000            ; USB ports
0000            USB_Device_Address:     equ   10h       ; USB device address assigned by host
0000            EP_A0_Counter:          equ   11h       ; Address A endpoint 0 counter
0000            EP_A0_Mode:                     equ   12h       ; Address A endpoint 0 configuration
0000            EP_A1_Counter:          equ   13h       ; Address A endpoint 1 counter
0000            EP_A1_Mode:             equ   14h       ; Address A endpoint 1 configuration
0000            EP_A2_Counter:          equ   15h       ; Address A endpoint 2 counter
0000            EP_A2_Mode:             equ   16h       ; Address A endpoint 2 configuration
0000            USB_Status_Control:     equ   1Fh       ; USB upstream status and control
0000            
0000            ; control ports
0000            Global_Interrupt:       equ   20h   ; Global interrupt enable
0000            Endpoint_Interrupt:     equ   21h   ; USB endpoint interrupt enable
0000            Timer_LSB:              equ   24h   ; lower eight bits of timer
0000            Timer_MSB:              equ   25h   ; upper six bits of timer
0000            Watchdog:               equ   26h   ; clear watchdog Timer
0000            
0000            ; DAC port
0000            DAC_Data:                     equ       30h     ; GPIO DAC
0000            DAC_Interrupt:          equ     31h     ; DAC interrupt enable
0000            DAC_Interrupt_Polarity: equ     32h     ; DAC interrupt polarity
0000            
0000            DAC_Isink:                      equ     38h     ; 4-bit sink current 
0000            DAC_Isink0:                     equ     38h     ; bit 0
0000            DAC_Isink1:                     equ     39h     ; bit 1
0000            DAC_Isink2:                     equ     3Ah     ; bit 2
0000            DAC_Isink3:                 equ 3Bh     ; bit 3
0000            DAC_Isink4:                     equ     3Ch     ; bit 4
0000            DAC_Isink5:                     equ     3Dh     ; bit 5
0000            DAC_Isink6:                     equ     3Eh     ; bit 6
0000            DAC_Isink7:                     equ     3Fh     ; bit 7
0000            
0000            ; processor control port
0000            Status_Control:         equ   FFh       ; Processor Status and Control
0000            
0000            
0000            
0000            RunBit:                 equ      1h     ; CPU Run bit
0000            SingleStep:                     equ      2h     ; Single Step
0000            InterruptEnable:                equ      4h     ; interrupt enable
0000            SuspendWait:            equ      8h     ; Suspend, wait for interrupt
0000            PowerOnReset:           equ     10h     ; power-on reset
0000            USBReset:                       equ     20h     ; USB Bus Reset bit
0000            WatchDogReset:          equ     40h     ; Watchdog Reset bit
0000            IRQpending:                     equ     80h     ; IRQ pending
0000            
0000            
0000            
0000            
0000            PORT0_DATA_REG:             equ   00h   ; GPIO data port 0
0000            PORT1_DATA_REG:             equ   01h   ; GPIO data port 1
0000            PORT2_DATA_REG:             equ   02h       ; GPIO data port 2
0000            PORT3_DATA_REG:             equ   03h     ; GPIO data port 3
0000            
0000            PORT0_INTERRUPT_REG:        equ   04h   ; Interrupt enable for port 0
0000            PORT1_INTERRUPT_REG:        equ   05h   ; Interrupt enable for port 1
0000            PORT2_INTERRUPT_REG:        equ   06h     ; Interrupt enable for port 2
0000            PORT3_INTERRUPT_REG:        equ   07h     ; Interrupt enable for port 3
0000            
0000            GPIO_CONFIG_REG:            equ   08h     ; General purpose I/O configuration
0000            
0000            ; USB ports
0000            USB_DEVICE_ADDRESS_REG:     equ   10h   ; USB device address assigned by host
0000            EP_A0_COUNTER_REG:          equ   11h   ; Address A endpoint 0 counter
0000            EP_A0_MODE_REG:             equ   12h   ; Address A endpoint 0 configuration
0000            EP_A1_COUNTER_REG:          equ   13h   ; Address A endpoint 1 counter
0000            EP_A1_MODE_REG:             equ   14h   ; Address A endpoint 1 configuration
0000            USB_STATUS_CONTROL_REG:     equ   1Fh   ; USB upstream status and control
0000            
0000            ; control ports
0000            GLOBAL_INTERRUPT_REG:       equ   20h   ; Global interrupt enable
0000            ENDPOINT_INTERRUPT_REG:     equ   21h   ; USB endpoint interrupt enable
0000            TIMER_LSB_REG:              equ   24h   ; lower eight bits of timer
0000            TIMER_MSB_REG:              equ   25h   ; upper six bits of timer
0000            WATCHDOG_REG:               equ   26h   ; clear watchdog Timer
0000            
0000            ; DAC port
0000            DAC_DATA_REG:               equ   30h     ; GPIO DAC
0000            DAC_INTERRUPT_REG:          equ   31h     ; DAC interrupt enable
0000            DAC_INTERRUPT_POLARITY_REG: equ   32h     ; DAC interrupt polarity
0000            
0000            DAC_ISINK_REG:              equ   38h     ; 4-bit sink current 
0000            DAC_ISINK0_REG:             equ   38h     ; bit 0
0000            DAC_ISINK1_REG:             equ   39h     ; bit 1
0000            DAC_ISINK2_REG:             equ   3Ah     ; bit 2
0000            DAC_ISINK3_REG:             equ   3Bh     ; bit 3
0000            DAC_ISINK4_REG:             equ   3Ch     ; bit 4
0000            DAC_ISINK5_REG:             equ   3Dh     ; bit 5
0000            DAC_ISINK6_REG:             equ   3Eh     ; bit 6
0000            DAC_ISINK7_REG:             equ   3Fh     ; bit 7
0000            
0000            ; processor control port
0000            STATUS_CONTROL_REG:         equ   FFh       ; Processor Status and Control
0000            
0000            ;========================================================================
0000            ; GPIO constants
0000            ;========================================================================
0000            ; GPIO configuration
0000            ;       Two bits per port the driver mode for each 8-bit port:
0000            ;       00      resistive       interrupt on falling edge
0000            ;       01      CMOS            no interrupts
0000            ;       10      open drain      interrupt on falling edge
0000            ;       11      open drain      interrupt on rising edge
0000            
0000            PORT0_CONFIG_MASK:          equ     3h     ; configuration bits port 0
0000            PORT1_CONFIG_MASK:          equ     0Ch     ; configuration bits port 1
0000            PORT2_CONFIG_MASK:          equ     30h     ; configuration bits port 2
0000            PORT3_CONFIG_MASK:          equ     C0h     ; configuration bits port 3
0000            
0000            RESISTIVE_NEG:              equ     FFh
0000            CMOS_NONE:                  equ     AAh
0000            OPENDRAIN_NEG:              equ     55h
0000            OPENDRAIN_POS:              equ     00h
0000            
0000            ;========================================================================
0000            ; USB I/O port constants 
0000            ;========================================================================
0000            
0000            ; device address register
0000            ADDRESS_MASK:               equ     7Fh     ; 7 bits of device address
0000            ADDRESS_ENABLE_BIT:         equ     80h     ; enable the device address
0000            
0000            ; endpoint mode register
0000            USB_MODE_MASK:              equ     0Fh     ; mode[3:0] bits
0000            
0000            DISABLED:                   equ     0h      ; disabled
0000            NAKINOUT:                   equ     1h      ; accept SETUP, NAK IN and OUT
0000            STATUSOUTONLY:              equ     2h      ; accept SETUP and OUT, stall IN
0000            STALL:                      equ     3h      ; stall IN and OUT packets
0000            SETUP:                      equ     4h      ; accept SETUP packets
0000            STATUSINONLY:               equ     6h      ; accept SETUP and IN (TX 0), stall OUT
0000            NAKOUTSTATUSIN:             equ     0Ah     ; accept SETUP, NAK Out
0000            ACKOUTSTATUSIN:             equ     0Bh     ; accept SETUP, TX0 IN, ACK OUT
0000            NAKIN:                      equ     0Ch     ; NAK IN packets
0000            ACKIN:                      equ     0Dh     ; ACK IN packets (EP one)
0000            NAKIN_STATUSOUT:            equ     0eh
0000            ACKIN_STATUSOUT:            equ     0Fh     ; accept SETUP packets (EP zero) 
0000                                                    ; ACK IN packets
0000            
0000            ; endpoint 0 only mode register
0000            ACK_BIT:                    equ     10h     ; ACK received from host (same for EP1,EP2)
0000            EP0_OUT_RCV:                equ     20h     ; EP0 OUT received
0000            EP0_IN_RCV:                 equ     40h     ; EP0 IN received
0000            EP0_SETUP_RCV:              equ     80h     ; EP0 SETUP received
0000            
0000            ; endpoint count register
0000            COUNT_MASK:                 equ     0Fh     ; count[3:0] bits
0000            DATAVALID:                  equ     40h     ; data valid (OUT and SETUP)
0000            DATATOGGLE:                 equ     80h     ; Data 0/1 bit
0000            
0000            ; USB Status and Control
0000            USB_CONTROL_BITS:           equ     7h      ; control[2:0] bits
0000            BUS_ACTIVITY:               equ     8h      ; bus activity bit
0000            DATA_BITS:                  equ     30h     ; D+ and D-
0000            DP:                         equ     20h
0000            DM:                         equ     10h
0000            
0000            DPH_DMH:                     equ     7
0000            DPH_DML:                     equ     5
0000            DPL_DMH:                     equ     6
0000            DPL_DML:                     equ     3
0000            
0000            
0000            ;========================================================================
0000            ; interrupt constants
0000            ;========================================================================
0000            
0000            ; Global interrupt masks
0000            RESET_MASK:                 equ     1h      ; USB Bus Reset interrupt
0000            
0000            TIMER_MASK:                 equ     5h      ; USB Bus Reset interrupt
0000                                                                            ; one msec timer interrupt
0000            
0000            GPIO_ONLY_MASK:             equ     20h     ; GPIO interrupt 
0000            
0000            TIMER_ONLY_MASK:            equ     04h     ; one msec timer interrupt
0000            GPIO_TIMER_MASK:                    equ     24h   ; GPIO and 1ms timer interrupt
0000            GPIO_TIMER_RESET_MASK:      equ     25h   ; GPIO, 1ms timer and bus reset interrupt
0000            ; Global interrupt masks
0000            GPIO_ISR_MASK:              equ     20h     ; GPIO interrupt 
0000            DAC_ISR_MASK:               equ     10h     ; DAC interrupt 
0000            
0000            TIMER_ISR_MASK:             equ     04h     ; one msec timer interrupt
0000            RESET_ISR_MASK:                 equ     01h   ; GPIO and 1ms timer interrupt
0000            
0000            
0000            
0000            
0000            
0000            
0000            ; endpoint interrupt masks
0000            NO_ENDPOINTS:               equ     0h      ; no USB endpoint interrupts
0000            
0000            ENUMERATE:                  equ     1h      ; USB EP A0 interrupt enable
0000            KEYBOARD_ONLY:              equ     3h      ; USB EP A0 interrupt enable
0000            KEYBOARD_PLUS_MOUSE:    equ    7h   ; USB EP A0, A1, A2 interrupt enable
0000                                                                            ; USB EP A1 interrupt enable
0000            EP0_EP1_EP2:    equ    7h   ; USB EP A0, A1, A2 interrupt enable
0000                                                                            ; USB EP A1 interrupt enable

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -