📄 usbint.lis
字号:
0000 USB_CB_h2d_vnd_dev: equ 0
0000 USB_CB_h2d_vnd_ifc: equ 0
0000 USB_CB_h2d_vnd_ep: equ 0
0000 USB_CB_h2d_vnd_oth: equ 0
0000 USB_CB_d2h_vnd_dev: equ 0
0000 USB_CB_d2h_vnd_ifc: equ 0
0000 USB_CB_d2h_vnd_ep: equ 0
0000 USB_CB_d2h_vnd_oth: equ 0
0000
0000 ;-----------------------------------------------
0000 ; 1st Tier Dispatch--Reserved Requests
0000 ;-----------------------------------------------
0000 USB_CB_h2d_rsv_dev: equ 0
0000 USB_CB_h2d_rsv_ifc: equ 0
0000 USB_CB_h2d_rsv_ep: equ 0
0000 USB_CB_h2d_rsv_oth: equ 0
0000 USB_CB_d2h_rsv_dev: equ 0
0000 USB_CB_d2h_rsv_ifc: equ 0
0000 USB_CB_d2h_rsv_ep: equ 0
0000 USB_CB_d2h_rsv_oth: equ 0
0000
0000 ;-----------------------------------------------
0000 ; Endpoint event flags
0000 ;-----------------------------------------------
0002 NO_EVENT_ALLOWED: equ 2
0001 EVENT_PENDING: equ 1
0000 NO_EVENT_PENDING: equ 0
0000
0000 IN_BUFFER_FULL: equ NO_EVENT_PENDING
0001 IN_BUFFER_EMPTY: equ EVENT_PENDING
0001 OUT_BUFFER_FULL: equ EVENT_PENDING
0000 OUT_BUFFER_EMPTY: equ NO_EVENT_PENDING
0000
0000 ;-----------------------------------------------
0000 ; HID Descriptor Types
0000 ;-----------------------------------------------
0021 DESCR_TYPE_HID_CLASS: equ 0x21
0009 DESCR_SIZE_HID_CLASS: equ 9
0022 DESCR_TYPE_HID_REPORT: equ 0x22
0023 DESCR_TYPE_HID_PHYSICAL: equ 0x23
0000
0000 ;-----------------------------------------------
0000 ; Transfer Completion Notification
0000 ;-----------------------------------------------
0000 USB_XFER_IDLE: equ 0x00
0001 USB_XFER_STATUS_ACK: equ 0x01
0002 USB_XFER_PREMATURE: equ 0x02
0003 USB_XFER_ERROR: equ 0x03
0000
0000 ; This macro is used to allocate a completion status block
0000 ; for all Requests. The macro parameter is used
0000 ; to prefix the two data elements.
0000 USB_XFER_STATUS: equ 0
0001 USB_XFER_LENGTH: equ 1
0000 MACRO USB_XFER_STATUS_BLOCK
0000 BLK 1 ; Completion Status
0000 BLK 2 ; Transfer Length
0000 USB_VSR_SUPPORT: EQU 0
IF USB_CB_h2d_vnd_dev
USB_VSR_SUPPORT: EQU 1
ENDIF
IF USB_CB_h2d_vnd_ifc
USB_VSR_SUPPORT: EQU 1
ENDIF
IF USB_CB_h2d_vnd_ep
USB_VSR_SUPPORT: EQU 1
ENDIF
IF USB_CB_h2d_vnd_oth
USB_VSR_SUPPORT: EQU 1
ENDIF
IF USB_CB_d2h_vnd_dev
USB_VSR_SUPPORT: EQU 1
ENDIF
IF USB_CB_d2h_vnd_ifc
USB_VSR_SUPPORT: EQU 1
ENDIF
IF USB_CB_d2h_vnd_ep
USB_VSR_SUPPORT: EQU 1
ENDIF
IF USB_CB_d2h_vnd_oth
USB_VSR_SUPPORT: EQU 1
ENDIF
; end of file USB.inc
;-----------------------------------------------
; Global Symbols
;-----------------------------------------------
AREA bss (RAM,REL)
;-----------------------------------------------
; Constant Definitions
;-----------------------------------------------
;-----------------------------------------------
; Variable Allocation
;-----------------------------------------------
AREA text (ROM, REL)
;-----------------------------------------------------------------------------
; FUNCTION NAME: USB_EP1_ISR
;
; DESCRIPTION: Handle the Endpoint 1 event by updating the data toggle
; and setting the endpoint state to EVENT_PENDING. The SIE
; automatically set the mode to NAK both IN and out transfers
;-----------------------------------------------------------------------------
export USB_EP1_ISR
export _USB_EP1_ISR
0000 USB_EP1_ISR:
0000 _USB_EP1_ISR:
0000 ;@PSoC_UserCode_BODY_EP1@ (Do not change this line.)
0000 ;---------------------------------------------------
0000 ; Insert your custom code below this banner
0000 ;---------------------------------------------------
0000 ; NOTE: interrupt service routines must preserve
0000 ; the values of the A and X CPU registers.
0001 STD_EP1: EQU 1 ; Set this equate to 0 to remove the standard
0000 ; endpoint handling code
0000 ;---------------------------------------------------
0000 ; Insert your custom code above this banner
0000 ;---------------------------------------------------
0000 ;@PSoC_UserCode_END@ (Do not change this line.)
0000
IF STD_EP1
0000 08 PUSH A
0001 360002 XOR [USB_EPDataToggle], 2 ; Update EP1 data toggle
0004 5D45 MOV A, REG[EP1MODE] ; Get the mode
0006 550101 MOV [USB_EndpointAPIStatus+1], EVENT_PENDING ; For the API
0009 18 POP A
000A 7E RETI
ENDIF
;-----------------------------------------------------------------------------
; FUNCTION NAME: USB_EP2_ISR
;
; DESCRIPTION: Handle the Endpoint 2 event by updating the data toggle
; and setting the endpoint state to EVENT_PENDING. The SIE
; automatically set the mode to NAK both IN and out transfers
;-----------------------------------------------------------------------------
export USB_EP2_ISR
export _USB_EP2_ISR
000B USB_EP2_ISR:
000B _USB_EP2_ISR:
000B ;@PSoC_UserCode_BODY_EP2@ (Do not change this line.)
000B ;---------------------------------------------------
000B ; Insert your custom code below this banner
000B ;---------------------------------------------------
000B ; NOTE: interrupt service routines must preserve
000B ; the values of the A and X CPU registers.
0001 STD_EP2: EQU 1 ; Set this equate to 0 to remove the standard
000B ; endpoint handling code
000B ;---------------------------------------------------
000B ; Insert your custom code above this banner
000B ;---------------------------------------------------
000B ;@PSoC_UserCode_END@ (Do not change this line.)
000B
IF STD_EP2
000B 08 PUSH A
000C 360004 XOR [USB_EPDataToggle], 4 ; Update EP2 data toggle
000F 5D46 MOV A, REG[EP2MODE] ; Get the mode
0011 550201 MOV [USB_EndpointAPIStatus + 2], EVENT_PENDING ; For the API
0014 18 POP A
0015 7E RETI
ENDIF
;-----------------------------------------------------------------------------
; FUNCTION NAME: USB_RESET_ISR
;
; DESCRIPTION: Handle the USB Bus Reset Interrupt
;-----------------------------------------------------------------------------
export USB_RESET_ISR
export _USB_RESET_ISR
0016 USB_RESET_ISR:
0016 _USB_RESET_ISR:
0016
0016 ;@PSoC_UserCode_BODY_USB_RESET@ (Do not change this line.)
0016 ;---------------------------------------------------
0016 ; Insert your custom code below this banner
0016 ;---------------------------------------------------
0016 ; NOTE: interrupt service routines must preserve
0016 ; the values of the A and X CPU registers.
0016
0001 STD_USB_RESET: EQU 1 ; Set this equate to 0 to remove the standard
0016 ; USB reset handling code below
0016
0016 ;---------------------------------------------------
0016 ; Insert your custom code above this banner
0016 ;---------------------------------------------------
0016 ;@PSoC_UserCode_END@ (Do not change this line.)
0016
IF STD_USB_RESET
0016 08 PUSH A
0017 10 PUSH X
0018 5100 MOV A, [USB_bCurrentDevice] ; Select the current device
001A 7C0000 LCALL _USB_Start ; Restart USB
001D 20 POP X
001E 18 POP A
ENDIF
001F 7E RETI
0020 ;-----------------------------------------------------------------------------
0020 ; FUNCTION NAME: USB_ACT_ISR
0020 ;
0020 ; DESCRIPTION: Handle the activity ISR
0020 ;
0020 ; THEORY of OPERATION or PROCEDURE:
0020 ;
0020 ; The activity interrupt sets a RAM flag indicating activity and disables the
0020 ; interrupt. Disabling the interrupt keeps the bus activity from creating too
0020 ; many interrupts. bCheckActivity checks and clears the flag, the enables
0020 ; interrupts for the next interval.
0020 ;
0020 ;-----------------------------------------------------------------------------
export USB_ACT_ISR
export _USB_ACT_ISR
0020 USB_ACT_ISR:
0020 _USB_ACT_ISR:
0020 550001 MOV [USB_bActivity], 1 ; Set the activity flag
0023 41E1EF and reg[INT_MSK1], ~INT_MSK1_USB_ACTIVITY ; disable specified interrupt enable bit
0026 7E RETI
0027 ; End of File USB_std.asm
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -