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

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

?? usb_cls_hid.asm

?? 基于Cypress CY3655開發(fā)工具的USB鼠標(biāo)程序
?? ASM
?? 第 1 頁 / 共 2 頁
字號(hào):
;;*****************************************************************************
;;*****************************************************************************
;;  FILENAME: USB_cls_hid.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 Human Interface Device (HID) Class request implemenatation
;;               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_UpdateHIDTimer
EXPORT _USB_UpdateHIDTimer
EXPORT USB_bGetProtocol
EXPORT _USB_bGetProtocol

AREA bss (RAM,REL)
;-----------------------------------------------
;  Constant Definitions
;-----------------------------------------------
;-----------------------------------------------
; Variable Allocation
;-----------------------------------------------
;----------------------------------------------------------------------------
; Interface Setting
;----------------------------------------------------------------------------
 USB_IdleReload:                        BLK   1h    ; Idle Timer Reload Value
 USB_IdleTimer:                         BLK   1h    ; Idle Timers
 USB_Protocol:                          BLK   1h    ; Active Protocol

AREA UserModules (ROM, REL)
;-----------------------------------------------------------------------------
;  FUNCTION NAME: USB_bGetProtocol
;
;  DESCRIPTION:   Returns the selected protocol value to the application
;
;-----------------------------------------------------------------------------
;
;  ARGUMENTS:    A: Interface number
;
;  RETURNS:      A: Protocol values
;
;  SIDE EFFECTS: REGISTERS ARE VOLATILE: THE A AND X REGISTERS MAY BE MODIFIED!
;
;  THEORY of OPERATION or PROCEDURE:
;
;-----------------------------------------------------------------------------
.SECTION
 USB_bGetProtocol:
_USB_bGetProtocol:
    MOV    X, A                        ; Argument is the index
    MOV    A, [X + USB_Protocol] ; Return the protocol
    RET
.ENDSECTION
;-----------------------------------------------------------------------------
;  FUNCTION NAME: USB_UpdateHIDTimer
;
;  DESCRIPTION:    Updates the HID report timer and reloads it if it expires
;
;-----------------------------------------------------------------------------
;
;  ARGUMENTS:     A: Interface number
;
;  RETURNS:       A: USB_IDLE_TIMER_EXPIRED, if the timer is running and expired
;                    USB_IDLE_TIMER_RUNNING, if the timer is running
;                    USB_IDLE_TIMER_INDEFINITE, if the report should be made on change
;
;  SIDE EFFECTS: REGISTERS ARE VOLATILE: THE A AND X REGISTERS MAY BE MODIFIED!
;
;  THEORY of OPERATION or PROCEDURE:
;
;-----------------------------------------------------------------------------
.SECTION
 USB_UpdateHIDTimer:
_USB_UpdateHIDTimer:
    MOV    X, A                        ; Make the argument the index
; Flow here to check if the timer is "indefinite"
    CMP    [X + USB_IdleReload], 0     ; Indefinite?
    JZ     .indefinite                 ; Jump if Indefinite?
; Flow here to check the timers
    DEC    [X + USB_IdleTimer]         ; Decrement the timer
    JC     .expired
; Flow here if the timer has not expired
    MOV    A, USB_IDLE_TIMER_RUNNING   ; Return value (not expired)
    RET                                ; Quick exit
; Jump here if the timer expired
.expired:
    MOV    A, [X + USB_IdleReload]     ; Reload the timer
    MOV    [X + USB_IdleTimer], A      ; 
    MOV    A, USB_IDLE_TIMER_EXPIRED   ; Return value (expired)
    RET                                ; Quick exit
; Jump here to make return "on change/indefinite"
.indefinite:
    MOV    A, USB_IDLE_TIMER_INDEFINITE; Return value (change/indefinite)
    RET                                ; Exit
