📄 myusbint.asm
字号:
;;*****************************************************************************
;;*****************************************************************************
;; FILENAME: myUSBINT.asm
;; Version: 1.5, Updated on 2005/08/17 at 15:01:28
;; Generated by PSoC Designer ver 4.2 b1013 : 02 September, 2004
;;
;; DESCRIPTION: USB Device User Module software implementation file
;; 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, 2005. All Rights Reserved.
;;*****************************************************************************
;;*****************************************************************************
include "m8c.inc"
include "myUSB_macros.inc"
include "myUSB.inc"
;-----------------------------------------------
; Global Symbols
;-----------------------------------------------
AREA bss (RAM,REL)
;-----------------------------------------------
; Constant Definitions
;-----------------------------------------------
;-----------------------------------------------
; Variable Allocation
;-----------------------------------------------
AREA text (ROM, REL)
;-----------------------------------------------------------------------------
; FUNCTION NAME: myUSB_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 myUSB_EP1_ISR
export _myUSB_EP1_ISR
myUSB_EP1_ISR:
_myUSB_EP1_ISR:
;@PSoC_UserCode_BODY_EP1@ (Do not change this line.)
;---------------------------------------------------
; Insert your custom code below this banner
;---------------------------------------------------
; NOTE: interrupt service routines must preserve
; the values of the A and X CPU registers.
STD_EP1: EQU 1 ; Set this equate to 0 to remove the standard
; endpoint handling code
;---------------------------------------------------
; Insert your custom code above this banner
;---------------------------------------------------
;@PSoC_UserCode_END@ (Do not change this line.)
IF STD_EP1
PUSH A
XOR [myUSB_EPDataToggle], 2 ; Update EP1 data toggle
MOV A, REG[EP1MODE] ; Get the mode
MOV [myUSB_EndpointAPIStatus+1], EVENT_PENDING ; For the API
POP A
RETI
ENDIF
;-----------------------------------------------------------------------------
; FUNCTION NAME: myUSB_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 myUSB_EP2_ISR
export _myUSB_EP2_ISR
myUSB_EP2_ISR:
_myUSB_EP2_ISR:
;@PSoC_UserCode_BODY_EP2@ (Do not change this line.)
;---------------------------------------------------
; Insert your custom code below this banner
;---------------------------------------------------
; NOTE: interrupt service routines must preserve
; the values of the A and X CPU registers.
STD_EP2: EQU 1 ; Set this equate to 0 to remove the standard
; endpoint handling code
;---------------------------------------------------
; Insert your custom code above this banner
;---------------------------------------------------
;@PSoC_UserCode_END@ (Do not change this line.)
IF STD_EP2
PUSH A
XOR [myUSB_EPDataToggle], 4 ; Update EP2 data toggle
MOV A, REG[EP2MODE] ; Get the mode
MOV [myUSB_EndpointAPIStatus + 2], EVENT_PENDING ; For the API
POP A
RETI
ENDIF
;-----------------------------------------------------------------------------
; FUNCTION NAME: myUSB_RESET_ISR
;
; DESCRIPTION: Handle the USB Bus Reset Interrupt
;-----------------------------------------------------------------------------
export myUSB_RESET_ISR
export _myUSB_RESET_ISR
myUSB_RESET_ISR:
_myUSB_RESET_ISR:
;@PSoC_UserCode_BODY_USB_RESET@ (Do not change this line.)
;---------------------------------------------------
; Insert your custom code below this banner
;---------------------------------------------------
; NOTE: interrupt service routines must preserve
; the values of the A and X CPU registers.
STD_USB_RESET: EQU 1 ; Set this equate to 0 to remove the standard
; USB reset handling code below
;---------------------------------------------------
; Insert your custom code above this banner
;---------------------------------------------------
;@PSoC_UserCode_END@ (Do not change this line.)
IF STD_USB_RESET
PUSH A
PUSH X
MOV A, [myUSB_bCurrentDevice] ; Select the current device
LCALL _myUSB_Start ; Restart USB
POP X
POP A
ENDIF
RETI
;-----------------------------------------------------------------------------
; FUNCTION NAME: myUSB_ACT_ISR
;
; DESCRIPTION: Handle the activity ISR
;
; THEORY of OPERATION or PROCEDURE:
;
; The activity interrupt sets a RAM flag indicating activity and disables the
; interrupt. Disabling the interrupt keeps the bus activity from creating too
; many interrupts. bCheckActivity checks and clears the flag, the enables
; interrupts for the next interval.
;
;-----------------------------------------------------------------------------
export myUSB_ACT_ISR
export _myUSB_ACT_ISR
myUSB_ACT_ISR:
_myUSB_ACT_ISR:
MOV [myUSB_bActivity], 1 ; Set the activity flag
M8C_DisableIntMask INT_MSK1, INT_MSK1_USB_ACTIVITY
RETI
; End of File myUSB_std.asm
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -