; generated by Component: ARM Compiler 5.05 update 1 (build 106) Tool: ArmCC [4d0efa]
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave -o..\output\sc32f1xxx_uart.o --asm_dir=..\List\ --list_dir=..\List\ --depend=..\output\sc32f1xxx_uart.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 -ID:\Keil5\ARM\Pack\Keil\SC32F10xx_DFP\1.0.0\Device\SC32F10xx\FWLib\SC32_Lib\inc -ID:\Keil5\ARM\Pack\Keil\SC32F10xx_DFP\1.0.0\Device\SH32F2xx\Include -D__UVISION_VERSION=538 -DSC32F10xx --omf_browse=..\output\sc32f1xxx_uart.crf ..\FWLib\SC32F1XXX_Lib\src\sc32f1xxx_uart.c]
                          THUMB

                          AREA ||i.UART_ClearFlag||, CODE, READONLY, ALIGN=1

                  UART_ClearFlag PROC
;;;325     */
;;;326    void UART_ClearFlag(UART_TypeDef* UARTx, uint16_t UART_FLAG)
000000  6041              STR      r1,[r0,#4]
;;;327    {
;;;328      /* Check the parameters */
;;;329      assert_param(IS_UART_ALL_PERIPH(UARTx));
;;;330    
;;;331      /* Clear the flags */
;;;332      UARTx->UART_STS = (uint16_t)UART_FLAG;
;;;333    }
000002  4770              BX       lr
;;;334    
                          ENDP


                          AREA ||i.UART_DMACmd||, CODE, READONLY, ALIGN=1

                  UART_DMACmd PROC
;;;343     */
;;;344    void UART_DMACmd(UART_TypeDef* UARTx, uint16_t UART_DMAReq, FunctionalState NewState)
000000  2a00              CMP      r2,#0
;;;345    {
;;;346      /* Check the parameters */
;;;347      assert_param(IS_UART_ALL_PERIPH(UARTx));
;;;348      assert_param(IS_UART_DMAREQ(UART_DMAReq));
;;;349      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;350    
;;;351      if(NewState != DISABLE)
;;;352      {
;;;353        /* Enable the DMA transfer for selected requests by setting the DMAT and/or
;;;354           DMAR bits in the UART IDE register */
;;;355        UARTx->UART_IDE |= UART_DMAReq;
;;;356      }
;;;357      else
;;;358      {
;;;359        /* Disable the DMA transfer for selected requests by clearing the DMAT and/or
;;;360           DMAR bits in the UART IDE register */
;;;361        UARTx->UART_IDE &= (uint16_t)~UART_DMAReq;
000002  6902              LDR      r2,[r0,#0x10]
000004  d001              BEQ      |L2.10|
000006  430a              ORRS     r2,r2,r1              ;355
000008  e002              B        |L2.16|
                  |L2.10|
00000a  43c9              MVNS     r1,r1
00000c  b289              UXTH     r1,r1
00000e  400a              ANDS     r2,r2,r1
                  |L2.16|
000010  6102              STR      r2,[r0,#0x10]         ;355
;;;362      }
;;;363    }
000012  4770              BX       lr
;;;364    
                          ENDP


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

                  UART_DeInit PROC
;;;43      */
;;;44     void UART_DeInit(UART_TypeDef* UARTx)
000000  4917              LDR      r1,|L3.96|
;;;45     {
000002  b510              PUSH     {r4,lr}
;;;46       assert_param(IS_UART_ALL_PERIPH(UARTx));
;;;47     
;;;48       if(UARTx == UART0)
000004  4288              CMP      r0,r1
000006  d106              BNE      |L3.22|
;;;49       {
;;;50         /* Enable UART0 reset state */
;;;51         RCC_APB0PeriphResetCmd(RCC_APB0Periph_UART0, ENABLE);
000008  2101              MOVS     r1,#1
00000a  2040              MOVS     r0,#0x40
00000c  f7fffffe          BL       RCC_APB0PeriphResetCmd
;;;52         /* Release UART0 from reset state */
;;;53         RCC_APB0PeriphResetCmd(RCC_APB0Periph_UART0, DISABLE);
000010  2100              MOVS     r1,#0
000012  2040              MOVS     r0,#0x40
000014  e009              B        |L3.42|
                  |L3.22|
;;;54       }
;;;55       else if(UARTx == UART1)
000016  4912              LDR      r1,|L3.96|
000018  3160              ADDS     r1,r1,#0x60
00001a  4288              CMP      r0,r1
00001c  d108              BNE      |L3.48|
;;;56       {
;;;57         /* Enable UART1 reset state */
;;;58         RCC_APB0PeriphResetCmd(RCC_APB0Periph_UART1, ENABLE);
00001e  2101              MOVS     r1,#1
000020  2080              MOVS     r0,#0x80
000022  f7fffffe          BL       RCC_APB0PeriphResetCmd
;;;59         /* Release UART1 from reset state */
;;;60         RCC_APB0PeriphResetCmd(RCC_APB0Periph_UART1, DISABLE);
000026  2100              MOVS     r1,#0
000028  2080              MOVS     r0,#0x80
                  |L3.42|
00002a  f7fffffe          BL       RCC_APB0PeriphResetCmd
;;;61       }
;;;62       else if(UARTx == UART2)
;;;63       {
;;;64         /* Enable UART2 reset state */
;;;65         RCC_APB1PeriphResetCmd(RCC_APB1Periph_UART2, ENABLE);
;;;66         /* Release UART2 from reset state */
;;;67         RCC_APB1PeriphResetCmd(RCC_APB1Periph_UART2, DISABLE);
;;;68       }
;;;69       else if(UARTx == UART3)
;;;70       {
;;;71         /* Enable UART3 reset state */
;;;72         RCC_APB2PeriphResetCmd(RCC_APB2Periph_UART3, ENABLE);
;;;73         /* Release UART3 from reset state */
;;;74         RCC_APB2PeriphResetCmd(RCC_APB2Periph_UART3, DISABLE);
;;;75       }
;;;76     }
00002e  bd10              POP      {r4,pc}
                  |L3.48|
000030  490c              LDR      r1,|L3.100|
000032  4288              CMP      r0,r1                 ;62
000034  d108              BNE      |L3.72|
000036  2101              MOVS     r1,#1                 ;65
000038  2080              MOVS     r0,#0x80              ;65
00003a  f7fffffe          BL       RCC_APB1PeriphResetCmd
00003e  2100              MOVS     r1,#0                 ;67
000040  2080              MOVS     r0,#0x80              ;67
000042  f7fffffe          BL       RCC_APB1PeriphResetCmd
                  |L3.70|
000046  bd10              POP      {r4,pc}
                  |L3.72|
000048  4907              LDR      r1,|L3.104|
00004a  4288              CMP      r0,r1                 ;69
00004c  d1fb              BNE      |L3.70|
00004e  2101              MOVS     r1,#1                 ;72
000050  2004              MOVS     r0,#4                 ;72
000052  f7fffffe          BL       RCC_APB2PeriphResetCmd
000056  2100              MOVS     r1,#0                 ;74
000058  2004              MOVS     r0,#4                 ;74
00005a  f7fffffe          BL       RCC_APB2PeriphResetCmd
00005e  bd10              POP      {r4,pc}
;;;77     
                          ENDP

                  |L3.96|
                          DCD      0x40020020
                  |L3.100|
                          DCD      0x40021020
                  |L3.104|
                          DCD      0x40022020

                          AREA ||i.UART_GetFlagStatus||, CODE, READONLY, ALIGN=1

                  UART_GetFlagStatus PROC
;;;300     */
;;;301    FlagStatus UART_GetFlagStatus(UART_TypeDef* UARTx, UART_FLAG_TypeDef UART_FLAG)
000000  4602              MOV      r2,r0
;;;302    {
;;;303      ITStatus bitstatus = RESET;
;;;304      /* Check the parameters */
;;;305      assert_param(IS_UART_ALL_PERIPH(UARTx));
;;;306      assert_param(IS_GET_UART_FLAG(UART_FLAG));
;;;307    
;;;308      if((UARTx->UART_STS & UART_FLAG) != (uint16_t)RESET)
000002  6852              LDR      r2,[r2,#4]
000004  2000              MOVS     r0,#0                 ;303
000006  420a              TST      r2,r1
000008  d000              BEQ      |L4.12|
;;;309      {
;;;310        bitstatus = SET;
00000a  2001              MOVS     r0,#1
                  |L4.12|
;;;311      }
;;;312      else
;;;313      {
;;;314        bitstatus = RESET;
;;;315      }
;;;316      return bitstatus;
;;;317    }
00000c  4770              BX       lr
;;;318    
                          ENDP


                          AREA ||i.UART_ITConfig||, CODE, READONLY, ALIGN=1

                  UART_ITConfig PROC
;;;274     */
;;;275    void UART_ITConfig(UART_TypeDef* UARTx, uint16_t UART_IT, FunctionalState NewState)
000000  2a00              CMP      r2,#0
;;;276    {
;;;277      /* Check the parameters */
;;;278      assert_param(IS_UART_ALL_PERIPH(UARTx));
;;;279      assert_param(IS_UART_IT(UART_IT));
;;;280      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;281    
;;;282      if(NewState != DISABLE)
;;;283      {
;;;284        /* Enable the Interrupt sources */
;;;285        UARTx->UART_IDE |= UART_IT;
;;;286      }
;;;287      else
;;;288      {
;;;289        /* Disable the Interrupt sources */
;;;290        UARTx->UART_IDE &= (uint16_t)~UART_IT;
000002  6902              LDR      r2,[r0,#0x10]
000004  d001              BEQ      |L5.10|
000006  430a              ORRS     r2,r2,r1              ;285
000008  e002              B        |L5.16|
                  |L5.10|
00000a  43c9              MVNS     r1,r1
00000c  b289              UXTH     r1,r1
00000e  400a              ANDS     r2,r2,r1
                  |L5.16|
000010  6102              STR      r2,[r0,#0x10]         ;285
;;;291      }
;;;292    }
000012  4770              BX       lr
;;;293    
                          ENDP


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

                  UART_Init PROC
;;;85      */
;;;86     void UART_Init(UART_TypeDef* UARTx, UART_InitTypeDef* UART_InitStruct)
000000  b570              PUSH     {r4-r6,lr}
;;;87     {
000002  4604              MOV      r4,r0
;;;88       uint32_t tmpreg;
;;;89       /* Check the parameters */
;;;90       assert_param(IS_UART_ALL_PERIPH(UARTx));
;;;91       assert_param(IS_UART_Mode(UART_InitStruct->UART_Mode));
;;;92     
;;;93       tmpreg = UARTx->UART_CON;
000004  6800              LDR      r0,[r0,#0]
;;;94       tmpreg &= (uint32_t) ~(UART_CON_SM01 | UART_CON_SM2);
;;;95       tmpreg |= (uint32_t)(UART_InitStruct->UART_Mode);
000006  688a              LDR      r2,[r1,#8]
000008  08c0              LSRS     r0,r0,#3              ;94
00000a  00c0              LSLS     r0,r0,#3              ;94
00000c  4302              ORRS     r2,r2,r0
;;;96       UARTx->UART_CON = tmpreg;
00000e  6022              STR      r2,[r4,#0]
;;;97     
;;;98       if(UART_InitStruct->UART_Mode == UART_Mode_8B)
000010  6888              LDR      r0,[r1,#8]
;;;99       {
;;;100        assert_param(IS_UART_PRESCALER(UART_InitStruct->UART_BaudRate));
;;;101    
;;;102    		UARTx->UART_CON &= ~(uint32_t)UART_CON_PERSCALER;
000012  2510              MOVS     r5,#0x10
000014  2800              CMP      r0,#0                 ;98
000016  d00c              BEQ      |L6.50|
000018  c905              LDM      r1!,{r0,r2}           ;87
00001a  4611              MOV      r1,r2                 ;87
;;;103        UARTx->UART_CON |= (uint32_t)UART_InitStruct->UART_BaudRate;
;;;104      }
;;;105      else
;;;106      {
;;;107        tmpreg = (UART_InitStruct->UART_ClockFrequency / UART_InitStruct->UART_BaudRate);
00001c  f7fffffe          BL       __aeabi_uidivmod
;;;108        if(tmpreg > 65535)
000020  4908              LDR      r1,|L6.68|
000022  4288              CMP      r0,r1
000024  d903              BLS      |L6.46|
;;;109        {
;;;110          UARTx->UART_CON |= (uint32_t)UART_CON_PERSCALER;
000026  6821              LDR      r1,[r4,#0]
000028  4329              ORRS     r1,r1,r5
00002a  6021              STR      r1,[r4,#0]
;;;111          tmpreg = tmpreg / 16;
00002c  0900              LSRS     r0,r0,#4
                  |L6.46|
;;;112        }
;;;113        UARTx->UART_BAUD = tmpreg;
00002e  60a0              STR      r0,[r4,#8]
;;;114      }
;;;115    }
000030  bd70              POP      {r4-r6,pc}
                  |L6.50|
000032  6820              LDR      r0,[r4,#0]            ;102
000034  43a8              BICS     r0,r0,r5              ;102
000036  6020              STR      r0,[r4,#0]            ;102
000038  6820              LDR      r0,[r4,#0]            ;103
00003a  6849              LDR      r1,[r1,#4]            ;103
00003c  4308              ORRS     r0,r0,r1              ;103
00003e  6020              STR      r0,[r4,#0]            ;103
000040  bd70              POP      {r4-r6,pc}
;;;116    
                          ENDP

000042  0000              DCW      0x0000
                  |L6.68|
                          DCD      0x0000ffff

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

                  UART_PinRemapConfig PROC
;;;232     */
;;;233    void UART_PinRemapConfig(UART_TypeDef* UARTx, UART_PinRemap_TypeDef UART_Remap)
000000  4a04              LDR      r2,|L7.20|
;;;234    {
;;;235      uint32_t tmpreg;
;;;236    	
;;;237      /* Check the parameters */
;;;238      assert_param(IS_UART_REMAP_PERIPH(UARTx));
;;;239    
;;;240      if(UARTx == UART2)
000002  4290              CMP      r0,r2
000004  d105              BNE      |L7.18|
;;;241      {
;;;242        tmpreg = UARTx->UART_CON;
000006  6802              LDR      r2,[r0,#0]
;;;243    
;;;244        tmpreg &= (uint32_t)(~UART_CON_SPOS);
000008  2303              MOVS     r3,#3
00000a  039b              LSLS     r3,r3,#14
00000c  439a              BICS     r2,r2,r3
;;;245    
;;;246        tmpreg |= UART_Remap;
00000e  430a              ORRS     r2,r2,r1
;;;247    
;;;248        UARTx->UART_CON = tmpreg;
000010  6002              STR      r2,[r0,#0]
                  |L7.18|
;;;249      }
;;;250    }
000012  4770              BX       lr
;;;251    
                          ENDP

                  |L7.20|
                          DCD      0x40021020

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

                  UART_RXCmd PROC
;;;148     */
;;;149    void UART_RXCmd(UART_TypeDef* UARTx, FunctionalState NewState)
000000  2900              CMP      r1,#0
;;;150    {
;;;151      /* Check the parameters */
;;;152      assert_param(IS_UART_ALL_PERIPH(UARTx));
;;;153      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;154    
;;;155      if(NewState != DISABLE)
;;;156      {
;;;157        /* Enable the UART RX Function */
;;;158        UARTx->UART_CON |= UART_CON_RXEN;
;;;159      }
;;;160      else
;;;161      {
;;;162        /* Disable the UART RX Function */
;;;163        UARTx->UART_CON &= (uint16_t)~UART_CON_RXEN;
000002  6801              LDR      r1,[r0,#0]
000004  d002              BEQ      |L8.12|
000006  2240              MOVS     r2,#0x40              ;158
000008  4311              ORRS     r1,r1,r2              ;158
00000a  e001              B        |L8.16|
                  |L8.12|
00000c  4a01              LDR      r2,|L8.20|
00000e  4011              ANDS     r1,r1,r2
                  |L8.16|
000010  6001              STR      r1,[r0,#0]            ;158
;;;164      }
;;;165    }
000012  4770              BX       lr
;;;166    
                          ENDP

                  |L8.20|
                          DCD      0x0000ffbf

                          AREA ||i.UART_ReceiveData||, CODE, READONLY, ALIGN=1

                  UART_ReceiveData PROC
;;;201     */
;;;202    uint16_t UART_ReceiveData(UART_TypeDef* UARTx)
000000  68c0              LDR      r0,[r0,#0xc]
;;;203    {
;;;204      /* Check the parameters */
;;;205      assert_param(IS_UART_ALL_PERIPH(UARTx));
;;;206    
;;;207      /* Receive Data */
;;;208      return (uint16_t)(UARTx->UART_DATA & (uint16_t)0x01FF);
000002  05c0              LSLS     r0,r0,#23
000004  0dc0              LSRS     r0,r0,#23
;;;209    }
000006  4770              BX       lr
;;;210    
                          ENDP


                          AREA ||i.UART_SendData||, CODE, READONLY, ALIGN=1

                  UART_SendData PROC
;;;187     */
;;;188    void UART_SendData(UART_TypeDef* UARTx, uint16_t Data)
000000  05c9              LSLS     r1,r1,#23
;;;189    {
;;;190      /* Check the parameters */
;;;191      assert_param(IS_UART_ALL_PERIPH(UARTx));
;;;192    
;;;193      /* Transmit Data */
;;;194      UARTx->UART_DATA = (Data & (uint16_t)0x01FF);
000002  0dc9              LSRS     r1,r1,#23
000004  60c1              STR      r1,[r0,#0xc]
;;;195    }
000006  4770              BX       lr
;;;196    
                          ENDP


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

                  UART_TXCmd PROC
;;;123     */
;;;124    void UART_TXCmd(UART_TypeDef* UARTx, FunctionalState NewState)
000000  2900              CMP      r1,#0
;;;125    {
;;;126      /* Check the parameters */
;;;127      assert_param(IS_UART_ALL_PERIPH(UARTx));
;;;128      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;129    
;;;130      if(NewState != DISABLE)
;;;131      {
;;;132        /* Enable the UART TX Function */
;;;133        UARTx->UART_CON |= UART_CON_TXEN;
;;;134      }
;;;135      else
;;;136      {
;;;137        /* Disable the UART TX Function */
;;;138        UARTx->UART_CON &= (uint16_t)~UART_CON_TXEN;
000002  6801              LDR      r1,[r0,#0]
000004  d002              BEQ      |L11.12|
000006  2280              MOVS     r2,#0x80              ;133
000008  4311              ORRS     r1,r1,r2              ;133
00000a  e001              B        |L11.16|
                  |L11.12|
00000c  4a01              LDR      r2,|L11.20|
00000e  4011              ANDS     r1,r1,r2
                  |L11.16|
000010  6001              STR      r1,[r0,#0]            ;133
;;;139      }
;;;140    }
000012  4770              BX       lr
;;;141    
                          ENDP

                  |L11.20|
                          DCD      0x0000ff7f

;*** Start embedded assembler ***

#line 1 "..\\FWLib\\SC32F1XXX_Lib\\src\\sc32f1xxx_uart.c"
	AREA ||.rev16_text||, CODE
	THUMB
	EXPORT |__asm___16_sc32f1xxx_uart_c_c95a8597____REV16|
#line 463 "..\\CMSIS\\cmsis_armcc.h"
|__asm___16_sc32f1xxx_uart_c_c95a8597____REV16| PROC
#line 464

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

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
