73x_vect.s

来自「最新版IAR FOR ARM(EWARM)5.11中的代码例子」· S 代码 · 共 1,404 行 · 第 1/4 页

S
1,404
字号

;*******************************************************************************
;* Function Name  : FIQHandler
;* Description    : This function is called when FIQ
;                   exception is entered.
;* Input          : none
;* Output         : none
;*******************************************************************************

FIQHandler
        SUB    lr,lr,#4       ; Update the link register.
        SaveContext r0,r7     ; Save the workspace plus the current
                              ; return address lr_ fiq and spsr_fiq.
        ldr r0, =FIQ_Handler
        ldr lr,=FIQ_Handler_end
        bx      r0            ; Branch to FIQ_Handler.
FIQ_Handler_end:
        RestoreContext r0,r7  ; Restore the context and return to the...
                              ; ...program execution.

;*******************************************************************************
;* Macro Name     : IRQ_to_SYS
;* Description    : This macro used to switch form IRQ mode to SYS mode
;* Input          : none.
;* Output         : none
;*******************************************************************************
IRQ_to_SYS  MACRO
        MSR    cpsr_c,#0x1F
        STMFD  sp!,{lr}
       ENDM
;*******************************************************************************
;* Macro Name     : SYS_to_IRQ
;* Description    : This macro used to switch from SYS mode to IRQ mode
;* Input          : none.
;* Output         : none
;*******************************************************************************
SYS_to_IRQ MACRO
        LDMFD  sp!,{lr}
        MSR    cpsr_c,#0xD2
        MOV    pc,lr
       ENDM
;*******************************************************************************
;* Function Name  : PRCCUCMUIRQHandler
;* Description    : This function used to switch to SYS mode before entering
;                   the PRCCUCMUIRQHandler function located in 73x_it.c.
;                   Then to return to IRQ mode after the
;                   PRCCUCMUIRQHandler function termination.
;* Input          : none
;* Output         : none
;*******************************************************************************
PRCCUCMUIRQHandler
        IRQ_to_SYS
        ldr r0, =PRCCUCMU_IRQHandler
        ldr lr,=PRCCUCMU_IRQHandler_end
        bx     r0
PRCCUCMU_IRQHandler_end:
        SYS_to_IRQ

;*******************************************************************************
;* Function Name  : EXTIT01IRQHandler
;* Description    : This function used to switch to SYS mode before entering
;                   the EXTIT01IRQHandler function located in 73x_it.c.
;                   Then to return to IRQ mode after the
;                   EXTIT01IRQHandler function termination.
;* Input          : none
;* Output         : none
;*******************************************************************************
EXTIT01IRQHandler
        IRQ_to_SYS
        ldr r0, =EXTIT01_IRQHandler
        ldr lr,=EXTIT01_IRQHandler_end
        bx     r0
EXTIT01_IRQHandler_end:
        SYS_to_IRQ

;*******************************************************************************
;* Function Name  : EXTIT02IRQHandler
;* Description    : This function used to switch to SYS mode before entering
;                   the EXTIT02IRQHandler function located in 73x_it.c.
;                   Then to return to IRQ mode after the
;                   EXTIT02IRQHandler function termination.
;* Input          : none
;* Output         : none
;*******************************************************************************
EXTIT02IRQHandler
        IRQ_to_SYS
        ldr r0, =EXTIT02_IRQHandler
        ldr lr,=EXTIT02_IRQHandler_end
        bx     r0
EXTIT02_IRQHandler_end:
        SYS_to_IRQ

;*******************************************************************************
;* Function Name  : EXTIT03IRQHandler
;* Description    : This function used to switch to SYS mode before entering
;                   the EXTIT03IRQHandler function located in 73x_it.c.
;                   Then to return to IRQ mode after the
;                   EXTIT03IRQHandler function termination.
;* Input          : none
;* Output         : none
;*******************************************************************************
EXTIT03IRQHandler
        IRQ_to_SYS
        ldr r0, =EXTIT03_IRQHandler
        ldr lr,=EXTIT03_IRQHandler_end
        bx     r0
EXTIT03_IRQHandler_end:
        SYS_to_IRQ

;*******************************************************************************
;* Function Name  : EXTIT04IRQHandler
;* Description    : This function used to switch to SYS mode before entering
;                   the EXTIT04IRQHandler function located in 73x_it.c.
;                   Then to return to IRQ mode after the
;                   EXTIT04IRQHandler function termination.
;* Input          : none
;* Output         : none
;*******************************************************************************
EXTIT04IRQHandler
        IRQ_to_SYS
        ldr r0, =EXTIT04_IRQHandler
        ldr lr,=EXTIT04_IRQHandler_end
        bx     r0
EXTIT04_IRQHandler_end:
        SYS_to_IRQ
;*******************************************************************************
;* Function Name  : EXTIT05IRQHandler
;* Description    : This function used to switch to SYS mode before entering
;                   the EXTIT05IRQHandler function located in 73x_it.c.
;                   Then to return to IRQ mode after the
;                   EXTIT05IRQHandler function termination.
;* Input          : none
;* Output         : none
;*******************************************************************************
EXTIT05IRQHandler
        IRQ_to_SYS
        ldr r0, =EXTIT05_IRQHandler
        ldr lr,=EXTIT05_IRQHandler_end
        bx     r0
EXTIT05_IRQHandler_end:
        SYS_to_IRQ

;*******************************************************************************
;* Function Name  : EXTIT06IRQHandler
;* Description    : This function used to switch to SYS mode before entering
;                   the EXTIT06IRQHandler function located in 73x_it.c.
;                   Then to return to IRQ mode after the
;                   EXTIT06IRQHandler function termination.
;* Input          : none
;* Output         : none
;*******************************************************************************
EXTIT06IRQHandler
        IRQ_to_SYS
        ldr r0, =EXTIT06_IRQHandler
        ldr lr,=EXTIT06_IRQHandler_end
        bx     r0
EXTIT06_IRQHandler_end:
        SYS_to_IRQ
;*******************************************************************************
;* Function Name  : EXTIT07IRQHandler
;* Description    : This function used to switch to SYS mode before entering
;                   the EXTIT07IRQHandler function located in 73x_it.c.
;                   Then to return to IRQ mode after the
;                   EXTIT07IRQHandler function termination.
;* Input          : none
;* Output         : none
;*******************************************************************************
EXTIT07IRQHandler
        IRQ_to_SYS
        ldr r0, =EXTIT07_IRQHandler
        ldr lr,=EXTIT07_IRQHandler_end
        bx     r0
EXTIT07_IRQHandler_end:
        SYS_to_IRQ

;*******************************************************************************
;* Function Name  : EXTIT08IRQHandler
;* Description    : This function used to switch to SYS mode before entering
;                   the EXTIT08IRQHandler function located in 73x_it.c.
;                   Then to return to IRQ mode after the
;                   EXTIT08IRQHandler function termination.
;* Input          : none
;* Output         : none
;*******************************************************************************
EXTIT08IRQHandler
        IRQ_to_SYS
        ldr r0, =EXTIT08_IRQHandler
        ldr lr,=EXTIT08_IRQHandler_end
        bx     r0
EXTIT08_IRQHandler_end:
        SYS_to_IRQ

;*******************************************************************************
;* Function Name  : EXTIT09IRQHandler
;* Description    : This function used to switch to SYS mode before entering
;                   the EXTIT09IRQHandler function located in 73x_it.c.
;                   Then to return to IRQ mode after the
;                   EXTIT09IRQHandler function termination.
;* Input          : none
;* Output         : none
;*******************************************************************************
EXTIT09IRQHandler
        IRQ_to_SYS
        ldr r0, =EXTIT09_IRQHandler
        ldr lr,=EXTIT09_IRQHandler_end
        bx     r0
EXTIT09_IRQHandler_end:
        SYS_to_IRQ
;*******************************************************************************
;* Function Name  : EXTIT10IRQHandler
;* Description    : This function used to switch to SYS mode before entering
;                   the EXTIT10IRQHandler function located in 73x_it.c.
;                   Then to return to IRQ mode after the
;                   EXTIT10IRQHandler function termination.
;* Input          : none
;* Output         : none
;*******************************************************************************
EXTIT10IRQHandler
        IRQ_to_SYS
        ldr r0, =EXTIT10_IRQHandler
        ldr lr,=EXTIT10_IRQHandler_end
        bx     r0
EXTIT10_IRQHandler_end:
        SYS_to_IRQ

