?? interrupt_timer.lst
字號:
##############################################################################
# #
# IAR ARM ANSI C/C++ Compiler V4.30A/W32 KICKSTART 02/Nov/2005 11:33:36 #
# Copyright 1999-2005 IAR Systems. All rights reserved. #
# #
# Cpu mode = interwork #
# Endian = little #
# Stack alignment = 4 #
# Source file = E:\SAM7X\AT91_SAM7X256-IAR\AT91SAM7X256-Interrupt-IA #
# R4_30A-1_2\AT91SAM7X-Interrupt\src\interrupt_timer.c #
# Command line = E:\SAM7X\AT91_SAM7X256-IAR\AT91SAM7X256-Interrupt-IA #
# R4_30A-1_2\AT91SAM7X-Interrupt\src\interrupt_timer.c #
# -lC E:\SAM7X\AT91_SAM7X256-IAR\AT91SAM7X256-Interru #
# pt-IAR4_30A-1_2\AT91SAM7X-Interrupt\compil\FLASH_FLA #
# SH\List\ -o E:\SAM7X\AT91_SAM7X256-IAR\AT91SAM7X256- #
# Interrupt-IAR4_30A-1_2\AT91SAM7X-Interrupt\compil\FL #
# ASH_FLASH\Obj\ -z9 --debug --cpu_mode thumb #
# --endian little --cpu ARM7TDMI --stack_align 4 #
# --interwork -e --fpu None --dlib_config "D:\Program #
# Files\IAR Systems\Embedded Workbench 4.0 #
# Kickstart\arm\LIB\dl4tptinl8n.h" -I #
# E:\SAM7X\AT91_SAM7X256-IAR\AT91SAM7X256-Interrupt-IA #
# R4_30A-1_2\AT91SAM7X-Interrupt\compil\srcIAR\ -I #
# E:\SAM7X\AT91_SAM7X256-IAR\AT91SAM7X256-Interrupt-IA #
# R4_30A-1_2\AT91SAM7X-Interrupt\compil\..\src\ -I #
# E:\SAM7X\AT91_SAM7X256-IAR\AT91SAM7X256-Interrupt-IA #
# R4_30A-1_2\AT91SAM7X-Interrupt\compil\..\..\ -I #
# "D:\Program Files\IAR Systems\Embedded Workbench #
# 4.0 Kickstart\arm\INC\" #
# List file = E:\SAM7X\AT91_SAM7X256-IAR\AT91SAM7X256-Interrupt-IA #
# R4_30A-1_2\AT91SAM7X-Interrupt\compil\FLASH_FLASH\Li #
# st\interrupt_timer.lst #
# Object file = E:\SAM7X\AT91_SAM7X256-IAR\AT91SAM7X256-Interrupt-IA #
# R4_30A-1_2\AT91SAM7X-Interrupt\compil\FLASH_FLASH\Ob #
# j\interrupt_timer.r79 #
# #
# #
##############################################################################
E:\SAM7X\AT91_SAM7X256-IAR\AT91SAM7X256-Interrupt-IAR4_30A-1_2\AT91SAM7X-Interrupt\src\interrupt_timer.c
1 // ----------------------------------------------------------------------------
2 // ATMEL Microcontroller Software Support - ROUSSET -
3 // ----------------------------------------------------------------------------
4 // DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
5 // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
7 // DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
8 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
10 // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
11 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
12 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
13 // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14 // ----------------------------------------------------------------------------
15 // File Name : interrupt_timer.c
16 // Object : Timer interrupt management
17 // : Use AT91B_LED7 & AT91B_LED8 for status interrupt
18 // Creation : JPP 08-Sep-2005
19 // ----------------------------------------------------------------------------
20
21 // Include Standard LIB files
22 #include "project.h"
\ In segment CODE, align 4, keep-with-next
\ __??Code16?? __code __interwork __atpcs unsigned int AT91F_AIC_ConfigureIt(AT91PS_AIC, unsigned int, unsigned int, unsigned int, void (*)())
\ AT91F_AIC_ConfigureIt:
\ 00000000 F4B4 PUSH {R2,R4-R7}
\ 00000002 021C MOV R2,R0
\ 00000004 0C1C MOV R4,R1
\ 00000006 059E LDR R6,[SP, #+0x14]
\ 00000008 8900 LSL R1,R1,#+0x2
\ 0000000A 4718 ADD R7,R0,R1
\ 0000000C 8037 ADD R7,#+0x80
\ 0000000E 3868 LDR R0,[R7, #+0]
\ 00000010 0125 MOV R5,#+0x1
\ 00000012 A540 LSL R5,R4
\ 00000014 2C1C MOV R4,R5
\ 00000016 9225 MOV R5,#+0x92
\ 00000018 6D00 LSL R5,R5,#+0x1 ;; #+0x124
\ 0000001A 5519 ADD R5,R2,R5
\ 0000001C 2C60 STR R4,[R5, #+0]
\ 0000001E 3E60 STR R6,[R7, #+0]
\ 00000020 009E LDR R6,[SP, #+0]
\ 00000022 1E43 ORR R6,R3
\ 00000024 5650 STR R6,[R2, R1]
\ 00000026 6C60 STR R4,[R5, #+0x4]
\ 00000028 F8BC POP {R3-R7}
\ 0000002A 7047 BX LR ;; return
23
24 //* Global variable
25 extern int count_timer0_interrupt;
26 extern int count_timer1_interrupt;
27
28 #define TIMER0_INTERRUPT_LEVEL 1
29 #define TIMER1_INTERRUPT_LEVEL 7
30
31 /*-----------------*/
32 /* Clock Selection */
33 /*-----------------*/
34 #define TC_CLKS 0x7
35 #define TC_CLKS_MCK2 0x0
36 #define TC_CLKS_MCK8 0x1
37 #define TC_CLKS_MCK32 0x2
38 #define TC_CLKS_MCK128 0x3
39 #define TC_CLKS_MCK1024 0x4
40
41 //#define DEBUG
42
43 #ifdef DEBUG
44 static AT91PS_USART COM0 = AT91C_BASE_US0;
45 #endif
46
47 //*------------------------- Internal Function --------------------------------
48 //*----------------------------------------------------------------------------
49 //* Function Name : AT91F_TC_Open
50 //* Object : Initialize Timer Counter Channel and enable is clock
51 //* Input Parameters : <tc_pt> = TC Channel Descriptor Pointer
52 //* <mode> = Timer Counter Mode
53 //* : <TimerId> = Timer peripheral ID definitions
54 //* Output Parameters : None
55 //*----------------------------------------------------------------------------
\ In segment CODE, align 4, keep-with-next
56 void AT91F_TC_Open ( AT91PS_TC TC_pt, unsigned int Mode, unsigned int TimerId)
57 //* Begin
58 {
\ AT91F_TC_Open:
\ 00000000 10B4 PUSH {R4}
59 unsigned int dummy;
60
61 //* First, enable the clock of the TIMER
62 AT91F_PMC_EnablePeriphClock ( AT91C_BASE_PMC, 1<< TimerId ) ;
\ 00000002 074B LDR R3,??AT91F_TC_Open_0 ;; 0xfffffc10
\ 00000004 0124 MOV R4,#+0x1
\ 00000006 9440 LSL R4,R2
\ 00000008 1C60 STR R4,[R3, #+0]
63
64 //* Disable the clock and the interrupts
65 TC_pt->TC_CCR = AT91C_TC_CLKDIS ;
\ 0000000A 0222 MOV R2,#+0x2
\ 0000000C 0260 STR R2,[R0, #+0]
66 TC_pt->TC_IDR = 0xFFFFFFFF ;
\ 0000000E 0022 MOV R2,#+0
\ 00000010 D243 MVN R2,R2 ;; #-1
\ 00000012 8262 STR R2,[R0, #+0x28]
67
68 //* Clear status bit
69 dummy = TC_pt->TC_SR;
\ 00000014 026A LDR R2,[R0, #+0x20]
70 //* Suppress warning variable "dummy" was set but never used
71 dummy = dummy;
72 //* Set the Mode of the Timer Counter
73 TC_pt->TC_CMR = Mode ;
\ 00000016 4160 STR R1,[R0, #+0x4]
74
75 //* Enable the clock
76 TC_pt->TC_CCR = AT91C_TC_CLKEN ;
\ 00000018 0121 MOV R1,#+0x1
\ 0000001A 0160 STR R1,[R0, #+0]
77 //* End
78 }
\ 0000001C 10BC POP {R4}
\ 0000001E 7047 BX LR ;; return
\ ??AT91F_TC_Open_0:
\ 00000020 10FCFFFF DC32 0xfffffc10
79 //*------------------------- Interrupt Function -------------------------------
80
81 //*----------------------------------------------------------------------------
82 //* Function Name : timer0_c_irq_handler
83 //* Object : C handler interrupt function calAT91B_LED by the interrupts
84 //* assembling routine
85 //* Output Parameters : increment count_timer0_interrupt
86 //*----------------------------------------------------------------------------
\ In segment CODE_I, align 4, keep-with-next
87 __ramfunc void timer0_c_irq_handler(void)
88 {
89 AT91PS_TC TC_pt = AT91C_BASE_TC0;
90 unsigned int dummy;
91 //* AcknowAT91B_LEDge interrupt status
92 dummy = TC_pt->TC_SR;
\ timer0_c_irq_handler:
\ 00000000 0548 LDR R0,??timer0_c_irq_handler_0 ;; 0xfffa0020
\ 00000002 0068 LDR R0,[R0, #+0]
93 //* Suppress warning variable "dummy" was set but never used
94 dummy = dummy;
95 count_timer0_interrupt++;
\ 00000004 0548 LDR R0,??timer0_c_irq_handler_0+0x4 ;; count_timer0_interrupt
\ 00000006 0168 LDR R1,[R0, #+0]
\ 00000008 491C ADD R1,R1,#+0x1
\ 0000000A 0160 STR R1,[R0, #+0]
96 //* Read the output state
97 if ( (AT91F_PIO_GetInput(AT91C_BASE_PIOB) & AT91B_LED3 ) == AT91B_LED3 )
\ 0000000C .... LDR R0,??DataTable1 ;; 0xfffff63c
\ 0000000E 0068 LDR R0,[R0, #+0]
\ 00000010 8021 MOV R1,#+0x80
\ 00000012 8903 LSL R1,R1,#+0xE ;; #+0x200000
\ 00000014 .... B ?Subroutine4
\ 00000016 C046 NOP
\ ??timer0_c_irq_handler_0:
\ 00000018 2000FAFF DC32 0xfffa0020
\ 0000001C ........ DC32 count_timer0_interrupt
98 {
99 AT91F_PIO_ClearOutput( AT91C_BASE_PIOB, AT91B_LED3 );
100 }
101 else
102 {
103 AT91F_PIO_SetOutput( AT91C_BASE_PIOB, AT91B_LED3 );
104 }
105 #ifdef DEBUG
106 AT91F_US_PutChar (COM0,'0');
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -