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

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

                  UART_Communication_Function PROC
;;;13     
;;;14     void UART_Communication_Function(void)
000000  b086              SUB      sp,sp,#0x18
;;;15     {
;;;16       uint8_t i;
;;;17       volatile uint16_t UART_RxData[5];                            //发送5个8位自定义数据（若要修改数据个数需修改相应数组大小和发送/接收for循环大小）
;;;18       UART_InitTypeDef UART_InitStruct;                             //定义UART初始化结构体变量
;;;19       
;;;20       /* 使能UART时钟 */
;;;21       RCC_APB1Cmd(ENABLE);                                          //UART0和1外设挂载在APB1时钟上
000002  2001              MOVS     r0,#1
000004  f7fffffe          BL       RCC_APB1Cmd
;;;22       RCC_APB1PeriphClockCmd(RCC_APB1Periph_UART2,ENABLE);          //开启UART2时钟
000008  2101              MOVS     r1,#1
00000a  2080              MOVS     r0,#0x80
00000c  f7fffffe          BL       RCC_APB1PeriphClockCmd
;;;23       
;;;24       UART_InitStruct.UART_BaudRate = 115200;	                //串口波特率为115200
000010  20e1              MOVS     r0,#0xe1
000012  0240              LSLS     r0,r0,#9
;;;25     #if defined(SC32f10xx)|| defined(SC32f12xx)
;;;26       UART_InitStruct.UART_ClockFrequency = 32000000;	        //APB时钟频率配置为32MHz
000014  9001              STR      r0,[sp,#4]
000016  481f              LDR      r0,|L1.148|
;;;27     
;;;28     #endif
;;;29       UART_InitStruct.UART_Mode = UART_Mode_10B;	                //工作在模式1
000018  9000              STR      r0,[sp,#0]
00001a  2001              MOVS     r0,#1
;;;30       
;;;31       /*  根据结构体配置初始化串口 */
;;;32       UART_Init(UART2,&UART_InitStruct);		
00001c  4d1e              LDR      r5,|L1.152|
00001e  9002              STR      r0,[sp,#8]
000020  4669              MOV      r1,sp
000022  4628              MOV      r0,r5
000024  f7fffffe          BL       UART_Init
;;;33       
;;;34       /* 使能串口接收中断 */
;;;35       UART_ITConfig(UART2,UART_IT_EN | UART_IT_RX,ENABLE);
000028  2201              MOVS     r2,#1
00002a  2103              MOVS     r1,#3
00002c  4628              MOV      r0,r5
00002e  f7fffffe          BL       UART_ITConfig
000032  4a1a              LDR      r2,|L1.156|
000034  2180              MOVS     r1,#0x80
000036  6011              STR      r1,[r2,#0]
;;;36     #if defined(SC32f12xx)
;;;37       NVIC_EnableIRQ(UART0_2_4_IRQn);
;;;38     #elif defined(SC32f10xx)
;;;39         NVIC_EnableIRQ(UART0_2_IRQn);
;;;40     #endif
;;;41       /* 使能接收发送口 */
;;;42       UART_TXCmd(UART2,ENABLE);
000038  2101              MOVS     r1,#1
00003a  4628              MOV      r0,r5
00003c  f7fffffe          BL       UART_TXCmd
;;;43       UART_RXCmd(UART2,ENABLE);
000040  2101              MOVS     r1,#1
000042  4628              MOV      r0,r5
000044  f7fffffe          BL       UART_RXCmd
;;;44       
;;;45       while(1)
;;;46       {
;;;47         /* UART2接收到5个8位数据 */
;;;48         for(i=0;i<5;i++)
;;;49         {
;;;50           while(UART_RxFlag == RESET);
000048  4f15              LDR      r7,|L1.160|
;;;51           UART_RxFlag = RESET;
;;;52           UART_RxData[i] = UART_ReceiveData(UART2);
00004a  ae03              ADD      r6,sp,#0xc
                  |L1.76|
00004c  2400              MOVS     r4,#0                 ;48
                  |L1.78|
00004e  7838              LDRB     r0,[r7,#0]            ;50  ; UART_RxFlag
000050  2800              CMP      r0,#0                 ;50
000052  d0fc              BEQ      |L1.78|
000054  2000              MOVS     r0,#0                 ;51
000056  7038              STRB     r0,[r7,#0]            ;51
000058  4628              MOV      r0,r5
00005a  f7fffffe          BL       UART_ReceiveData
00005e  0061              LSLS     r1,r4,#1
000060  5270              STRH     r0,[r6,r1]
000062  1c64              ADDS     r4,r4,#1
000064  b2e4              UXTB     r4,r4                 ;48
000066  2c05              CMP      r4,#5                 ;48
000068  d3f1              BCC      |L1.78|
;;;53         }
;;;54         /* UART2将接收到的数据发送出去 */
;;;55         for(i=0;i<5;i++)
00006a  2400              MOVS     r4,#0
                  |L1.108|
;;;56         {
;;;57           UART_SendData(UART2,UART_RxData[i]);
00006c  0060              LSLS     r0,r4,#1
00006e  5a31              LDRH     r1,[r6,r0]
000070  4628              MOV      r0,r5
000072  f7fffffe          BL       UART_SendData
                  |L1.118|
;;;58           while(UART_GetFlagStatus(UART2,UART_Flag_TX) == RESET);
000076  2102              MOVS     r1,#2
000078  4628              MOV      r0,r5
00007a  f7fffffe          BL       UART_GetFlagStatus
00007e  2800              CMP      r0,#0
000080  d0f9              BEQ      |L1.118|
;;;59           UART_ClearFlag(UART2,UART_Flag_TX);
000082  2102              MOVS     r1,#2
000084  4628              MOV      r0,r5
000086  f7fffffe          BL       UART_ClearFlag
00008a  1c64              ADDS     r4,r4,#1
00008c  b2e4              UXTB     r4,r4                 ;55
00008e  2c05              CMP      r4,#5                 ;55
000090  d3ec              BCC      |L1.108|
000092  e7db              B        |L1.76|
;;;60         }
;;;61       }
;;;62     }
;;;63     
                          ENDP

                  |L1.148|
                          DCD      0x01e84800
                  |L1.152|
                          DCD      0x40021020
                  |L1.156|
                          DCD      0xe000e100
                  |L1.160|
                          DCD      ||.data||

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

                  UART_Communication_UART2Handler PROC
;;;63     
;;;64     void UART_Communication_UART2Handler(void)
000000  b510              PUSH     {r4,lr}
;;;65     {
;;;66       if(UART_GetFlagStatus(UART2,UART_Flag_RX))
000002  4c07              LDR      r4,|L2.32|
000004  2101              MOVS     r1,#1
000006  4620              MOV      r0,r4
000008  f7fffffe          BL       UART_GetFlagStatus
00000c  2800              CMP      r0,#0
00000e  d006              BEQ      |L2.30|
;;;67       {
;;;68         UART_ClearFlag(UART2,UART_Flag_RX);
000010  2101              MOVS     r1,#1
000012  4620              MOV      r0,r4
000014  f7fffffe          BL       UART_ClearFlag
;;;69         UART_RxFlag = SET;
000018  4902              LDR      r1,|L2.36|
00001a  2001              MOVS     r0,#1
00001c  7008              STRB     r0,[r1,#0]
                  |L2.30|
;;;70       }
;;;71     }
00001e  bd10              POP      {r4,pc}
                          ENDP

                  |L2.32|
                          DCD      0x40021020
                  |L2.36|
                          DCD      ||.data||

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

                  UART_RxFlag
000000  00                DCB      0x00

;*** Start embedded assembler ***

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

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

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