;*******************************************************************************
;* Function Name  : EXTIT11IRQHandler
;* Description    : This function used to switch to SYS mode before entering
;                   the EXTIT11IRQHandler function located in 73x_it.c.
;                   Then to return to IRQ mode after the
;                   EXTIT11IRQHandler function termination.
;* Input          : none
;* Output         : none
;*******************************************************************************
EXTIT11IRQHandler
        IRQ_to_SYS
        ldr r0, =EXTIT11_IRQHandler
        ldr lr,=EXTIT11_IRQHandler_end
        bx     r0
EXTIT11_IRQHandler_end:
        SYS_to_IRQ

;*******************************************************************************
;* Function Name  : EXTIT12IRQHandler
;* Description    : This function used to switch to SYS mode before entering
;                   the EXTIT12IRQHandler function located in 73x_it.c.
;                   Then to return to IRQ mode after the
;                   EXTIT12IRQHandler function termination.
;* Input          : none
;* Output         : none
;*******************************************************************************
EXTIT12IRQHandler
        IRQ_to_SYS
        ldr r0, =EXTIT12_IRQHandler
        ldr lr,=EXTIT12_IRQHandler_end
        bx     r0
EXTIT12_IRQHandler_end:
        SYS_to_IRQ

;*******************************************************************************
;* Function Name  : EXTIT13IRQHandler
;* Description    : This function used to switch to SYS mode before entering
;                   the EXTIT13IRQHandler function located in 73x_it.c.
;                   Then to return to IRQ mode after the
;                   EXTIT13IRQHandler function termination.
;* Input          : none
;* Output         : none
;*******************************************************************************
EXTIT13IRQHandler
        IRQ_to_SYS
        ldr r0, =EXTIT13_IRQHandler
        ldr lr,=EXTIT13_IRQHandler_end
        bx     r0
EXTIT13_IRQHandler_end:
        SYS_to_IRQ

;*******************************************************************************
;* Function Name  : EXTIT14IRQHandler
;* Description    : This function used to switch to SYS mode before entering
;                   the EXTIT14IRQHandler function located in 73x_it.c.
;                   Then to return to IRQ mode after the
;                   EXTIT14IRQHandler function termination.
;* Input          : none
;* Output         : none
;*******************************************************************************
EXTIT14IRQHandler
        IRQ_to_SYS
        ldr r0, =EXTIT14_IRQHandler
        ldr lr,=EXTIT14_IRQHandler_end
        bx     r0
EXTIT14_IRQHandler_end:
        SYS_to_IRQ

;*******************************************************************************
;* Function Name  : EXTIT15IRQHandler
;* Description    : This function used to switch to SYS mode before entering
;                   the EXTIT15IRQHandler function located in 73x_it.c.
;                   Then to return to IRQ mode after the
;                   EXTIT15IRQHandler function termination.
;* Input          : none
;* Output         : none
;*******************************************************************************
EXTIT15IRQHandler
        IRQ_to_SYS
        ldr r0, =EXTIT15_IRQHandler
        ldr lr,=EXTIT15_IRQHandler_end
        bx     r0
EXTIT15_IRQHandler_end:
        SYS_to_IRQ

;*******************************************************************************
;* Function Name  : DMATRERRIRQHandler
;* Description    : This function used to switch to SYS mode before entering
;                   the DMATRERRIRQHandler function located in 73x_it.c.
;                   Then to return to IRQ mode after the
;                   DMATRERRIRQHandler function termination.
;* Input          : none
;* Output         : none
;*******************************************************************************
DMATRERRIRQHandler
        IRQ_to_SYS
        ldr r0, =DMATRERR_IRQHandler
        ldr lr,=DMATRERR_IRQHandler_end
        bx     r0
DMATRERR_IRQHandler_end:
       SYS_to_IRQ

;*******************************************************************************
;* Function Name  : TIM1IRQHandler
;* Description    : This function used to switch to SYS mode before entering
;                   the TIM1IRQHandler function located in 73x_it.c.
;                   Then to return to IRQ mode after the
;                   TIM1IRQHandler function termination.
;* Input          : none
;* Output         : none
;*******************************************************************************
TIM1IRQHandler
        IRQ_to_SYS
        ldr r0, =TIM1_IRQHandler
        ldr lr,=TIM1_IRQHandler_end
        bx     r0
TIM1_IRQHandler_end:
        SYS_to_IRQ

;*******************************************************************************
;* Function Name  : TIM2IRQHandler
;* Description    : This function used to switch to SYS mode before entering
;                   the TIM2IRQHandler function located in 73x_it.c.
;                   Then to return to IRQ mode after the
;                   TIM2IRQHandler function termination.
;* Input          : none

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?