; generated by Component: ARM Compiler 5.06 update 7 (build 960) Tool: ArmCC [4d365d]
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave -o..\output\tim_ti_dma.o --asm_dir=..\List\ --list_dir=..\List\ --depend=..\output\tim_ti_dma.d --cpu=Cortex-M0+ --apcs=interwork --diag_suppress=9931 -I..\FWLib\SC32F1XXX_Lib\inc -I..\User\HeadFiles -I..\User -I..\Drivers -I..\Apps -I..\CMSIS -IF:\Users\SOC\AppData\Local\Arm\Packs\ARM\CMSIS\5.8.0\Device\ARM\ARMCM0plus\Include -D__UVISION_VERSION=536 -DARMCM0P -DSC32f10xx --omf_browse=..\output\tim_ti_dma.crf ..\Apps\TIM_TI_DMA.c]
                          THUMB

                          AREA ||i.TIM_TI_DMA_DMA0Handler||, CODE, READONLY, ALIGN=2

                  TIM_TI_DMA_DMA0Handler PROC
;;;80     
;;;81     void TIM_TI_DMA_DMA0Handler(void)
000000  b510              PUSH     {r4,lr}
;;;82     {
;;;83       if(DMA_GetFlagStatus(DMA0, DMA_FLAG_TCIF) == SET)
000002  4c07              LDR      r4,|L1.32|
000004  2102              MOVS     r1,#2
000006  4620              MOV      r0,r4
000008  f7fffffe          BL       DMA_GetFlagStatus
00000c  2801              CMP      r0,#1
00000e  d106              BNE      |L1.30|
;;;84       {
;;;85         DMA_ClearFlag(DMA0, DMA_FLAG_TCIF);
000010  2102              MOVS     r1,#2
000012  4620              MOV      r0,r4
000014  f7fffffe          BL       DMA_ClearFlag
;;;86         TIM_DMA_Flag = SET;
000018  4902              LDR      r1,|L1.36|
00001a  2001              MOVS     r0,#1
00001c  7008              STRB     r0,[r1,#0]
                  |L1.30|
;;;87       }
;;;88     }
00001e  bd10              POP      {r4,pc}
;;;89     
                          ENDP

                  |L1.32|
                          DCD      0x40010800
                  |L1.36|
                          DCD      ||.data||

                          AREA ||i.TIM_TI_DMA_Function||, CODE, READONLY, ALIGN=2

                          REQUIRE _printf_percent
                          REQUIRE _printf_s
                          REQUIRE _printf_str
                          REQUIRE _printf_str
                  TIM_TI_DMA_Function PROC
;;;16     
;;;17     void TIM_TI_DMA_Function(void)
000000  b08e              SUB      sp,sp,#0x38
;;;18     {
;;;19     
;;;20       TIM_TimeBaseInitTypeDef TIM_TimeBaseInitStruct; //定义TIM初始化结构体变量
;;;21       DMA_InitTypeDef DMA_InitStruct; //定义DMA初始化结构体变量
;;;22       uint8_t TIM_TI_DMA_DstData[10];
;;;23     
;;;24       /* 使能TIM0时钟 */
;;;25       RCC_APB0Cmd(ENABLE);
000002  2001              MOVS     r0,#1
000004  f7fffffe          BL       RCC_APB0Cmd
;;;26       RCC_APB0PeriphClockCmd(RCC_APB0Periph_TIM1, ENABLE);
000008  2101              MOVS     r1,#1
00000a  2002              MOVS     r0,#2
00000c  f7fffffe          BL       RCC_APB0PeriphClockCmd
;;;27       /* 使能DMA的时钟 */
;;;28       RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA, ENABLE);
000010  2101              MOVS     r1,#1
000012  4608              MOV      r0,r1
000014  f7fffffe          BL       RCC_AHBPeriphClockCmd
;;;29     
;;;30       /* TIM配置结构体初始化 */
;;;31       TIM_TimeBaseStructInit(&TIM_TimeBaseInitStruct);
000018  a80a              ADD      r0,sp,#0x28
00001a  f7fffffe          BL       TIM_TimeBaseStructInit
;;;32       /* 设置TIM配置结构体 */
;;;33       TIM_TimeBaseInitStruct.TIM_CounterMode = TIM_CounterMode_Up;	//TIM工作在向上计数模式
00001e  2400              MOVS     r4,#0
000020  4668              MOV      r0,sp
000022  8584              STRH     r4,[r0,#0x2c]
;;;34       TIM_TimeBaseInitStruct.TIM_EXENX = TIM_EXENX_Disable;	//外部重加载管脚失能
000024  85c4              STRH     r4,[r0,#0x2e]
;;;35     #if defined(SC32f10xx)||defined(SC32f12xx)
;;;36       TIM_TimeBaseInitStruct.TIM_Preload = 65535 - (32000000 / 1000);	//设置TIM的定时器评论为1000Hz@APB0Clock=32M
000026  492f              LDR      r1,|L2.228|
000028  8601              STRH     r1,[r0,#0x30]
;;;37     #endif
;;;38       TIM_TimeBaseInitStruct.TIM_Prescaler = TIM_PRESCALER_8;	//TIM分频为8分频,定时器频率为100HZ
00002a  2503              MOVS     r5,#3
00002c  022d              LSLS     r5,r5,#8
00002e  8505              STRH     r5,[r0,#0x28]
;;;39       TIM_TimeBaseInitStruct.TIM_WorkMode = TIM_WorkMode_Timer;	//TIM工作在定时器模式，时钟源为APB0时钟
;;;40       /* TIM时基配置 */
;;;41       TIM_TIMBaseInit(TIM1, &TIM_TimeBaseInitStruct);
000030  4e2d              LDR      r6,|L2.232|
000032  8544              STRH     r4,[r0,#0x2a]         ;39
000034  a90a              ADD      r1,sp,#0x28
000036  4630              MOV      r0,r6
000038  f7fffffe          BL       TIM_TIMBaseInit
;;;42       TIM_DMACmd(TIM1, TIM_DMAReq_TI, ENABLE);
00003c  2201              MOVS     r2,#1
00003e  2110              MOVS     r1,#0x10
000040  4630              MOV      r0,r6
000042  f7fffffe          BL       TIM_DMACmd
;;;43       TIM_Cmd(TIM1, ENABLE);
000046  2101              MOVS     r1,#1
000048  4630              MOV      r0,r6
00004a  f7fffffe          BL       TIM_Cmd
;;;44     
;;;45       /* DMA外设配置 */
;;;46       DMA_StructInit(&DMA_InitStruct);
00004e  4668              MOV      r0,sp
000050  f7fffffe          BL       DMA_StructInit
;;;47       DMA_InitStruct.DMA_BufferSize = 10;	//DMA搬运数量为10个
000054  200a              MOVS     r0,#0xa
;;;48       DMA_InitStruct.DMA_Burst = DMA_Burst_Disable;	//Brust模式关闭
000056  9003              STR      r0,[sp,#0xc]
000058  4668              MOV      r0,sp
00005a  8144              STRH     r4,[r0,#0xa]
;;;49       DMA_InitStruct.DMA_CircularMode = DMA_CircularMode_Disable;	//开启循环模式
00005c  8044              STRH     r4,[r0,#2]
;;;50       DMA_InitStruct.DMA_DataSize = DMA_DataSize_Byte;	//传输宽度为字节
00005e  8084              STRH     r4,[r0,#4]
;;;51       DMA_InitStruct.DMA_SourceMode = DMA_SourceMode_INC_CIRC;	//源地址循环递增
000060  00a9              LSLS     r1,r5,#2
000062  8101              STRH     r1,[r0,#8]
;;;52       DMA_InitStruct.DMA_TargetMode = DMA_TargetMode_INC_CIRC;	//目标地址递增循环
000064  80c5              STRH     r5,[r0,#6]
;;;53       DMA_InitStruct.DMA_SrcAddress = (uint32_t)&TIM_TI_DMA_SrcData;	//设置第一次传输的首地址
000066  4821              LDR      r0,|L2.236|
;;;54       DMA_InitStruct.DMA_DstAddress = (uint32_t)TIM_TI_DMA_DstData;	//设置目标地址
000068  9005              STR      r0,[sp,#0x14]
00006a  a807              ADD      r0,sp,#0x1c
;;;55       DMA_InitStruct.DMA_Request = DMA_Request_TIM1_TI;	//TIM1触发DMA0
00006c  9006              STR      r0,[sp,#0x18]
00006e  2021              MOVS     r0,#0x21
000070  0600              LSLS     r0,r0,#24
;;;56       DMA_InitStruct.DMA_Priority = DMA_Priority_HIGH;	//设置优先级为高
000072  9004              STR      r0,[sp,#0x10]
000074  2102              MOVS     r1,#2
000076  4668              MOV      r0,sp
000078  8001              STRH     r1,[r0,#0]
;;;57       DMA_Init(DMA0, &DMA_InitStruct);
00007a  4f1d              LDR      r7,|L2.240|
00007c  4669              MOV      r1,sp
00007e  4638              MOV      r0,r7
000080  f7fffffe          BL       DMA_Init
;;;58       /* 开启DMA相关的中断 */
;;;59       DMA_ITConfig(DMA0,DMA_IT_INTEN | DMA_IT_TCIE,ENABLE);
000084  2201              MOVS     r2,#1
000086  0229              LSLS     r1,r5,#8
000088  4638              MOV      r0,r7
00008a  f7fffffe          BL       DMA_ITConfig
00008e  4919              LDR      r1,|L2.244|
000090  14f0              ASRS     r0,r6,#19
000092  6008              STR      r0,[r1,#0]
;;;60       NVIC_EnableIRQ(DMA0_IRQn);
;;;61       memset(TIM_TI_DMA_DstData,0x00,11);	//把目标数据清理
000094  9407              STR      r4,[sp,#0x1c]
000096  9408              STR      r4,[sp,#0x20]
;;;62       DMA_Cmd(DMA0, ENABLE);
000098  2101              MOVS     r1,#1
00009a  4638              MOV      r0,r7
00009c  9409              STR      r4,[sp,#0x24]
00009e  f7fffffe          BL       DMA_Cmd
;;;63       
;;;64       printf("TIM DMA开始搬运，源数组数据为：%s。\r\n",TIM_TI_DMA_SrcData);
0000a2  4912              LDR      r1,|L2.236|
0000a4  a014              ADR      r0,|L2.248|
0000a6  f7fffffe          BL       __2printf
;;;65       while(1)
;;;66       {
;;;67         if(TIM_DMA_Flag == SET)
0000aa  4d10              LDR      r5,|L2.236|
0000ac  1e6d              SUBS     r5,r5,#1
                  |L2.174|
0000ae  7828              LDRB     r0,[r5,#0]  ; TIM_DMA_Flag
0000b0  2801              CMP      r0,#1
0000b2  d1fc              BNE      |L2.174|
;;;68         {
;;;69           printf("TIM DMA搬运完成，目标数组数据为：%s。\r\n",TIM_TI_DMA_DstData);
0000b4  a907              ADD      r1,sp,#0x1c
0000b6  a01a              ADR      r0,|L2.288|
0000b8  f7fffffe          BL       __2printf
;;;70           memset(TIM_TI_DMA_DstData,0x00,11);	//把目标数据清理
0000bc  9407              STR      r4,[sp,#0x1c]
0000be  9408              STR      r4,[sp,#0x20]
;;;71          
;;;72           /* 开启下一轮DMA传输 */
;;;73           DMA_SetCurrDataCounter(DMA0, 10);
0000c0  210a              MOVS     r1,#0xa
0000c2  4638              MOV      r0,r7
0000c4  9409              STR      r4,[sp,#0x24]
0000c6  f7fffffe          BL       DMA_SetCurrDataCounter
;;;74           TIM_DMACmd(TIM1,TIM_DMAReq_TI,DISABLE);
0000ca  2200              MOVS     r2,#0
0000cc  2110              MOVS     r1,#0x10
0000ce  4630              MOV      r0,r6
0000d0  f7fffffe          BL       TIM_DMACmd
;;;75           TIM_DMACmd(TIM1,TIM_DMAReq_TI,ENABLE);
0000d4  2201              MOVS     r2,#1
0000d6  2110              MOVS     r1,#0x10
0000d8  4630              MOV      r0,r6
0000da  f7fffffe          BL       TIM_DMACmd
;;;76           TIM_DMA_Flag = RESET;
0000de  702c              STRB     r4,[r5,#0]
0000e0  e7e5              B        |L2.174|
;;;77         }
;;;78       }
;;;79     }
;;;80     
                          ENDP

0000e2  0000              DCW      0x0000
                  |L2.228|
                          DCD      0x000082ff
                  |L2.232|
                          DCD      0x40020140
                  |L2.236|
                          DCD      ||.data||+0x1
                  |L2.240|
                          DCD      0x40010800
                  |L2.244|
                          DCD      0xe000e100
                  |L2.248|
0000f8  54494d20          DCB      "TIM DMA",191,170,202,188,176,225,212,203,163,172,212,180
0000fc  444d41bf
000100  aacabcb0
000104  e1d4cba3
000108  acd4b4  
00010b  cafdd7e9          DCB      202,253,215,233,202,253,190,221,206,170,163,186,"%s",161
00010f  cafdbedd
000113  ceaaa3ba
000117  2573a1  
00011a  a30d0a00          DCB      163,"\r\n",0
00011e  00                DCB      0
00011f  00                DCB      0
                  |L2.288|
000120  54494d20          DCB      "TIM DMA",176,225,212,203,205,234,179,201,163,172,196,191
000124  444d41b0
000128  e1d4cbcd
00012c  eab3c9a3
000130  acc4bf  
000133  b1eacafd          DCB      177,234,202,253,215,233,202,253,190,221,206,170,163,186,"%"
000137  d7e9cafd
00013b  beddceaa
00013f  a3ba25  
000142  73a1a30d          DCB      "s",161,163,"\r\n",0
000146  0a00    

                          AREA ||.data||, DATA, ALIGN=0

                  TIM_DMA_Flag
000000  00                DCB      0x00
                  TIM_TI_DMA_SrcData
000001  414243            DCB      0x41,0x42,0x43
000004  44454647          DCB      0x44,0x45,0x46,0x47
000008  48494a00          DCB      0x48,0x49,0x4a,0x00
                          DCDU     0x00000000
000010  00                DCB      0x00

;*** Start embedded assembler ***

#line 1 "..\\Apps\\TIM_TI_DMA.c"
	AREA ||.rev16_text||, CODE
	THUMB
	EXPORT |__asm___12_TIM_TI_DMA_c_9de29dc1____REV16|
#line 463 "..\\CMSIS\\cmsis_armcc.h"
|__asm___12_TIM_TI_DMA_c_9de29dc1____REV16| PROC
#line 464

 rev16 r0, r0
 bx lr
	ENDP
	AREA ||.revsh_text||, CODE
	THUMB
	EXPORT |__asm___12_TIM_TI_DMA_c_9de29dc1____REVSH|
#line 478
|__asm___12_TIM_TI_DMA_c_9de29dc1____REVSH| PROC
#line 479

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
