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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? usb_drv.asm

?? 基于Cypress CY3655開發工具的USB鼠標程序
?? ASM
?? 第 1 頁 / 共 3 頁
字號:
;;*****************************************************************************
;;*****************************************************************************
;;  FILENAME: USB_drv.asm
;;   Version: 1.5, Updated on 2006/06/19 at 11:43:56
;;  Generated by PSoC Designer ver 4.4  b1884 : 14 Jan, 2007
;;
;;  DESCRIPTION: USB Device User Module control endpoint driver
;;               for the enCoRe II family of devices
;;
;;  NOTE: User Module APIs conform to the fastcall convention for marshalling
;;        arguments and observe the associated "Registers are volatile" policy.
;;        This means it is the caller's responsibility to preserve any values
;;        in the X and A registers that are still needed after the API
;;        function returns. Even though these registers may be preserved now,
;;        there is no guarantee they will be preserved in future releases.
;;-----------------------------------------------------------------------------
;;  Copyright (c) Cypress Semiconductor 2004. All Rights Reserved.
;;*****************************************************************************
;;*****************************************************************************

include "m8c.inc"
include "USB_macros.inc"
include "USB.inc"

;-----------------------------------------------
;  Global Symbols
;-----------------------------------------------
export  _USB_EP0_ISR
export  USB_InitControlRead
export  USB_InitControlWrite
export  USB_InitNoDataStageControlTransfer
export  USB_NoDataStageControlTransfer

;-----------------------------------------------
;  Macro Definitions
;-----------------------------------------------

;-----------------------------------------------
;  Constant Definitions
;-----------------------------------------------

;-----------------------------------------------
; Variable Allocation
;-----------------------------------------------
AREA bss (RAM,REL)
;----------------------------------------------------------------------------
; Current Device
;----------------------------------------------------------------------------
EXPORT USB_bCurrentDevice
USB_bCurrentDevice:                     BLK   1    ;  Current Device
;----------------------------------------------------------------------------
; Current Configuration
;----------------------------------------------------------------------------
EXPORT USB_Configuration, _USB_Configuration
_USB_Configuration:
 USB_Configuration:                     BLK   1    ;  Current Configuration
;----------------------------------------------------------------------------
; Current Device Status
;----------------------------------------------------------------------------
EXPORT USB_DeviceStatus
 USB_DeviceStatus:                      BLK   1    ;  Current Device Status
;----------------------------------------------------------------------------
; Interface Setting
;----------------------------------------------------------------------------
EXPORT USB_InterfaceSetting
 USB_InterfaceSetting:                  BLK   1h    ; Interface Setting
;----------------------------------------------------------------------------
; Endpoint Status--USB Status
;----------------------------------------------------------------------------
EXPORT USB_EndpointStatus
 USB_EndpointStatus:                    BLK   USB_NUM_ENDPOINTS    ; Endpoint Status
;----------------------------------------------------------------------------
; Last Packet Size
;----------------------------------------------------------------------------
EXPORT USB_LastSize
 USB_LastSize:                          BLK   1    ;  Last Packet Size
;----------------------------------------------------------------------------
; Control Transfer State Machine
; State values for Control Write
; State values for Control Read
;----------------------------------------------------------------------------
EXPORT USB_TransferType
 USB_TransferType:                      BLK   1    ; Control Transfer State Machine
;----------------------------------------------------------------------------
; Control Transfer Intermediate Buffer--Shared among the requests
;----------------------------------------------------------------------------
EXPORT USB_TransferBuffer
 USB_TransferBuffer:                    BLK   8
;----------------------------------------------------------------------------
; Transfer Descriptor Data for Control Transfer
;  --The following data have the same format as the first 5 bytes of the TD_ENTRY
;----------------------------------------------------------------------------
; Control Transfer Data Source
;   USB_DS_ROM
;   USB_DS_RAM
;   USB_DS_RAM_AS_NEEDED
;----------------------------------------------------------------------------
EXPORT USB_CurrentTD, _USB_CurrentTD
 USB_CurrentTD:
_USB_CurrentTD:
EXPORT USB_DataSource, _USB_DataSource
 USB_DataSource:
_USB_DataSource:                       BLK   1
;----------------------------------------------------------------------------
; Control Transfer Data Size
;----------------------------------------------------------------------------
EXPORT USB_TransferSize, _USB_TransferSize
 USB_TransferSize:
 _USB_TransferSize:                    BLK   2
;----------------------------------------------------------------------------
; Control Transfer Data Pointer
;   Source for Control Read
;   Destination for Control Write
;----------------------------------------------------------------------------
EXPORT USB_DataPtr, _USB_DataPtr
 USB_DataPtr:
 _USB_DataPtr:                         BLK   2
;----------------------------------------------------------------------------
; Transfer Completion Notification
;----------------------------------------------------------------------------
EXPORT USB_StatusBlockPtr, _USB_StatusBlockPtr
 USB_StatusBlockPtr:
 _USB_StatusBlockPtr:                  BLK   2
;----------------------------------------------------------------------------
; Control Transfer _TransferByteCount (Actually transfered)
;----------------------------------------------------------------------------
 USB_TransferByteCount:                 BLK   2
;----------------------------------------------------------------------------
; Control Endpoint Data toggle
EXPORT USB_EPDataToggle
 USB_EPDataToggle:
 USB_EP0DataToggle:                     BLK   1
;----------------------------------------------------------------------------
; Control Endpoint Data Pending Flag
EXPORT USB_fDataPending
 USB_fDataPending:                      BLK   1
;----------------------------------------------------------------------------
; Control Endpoint Data Pending Flag
;EXPORT USB_PendingData
; USB_PendingData:                      BLK   1
;----------------------------------------------------------------------------
; Temporary Data registers
EXPORT USB_t2, USB_t1, USB_t0
 USB_t2:                                BLK   1    ; Temporary shared by the UM
 USB_t1:                                BLK   1    ; Temporary shared by the UM
 USB_t0:                                BLK   1    ; Temporary shared by the UM
;----------------------------------------------------------------------------
; Endpoint Transfer--API Status
;----------------------------------------------------------------------------
EXPORT USB_EndpointAPIStatus, _USB_EndpointAPIStatus
 USB_EndpointAPIStatus:
_USB_EndpointAPIStatus:                 BLK   USB_NUM_ENDPOINTS    ; Endpoint Status

AREA UserModules (ROM, REL)
;-----------------------------------------------------------------------------
;  FUNCTION NAME: USB_EP0_ISR

;
;  DESCRIPTION:   The EPO ISR serves the control endpoint interrupts and
;                 dispaches all SETUP, IN, and OUT transfers to the proper
;                 dispatch routines for all supported USB requests.
;
;-----------------------------------------------------------------------------
;
;  ARGUMENTS:   n/a
;
;  RETURNS:     n/a
;
;  SIDE EFFECTS: REGISTERS ARE VOLATILE: THE A AND X REGISTERS MAY BE MODIFIED!
;
;  THEORY of OPERATION or PROCEDURE:
;
;-----------------------------------------------------------------------------
 USB_EP0_ISR:
_USB_EP0_ISR:
    PUSH    A                          ; Save the context
    PUSH    X                          ;
    ; Dispatch to setup/in/out handlers
EXPORT  USB_mode_read
USB_mode_read:
   MOV    A, REG[USB_EP0MODE]           ; Get the mode reg

; MSB is the SETUP bit, followed by IN, then OUT
    asl    a                           ; Shift to the carry and jump if SETUP bit set
    jc      USB_EP0_Setup

    asl    a                           ; Shift to the carry and jump if IN bit set
    jc      USB_EP0_IN

    asl    a                           ; Shift to the carry and jump if OUT bit set
    jc     USB_EP0_OUT
    JMP    USB_Not_Supported_Local_Drv
; ISR Exit Point to update the mode register
;   mode and count have been pushed onto the stack
EXPORT USB_EP0_UPD_MODE_EXIT
USB_EP0_UPD_MODE_EXIT:

    MOV    REG[USB_EP0CNT], A          ; Update the count
    MOV    A, X                        ; Get the new mode
    MOV    REG[USB_EP0MODE], A         ; Update the node

USB_EP0_ISR_EXIT:

    POP X                              ;
    POP A                              ; Restore Context
    RETI
;-----------------------------------------------------------------------------
;  FUNCTION NAME: USB_EP0_Setup
;
;  DESCRIPTION:   Dispatch a USB SETUP
;
;-----------------------------------------------------------------------------
 USB_EP0_Setup:
_USB_EP0_Setup:
; Check the byte count and validity.  All SETUP are 8 bytes and 0 toggle
    PUSH    A                          ; Save the mode register
    MOV     A, USB_XFER_PREMATURE      ; Return a Premature Completion?
    CALL    USB_UpdateStatusBlock
    POP     A                          ; Restore the mode register
    MOV    A, REG[USB_EP0CNT]                ; Get the count reg
    CMP    A, (USB_CNT_VALID | 0x0A)
    JZ      .dispatch

    JMP    USB_Not_Supported_Local_Drv
;-----------------------------------------------------------------------------
; Jump here to dispatch the request
; The SETUP request is encoded in [bmRequestType]. Among the 8 bits in [bmRequestType], only bits
; 7,6,5,1,0 determine what the request is. Bits [2:4] are default to zero. The below code
; re-organizes [bmRequestType] to the following format:
; ( Zero, Zero, Bit7, Bit6, Bit5, Bit1, Bit0, Zero ), and depending on the value of this
; "re-organization", the firmware will jump to an appropriate table to handle the request.
;-----------------------------------------------------------------------------
.dispatch:
    MOV     A, REG[USB_EP0DATA+bmRequestType]   ; Get bmRequestType
    AND     A, E3h                           ; clear bits 4-3-2, these unused for our purposes
    PUSH    A                                ; store value on the stack
    ASR     A                                ; move bits 7-6-5 into 4-3-2's place
    ASR     A                                ; "asr" instruction shift all bits one place to the right.
    ASR     A                                ; Bit7 remains the same.
    MOV     [USB_t2], A                      ; store shifted value
    POP     A                                ; get original value
    OR      A, [USB_t2]                      ; or the two to get the 5-bit field
    AND     A, 1Fh                           ; clear bits 7-6-5 (asr wraps bit7)
                                             ; Bit0 is loaded with a Zero. This results in multiplying
                                             ; the accumulator by 2, and the reason to mutiply it by 2
                                             ; is that each "jmp" instruction in the tables is two bytes long.

    LJMP USB_bmRequestType_Dispatch
;-----------------------------------------------------------------------------
;  FUNCTION NAME: USB_EP0_IN
;
;  DESCRIPTION:   Dispatch a USB IN
;
;-----------------------------------------------------------------------------
 USB_EP0_IN:
_USB_EP0_IN:

    MOV     A, [USB_TransferType]
USB_ControlInDispatch:
    JACC    USB_ControlInDispatchTable
USB_ControlInDispatchTable:
    JMP     USB_Not_Supported_Local_Drv  ; USB_TRANS_STATE_IDLE
    JMP     USB_ControlReadDataStage     ; USB_TRANS_STATE_CONTROL_READ
    JMP     USB_ControlWriteStatusStage  ; USB_TRANS_STATE_CONTROL_WRITE
    JMP     USB_NoDataControlStatusStage ; USB_TRANS_STATE_NO_DATA_CONTROL
;-----------------------------------------------------------------------------
;  FUNCTION NAME: USB_EP0_OUT
;
;  DESCRIPTION:   Dispatch a USB OUT
;
;-----------------------------------------------------------------------------
 USB_EP0_OUT:
_USB_EP0_OUT:
    MOV     A, [USB_TransferType]
    JACC    USB_ControlOutDispatchTable
