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

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

?? usb_cls_hid.asm

?? The CY4623 reference design kit offers a complete production-ready solution for a USB or PS/2 optica
?? ASM
?? 第 1 頁 / 共 2 頁
字號:
;;*****************************************************************************
;;*****************************************************************************
;;  FILENAME: USB_cls_hid.asm
;;   Version: 1.5.0.1, Updated on 2005/08/17 at 15:01:28
;;  Generated by PSoC Designer ver 4.2  b1013 : 02 September, 2004
;;
;;  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   1    ; Idle Timer Reload Value
 USB_IdleTimer:                         BLK   1    ; Idle Timers
 USB_Protocol:                          BLK   1    ; 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  1                  ; 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, 1                       ; 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, 1                       ; 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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
√…a在线天堂一区| 免费亚洲电影在线| 91色视频在线| 综合久久国产九一剧情麻豆| 国产成人aaaa| 亚洲日本在线看| 欧洲生活片亚洲生活在线观看| 亚洲日本韩国一区| 欧美在线小视频| 日韩二区三区在线观看| 日韩手机在线导航| 国产精品综合一区二区| 国产精品伦一区二区三级视频| 成人精品高清在线| 一区二区三区四区蜜桃| 欧美三级中文字幕在线观看| 日韩电影在线免费观看| 精品国产露脸精彩对白 | 久久日韩粉嫩一区二区三区| 国内成人自拍视频| 国产精品乱码一区二区三区软件 | 国产精品久久国产精麻豆99网站 | 久久国产福利国产秒拍| 久久久高清一区二区三区| 成人av免费网站| 亚洲成av人片在www色猫咪| 日韩欧美高清在线| 成人av免费观看| 亚洲高清免费在线| 国产性做久久久久久| 色屁屁一区二区| 精品一区二区在线视频| 成人免费在线观看入口| 91精品国产一区二区三区香蕉| 国产精品综合在线视频| 亚洲国产精品一区二区久久恐怖片| 日韩三级高清在线| 99久久精品国产毛片| 美女视频免费一区| 日本一区二区三区久久久久久久久不| 91黄色激情网站| 国产资源精品在线观看| 一区二区三区国产豹纹内裤在线| 欧美一级爆毛片| 色一区在线观看| 精品一区二区三区在线播放视频 | 激情成人综合网| 亚洲综合色成人| 久久久777精品电影网影网| 欧美写真视频网站| 成人性生交大合| 国产一区二区精品在线观看| 亚洲国产一区二区视频| 中文字幕 久热精品 视频在线| 337p亚洲精品色噜噜| 一本大道久久a久久精二百| 国产在线国偷精品免费看| 五月婷婷综合激情| 亚洲欧美视频在线观看| 久久精品在这里| 日韩免费在线观看| 欧美日韩夫妻久久| 色一情一伦一子一伦一区| 国产寡妇亲子伦一区二区| 视频一区二区不卡| 夜夜夜精品看看| 亚洲三级电影全部在线观看高清| 国产亚洲精品资源在线26u| 日韩午夜在线播放| 欧美日韩www| 欧美又粗又大又爽| 99热这里都是精品| 成人免费视频国产在线观看| 国产在线精品一区在线观看麻豆| 人妖欧美一区二区| 日韩一区精品字幕| 亚洲成人免费在线| 亚洲一区二区精品久久av| 亚洲女同女同女同女同女同69| 国产欧美一区视频| 亚洲国产经典视频| 久久精品一区二区三区不卡| 26uuu另类欧美| 久久噜噜亚洲综合| 久久久久久久久99精品| 久久老女人爱爱| 国产欧美一区二区精品性色超碰| 久久亚洲一区二区三区明星换脸| 日韩欧美国产成人一区二区| 亚洲精品一区二区精华| 精品久久人人做人人爰| 欧美精品一区视频| 久久亚洲欧美国产精品乐播| 国产人久久人人人人爽| 国产精品久久久久久福利一牛影视| 中文字幕va一区二区三区| 国产精品毛片久久久久久| 免费日本视频一区| 麻豆久久久久久久| 国产乱子伦视频一区二区三区| 国产一区二区剧情av在线| 不卡电影免费在线播放一区| 成人av在线影院| 欧美亚洲图片小说| 91精品国产91久久久久久一区二区 | 国产麻豆成人传媒免费观看| 国产高清精品网站| 91欧美一区二区| 在线电影欧美成精品| 日韩欧美综合在线| 中文字幕av免费专区久久| 亚洲精品国产一区二区精华液| 亚洲一区二区三区三| 久久国产精品区| a亚洲天堂av| 91精品中文字幕一区二区三区| 2020国产成人综合网| 亚洲日本中文字幕区| 麻豆国产精品一区二区三区 | 91精品在线麻豆| 久久噜噜亚洲综合| 一级女性全黄久久生活片免费| 美女视频一区二区三区| 99热在这里有精品免费| 欧美日韩电影在线播放| 国产三级久久久| 亚洲第一激情av| 国产精品一区二区果冻传媒| 欧美综合亚洲图片综合区| 精品毛片乱码1区2区3区| 亚洲啪啪综合av一区二区三区| 奇米影视一区二区三区小说| 成人免费看视频| 欧美一区二区三区免费| 中文字幕人成不卡一区| 久久精品国内一区二区三区| 成a人片亚洲日本久久| 国产精品福利影院| 五月综合激情婷婷六月色窝| 成人免费毛片嘿嘿连载视频| 日韩欧美一区二区在线视频| 亚洲精品一二三四区| 国产尤物一区二区| 欧美精品粉嫩高潮一区二区| 国产精品初高中害羞小美女文| 裸体一区二区三区| 欧美三级电影在线观看| 国产精品三级视频| 国内偷窥港台综合视频在线播放| 欧洲精品在线观看| 国产精品乱人伦| 国产黄色成人av| 欧美tk—视频vk| 日韩电影在线免费看| 在线精品视频免费播放| 亚洲欧洲99久久| 成人激情文学综合网| 久久精品综合网| 久久精品99国产国产精| 777xxx欧美| 午夜伊人狠狠久久| 欧美三级电影在线看| 亚洲一区二区三区视频在线| 色悠悠久久综合| 亚洲欧美在线视频| 成人av网站大全| 国产精品天天摸av网| 国产aⅴ综合色| 国产欧美日韩另类视频免费观看| 精品一区二区在线观看| 日韩精品一区二区三区中文不卡| 日韩av在线播放中文字幕| 欧美伦理电影网| 婷婷夜色潮精品综合在线| 欧美日韩精品欧美日韩精品一| 亚洲国产三级在线| 欧美日韩国产成人在线免费| 亚洲一级二级三级在线免费观看| 欧美这里有精品| 亚洲成精国产精品女| 欧美日韩www| 奇米影视7777精品一区二区| 日韩一区二区麻豆国产| 精品无人码麻豆乱码1区2区| 精品国产一区a| 国产91精品一区二区麻豆亚洲| 久久久亚洲高清| 成人国产精品免费网站| 亚洲视频在线观看一区| 欧美在线999| 琪琪久久久久日韩精品| 久久久噜噜噜久噜久久综合| 成人免费毛片高清视频| 日本网站在线观看一区二区三区| 这里只有精品视频在线观看| 极品瑜伽女神91| 国产精品久久久爽爽爽麻豆色哟哟| 色偷偷88欧美精品久久久| 婷婷丁香久久五月婷婷| 欧美精品一区二区不卡|