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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? usb_cls_hid.asm

?? 單片機(jī)USB接口模擬鍵盤(pán),該程序可以控制PC機(jī)的PS/2鍵盤(pán)的NUM LOCK和SCROLL LOCK的燈,以此說(shuō)明通訊正常
?? ASM
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(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.3  b1884 : 23 June, 2006
;;
;;  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

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产99久久久国产精品免费看| 国产成人午夜精品影院观看视频| 日韩三级高清在线| 成人av在线网站| 免费在线看成人av| 亚洲综合色噜噜狠狠| 国产欧美一区二区三区在线老狼| 欧美一区二区在线免费播放| 99国产精品一区| 国产精品一区一区| 天堂va蜜桃一区二区三区漫画版| 国产精品国产三级国产| 久久久久成人黄色影片| 正在播放一区二区| 日本久久精品电影| 成人自拍视频在线观看| 久久精品国产**网站演员| 亚洲一区二区三区视频在线播放| 日韩美女啊v在线免费观看| 久久免费偷拍视频| 精品国内二区三区| 欧美一激情一区二区三区| 欧美日韩免费高清一区色橹橹 | 午夜成人在线视频| 日韩久久一区二区| 国产亚洲欧美中文| 久久久一区二区三区| 精品伦理精品一区| 欧美电影在线免费观看| 在线观看www91| 日本电影欧美片| 欧美国产亚洲另类动漫| 日韩精品中文字幕在线一区| 欧美精三区欧美精三区| 欧美精品一级二级| 5566中文字幕一区二区电影| 欧美色图一区二区三区| 欧美日韩中文国产| 欧美精品久久一区二区三区| 欧美视频中文字幕| 欧美色网一区二区| 69av一区二区三区| 日韩一区二区三区免费观看 | 国产日韩精品一区二区浪潮av| 精品三级av在线| 精品国产乱码久久久久久闺蜜| 日韩一区二区免费电影| 日韩美女天天操| 久久精品夜夜夜夜久久| 成人av资源下载| 亚洲一区日韩精品中文字幕| 91精品综合久久久久久| 9191精品国产综合久久久久久 | 色综合久久中文字幕| 91网上在线视频| 欧美日韩一区二区三区四区五区| 欧美日韩精品电影| 精品精品欲导航| 国产日本一区二区| 亚洲欧美一区二区三区国产精品 | 国产精品人成在线观看免费| 中文字幕免费不卡| 一区二区在线观看视频| 性做久久久久久久久| 精品一区二区久久| 成人午夜激情在线| 欧美吞精做爰啪啪高潮| 欧美一区二区三区白人| 国产网站一区二区| 亚洲一区中文日韩| 国产一区二区三区国产| av成人免费在线| 欧美日韩午夜在线视频| 久久亚洲免费视频| 亚洲精品水蜜桃| 六月丁香婷婷久久| 91免费国产在线| 欧美一区二区三区在线视频| 久久久久久**毛片大全| 樱花影视一区二区| 久久99精品久久久久久国产越南 | 国产欧美一二三区| 亚洲18色成人| 国v精品久久久网| 欧美性欧美巨大黑白大战| 精品99一区二区| 亚洲欧美日韩国产综合| 欧美日韩电影一区| 国产精品系列在线| 日韩高清一级片| 99久久久无码国产精品| 日韩精品一区二区三区中文精品| 亚洲人成亚洲人成在线观看图片| 麻豆国产91在线播放| 99re热视频精品| 精品国产123| 亚洲高清三级视频| 99久久99久久精品免费看蜜桃| 日韩一区二区三| 一区二区三区日韩在线观看| 国产毛片精品视频| 欧美乱熟臀69xxxxxx| 亚洲色图欧美偷拍| 国产成人无遮挡在线视频| 69久久99精品久久久久婷婷 | 久久久综合网站| 天天影视涩香欲综合网| 97se狠狠狠综合亚洲狠狠| 精品国产电影一区二区| 日韩高清不卡在线| 在线观看av一区| 自拍视频在线观看一区二区| 国产精品一区二区免费不卡| 日韩一区二区三区观看| 五月婷婷久久综合| 欧美系列一区二区| 亚洲综合色自拍一区| 99精品热视频| 久久精品夜夜夜夜久久| 韩国精品久久久| 精品国精品国产| 免费国产亚洲视频| 欧美一级国产精品| 五月天网站亚洲| 欧美日韩激情在线| 亚洲国产日韩av| 欧美性感一类影片在线播放| 亚洲欧洲av另类| 9色porny自拍视频一区二区| 国产色一区二区| 高清av一区二区| 国产精品美女一区二区在线观看| 国产一区二区三区免费观看| 精品国产乱码久久久久久久久| 久久精品理论片| 欧美v国产在线一区二区三区| 麻豆精品蜜桃视频网站| 欧美一区二区在线播放| 久久国产精品无码网站| 欧美一二三区在线观看| 久久国产精品99精品国产 | 亚洲综合色在线| 欧美视频中文一区二区三区在线观看| 亚洲永久精品国产| 欧美男人的天堂一二区| 亚洲bt欧美bt精品| 日韩一区二区麻豆国产| 欧美成人精品福利| 久久精品国产网站| 精品国产乱码久久久久久图片| 激情欧美日韩一区二区| 久久精品亚洲精品国产欧美kt∨ | 亚洲成人午夜电影| 欧美一三区三区四区免费在线看| 日韩不卡手机在线v区| 精品国产免费人成电影在线观看四季| 激情综合色播五月| 中文字幕精品—区二区四季| 99riav一区二区三区| 亚洲成人午夜电影| 久久女同性恋中文字幕| 成人国产精品视频| 亚洲第一搞黄网站| 久久综合网色—综合色88| 成人av在线资源网站| 亚洲成人av一区二区| www国产成人免费观看视频 深夜成人网| 国产精品一二三区在线| 国产精品福利一区二区三区| 欧美三级在线视频| 国产在线不卡视频| 最新欧美精品一区二区三区| 欧美日韩国产综合久久| 国产又粗又猛又爽又黄91精品| 亚洲欧洲一区二区在线播放| 欧美日韩国产首页在线观看| 久久超碰97中文字幕| 国产精品久久精品日日| 欧美狂野另类xxxxoooo| 高清在线成人网| 日韩精品福利网| 国产精品天美传媒沈樵| 欧美精选一区二区| eeuss影院一区二区三区| 天堂va蜜桃一区二区三区| 国产精品乱码久久久久久| 5858s免费视频成人| 97精品视频在线观看自产线路二 | 91福利社在线观看| 久草中文综合在线| 亚洲综合色噜噜狠狠| 欧美激情自拍偷拍| 91精品国产麻豆国产自产在线| av在线播放一区二区三区| 91精品国产欧美一区二区成人| 99久久婷婷国产| 国产高清不卡二三区| 日韩成人免费在线| 亚洲综合激情网| 国产精品二三区|