.ENDSECTION
;-----------------------------------------------------------------------------
;  FUNCTION NAME: USB_CB_d2h_std_ifc_06
;
;  DESCRIPTION:   Get Interface Descriptor
;
;****************************************************************
; STANDARD INTERFACE IN REQUEST: Get_Interface_Descriptor
;****************************************************************
;
; bmRequestType   : (IN | STANDARD | INTERFACE)    = 81h
; bRequest        : GET_DESCRIPTOR                 = 06h    
; wValue          : DESCRIPTOR TYPE | INDEX        = xxxxh  
; wIndex          : INTERFACE                      = --xxh
; wLength         : DESCRIPTOR_LENGTH              = --xxh  
; 
; The GET_INTERFACE_DESCRIPTOR request returns the specified 
; descriptor if the descriptor exists. 
;
; The upper byte of request_value contains the descriptor type and 
; the lower byte contains the descriptor index. request_index 
; contains either 0000h or the Language ID. request_length contains 
; the descriptor length. The actual descriptor information is 
; transferred in subsequent data packets. 
;
; USB defines only a DEVICE recipient but the HID spec added 
; support for the INTERFACE recipient.
;
; Get Descriptor from an HID interface returns either HID, 
; REPORT, or PHYSICAL descriptors.
;
;****************************************************************
IF (USB_CB_SRC_d2h_std_ifc_06 & USB_UM_SUPPLIED)
export  USB_CB_d2h_std_ifc_06
USB_CB_d2h_std_ifc_06:
    CALL    USB_GetInterfaceLookupTable  ; Point the the interface lookup table
    PUSH    A                          ; Save the MSB
    MOV     A, REG[USB_EP0DATA+wValueHi] ; Get descriptor type
    CMP     A, DESCR_TYPE_HID_CLASS    ; HID Class descriptor?
    JZ      .send_hid_class_descr
    CMP     A, DESCR_TYPE_HID_REPORT   ; HID Report descriptor?
    JZ      .send_hid_report_descr
; Jump or flow here if the request is not supported
.not_supported:
    POP     A                          ; Restore the stack
    JMP     USB_Not_Supported_Local_Hid
; Jump here to send the HID Report Descriptor
.send_hid_report_descr:
    POP     A                          ; Restore the interface lookup table MSB
    SWAP    A, X                       ; Add the offset
    ADD     A, 2                       ; Point to the right table entry
    JMP     .finish
; Jump here to send the HID Class Descriptor
.send_hid_class_descr:
    POP     A                          ; Restore the interface lookup table MSB
    SWAP    A, X                       ; Add the offset
    ADD     A, 4                       ; Point to the right table entry
; Jump or flow here with A:X Pointing to the 
.finish:
    SWAP    A, X                       ; Back where they belong
    ADC     A, 0                       ; Don't forget the carry
    MOV     [USB_t2],USB_t1            ; Set the GETWORD destination 
    LCALL   USB_GETWORD                ; Get the pointer to the transfer descriptor table
                                       ; ITempW has the address
; Get the interface number
    MOV     A, REG[USB_EP0DATA+wIndexLo] ; Get the interface number
    MOV     [USB_t2], A                ; Save it for the call to LOOKUP
    MOV     A, [USB_t1]                ; Get the transfer descriptor ROM Address MSB
    MOV     X, [USB_t1+1]              ; Get the transfer descriptor ROM Address LSB

    JMP     USB_GetTableEntry_Local_Hid
ENDIF
;-----------------------------------------------------------------------------
;  FUNCTION NAME: USB_CB_d2h_cls_ifc_01
;
;  DESCRIPTION:   Get Report
;
;****************************************************************
; HID CLASS INTERFACE IN REQUEST: Get_Report   
;****************************************************************
;
; bmRequestType  : (IN | CLASS | INTERFACE)       = A1h
; bRequest       : GET_REPORT                     = 01h    
; wValue         : REPORT TYPE | REPORT ID        = xxxxh  
; wIndex         : INTERFACE                      = --xxh
; wLength        : REPORT LENGTH                  = --xxh  
; 
; The GET_REPORT request allows the host to receive a report from 
; a specific interface via the control pipe. 
;
;****************************************************************
;-----------------------------------------------------------------------------
;
;  ARGUMENTS:
;
;  RETURNS:
;
;  SIDE EFFECTS: REGISTERS ARE VOLATILE: THE A AND X REGISTERS MAY BE MODIFIED!
;
;  THEORY of OPERATION or PROCEDURE:
;
;-----------------------------------------------------------------------------
IF (USB_CB_SRC_d2h_cls_ifc_01 & USB_UM_SUPPLIED)
export  USB_CB_d2h_cls_ifc_01
USB_CB_d2h_cls_ifc_01:

    CALL    Find_Report
    NULL_PTR_CHECK USB_Not_Supported_Local_Hid
    
    JMP     USB_GetTableEntry_Local_Hid

