亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? 637mouse.asm

?? 這是使用CYPRESS的7C637xx芯片完成USB鼠標(biāo)的例子。
?? ASM
?? 第 1 頁 / 共 5 頁
字號(hào):
;***************************************************************************
;
; File: 637mouse.asm
; Version: 1.02
; Description: This code provides both PS/2 and USB support for a combi
;              mouse
; Target: Cypress CY7C63743
;
; Overview
;        On power up, the firmware starts executing code at address 0h. 
; After some housekeeping tasks it will determine whether it is attached to
; a USB or a PS2 interface. From that, it will branch either to USB_Main or
; PS2_Main.
;
; PS2 Overview
;        There are four main tasks:
;        * PS2_Main
;        * buttons (common to USB and PS2)
;        * optics (common to USB and PS2)
;        * PS2_DoCommand - processing of PS2 commands from host
;
; PS2_Main
;        This routine initializes the PS2 variables, the IO ports, computes
; the (X,Y) coordinates of mouse movement, the Z-coordinate of wheel motion,
; if needed, determines which button has been pressed and sends out a mouse 
; packet to a host.
;
; PS2_DoCommand
;        When a host wants to send data to the mouse it will drive the
; SDATA line low. The PS2_Main task will continuously poll it and will clock 
; in the data. The latter will be parsed and processed.
;
; USB Overview
;        There are also four main tasks: 
;        * USB_Main
;        * buttons (common to USB and PS2)
;        * optics (common to USB and PS2)
;        * suspend/resume 
;
; USB_Main
;        This routine initializes the USB variables, the IO ports, the mouse
; logic, and the data space. All USB communication occurs on an interrupt 
; basis.
; 
;        Endpoint 0 is used to support Control Transfers and vendor specific
; requests.  During enumeration setup commands are sent to endpoint1 to 
; initialize the USB device and to extract configuration information from the
; device
;
;        Endpoint 1 is used to transfer interrupt data back to the host.  
; In this case we transfer data from the button and optics back to the host. 
;
; Buttons
;        The buttons are polled every millisecond inside the 1ms handler and
; processed in the main task loop.
;
; Optics
;        The optics for mouse mouvement (X,Y,Z) are continuously polled
; and processed in the main task loop.  The quadrature state of the optics
; tells us which direction the mouse is moving in. This data is sent back to
; the host as an offset from the last time the mouse was polled for data by
; the host. Further, for PS/2, the optics will be polled and processed every
; time a bit is sent out or received. This prevents missing any optics count
; during PS2 data transfer.
;
; Suspend/Resume
;        Every millisecond, the USB is polled for activity. If no activity
; occurs for three milliseconds, then it is assumed that the USB is in 
; suspend.  Because this device supports remote wakeup, pressing the buttons
; or moving the mouse causes the firmware to send resume signalling back 
; to the host to wakeup and resume operation.
;
; Endpoint1 packet definition
;     Byte      Usage
;      0    Button Data 7-3 Not used, 2=middle, 1=right, 0=left
;      1    horizontal displacement measured via the optics
;      2    vertical displacement measured via the optics
;      3    z-displacement (wheel) measured via the optics
;
; Revisions:
;    10/09/00: Original Version. Taken from u5combi.asm, v.1.03
;
;    1.00    
;       Fixed the Chapter 9 Test - device remote wakeup
;
;    1.01    
;       Fixed the suspend current requirements by explicitly writing SUSPEND
; and RUN bits of the processor status control register when going into 
; suspend
;
;    1.02
;	Convert TABS into spaces. No code change.
;    
;***************************************************************************
;
;        Copyright 2000 Cypress Semiconductor
;    This code is provided by Cypress as a reference.  Cypress makes no
;    claims or warranties to this firmware's suitability for any 
;    application. 
;
;*************************************************************************** 

    CPU    63743

    XPAGEON

    INCLUDE "637xx.inc"
    INCLUDE "USB.inc"
    INCLUDE "PS2.inc"
    INCLUDE "macros.inc"

;
; Supported Interfaces 
;
USB_MOUSE:                      equ    01h
PS2_MOUSE:                      equ    00h

;
; EP0 In-Transaction State Machine
;
EP0_IN_IDLE:                    equ    00h
CONTROL_READ_DATA:              equ    02h
NO_DATA_STATUS:                 equ    04h
EP0_IN_STALL:                   equ    06h

;
; EP0 No-Data Control Flags
;
ADDRESS_CHANGE_PENDING:         equ    00h
NO_CHANGE_PENDING:              equ    02h

;
; Response Sizes
;
DEVICE_STATUS_LENGTH:           equ    2
DEVICE_CONFIG_LENGTH:           equ    1
ENDPOINT_STALL_LENGTH:          equ    2
INTERFACE_STATUS_LENGTH:        equ    2
INTERFACE_ALTERNATE_LENGTH:     equ    1
INTERFACE_PROTOCOL_LENGTH:      equ    1

;
; General Constants
;
BIT0:                           equ    01h
BIT1:                           equ    02h
BIT2:                           equ    04h
BIT3:                           equ    08h
BIT4:                           equ    10h
BIT5:                           equ    20h
BIT6:                           equ    40h
BIT7:                           equ    80h

;
; Interface Constants - they need to be redefined for a new hardware platform
;
DUAL_DSP_DATA:                  equ    20h      ; top of data stack 
                                                ; (for PUSH/POP instructions)
LEFT_BUTTON_PORT:               equ    PORT0
LEFT_BUTTON_MASK:               equ    BIT7

RIGHT_BUTTON_PORT:              equ    PORT1
RIGHT_BUTTON_MASK:              equ    BIT0

MIDDLE_BUTTON_PORT:             equ    PORT1
MIDDLE_BUTTON_MASK:             equ    BIT1

OPTICS_PORT:                    equ    PORT0

X_LEFT_OPTICS_PORT:             equ    PORT0
X_LEFT_OPTICS_MASK:             equ    BIT0
X_RIGHT_OPTICS_PORT:            equ    PORT0
X_RIGHT_OPTICS_MASK:            equ    BIT1

Y_LEFT_OPTICS_PORT:             equ    PORT0
Y_LEFT_OPTICS_MASK:             equ    BIT2
Y_RIGHT_OPTICS_PORT:            equ    PORT0
Y_RIGHT_OPTICS_MASK:            equ    BIT3

Z_UP_OPTICS_PORT:               equ    PORT0
Z_UP_OPTICS_MASK:               equ    BIT4
Z_DOWN_OPTICS_PORT:             equ    PORT0
Z_DOWN_OPTICS_MASK:             equ    BIT5

LED_PORT:                       equ    PORT0
LED_MASK:                       equ    BIT6
    ;
    ; Normal operating mode - configure buttons as resistive/CMOS
    ; LED as medium sink/CMOS and optics (x,y,z) as HI-Z/CMOS
    ;
PORT0_NORMAL:                   equ    80h
PORT0_MODE1_NORMAL:             equ    80h
PORT0_MODE0_NORMAL:             equ    40h

PORT1_NORMAL:                   equ    03h
PORT1_MODE1_NORMAL:             equ    03h
PORT1_MODE0_NORMAL:             equ    00h

    ;
    ; Suspend operating mode (no wake up) - configure buttons as 
    ; medium sink/CMOS, LED as resistive/CMOS and 
    ; optics (x,y,z) as HI-Z/CMOS
    ;
PORT0_SUSPEND:                  equ    40h
PORT0_MODE1_SUSPEND:            equ    40h
PORT0_MODE0_SUSPEND:            equ    80h

PORT1_SUSPEND:                  equ    00h
PORT1_MODE1_SUSPEND:            equ    00h
PORT1_MODE0_SUSPEND:            equ    03h

    ;
    ; Suspend with remote wake-up - configure buttons as resistive/CMOS
    ; LED as resistive/CMOS and optics (x,y,z) as HI-Z/CMOS
    ;
PORT0_SUSRW:                    equ    0C0h
PORT0_MODE1_SUSRW:              equ    0C0h
PORT0_MODE0_SUSRW:              equ    00h

PORT1_SUSRW:                    equ    03h
PORT1_MODE1_SUSRW:              equ    03h
PORT1_MODE0_SUSRW:              equ    00h

BUTTON_DEBOUNCE:                equ    15       ; 15ms debouce time
MOUSE_PACKET_4:                 equ    4        ; 4-byte mouse packet
MOUSE_PACKET_3:                 equ    3        ; 3-byte mouse packet

;
; Button State Machine
;
NO_BUTTON_DATA_PENDING:         equ    00h
BUTTON_DATA_PENDING:            equ    02h       ; state defined any time
                                                 ; we read a button
;
; Optics State Machine
;
NO_OPTIC_DATA_PENDING:          equ    00h
OPTIC_DATA_PENDING:             equ    02h       ; state defined any time
                                                 ; we read the optics
;
; Event State Machine
;
NO_EVENT_PENDING:               equ    00h
EVENT_PENDING:                  equ    02h       ; state defined any time 
                                                 ; we have mouse packet to
                                                 ; be sent back to host
;
; Transaction Types
;
TRANS_NONE:                     equ    00h
TRANS_CONTROL_READ:             equ    02h
TRANS_CONTROL_WRITE:            equ    04h
TRANS_NO_DATA_CONTROL:          equ    06h

;
; Optics & Button Variables
;
debounceCount:                  equ    20h      ; debounce counters for buttons
currentButtonState:             equ    21h      ; current button status 
lastButtonState:                equ    22h      ; last read value of buttons

opticStatus:                    equ    23h      ; current optic status
xCount:                         equ    24h      ; current optics x state
yCount:                         equ    25h      ; current optics y state
zCount:                         equ    26h      ; current wheel button state
                            
buttonMachine:                  equ    27h      ; buttons/optics state machine
eventMachine:                   equ    28h      ; state machine for sending data back to host
vertMachine:                    equ    29h      ; y-axis state machine
horzMachine:                    equ    2Ah      ; x-axis state machine
zMachine:                       equ    2Bh      ; z-axis (wheel) state machine

lastVertState:                  equ    2Ch      ; last read y-axis optics
lastHorzState:                  equ    2Dh      ; last read x-axis optics
lastZstate:                     equ    2Eh      ; last read z-axis optics
                                                ; (wheel)

temp:                           equ    2Fh      ; temporary register
buttonValue:                    equ    30h
buttonTemp:                     equ    31h

;
; Dual Interface Variables
;
                                          
dualInterfaceMouse:             equ    32h      ; mouse type
delayCounter:                   equ    33h      ; delay counter
dualInterface1ms:               equ    34h      ; 1ms counter

;
; USB Variables
;
suspendCount:                   equ    35h      ; usb suspend counter
ep1DataToggle:                  equ    36h      ; endpoint 1 data toggle
ep0DataToggle:                  equ    37h      ; endpoint 0 data toggle
dataStart:                      equ    38h      ; ROM table address, start of data
dataCount:                      equ    39h      ; data count to return to host
maximumDataCount:               equ    3Ah      ; maximum size of data to return to host
ep0InMachine:                   equ    3Bh      ; endpoint 0 IN state machine
ep0InFlag:                      equ    3Ch      ; endpoint 0 flag for no-data control
configuration:                  equ    3Dh      ; configured/not configured state
remoteWakeup:                   equ    3Eh      ; remote wakeup on/off
ep1Stall:                       equ    3Fh      ; endpoint 1 stall on/off
idle:                           equ    40h      ; HID idle timer
intTemp:                        equ    41h      ; interrupt routine temp variable
idleTimer:                      equ    42h      ; HID idle timer
idlePrescaler:                  equ    43h      ; HID idle prescale (4ms)
ep0Transtype:                   equ    44h      ; Endpoint 0 transaction type
pendingData:                    equ    45h      ; data pending during no-data control
protocol:                       equ    46h      ; mouse protocol boot/report

;
; PS2 Variables - written on top of USB variables
;
ps2Temp0:                       equ    35h

ps2LastValidCmd:                equ    36h
ps2InvalidCmdCount:             equ    37h
ps2ReportRate:                  equ    38h
ps2ReportInterval:              equ    39h
ps2Scale:                       equ    3Ah
ps2StreamMode:                  equ    3Bh
ps2Resolution:                  equ    3Ch
ps2MouseEnabled:                equ    3Dh
ps2Wheel:                       equ    3Eh
ps2WrapMode:                    equ    3Fh

ps2IntervalCount:               equ    40h       ; send back a mouse packet
                                                 ; when this interval expires