USB_ControlOutDispatchTable:
    JMP     USB_Not_Supported_Local_Drv  ; USB_TRANS_STATE_IDLE
    JMP     USB_ControlReadStatusStage   ; USB_TRANS_STATE_CONTROL_READ
    JMP     USB_ControlWriteDataStage    ; USB_TRANS_STATE_CONTROL_WRITE
    JMP     USB_NoDataControlError       ; USB_TRANS_STATE_NO_DATA_CONTROL
;-----------------------------------------------------------------------------
;  FUNCTION NAME: USB_InitControlRead
;
;  DESCRIPTION:   This routine initializes a control read.  It must be JUMPed to,
;                 not called.  It assumes a tranfer descriptor has been loaded
;                 into the driver USB_CurrentTD data structure.
;
;-----------------------------------------------------------------------------
 USB_InitControlRead:
    MOV     [USB_LastSize], A          ; Save the packet size?
    CALL    USB_InitializeStatusBlock
    MOV     [USB_TransferType], USB_TRANS_STATE_CONTROL_READ

    ; Check the transfer size against the request size
    MOV    A, REG[USB_EP0DATA+wLengthHi] ; MSB of wLength
    CMP    A, [USB_TransferSize]
    JNZ    .L1

    MOV    A, REG[USB_EP0DATA+wLengthLo] ; LSB of wLength
    CMP    A, [USB_TransferSize+1]
    JZ     .L9
.L1:
    JNC    .L9
;
    MOV    [USB_TransferSize+1], A     ;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲人成7777| 裸体一区二区三区| 一区二区三区欧美久久| 秋霞电影一区二区| 美女在线视频一区| 99久久综合狠狠综合久久| 欧美日韩午夜影院| 久久精品男人的天堂| 一区二区三区蜜桃网| 激情成人午夜视频| 91国偷自产一区二区开放时间| 日韩欧美一区在线| 亚洲人成影院在线观看| 九九久久精品视频 | 亚洲精品一区二区三区香蕉 | 丁香网亚洲国际| 欧洲激情一区二区| 国产欧美日韩三级| 亚洲欧洲色图综合| 九九国产精品视频| 欧美日韩国产美| 国产精品视频观看| 中文字幕一区视频| 捆绑紧缚一区二区三区视频 | 精品国产乱码91久久久久久网站| 中文字幕国产一区| 久久国产剧场电影| 欧美狂野另类xxxxoooo| 欧美激情在线一区二区| 久久99精品网久久| 欧美日韩在线三区| 中文字幕综合网| 国产精品一区二区黑丝| 欧美一级一区二区| 日韩精品久久久久久| 色综合色综合色综合色综合色综合 | 久久久激情视频| 秋霞国产午夜精品免费视频| 欧美日韩在线精品一区二区三区激情 | 久久综合狠狠综合| 奇米精品一区二区三区在线观看| 在线观看一区不卡| 亚洲精品国产a| 国产自产v一区二区三区c| 678五月天丁香亚洲综合网| 亚洲另类色综合网站| 成人网页在线观看| 日韩综合在线视频| 欧美在线制服丝袜| 伊人婷婷欧美激情| 色女孩综合影院| 亚洲女同一区二区| 一本色道亚洲精品aⅴ| 中文字幕亚洲精品在线观看| 成人久久久精品乱码一区二区三区| 欧美成人精品福利| 国产一区福利在线| 国产亚洲一区二区三区在线观看| 日本伊人午夜精品| 日韩精品专区在线| 国内精品写真在线观看| 久久精品人人爽人人爽| www.99精品| 一区二区免费在线播放| 91精品国产综合久久久久久久久久 | 日韩高清不卡一区二区三区| 91精品国产福利在线观看 | 久久久久99精品国产片| 从欧美一区二区三区| 国产精品网站在线观看| 国产一区二区剧情av在线| 久久午夜羞羞影院免费观看| 国产成人免费av在线| 国产精品美日韩| 一本大道av一区二区在线播放 | 久久影音资源网| 成人性生交大合| 国产欧美一区二区精品久导航| 成人免费高清视频在线观看| 最新高清无码专区| 欧美日本在线播放| 国产自产v一区二区三区c| 亚洲色欲色欲www| 欧美在线色视频| 久久国产精品区| 中文字幕一区二区三区四区不卡 | a4yy欧美一区二区三区| 亚洲国产精品久久人人爱蜜臀| 4438x亚洲最大成人网| 日本不卡高清视频| 中文字幕一区二区三区精华液 | 麻豆91精品91久久久的内涵| 国产精品婷婷午夜在线观看| 成人动漫在线一区| 日本在线不卡一区| 亚洲欧美国产高清| 久久久久国产精品厨房| 欧美日韩国产a| 国产原创一区二区| 亚洲h在线观看| 午夜一区二区三区视频| 久久久av毛片精品| 欧美美女bb生活片| hitomi一区二区三区精品| 美女视频免费一区| 一区二区三区四区不卡在线| 国产欧美日韩一区二区三区在线观看 | 亚洲国产精华液网站w| 久久99国产乱子伦精品免费| 亚洲乱码精品一二三四区日韩在线| 久久久噜噜噜久久人人看| 精品成a人在线观看| 久久综合久久综合久久综合| 日韩视频免费观看高清完整版| 69av一区二区三区| 91精品国产一区二区人妖| 51精品视频一区二区三区| 欧美一区二区视频网站| 日韩三级伦理片妻子的秘密按摩| 欧美电影一区二区三区| 欧美精品视频www在线观看| 91精品国产全国免费观看| 欧美xxxx在线观看| 国产亚洲成av人在线观看导航| 久久精品夜色噜噜亚洲a∨| 中文幕一区二区三区久久蜜桃| 中文字幕在线不卡一区| 亚洲精品videosex极品| 亚洲一区二区三区四区不卡| 天天色天天爱天天射综合| 秋霞电影一区二区| 国产精品一级二级三级| 99re这里都是精品| 欧美酷刑日本凌虐凌虐| 欧美精品一区视频| 18欧美乱大交hd1984| 亚洲国产wwwccc36天堂| 理论电影国产精品| 成人免费视频国产在线观看| 在线观看亚洲专区| 欧美成人性战久久| 亚洲欧美日韩国产手机在线| 五月天视频一区| 黄一区二区三区| 91免费版pro下载短视频| 欧美伦理影视网| 久久综合久久综合久久| 一区二区三区精品在线| 男人的天堂亚洲一区| jiyouzz国产精品久久| 欧美高清你懂得| 国产三级久久久| 午夜激情一区二区| 国产精品 欧美精品| 欧美三级中文字幕在线观看| 精品免费国产二区三区| 中文字幕日本乱码精品影院| 丝袜亚洲精品中文字幕一区| 极品销魂美女一区二区三区| 色系网站成人免费| 久久久99精品免费观看不卡| 午夜视频一区在线观看| 99麻豆久久久国产精品免费| 日韩欧美二区三区| 亚洲精品国产精品乱码不99| 国产激情视频一区二区在线观看| 欧美日韩国产系列| 国产中文字幕精品| 欧美午夜宅男影院| 欧美国产一区二区在线观看| 日本伊人色综合网| 欧美中文一区二区三区| 中文字幕一区三区| 狠狠v欧美v日韩v亚洲ⅴ| 欧美丰满少妇xxxxx高潮对白| 中文欧美字幕免费| 国产一区二区不卡在线| 欧美一区二区在线播放| 亚洲激情图片小说视频| 成人午夜电影网站| 久久久国产精品午夜一区ai换脸| 奇米影视一区二区三区小说| 欧美在线你懂的| 亚洲精品国产精华液| www.性欧美| 国产精品免费网站在线观看| 国产精品亚洲综合一区在线观看| 日韩一区二区三区电影 | 美女诱惑一区二区| 欧美绝品在线观看成人午夜影视| 亚洲激情网站免费观看| 色中色一区二区| 亚洲人亚洲人成电影网站色| 成人av午夜电影| 国产精品免费久久久久| 国产99久久久国产精品潘金网站| 精品少妇一区二区三区日产乱码 | 色婷婷亚洲婷婷| 日韩理论片中文av| 91丝袜美女网|