; 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\dma_scattergather.o --asm_dir=..\List\ --list_dir=..\List\ --depend=..\output\dma_scattergather.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\dma_scattergather.crf ..\Apps\DMA_ScatterGather.c]
                          THUMB

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

                          REQUIRE _printf_percent
                          REQUIRE _printf_widthprec
                          REQUIRE _printf_s
                          REQUIRE _printf_str
                  DMA_ScatterGather_Function PROC
;;;15     
;;;16     void DMA_ScatterGather_Function(void)
000000  b090              SUB      sp,sp,#0x40
;;;17     {
;;;18       DMA_InitTypeDef DMA_InitStruct; //定义DMA初始化结构体变量
;;;19       TIM_TimeBaseInitTypeDef TIM_TimeBaseInitStruct;
;;;20     
;;;21       const uint8_t* DMA_ScatterGather_ScatterSrc[] =
000002  4848              LDR      r0,|L1.292|
000004  ab0a              ADD      r3,sp,#0x28
000006  c807              LDM      r0,{r0-r2}
000008  c307              STM      r3!,{r0-r2}
;;;22       {
;;;23         DMA_ScatterGather_Data1, DMA_ScatterGather_Data2,
;;;24         DMA_ScatterGather_Data3
;;;25       };
;;;26       uint8_t DMA_ScatterGather_GatherDst[12];
;;;27     
;;;28       /* 使能TIM1时钟 */
;;;29       RCC_APB0Cmd(ENABLE);
00000a  2001              MOVS     r0,#1
00000c  f7fffffe          BL       RCC_APB0Cmd
;;;30       RCC_APB0PeriphClockCmd(RCC_APB0Periph_TIM1, ENABLE);
000010  2101              MOVS     r1,#1
000012  2002              MOVS     r0,#2
000014  f7fffffe          BL       RCC_APB0PeriphClockCmd
;;;31       /* 使能DMA的时钟 */
;;;32       RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA, ENABLE);
000018  2101              MOVS     r1,#1
00001a  4608              MOV      r0,r1
00001c  f7fffffe          BL       RCC_AHBPeriphClockCmd
;;;33     
;;;34       /* TIM配置结构体初始化 */
;;;35       TIM_TimeBaseStructInit(&TIM_TimeBaseInitStruct);
000020  a807              ADD      r0,sp,#0x1c
000022  f7fffffe          BL       TIM_TimeBaseStructInit
;;;36       /* 设置TIM配置结构体 */
;;;37       TIM_TimeBaseInitStruct.TIM_CounterMode = TIM_CounterMode_Up;	//TIM工作在向上计数模式
000026  2400              MOVS     r4,#0
000028  4668              MOV      r0,sp
00002a  8404              STRH     r4,[r0,#0x20]
;;;38       TIM_TimeBaseInitStruct.TIM_EXENX = TIM_EXENX_Disable;	//外部重加载管脚失能
00002c  8444              STRH     r4,[r0,#0x22]
;;;39     #if defined(SC32f10xx)||defined(SC32f12xx)
;;;40       TIM_TimeBaseInitStruct.TIM_Preload = 65535-(32000000 / 1000);	//设置TIM的定时器频率为1000Hz@APB0Clock=32M                                                                   //TIM向上计数时，重载值=65536-(TIM时钟频率/1000000*TIM定时频率)
00002e  493e              LDR      r1,|L1.296|
000030  8481              STRH     r1,[r0,#0x24]
;;;41     #endif	
;;;42       TIM_TimeBaseInitStruct.TIM_Prescaler = TIM_PRESCALER_2;	//TIM分频为2分频
000032  26ff              MOVS     r6,#0xff
000034  3601              ADDS     r6,#1
000036  8386              STRH     r6,[r0,#0x1c]
;;;43       TIM_TimeBaseInitStruct.TIM_WorkMode = TIM_WorkMode_Timer;	//TIM工作在定时器模式，时钟源为APB0时钟
;;;44       /* TIM时基配置 */
;;;45       TIM_TIMBaseInit(TIM1, &TIM_TimeBaseInitStruct);
000038  4d3c              LDR      r5,|L1.300|
00003a  83c4              STRH     r4,[r0,#0x1e]         ;43
00003c  a907              ADD      r1,sp,#0x1c
00003e  4628              MOV      r0,r5
000040  f7fffffe          BL       TIM_TIMBaseInit
;;;46       TIM_DMACmd(TIM1, TIM_DMAReq_TI, ENABLE);
000044  2201              MOVS     r2,#1
000046  2110              MOVS     r1,#0x10
000048  4628              MOV      r0,r5
00004a  f7fffffe          BL       TIM_DMACmd
;;;47       TIM_Cmd(TIM1, ENABLE);
00004e  2101              MOVS     r1,#1
000050  4628              MOV      r0,r5
000052  f7fffffe          BL       TIM_Cmd
;;;48     
;;;49       /* DMA外设配置 */
;;;50       DMA_StructInit(&DMA_InitStruct);
000056  4668              MOV      r0,sp
000058  f7fffffe          BL       DMA_StructInit
;;;51       DMA_InitStruct.DMA_BufferSize = 4;	//DMA搬运数量为4个
00005c  2004              MOVS     r0,#4
;;;52       DMA_InitStruct.DMA_Burst = DMA_Burst_Disable;	//Brust模式关闭
00005e  9003              STR      r0,[sp,#0xc]
000060  4668              MOV      r0,sp
000062  8144              STRH     r4,[r0,#0xa]
;;;53       DMA_InitStruct.DMA_CircularMode = DMA_CircularMode_Enable;	//开启循环模式
000064  2110              MOVS     r1,#0x10
000066  8041              STRH     r1,[r0,#2]
;;;54       DMA_InitStruct.DMA_DataSize = DMA_DataSize_Byte;	//传输宽度为字节
;;;55       DMA_InitStruct.DMA_SourceMode = DMA_SourceMode_INC_CIRC;	//源地址循环递增
000068  2503              MOVS     r5,#3
00006a  8084              STRH     r4,[r0,#4]            ;54
00006c  02ad              LSLS     r5,r5,#10
00006e  8105              STRH     r5,[r0,#8]
;;;56       DMA_InitStruct.DMA_TargetMode = DMA_TargetMode_INC;	//目标地址递增
000070  80c6              STRH     r6,[r0,#6]
;;;57       DMA_InitStruct.DMA_SrcAddress = (uint32_t)0x00;	//不需要设置，通过DMA1自动传输
;;;58       DMA_InitStruct.DMA_DstAddress = (uint32_t)DMA_ScatterGather_GatherDst;	//设置目标地址
000072  a80d              ADD      r0,sp,#0x34
;;;59       DMA_InitStruct.DMA_Request = DMA_Request_TIM1_TI;	//TIM1触发DMA0
000074  9006              STR      r0,[sp,#0x18]
000076  2021              MOVS     r0,#0x21
000078  0600              LSLS     r0,r0,#24
;;;60       DMA_InitStruct.DMA_Priority = DMA_Priority_HIGH;	//设置优先级为高
00007a  9004              STR      r0,[sp,#0x10]
00007c  9405              STR      r4,[sp,#0x14]         ;59
00007e  2702              MOVS     r7,#2
000080  4668              MOV      r0,sp
;;;61       DMA_Init(DMA0, &DMA_InitStruct);
000082  4e2b              LDR      r6,|L1.304|
000084  8007              STRH     r7,[r0,#0]            ;60
000086  4669              MOV      r1,sp
000088  4630              MOV      r0,r6
00008a  f7fffffe          BL       DMA_Init
;;;62       DMA_DMACmd(DMA0, DMA_DMAReq_CHRQ, ENABLE);
00008e  2201              MOVS     r2,#1
000090  05d1              LSLS     r1,r2,#23
000092  4630              MOV      r0,r6
000094  f7fffffe          BL       DMA_DMACmd
;;;63     
;;;64     
;;;65       DMA_InitStruct.DMA_BufferSize = 3; 
000098  2003              MOVS     r0,#3
;;;66       DMA_InitStruct.DMA_CircularMode = DMA_CircularMode_Disable;	//关闭循环模式
00009a  9003              STR      r0,[sp,#0xc]
00009c  4668              MOV      r0,sp
00009e  8044              STRH     r4,[r0,#2]
;;;67       DMA_InitStruct.DMA_Burst = DMA_Burst_Disable;	//Brust模式关闭
0000a0  8144              STRH     r4,[r0,#0xa]
;;;68       DMA_InitStruct.DMA_DataSize = DMA_DataSize_Word;	//传输宽度为字
0000a2  2108              MOVS     r1,#8
0000a4  8081              STRH     r1,[r0,#4]
;;;69       DMA_InitStruct.DMA_TargetMode = DMA_TargetMode_FIXED;	//原地址循环递增
0000a6  80c4              STRH     r4,[r0,#6]
;;;70       DMA_InitStruct.DMA_SourceMode = DMA_SourceMode_INC_CIRC;	//目标地址不修改
0000a8  8105              STRH     r5,[r0,#8]
;;;71       DMA_InitStruct.DMA_SrcAddress = (uint32_t)&DMA_ScatterGather_ScatterSrc[0];	//设置后续传输地址
0000aa  a80a              ADD      r0,sp,#0x28
;;;72       DMA_InitStruct.DMA_DstAddress = (uint32_t)&DMA0->DMA_SADR;
;;;73       DMA_InitStruct.DMA_Request = DMA_Request_DMA0;	//TIM1触发TIM0
0000ac  9005              STR      r0,[sp,#0x14]
0000ae  200f              MOVS     r0,#0xf
0000b0  0680              LSLS     r0,r0,#26
;;;74       DMA_InitStruct.DMA_Priority = DMA_Priority_HIGH;	//设置优先级
0000b2  9004              STR      r0,[sp,#0x10]
;;;75     
;;;76       DMA_Init(DMA1, &DMA_InitStruct);
0000b4  4d1e              LDR      r5,|L1.304|
0000b6  9606              STR      r6,[sp,#0x18]         ;73
0000b8  4668              MOV      r0,sp                 ;74
0000ba  8007              STRH     r7,[r0,#0]            ;74
0000bc  3540              ADDS     r5,r5,#0x40
0000be  4669              MOV      r1,sp
0000c0  4628              MOV      r0,r5
0000c2  f7fffffe          BL       DMA_Init
;;;77     
;;;78       DMA_Cmd(DMA1, ENABLE);
0000c6  2101              MOVS     r1,#1
0000c8  4628              MOV      r0,r5
0000ca  f7fffffe          BL       DMA_Cmd
;;;79       DMA_SoftwareTrigger(DMA1);	//DMA0使能前，通过DMA1写入Data1个数组的地址
0000ce  4628              MOV      r0,r5
0000d0  f7fffffe          BL       DMA_SoftwareTrigger
;;;80     	
;;;81       DMA_Cmd(DMA0, ENABLE);
0000d4  2101              MOVS     r1,#1
0000d6  4630              MOV      r0,r6
0000d8  f7fffffe          BL       DMA_Cmd
0000dc  05bf              LSLS     r7,r7,#22             ;62
                  |L1.222|
;;;82     
;;;83       while(1)
;;;84       {
;;;85         if(DMA_GetFlagStatus(DMA1, DMA_FLAG_TCIF) == SET)
0000de  2102              MOVS     r1,#2
0000e0  4628              MOV      r0,r5
0000e2  f7fffffe          BL       DMA_GetFlagStatus
0000e6  2801              CMP      r0,#1
0000e8  d1f9              BNE      |L1.222|
;;;86         {
;;;87           DMA_DMACmd(DMA0, DMA_DMAReq_CHRQ, DISABLE);	//此时需要关闭DMA0的CHRQ，否则标志位不置起
0000ea  2200              MOVS     r2,#0
0000ec  4639              MOV      r1,r7
0000ee  4634              MOV      r4,r6
0000f0  4630              MOV      r0,r6
0000f2  f7fffffe          BL       DMA_DMACmd
                  |L1.246|
;;;88           while(DMA_GetFlagStatus(DMA0, DMA_FLAG_TCIF) == RESET);
0000f6  2102              MOVS     r1,#2
0000f8  4620              MOV      r0,r4
0000fa  f7fffffe          BL       DMA_GetFlagStatus
0000fe  2800              CMP      r0,#0
000100  d0f9              BEQ      |L1.246|
;;;89           DMA_Cmd(DMA0,DISABLE);        //DMA0失能
000102  2100              MOVS     r1,#0
000104  4620              MOV      r0,r4
000106  f7fffffe          BL       DMA_Cmd
;;;90           DMA_Cmd(DMA1,DISABLE);        //DMA1失能
00010a  2100              MOVS     r1,#0
00010c  4628              MOV      r0,r5
00010e  f7fffffe          BL       DMA_Cmd
;;;91           DMA_ClearFlag(DMA0, DMA_FLAG_TCIF);
000112  2102              MOVS     r1,#2
000114  4620              MOV      r0,r4
000116  f7fffffe          BL       DMA_ClearFlag
;;;92           printf("ScatterGather模式下搬运完成数据：%.12s。\r\n", DMA_ScatterGather_GatherDst);
00011a  a90d              ADD      r1,sp,#0x34
00011c  a005              ADR      r0,|L1.308|
00011e  f7fffffe          BL       __2printf
000122  e7dc              B        |L1.222|
;;;93         }
;;;94       }
;;;95     }
                          ENDP

                  |L1.292|
                          DCD      ||.constdata||
                  |L1.296|
                          DCD      0x000082ff
                  |L1.300|
                          DCD      0x40020140
                  |L1.304|
                          DCD      0x40010800
                  |L1.308|
000134  53636174          DCB      "ScatterGather",196,163,202,189,207,194,176,225,212,203,205
000138  74657247
00013c  61746865
000140  72c4a3ca
000144  bdcfc2b0
000148  e1d4cbcd
00014c  eab3c9ca          DCB      234,179,201,202,253,190,221,163,186,"%.12s",161,163,"\r\n"
000150  fdbedda3
000154  ba252e31
000158  3273a1a3
00015c  0d0a    
00015e  00                DCB      0
00015f  00                DCB      0

                          AREA ||.constdata||, DATA, READONLY, ALIGN=2

                          DCD      DMA_ScatterGather_Data1
                          DCD      DMA_ScatterGather_Data2
                          DCD      DMA_ScatterGather_Data3

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

                  DMA_ScatterGather_Data1
000000  41424344          DCB      0x41,0x42,0x43,0x44
000004  4546              DCB      0x45,0x46

                          AREA ||area_number.6||, DATA, ALIGN=0

                          EXPORTAS ||area_number.6||, ||.data||
                  DMA_ScatterGather_Data2
000000  61626364          DCB      0x61,0x62,0x63,0x64
000004  6566              DCB      0x65,0x66

                          AREA ||area_number.7||, DATA, ALIGN=0

                          EXPORTAS ||area_number.7||, ||.data||
                  DMA_ScatterGather_Data3
000000  31323334          DCB      0x31,0x32,0x33,0x34
000004  3536              DCB      0x35,0x36

;*** Start embedded assembler ***

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

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

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