ENDIF
;-----------------------------------------------------------------------------
;  FUNCTION NAME: USB_CB_d2h_cls_ifc_02
;
;  DESCRIPTION:   Get Idle
;
;****************************************************************
; HID CLASS INTERFACE IN REQUEST: Get_Idle
;****************************************************************
;
; bmRequestType  : (OUT | CLASS | INTERFACE)      = A1h
; bRequest       : GET_IDLE                       = 02h    
; wValue         : REPORT ID                      = 00xxh  
; wIndex         : INTERFACE                      = --xxh
; wLength        : Report Size                    = 0001h  
; 
; The GET_IDLE request reads the current idle rate for a given 
; input report on a specific interface. 
;
;****************************************************************
;-----------------------------------------------------------------------------
;
;  ARGUMENTS:
;
;  RETURNS:
;
;  SIDE EFFECTS: REGISTERS ARE VOLATILE: THE A AND X REGISTERS MAY BE MODIFIED!
;
;  THEORY of OPERATION or PROCEDURE:
;
;-----------------------------------------------------------------------------
IF (USB_CB_SRC_d2h_cls_ifc_02 & USB_UM_SUPPLIED)
.LITERAL
GetSetIdleTable:
    TD_START_TABLE  1h                 ; One entry for each interface
    TD_ENTRY        USB_DS_RAM, 1, USB_IdleReload,   NULL_PTR  ; Reuse the transfer buffer
    TD_ENTRY        USB_DS_RAM, 1, USB_IdleReload+1, NULL_PTR  ; Reuse the transfer buffer
.ENDLITERAL
export  USB_CB_d2h_cls_ifc_02
USB_CB_d2h_cls_ifc_02:
    MOV     A, REG[USB_EP0DATA+wValueLo] ; Get the report number
    CMP     A, 0                       ; We don't support report by report idle
    JNZ     USB_Not_Supported_Local_Hid

    MOV     A, REG[USB_EP0DATA+wIndexLo] ; Get the interface number
    CMP     A, 1h                      ; We don't support report by report idle
    JNC     USB_Not_Supported_Local_Hid

    MOV     [USB_t2], A                ; Use the UM temp var--Selector
    MOV     A,>GetSetIdleTable         ; Get the ROM Address MSB
    MOV     X,<GetSetIdleTable         ; Get the ROM Address LSB
    
    JMP     USB_GetTableEntry_Local_Hid
ENDIF
;-----------------------------------------------------------------------------
;  FUNCTION NAME: USB_CB_d2h_cls_ifc_03
;
;  DESCRIPTION:   Get Protocol
;
;****************************************************************
; HID CLASS INTERFACE IN REQUEST: Get_Protocol
;****************************************************************
;
; bmRequestType  : (OUT | CLASS | INTERFACE)      = A1h
; bRequest       : GET_PROTOCOL                   = 03h    
; wValue         : RESERVED                       = 0000h  
; wIndex         : INTERFACE                      = --xxh
; wLength        : SIZEOF_INTERFACE_PROTOCOL      = 0001h  
; 
; The GET_PROTOCOL request reads which protocol is currently 
; active.
;
;****************************************************************
;-----------------------------------------------------------------------------
;
;  ARGUMENTS:
;
;  RETURNS:
;
;  SIDE EFFECTS: REGISTERS ARE VOLATILE: THE A AND X REGISTERS MAY BE MODIFIED!
;
;  THEORY of OPERATION or PROCEDURE:
;
;-----------------------------------------------------------------------------
IF (USB_CB_SRC_d2h_cls_ifc_03 & USB_UM_SUPPLIED)
.LITERAL
GetProtocolTable:
    TD_START_TABLE  2                  ; One entry for BOOT/One entry for REPORT
    TD_ENTRY        USB_DS_ROM, 1, ROM_ZERO,   NULL_PTR  ; Simply use a a hard coded zero or one
    TD_ENTRY        USB_DS_ROM, 1, ROM_ONE,    NULL_PTR  ; 
ROM_ZERO:   DB  0
ROM_ONE:    DB  1
.ENDLITERAL
export  USB_CB_d2h_cls_ifc_03
USB_CB_d2h_cls_ifc_03:
    MOV     A, REG[USB_EP0DATA+wIndexLo]  ; Get the interface number
    CMP     A, 1h                      ; Range check
    JNC     USB_Not_Supported_Local_Hid

    MOV     X, A                       ; Get the protocol for the requested interface
    MOV     A, [X + USB_Protocol]      ; 

    MOV     [USB_t2], A                ; Use the UM temp var--Selector

    MOV     A,>GetProtocolTable        ; Get the ROM Address MSB
    MOV     X,<GetProtocolTable        ; Get the ROM Address LSB
    
    JMP     USB_GetTableEntry_Local_Hid