sequence:                       equ    41h
saveCmd:                        equ    42h
ps2XmitBuffer:                  equ    43h
ps2XmitBuffer0:                 equ    ps2XmitBuffer+0
ps2XmitBuffer1:                 equ    ps2XmitBuffer+1
ps2XmitBuffer2:                 equ    ps2XmitBuffer+2
ps2XmitBuffer3:                 equ    ps2XmitBuffer+3

ps2XmitBufferLen:               equ    ps2XmitBuffer+4    ; total bytes to send
ps2XmitLen:                     equ    ps2XmitBuffer+5    ; remaining bytes to send


;********************************************************************
;
; Interrupt Vector Table
;
;********************************************************************
    ORG 00h            

jmp    dualMain                         ; power up        
jmp    dualUsbBusReset_ps2Error         ; USB reset / error
jmp    errorHandler                     ; 128us interrupt
jmp    dual1msTimer                     ; 1.024ms interrupt
jmp    dualUsbEndpoint0_ps2Error        ; Endpoint 0 interrupt / error
jmp    dualUsbEndpoint1_ps2Error        ; Endpoint 1 interrupt / error
jmp    errorHandler                     ; Endpoint 2 interrupt
jmp    errorHandler                     ; Reserved
jmp    errorHandler                     ; Capture timer A interrupt Vector
jmp    errorHandler                     ; Capture timer B interrupt Vector
jmp    errorHandler                     ; GPIO interrupt vector
jmp    dualUsbWakeup_ps2Error           ; Wake-up interrupt / error


;********************************************************************
; Error Handler
;
;********************************************************************
    ORG  1Ah

errorHandler: 
    reti                                ; do nothing

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产高清不卡| 亚洲免费在线观看| 色综合天天综合网天天看片| 亚洲香蕉伊在人在线观| 精品女同一区二区| 91老师国产黑色丝袜在线| 日本中文一区二区三区| 一区视频在线播放| 精品sm在线观看| 欧美日韩精品久久久| www.欧美亚洲| 欧美揉bbbbb揉bbbbb| 国产乱一区二区| 日产精品久久久久久久性色| 亚洲人成人一区二区在线观看 | 日韩精品在线看片z| 色欧美日韩亚洲| 国产不卡在线一区| 久久国产尿小便嘘嘘尿| 亚洲香肠在线观看| 亚洲精品国产品国语在线app| 久久你懂得1024| 日韩免费一区二区三区在线播放| 91蜜桃网址入口| 成人高清视频在线| 国产suv精品一区二区883| 青青草原综合久久大伊人精品| 一区二区三区日韩| **网站欧美大片在线观看| 久久久91精品国产一区二区精品 | 国产欧美一区二区三区在线看蜜臀| 欧美美女直播网站| 欧美性大战久久| 日本韩国精品一区二区在线观看| 成人性色生活片| 成人手机电影网| 成人性生交大片免费| 成人影视亚洲图片在线| 国产精品系列在线播放| 国产一区二区三区久久悠悠色av| 久久精品国产免费看久久精品| 日韩国产一区二| 日本系列欧美系列| 青青草97国产精品免费观看| 日韩vs国产vs欧美| 美女一区二区三区| 91一区二区在线| 色综合一个色综合亚洲| 色素色在线综合| 在线精品视频一区二区| 欧美在线一二三| 欧美日韩黄视频| 欧美精品国产精品| 欧美电影免费观看高清完整版在线 | 欧美性色欧美a在线播放| 在线观看亚洲专区| 欧美三级欧美一级| 91精品欧美久久久久久动漫| 日韩精品一区二区三区四区视频| 久久一区二区三区国产精品| 国产欧美日韩在线看| 综合亚洲深深色噜噜狠狠网站| 亚洲毛片av在线| 丝袜诱惑制服诱惑色一区在线观看 | 国产老肥熟一区二区三区| 成人性色生活片| 欧美视频自拍偷拍| 日韩一区二区精品| 国产清纯在线一区二区www| 成人欧美一区二区三区白人| 亚洲香蕉伊在人在线观| 另类专区欧美蜜桃臀第一页| 懂色av一区二区三区免费看| 色哟哟欧美精品| 538prom精品视频线放| 久久久蜜臀国产一区二区| 中文字幕一区在线观看| 调教+趴+乳夹+国产+精品| 国产一区二区三区蝌蚪| 91久久国产最好的精华液| 精品久久五月天| 亚洲欧美日韩综合aⅴ视频| 喷水一区二区三区| 成人免费va视频| 欧美电影影音先锋| 国产日韩视频一区二区三区| 亚洲欧美另类在线| 加勒比av一区二区| 色婷婷av一区| 久久九九99视频| 天堂av在线一区| 97久久人人超碰| 精品三级av在线| 伊人夜夜躁av伊人久久| 国产在线一区二区综合免费视频| 91论坛在线播放| 国产午夜亚洲精品不卡 | 国产一区二区三区不卡在线观看 | 欧美自拍偷拍午夜视频| 337p粉嫩大胆色噜噜噜噜亚洲| 亚洲免费成人av| 国产精品一区二区三区乱码| 5858s免费视频成人| 亚洲裸体在线观看| 成人午夜大片免费观看| 日韩午夜激情电影| 亚洲电影你懂得| 99re66热这里只有精品3直播 | 成人av在线播放网站| 日韩一区二区三区精品视频 | 亚洲视频中文字幕| 国产精品资源在线| 欧美一区二区三区爱爱| 一区二区欧美精品| 99在线精品视频| 国产三级一区二区| 精品综合久久久久久8888| 欧美久久久久中文字幕| 亚洲靠逼com| 99精品视频免费在线观看| 中文字幕第一区综合| 精品一区二区三区免费毛片爱| 欧美丰满少妇xxxbbb| 亚洲国产综合色| 在线观看亚洲精品视频| 亚洲色欲色欲www| 91亚洲永久精品| 亚洲视频在线一区二区| 不卡的av电影在线观看| 国产婷婷色一区二区三区四区| 黄页网站大全一区二区| 精品乱人伦一区二区三区| 蜜桃精品视频在线观看| 91精品国产综合久久精品性色| 亚洲第一激情av| 欧美日韩夫妻久久| 视频一区中文字幕国产| 欧美精品1区2区3区| 日韩激情视频在线观看| 欧美一区二区三区男人的天堂| 无吗不卡中文字幕| 欧美精品vⅰdeose4hd| 日韩国产在线观看一区| 91精品国产日韩91久久久久久| 日韩高清国产一区在线| 日韩欧美一区二区三区在线| 精品一区二区影视| 国产日产欧产精品推荐色| 成人激情电影免费在线观看| 国产精品久久久久影院亚瑟| 色综合久久88色综合天天免费| 亚洲精品高清在线| 欧美精品tushy高清| 久久99精品久久久久久久久久久久| 精品欧美黑人一区二区三区| 国产传媒欧美日韩成人| 中文字幕一区二区视频| 欧美性猛片xxxx免费看久爱| 日日摸夜夜添夜夜添国产精品| 日韩欧美亚洲另类制服综合在线| 国产一区二区在线视频| 中文字幕一区在线观看| 欧美偷拍一区二区| 久久成人免费电影| 国产精品乱码久久久久久| 91高清在线观看| 久久精工是国产品牌吗| 欧美高清在线视频| 欧美又粗又大又爽| 蜜桃精品视频在线| 国产精品成人免费精品自在线观看| 一本久久精品一区二区| 日韩电影在线一区| 国产欧美一区二区在线| 欧美四级电影网| 国内一区二区在线| 一卡二卡三卡日韩欧美| 26uuu精品一区二区在线观看| 99久久精品国产毛片| 欧美aaa在线| 日韩美女视频一区| 日韩视频一区二区三区在线播放| 成人午夜视频免费看| 日本美女一区二区三区视频| 中文一区在线播放| 91精品国产综合久久久蜜臀粉嫩 | 久色婷婷小香蕉久久| 中文字幕日韩av资源站| 日韩欧美成人激情| 色婷婷久久综合| 国产精品一区久久久久| 天涯成人国产亚洲精品一区av| 中文子幕无线码一区tr| 日韩欧美你懂的| 色激情天天射综合网| 国产精品99精品久久免费| 天天色 色综合| 亚洲精品高清在线观看| 国产欧美一区二区三区在线看蜜臀 | 色综合久久综合网97色综合 |