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

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

?? usb_cls_hid.asm

?? 單片機USB接口模擬鍵盤,該程序可以控制PC機的PS/2鍵盤的NUM LOCK和SCROLL LOCK的燈,以此說明通訊正常
?? ASM
?? 第 1 頁 / 共 2 頁
字號:
;;*****************************************************************************
;;*****************************************************************************
;;  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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品一区二区| 丰满少妇在线播放bd日韩电影| 97精品久久久久中文字幕| 国产情人综合久久777777| 成人精品视频一区| 亚洲黄一区二区三区| 欧美日韩mp4| 奇米精品一区二区三区四区 | 不卡av电影在线播放| 国产欧美日韩不卡| 91高清在线观看| 首页综合国产亚洲丝袜| 日韩精品一区国产麻豆| 国产成人免费xxxxxxxx| 综合在线观看色| 在线成人免费观看| 激情av综合网| 亚洲免费观看高清完整版在线观看| 欧美体内she精高潮| 九九九久久久精品| 中文字幕中文乱码欧美一区二区| 色哟哟国产精品免费观看| 日本视频一区二区| 国产精品卡一卡二| 欧美久久婷婷综合色| 国产成人鲁色资源国产91色综 | 国产福利91精品一区| 亚洲国产成人在线| 欧美视频在线观看一区二区| 美国十次综合导航| 一区二区三区在线免费视频| 欧美精品tushy高清| 粉嫩av一区二区三区粉嫩| 亚洲高清不卡在线观看| 久久久久国产精品免费免费搜索| 欧洲一区在线观看| 国产成人综合在线观看| 丝袜亚洲另类欧美综合| 亚洲欧洲国产日本综合| 日韩一区二区三区免费观看| 91浏览器在线视频| 国内成+人亚洲+欧美+综合在线| 亚洲欧美日韩中文字幕一区二区三区| 6080yy午夜一二三区久久| 99国产麻豆精品| 国产精品久久久久久久久晋中| 亚洲永久免费av| 久久久久久久久久久99999| 欧美日韩成人在线| 一本色道**综合亚洲精品蜜桃冫| 国产精品自拍三区| 91在线看国产| 国产一区二区影院| 日韩精品一区二区在线观看| 欧美一区二区网站| 91视频你懂的| 国产成+人+日韩+欧美+亚洲| 日韩成人一区二区三区在线观看| 亚洲激情图片一区| 国产精品美女久久久久av爽李琼| 欧美精品一区二区三区蜜臀 | 国产成人亚洲精品青草天美| 偷拍亚洲欧洲综合| 亚洲一区二区三区自拍| 最好看的中文字幕久久| 国产精品久久久久久久久图文区| 精品久久久久久久久久久久久久久 | 538prom精品视频线放| 久久综合九色综合欧美亚洲| 国内不卡的二区三区中文字幕| 日韩国产精品久久久| 偷窥少妇高潮呻吟av久久免费| 一区二区视频在线| 亚洲免费观看高清完整版在线观看| 欧美激情一区二区三区不卡 | 视频一区中文字幕| 一区二区成人在线| 亚洲自拍偷拍九九九| 亚洲精品五月天| 亚洲一区二区三区影院| 亚洲高清一区二区三区| 日日欢夜夜爽一区| 免费欧美在线视频| 激情五月播播久久久精品| 久久精品国产99国产精品| 精品一区二区三区在线观看| 在线观看日韩一区| 欧美唯美清纯偷拍| 日韩一区二区在线观看视频| 欧美xfplay| 国产精品毛片久久久久久| 国产精品国产三级国产普通话99 | 国产成人精品三级| 成人免费看视频| 91麻豆蜜桃一区二区三区| 91黄色免费版| 日韩女优电影在线观看| 久久久精品人体av艺术| 亚洲天堂免费在线观看视频| 亚洲免费高清视频在线| 亚洲大片精品永久免费| 奇米一区二区三区| 极品少妇xxxx精品少妇偷拍| 丁香婷婷深情五月亚洲| 欧美曰成人黄网| 日韩精品一区二区三区视频| 中文字幕第一区第二区| 亚洲一二三四久久| 国精产品一区一区三区mba桃花 | 色香蕉成人二区免费| 欧美日韩视频在线观看一区二区三区| 91精品国产欧美一区二区18| 久久精品欧美一区二区三区不卡| 亚洲色图制服诱惑| 麻豆国产精品官网| av网站一区二区三区| 制服.丝袜.亚洲.另类.中文| 久久免费视频色| 夜夜精品浪潮av一区二区三区| 久久精品99国产国产精| 色综合婷婷久久| 精品日本一线二线三线不卡| 亚洲欧美激情小说另类| 久久不见久久见免费视频7| 一本久道久久综合中文字幕| 日韩精品一区二区三区视频| 亚洲狼人国产精品| 国产一区美女在线| 欧美日本国产视频| 久久超碰97中文字幕| 91美女片黄在线| 国产欧美日韩麻豆91| 日韩黄色一级片| 91麻豆精品视频| 久久久久久黄色| 麻豆精品一二三| 欧美日韩在线综合| 亚洲日本青草视频在线怡红院| 精品午夜一区二区三区在线观看 | 欧美日韩久久一区| 国产精品女人毛片| 国产精品一区免费视频| 日韩一区二区视频| 亚洲成人三级小说| 色天天综合色天天久久| 欧美韩日一区二区三区四区| 狠狠色狠狠色综合系列| 在线成人免费观看| 天堂在线一区二区| 欧美色手机在线观看| 亚洲欧美二区三区| 色偷偷久久人人79超碰人人澡| 国产欧美一区二区精品久导航 | 亚洲高清免费观看高清完整版在线观看| 成人丝袜高跟foot| 国产性做久久久久久| 国产精品一级黄| 久久精品人人做| 国产精品一区久久久久| 久久亚洲二区三区| 国产在线一区二区| 久久久另类综合| 国产成人午夜视频| 国产无人区一区二区三区| 国产精品影音先锋| 中文在线一区二区| 成人av片在线观看| 亚洲欧美综合色| 97久久久精品综合88久久| 国产精品久久久久久久蜜臀| 99综合电影在线视频| 中文字幕综合网| 一本到不卡免费一区二区| 国产综合久久久久影院| 欧美电影免费观看高清完整版在 | 欧美久久免费观看| 免费久久精品视频| 国产色一区二区| 福利视频网站一区二区三区| 欧美极品xxx| 91丨九色丨尤物| 无吗不卡中文字幕| 精品嫩草影院久久| 成人精品视频.| 一区二区三区不卡在线观看| 欧美日韩高清在线| 九九国产精品视频| 国产精品视频免费| 91久久线看在观草草青青| 日韩在线观看一区二区| 精品不卡在线视频| fc2成人免费人成在线观看播放| 亚洲一区二区三区四区的| 欧美一级二级三级蜜桃| 国产高清不卡一区| 亚洲男同性恋视频| 欧美一区二区在线视频| 国产成人一区在线| 亚洲国产精品久久不卡毛片| 久久久久久免费网|