ENDIF
;-----------------------------------------------------------------------------
;  FUNCTION NAME: USB_CB_h2d_cls_ifc_09
;
;  DESCRIPTION:   Set Report
;
;****************************************************************
; HID CLASS INTERFACE OUT REQUEST: Set_Report
;****************************************************************
;
; bmRequestType   : (OUT | CLASS | INTERFACE)      = 21h
; bRequest        : SET_REPORT                     = 09h    
; wValue          : REPORT TYPE | REPORT ID        = xxxxh  
; wIndex          : INTERFACE                      = --xxh
; wLength         : REPORT LENGTH                  = --xxh  
; 
; The SET_REPORT request allows the host to send a report to the 
; device, possibly setting the state of input, output or feature 
; controls. 
;
;****************************************************************
;-----------------------------------------------------------------------------
;
;  ARGUMENTS:
;
;  RETURNS:
;
;  SIDE EFFECTS: REGISTERS ARE VOLATILE: THE A AND X REGISTERS MAY BE MODIFIED!
;
;  THEORY of OPERATION or PROCEDURE:
;
;-----------------------------------------------------------------------------
IF (USB_CB_SRC_h2d_cls_ifc_09 & USB_UM_SUPPLIED)
export  USB_CB_h2d_cls_ifc_09
USB_CB_h2d_cls_ifc_09:
    CALL    Find_Report
    NULL_PTR_CHECK USB_Not_Supported_Local_Hid
    
    JMP     USB_GetTableEntry_Local_Hid
ENDIF
;-----------------------------------------------------------------------------
;  FUNCTION NAME: USB_CB_h2d_cls_ifc_10
;
;  DESCRIPTION:   Set Idle

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
jlzzjlzz亚洲日本少妇| 国产欧美日韩不卡| 婷婷亚洲久悠悠色悠在线播放| 91在线免费看| 一区二区三区在线视频免费| 成人av资源在线| 亚洲欧美日韩一区二区| 波多野结衣亚洲一区| 中文字幕一区二区三区在线不卡| 久久99九九99精品| 欧美人妇做爰xxxⅹ性高电影| 日产欧产美韩系列久久99| 日韩精品一区在线| 成人做爰69片免费看网站| 免费看欧美美女黄的网站| 7777精品伊人久久久大香线蕉的| 日本成人超碰在线观看| 久久亚洲精精品中文字幕早川悠里 | 91色porny蝌蚪| 婷婷中文字幕综合| 国产亚洲精品精华液| 99精品视频一区二区三区| 亚洲成人一区二区| 久久久久国产精品麻豆ai换脸| 色综合天天综合在线视频| 视频一区二区三区中文字幕| 久久精品一区蜜桃臀影院| 色综合av在线| 精彩视频一区二区| 亚洲免费资源在线播放| 日韩欧美视频在线| 91麻豆免费看| 久久av老司机精品网站导航| 中文字幕日本乱码精品影院| 欧美一区二区三区视频在线| 99久久伊人久久99| 久久精品国产精品亚洲精品 | 91在线观看成人| 麻豆中文一区二区| 亚洲精品高清视频在线观看| 精品国产一区二区在线观看| 在线免费观看成人短视频| 国产一区二区不卡在线| 午夜免费久久看| 国产精品毛片久久久久久久| 欧美电视剧在线观看完整版| 91国产福利在线| 成人黄色电影在线| 激情综合亚洲精品| 日韩高清电影一区| 亚洲国产精品人人做人人爽| 亚洲欧洲精品一区二区三区不卡| 精品乱人伦小说| 欧美高清激情brazzers| 色综合久久99| www.色精品| 国产福利一区二区三区在线视频| 午夜伦理一区二区| 亚洲国产精品麻豆| 亚洲精品国久久99热| 国产精品女人毛片| 国产日韩精品一区二区三区| 欧美tickling挠脚心丨vk| 在线播放日韩导航| 欧美日韩国产高清一区| 在线视频一区二区三| 一本一本大道香蕉久在线精品| 成人动漫视频在线| 成人午夜视频网站| 懂色一区二区三区免费观看| 国产大片一区二区| 国产精品99久久久久久久vr| 国产乱国产乱300精品| 国内精品免费**视频| 精品亚洲国产成人av制服丝袜| 日本伊人精品一区二区三区观看方式| 婷婷综合在线观看| 日韩中文字幕亚洲一区二区va在线| 亚洲国产欧美在线| 一区二区三区日韩欧美| 18欧美亚洲精品| 一区二区三区四区在线免费观看 | 欧美亚洲禁片免费| 欧美视频三区在线播放| 欧美女孩性生活视频| 欧美日韩国产三级| 日韩一区二区不卡| 久久精品人人做人人综合| 国产丝袜在线精品| 中文字幕视频一区二区三区久| 亚洲视频你懂的| 亚洲五月六月丁香激情| 青青草国产成人99久久| 国产一区二区福利| av中文一区二区三区| 欧美午夜影院一区| 日韩欧美一二区| 国产精品嫩草99a| 亚洲伊人伊色伊影伊综合网| 偷拍与自拍一区| 国产乱子伦一区二区三区国色天香| 国产福利不卡视频| 色综合天天狠狠| 91精品国产综合久久精品麻豆| 日韩一级二级三级精品视频| 久久先锋资源网| 免费成人美女在线观看.| 精品一二三四区| 91美女视频网站| 欧美一区二区三区电影| 国产亚洲短视频| 亚洲一区二区中文在线| 久久精品国产亚洲a| 波多野结衣欧美| 777久久久精品| 中文av字幕一区| 日韩不卡一区二区| www.色精品| 欧美r级电影在线观看| 亚洲日穴在线视频| 六月丁香综合在线视频| 91麻豆国产自产在线观看| 日韩一区二区三区在线观看| 国产精品久久久久影院| 日韩国产精品久久久久久亚洲| 不卡的av网站| 日韩欧美在线观看一区二区三区| 国产精品色眯眯| 另类调教123区| 在线一区二区观看| 久久久www成人免费毛片麻豆 | 国产精品免费看片| 日韩**一区毛片| 日本伦理一区二区| 中文字幕乱码一区二区免费| 日本大胆欧美人术艺术动态| 99国产精品久| 久久久综合九色合综国产精品| 五月婷婷色综合| 91啪九色porn原创视频在线观看| 久久亚洲捆绑美女| 日本不卡视频一二三区| 欧美一a一片一级一片| 中文字幕精品一区| 国产在线精品不卡| 欧美一级久久久| 亚洲午夜精品网| 91国在线观看| 亚洲欧洲性图库| 国产aⅴ精品一区二区三区色成熟| 欧美一区二区视频在线观看2020| 亚洲欧美另类图片小说| 国产精品性做久久久久久| 日韩一级黄色片| 亚洲国产成人av好男人在线观看| 99久精品国产| 国产精品国产三级国产| 国内精品视频一区二区三区八戒| 欧美一级搡bbbb搡bbbb| 亚洲精品伦理在线| 91久久国产最好的精华液| 1024成人网| 一本色道亚洲精品aⅴ| 日韩国产精品久久久久久亚洲| 欧美在线不卡视频| 一区二区三区av电影 | 一本一道波多野结衣一区二区| 国产精品久久久久久久久久久免费看| 国产一区免费电影| 精品国产乱码久久久久久免费| 日本不卡一二三区黄网| 日韩精品资源二区在线| 精品在线亚洲视频| 久久久综合精品| 北条麻妃国产九九精品视频| 亚洲色图欧美激情| 91官网在线免费观看| 亚洲制服丝袜av| 欧美精品粉嫩高潮一区二区| 日韩精品色哟哟| 久久综合久久综合久久| 成人综合婷婷国产精品久久| 亚洲欧洲av在线| 欧美吻胸吃奶大尺度电影 | 激情综合色综合久久| 久久久不卡影院| 波多野结衣欧美| 亚洲第一综合色| 精品国产凹凸成av人网站| 国产九色sp调教91| 亚洲色图制服诱惑| 欧美日韩精品欧美日韩精品一 | 久久精品夜色噜噜亚洲a∨| 懂色av中文字幕一区二区三区| 亚洲女人的天堂| 91精品国产综合久久香蕉麻豆| 国产一区不卡在线| 日韩久久一区二区| 91精品中文字幕一区二区三区| 国产精品456|