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

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

?? usb_drv.asm

?? 單片機USB接口模擬鍵盤,該程序可以控制PC機的PS/2鍵盤的NUM LOCK和SCROLL LOCK的燈,以此說明通訊正常
?? 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.3  b1884 : 23 June, 2006
;;
;;  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一区二区三区免费野_久草精品视频
五月天激情小说综合| 成人小视频在线观看| 亚洲一区二区三区在线播放| 中国色在线观看另类| 久久精品人人做人人综合 | 成人午夜av在线| 国产成人99久久亚洲综合精品| 狠狠网亚洲精品| 国内精品写真在线观看| 韩国精品一区二区| 国产精品88av| 99r国产精品| 在线视频欧美精品| 在线91免费看| 日韩欧美一级在线播放| 亚洲精品在线观| 中文字幕第一区| 亚洲综合av网| 久久精品免费看| 国产成人午夜高潮毛片| av电影天堂一区二区在线| 95精品视频在线| 欧美日韩激情一区| 日韩精品一区二区三区视频播放 | 成人小视频在线| 91麻豆国产福利精品| 欧美日韩在线播| 欧美精品一区二区三区在线播放 | 国产91露脸合集magnet| yourporn久久国产精品| 欧美日韩美女一区二区| 日韩免费高清av| 国产精品少妇自拍| 亚洲一区二区三区在线| 久久精品二区亚洲w码| 成人理论电影网| 欧美丝袜第三区| 精品国产欧美一区二区| 中文字幕一区二区三区四区| 亚洲国产精品欧美一二99| 久久精品国产成人一区二区三区 | 欧美国产国产综合| 亚洲人成网站色在线观看| 日韩影院免费视频| 成人理论电影网| 91精品国产麻豆国产自产在线 | 精品在线你懂的| av电影天堂一区二区在线观看| 欧美日本一区二区在线观看| 久久久精品天堂| 午夜视频一区在线观看| 国产高清精品在线| 欧美久久一区二区| 日韩毛片视频在线看| 蜜臀av性久久久久蜜臀aⅴ| www.日韩大片| 久久美女艺术照精彩视频福利播放| 亚洲日本中文字幕区| 久色婷婷小香蕉久久| 在线免费av一区| 国产欧美日韩激情| 午夜久久久久久久久| 91网页版在线| 久久精品人人做人人爽97| 亚洲电影视频在线| 成人app软件下载大全免费| 日韩欧美国产综合一区 | 日本亚洲最大的色成网站www| 国产91精品一区二区麻豆亚洲| 欧美卡1卡2卡| 一级女性全黄久久生活片免费| 国产成人免费在线观看不卡| 欧美一卡2卡三卡4卡5免费| 亚洲精品国久久99热| 成人午夜看片网址| 久久综合久久综合九色| 天天免费综合色| 欧美在线高清视频| 亚洲欧洲三级电影| 国产91在线观看丝袜| 2020国产精品自拍| 看电视剧不卡顿的网站| 7777精品伊人久久久大香线蕉完整版 | 久久久久久久久免费| 视频在线观看91| 一本久久a久久精品亚洲| 久久嫩草精品久久久精品| 麻豆一区二区在线| 69堂成人精品免费视频| 亚洲国产日韩一级| 91国产丝袜在线播放| 亚洲色欲色欲www在线观看| 成人免费观看视频| 日本一二三不卡| 高清不卡一区二区在线| 久久美女高清视频| 国产又黄又大久久| 久久久久久久久岛国免费| 黄网站免费久久| 久久久欧美精品sm网站| 国内一区二区在线| 国产亚洲欧美在线| 国产精品18久久久久| 精品粉嫩aⅴ一区二区三区四区| 热久久久久久久| 日韩精品一区二区三区在线| 麻豆一区二区三| 久久久久久久久久美女| 国产黄色精品网站| 中文字幕在线播放不卡一区| 97超碰欧美中文字幕| 亚洲嫩草精品久久| 色婷婷av一区| 亚洲午夜三级在线| 91精品国产高清一区二区三区蜜臀| 性做久久久久久久免费看| 91精品麻豆日日躁夜夜躁| 免费看欧美女人艹b| 久久综合九色综合97婷婷女人 | 成人动漫在线一区| 亚洲色图19p| 欧美精品一级二级| 国产综合成人久久大片91| 日本一区二区视频在线| 97久久精品人人做人人爽| 亚洲一线二线三线久久久| 日韩一区二区免费视频| 国产真实乱子伦精品视频| 国产精品久久久久久久久免费相片 | 国产精品久久久久久亚洲伦| 色欲综合视频天天天| 午夜伊人狠狠久久| 26uuuu精品一区二区| 9i看片成人免费高清| 亚洲国产一区二区视频| 欧美成人video| 成人黄色一级视频| 午夜视黄欧洲亚洲| 久久网站热最新地址| 99亚偷拍自图区亚洲| 午夜视黄欧洲亚洲| 久久久精品tv| 欧美无砖砖区免费| 国产一区二区不卡| 亚洲精品久久久蜜桃| 精品国产91洋老外米糕| 97精品国产97久久久久久久久久久久 | 亚洲国产另类精品专区| 精品乱码亚洲一区二区不卡| 99久久综合国产精品| 日韩精品福利网| 国产精品久久久久久久岛一牛影视 | 日韩一区和二区| 成人av在线资源| 免费在线观看视频一区| 成人欧美一区二区三区1314| 日韩午夜小视频| 色狠狠色噜噜噜综合网| 国产盗摄一区二区三区| 亚洲成人tv网| 中文字幕中文乱码欧美一区二区| 欧美一区午夜视频在线观看 | 精品少妇一区二区三区免费观看| 91在线云播放| 国产美女精品人人做人人爽| 亚洲国产日韩av| 国产精品大尺度| 精品国产一区二区三区久久久蜜月 | 乱中年女人伦av一区二区| 亚洲欧美日韩国产综合| wwwwww.欧美系列| 91麻豆精品国产91久久久| 91在线免费视频观看| 国产精品一区二区不卡| 日本女人一区二区三区| 一区二区视频在线看| 国产亚洲成av人在线观看导航| 欧美一区二区三区视频| 在线免费观看不卡av| 成人动漫精品一区二区| 国产原创一区二区| 捆绑紧缚一区二区三区视频| 午夜激情久久久| 亚洲一区二区三区影院| 亚洲日本韩国一区| 国产精品青草综合久久久久99| 精品日本一线二线三线不卡| 欧美日韩视频在线一区二区| 91美女在线视频| www.日韩在线| www.日本不卡| 国产成人啪免费观看软件| 国产美女精品人人做人人爽 | 欧美日韩成人综合天天影院 | 亚洲国产精品99久久久久久久久| 精品国产污网站| 精品国产欧美一区二区| 日韩精品一区二区三区在线观看 | 国产精品久久一级| 精品卡一卡二卡三卡四在线|