📄 ax_enum.asm
字号:
setb PD ; Set PD - Enter Suspend Mode.
nop
nop
NOP
NOP
NOP
; Code execution stops here after PD.
RESUME_CODE:
jb GSUS, SUSPEND_LOOP ; If still suspended, (RWU Event) then goto top.
clr GRSM ; CLear Resume Flag
clr GSUS ; CLear GSUS Flag
ExitSuspendISR:
pop WR2
pop ACC
pop PSW1
pop PSW
reti
;----------------------------------------------------------------
;FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
;FF FUNCTION ISR
;FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
;----------------------------------------------------------------
;COMMENT *------------------------------------------------------------
;Function name : FUNCTION_ISR
;Brief Description : Service the FUNCTION_ISR Interrupt
; : This routine scans the interrupt pending bits in order
; : and branches to any routines that have pending interrupts.
; : After finishing the routine jumps back to the top of
; : the scanning loop to preserve interrupt priority.
; :
; : NOTE: The order of precidence is set by the order in which the
; : user places the checks.
; :
;Regs preserved : Reg. A, B & EPINDEX are saved
;--------------------------------------------------------------------*
FUNCTION_ISR:
push PSW
push PSW1
push ACC
push B
push EPINDEX
ProcessFunctionEndpoints:
;----------------------------------------------------------------
;-- NOTE: Priority of the check sequence determines priority. --
;----------------------------------------------------------------
F_EP0:
mov A, FIFLG ; First check to see if this is EP0 Command
anl A, #03h ; As they require extra overhead. Mask off all but EP0 Interrupts
jz NonEp0ISR
;----------------------------------------------------------------
;-- Process the EP0 COmmand in the correct order
;----------------------------------------------------------------
; If this an EP0 command then we need to process TX & RX
; ISRs in the correct order if, for whatever reason they occurred
; back to back. This happens in OHCI systems.
mov A, gbSetupSeqTX
cjne A, #SETUP_PHASE, CheckDataStatusStage
sjmp DoRxFirst ; If the current stage is Setup then check the RX First.
; as we are expecting a setup packet.
CheckDataStatusStage:
; Now check to see what stage the TX is in.
; If it is in the data stage then check it first.
; If it's in the status stage then check the RX first.
cjne A, #DATA_PHASE, DoRxFirst ; If current TX stage a data stage->a control read
; and we should process TX before RX ISR
;----------------------------------------------------------------
;-- Process the TX FIFO first
;----------------------------------------------------------------
DoTxFirst:
F_EP0_TXA:
jnb FTXD0, F_EP0_RXA
mov EPINDEX,#00
lCall ProcessInToken ; 82930 has sent a packet to HC
ljmp ProcessFunctionEndpoints ; Look at all Interrupt flags again
F_EP0_RXA:
jnb FRXD0, NonEp0ISR
mov EPINDEX,#00
lCall ProcessOutToken ; 82930 has received a packet from HC
ljmp ProcessFunctionEndpoints ; Look at all Interrupt flags again
;--------------------------------------------------------------------------------
DoRxFirst:
;----------------------------------------------------------------
;-- Process the RX FIFO first
;----------------------------------------------------------------
F_EP0_RXB:
jnb FRXD0, F_EP0_TXB
mov EPINDEX,#00
lCall ProcessOutToken ; 82930 has received a packet from HC
ljmp ProcessFunctionEndpoints ; Look at all Interrupt flags again
F_EP0_TXB:
jnb FTXD0, NonEp0ISR
mov EPINDEX,#00
lCall ProcessInToken ; 82930 has sent a packet to HC
ljmp ProcessFunctionEndpoints ; Look at all Interrupt flags again
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
;----------------------------------------------------------------
;-- Process the Other EPs next
;----------------------------------------------------------------
NonEp0ISR:
F_EP1_TX:
$$IF$ (BENCFG11 == 1)
$$IF$ (EPADDR11 == 129)
$$IFN$ (EPATT11 == 1)
jnb FTXD1, F_EP1_RX
mov EPINDEX,#01
lcall Ep1TxLoopBack
jb RXFIF0, GetEp1RxData ; If data is pending in the FIFOs go get it.
jb RXFIF1, GetEp1RxData ; This is quicker than calling the routines.
ljmp F_EP1_RX ; Look at all Interrupt flags again
GetEp1RxData:
lCall Ep1RxLoopBack ; 82930 has received a packet from HC
$$END$
$$END$
$$END$
$$IF$ (BENCFG12 == 1)
$$IF$ (EPADDR12 == 129)
$$IFN$ (EPATT12 == 1)
jnb FTXD1, F_EP1_RX
mov EPINDEX,#01
lcall Ep1TxLoopBack
jb RXFIF0, GetEp1RxData ; If data is pending in the FIFOs go get it.
jb RXFIF1, GetEp1RxData ; This is quicker than calling the routines.
ljmp F_EP1_RX ; Look at all Interrupt flags again
GetEp1RxData:
lCall Ep1RxLoopBack ; 82930 has received a packet from HC
$$END$
$$END$
$$END$
$$IF$ (BENCFG13 == 1)
$$IF$ (EPADDR13 == 129)
$$IFN$ (EPATT13 == 1)
jnb FTXD1, F_EP1_RX
mov EPINDEX,#01
lcall Ep1TxLoopBack
jb RXFIF0, GetEp1RxData ; If data is pending in the FIFOs go get it.
jb RXFIF1, GetEp1RxData ; This is quicker than calling the routines.
ljmp F_EP1_RX ; Look at all Interrupt flags again
GetEp1RxData:
lCall Ep1RxLoopBack ; 82930 has received a packet from HC
$$END$
$$END$
$$END$
$$IF$ (BENCFG14 == 1)
$$IF$ (EPADDR14 == 129)
$$IFN$ (EPATT14 == 1)
jnb FTXD1, F_EP1_RX
mov EPINDEX,#01
lcall Ep1TxLoopBack
jb RXFIF0, GetEp1RxData ; If data is pending in the FIFOs go get it.
jb RXFIF1, GetEp1RxData ; This is quicker than calling the routines.
ljmp F_EP1_RX ; Look at all Interrupt flags again
GetEp1RxData:
lCall Ep1RxLoopBack ; 82930 has received a packet from HC
$$END$
$$END$
$$END$
$$IF$ (BENCFG15 == 1)
$$IF$ (EPADDR15 == 129)
$$IFN$ (EPATT15 == 1)
jnb FTXD1, F_EP1_RX
mov EPINDEX,#01
lcall Ep1TxLoopBack
jb RXFIF0, GetEp1RxData ; If data is pending in the FIFOs go get it.
jb RXFIF1, GetEp1RxData ; This is quicker than calling the routines.
ljmp F_EP1_RX ; Look at all Interrupt flags again
GetEp1RxData:
lCall Ep1RxLoopBack ; 82930 has received a packet from HC
$$END$
$$END$
$$END$
$$IF$ (BENCFG16 == 1)
$$IF$ (EPADDR16 == 129)
$$IFN$ (EPATT16 == 1)
jnb FTXD1, F_EP1_RX
mov EPINDEX,#01
lcall Ep1TxLoopBack
jb RXFIF0, GetEp1RxData ; If data is pending in the FIFOs go get it.
jb RXFIF1, GetEp1RxData ; This is quicker than calling the routines.
ljmp F_EP1_RX ; Look at all Interrupt flags again
GetEp1RxData:
lCall Ep1RxLoopBack ; 82930 has received a packet from HC
$$END$
$$END$
$$END$
F_EP1_RX:
$$IF$ (BENCFG11 == 1)
$$IF$ (EPADDR11 == 1)
$$IFN$ (EPATT11 == 1)
jnb FRXD1, F_EP2_TX
mov EPINDEX,#01
lCall Ep1RxLoopBack ; 82930 has received a packet from HC
lcall Ep1TxLoopBack
$$END$
$$END$
$$END$
$$IF$ (BENCFG12 == 1)
$$IF$ (EPADDR12 == 1)
$$IFN$ (EPATT12 == 1)
jnb FRXD1, F_EP2_TX
mov EPINDEX,#01
lCall Ep1RxLoopBack ; 82930 has received a packet from HC
lcall Ep1TxLoopBack
$$END$
$$END$
$$END$
$$IF$ (BENCFG13 == 1)
$$IF$ (EPADDR13 == 1)
$$IFN$ (EPATT13 == 1)
jnb FRXD1, F_EP2_TX
mov EPINDEX,#01
lCall Ep1RxLoopBack ; 82930 has received a packet from HC
lcall Ep1TxLoopBack
$$END$
$$END$
$$END$
$$IF$ (BENCFG14 == 1)
$$IF$ (EPADDR14 == 1)
$$IFN$ (EPATT14 == 1)
jnb FRXD1, F_EP2_TX
mov EPINDEX,#01
lCall Ep1RxLoopBack ; 82930 has received a packet from HC
lcall Ep1TxLoopBack
$$END$
$$END$
$$END$
$$IF$ (BENCFG15 == 1)
$$IF$ (EPADDR15 == 1)
$$IFN$ (EPATT15 == 1)
jnb FRXD1, F_EP2_TX
mov EPINDEX,#01
lCall Ep1RxLoopBack ; 82930 has received a packet from HC
lcall Ep1TxLoopBack
$$END$
$$END$
$$END$
$$IF$ (BENCFG16 == 1)
$$IF$ (EPADDR16 == 1)
$$IFN$ (EPATT16 == 1)
jnb FRXD1, F_EP2_TX
mov EPINDEX,#01
lCall Ep1RxLoopBack ; 82930 has received a packet from HC
lcall Ep1TxLoopBack
$$END$
$$END$
$$END$
F_EP2_TX:
$$IF$ (BENCFG11 == 1)
$$IF$ (EPADDR11 == 130)
$$IFN$ (EPATT11 == 1)
jnb FTXD2, F_EP2_RX
mov EPINDEX,#02
lcall Ep2TxLoopBack
jb RXFIF0, GetEp2RxData ; If data is pending in the FIFOs go get it.
jb RXFIF1, GetEp2RxData ; This is quicker than calling the routines.
ljmp F_EP2_RX ; Look at all Interrupt flags again
GetEp2RxData:
lCall Ep2RxLoopBack ; 82930 has received a packet from HC
$$END$
$$END$
$$END$
$$IF$ (BENCFG12 == 1)
$$IF$ (EPADDR12 == 130)
$$IFN$ (EPATT12 == 1)
jnb FTXD2, F_EP2_RX
mov EPINDEX,#02
lcall Ep2TxLoopBack
jb RXFIF0, GetEp2RxData ; If data is pending in the FIFOs go get it.
jb RXFIF1, GetEp2RxData ; This is quicker than calling the routines.
ljmp F_EP2_RX ; Look at all Interrupt flags again
GetEp2RxData:
lCall Ep2RxLoopBack ; 82930 has received a packet from HC
$$END$
$$END$
$$END$
$$IF$ (BENCFG13 == 1)
$$IF$ (EPADDR13 == 130)
$$IFN$ (EPATT13 == 1)
jnb FTXD2, F_EP2_RX
mov EPINDEX,#02
lcall Ep2TxLoopBack
jb RXFIF0, GetEp2RxData ; If data is pending in the FIFOs go get it.
jb RXFIF1, GetEp2RxData ; This is quicker than calling the routines.
ljmp F_EP2_RX ; Look at all Interrupt flags again
GetEp2RxData:
lCall Ep2RxLoopBack ; 82930 has received a packet from HC
$$END$
$$END$
$$END$
$$IF$ (BENCFG14 == 1)
$$IF$ (EPADDR14 == 130)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -