; 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\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 -IF:\Keil_ARMV5.36_pack\ARM\CMSIS\5.8.0\Device\ARM\ARMCM0plus\Include -D__UVISION_VERSION=536 -DARMCM0P -DSC32f10xx --omf_browse=..\output\sc32f1xxx_uart.crf ..\FWLib\SC32F1XXX_Lib\src\sc32f1xxx_uart.c]
                          THUMB

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

                  Printf_UartInit PROC
;;;713     */
;;;714    __attribute__((weak)) void Printf_UartInit ( UART_TypeDef* UARTx )
000000  4901              LDR      r1,|L1.8|
;;;715    {
;;;716    
;;;717        Printf_Uart = UARTx;
000002  6008              STR      r0,[r1,#0]  ; Printf_Uart
;;;718    }
000004  4770              BX       lr
;;;719    /*printf mapping function*/
                          ENDP

000006  0000              DCW      0x0000
                  |L1.8|
                          DCD      ||.data||

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

                  UART_ClearFlag PROC
;;;454     */
;;;455    void UART_ClearFlag ( UART_TypeDef* UARTx, uint16_t UART_FLAG )
000000  6041              STR      r1,[r0,#4]
;;;456    {
;;;457        /* Check the parameters */
;;;458        assert_param ( IS_UART_ALL_PERIPH ( UARTx ) );
;;;459    
;;;460        /* Clear the flags */
;;;461        UARTx->UART_STS = ( uint16_t ) UART_FLAG;
;;;462    }
000002  4770              BX       lr
;;;463    
                          ENDP


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

                  UART_DMACmd PROC
;;;479     */
;;;480    void UART_DMACmd ( UART_TypeDef* UARTx, uint16_t UART_DMAReq, FunctionalState NewState )
000000  2a00              CMP      r2,#0
;;;481    {
;;;482        /* Check the parameters */
;;;483        assert_param ( IS_UART_ALL_PERIPH ( UARTx ) );
;;;484        assert_param ( IS_UART_DMAREQ ( UART_DMAReq ) );
;;;485        assert_param ( IS_FUNCTIONAL_STATE ( NewState ) );
;;;486    
;;;487        if ( NewState != DISABLE )
;;;488        {
;;;489            /* Enable the DMA transfer for selected requests by setting the DMAT and/or
;;;490               DMAR bits in the UART IDE register */
;;;491            UARTx->UART_IDE |= UART_DMAReq;
;;;492        }
;;;493        else
;;;494        {
;;;495            /* Disable the DMA transfer for selected requests by clearing the DMAT and/or
;;;496               DMAR bits in the UART IDE register */
;;;497            UARTx->UART_IDE &= ( uint16_t ) ~UART_DMAReq;
000002  6902              LDR      r2,[r0,#0x10]
000004  d001              BEQ      |L3.10|
000006  430a              ORRS     r2,r2,r1              ;491
000008  e002              B        |L3.16|
                  |L3.10|
00000a  43c9              MVNS     r1,r1
00000c  b289              UXTH     r1,r1
00000e  400a              ANDS     r2,r2,r1
                  |L3.16|
000010  6102              STR      r2,[r0,#0x10]         ;491
;;;498        }
;;;499    }
000012  4770              BX       lr
;;;500    /* End of UART_Group3.	*/
                          ENDP


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

                  UART_DeInit PROC
;;;51      */
;;;52     void UART_DeInit ( UART_TypeDef* UARTx )
000000  4917              LDR      r1,|L4.96|
;;;53     {
000002  b510              PUSH     {r4,lr}
;;;54         assert_param ( IS_UART_ALL_PERIPH ( UARTx ) );
;;;55     
;;;56         if ( UARTx == UART0 )
000004  4288              CMP      r0,r1
000006  d106              BNE      |L4.22|
;;;57         {
;;;58             /* Enable UART0 reset state */
;;;59             RCC_APB0PeriphResetCmd ( RCC_APB0Periph_UART0, ENABLE );
000008  2101              MOVS     r1,#1
00000a  2040              MOVS     r0,#0x40
00000c  f7fffffe          BL       RCC_APB0PeriphResetCmd
;;;60             /* Release UART0 from reset state */
;;;61             RCC_APB0PeriphResetCmd ( RCC_APB0Periph_UART0, DISABLE );
000010  2100              MOVS     r1,#0
000012  2040              MOVS     r0,#0x40
000014  e009              B        |L4.42|
                  |L4.22|
;;;62         }
;;;63         else if ( UARTx == UART1 )
000016  4912              LDR      r1,|L4.96|
000018  3160              ADDS     r1,r1,#0x60
00001a  4288              CMP      r0,r1
00001c  d108              BNE      |L4.48|
;;;64         {
;;;65             /* Enable UART1 reset state */
;;;66             RCC_APB0PeriphResetCmd ( RCC_APB0Periph_UART1, ENABLE );
00001e  2101              MOVS     r1,#1
000020  2080              MOVS     r0,#0x80
000022  f7fffffe          BL       RCC_APB0PeriphResetCmd
;;;67             /* Release UART1 from reset state */
;;;68             RCC_APB0PeriphResetCmd ( RCC_APB0Periph_UART1, DISABLE );
000026  2100              MOVS     r1,#0
000028  2080              MOVS     r0,#0x80
                  |L4.42|
00002a  f7fffffe          BL       RCC_APB0PeriphResetCmd
;;;69         }
;;;70         else if ( UARTx == UART2 )
;;;71         {
;;;72             /* Enable UART2 reset state */
;;;73             RCC_APB1PeriphResetCmd ( RCC_APB1Periph_UART2, ENABLE );
;;;74             /* Release UART2 from reset state */
;;;75             RCC_APB1PeriphResetCmd ( RCC_APB1Periph_UART2, DISABLE );
;;;76         }
;;;77         else if ( UARTx == UART3 )
;;;78         {
;;;79             /* Enable UART3 reset state */
;;;80             RCC_APB2PeriphResetCmd ( RCC_APB2Periph_UART3, ENABLE );
;;;81             /* Release UART3 from reset state */
;;;82             RCC_APB2PeriphResetCmd ( RCC_APB2Periph_UART3, DISABLE );
;;;83         }
;;;84     
;;;85     #if  defined(SC32f12xx)
;;;86         if ( UARTx == UART4 )
;;;87         {
;;;88             /* Enable UART0 reset state */
;;;89             RCC_APB1PeriphResetCmd ( RCC_APB1Periph_UART4, ENABLE );
;;;90             /* Release UART0 from reset state */
;;;91             RCC_APB1PeriphResetCmd ( RCC_APB1Periph_UART4, DISABLE );
;;;92         }
;;;93         else if ( UARTx == UART5 )
;;;94         {
;;;95             /* Enable UART5 reset state */
;;;96             RCC_APB0PeriphResetCmd ( RCC_APB0Periph_UART5, ENABLE );
;;;97             /* Release UART5 from reset state */
;;;98             RCC_APB0PeriphResetCmd ( RCC_APB0Periph_UART5, DISABLE );
;;;99         }
;;;100    #endif
;;;101    }
00002e  bd10              POP      {r4,pc}
                  |L4.48|
000030  490c              LDR      r1,|L4.100|
000032  4288              CMP      r0,r1                 ;70
000034  d108              BNE      |L4.72|
000036  2101              MOVS     r1,#1                 ;73
000038  2080              MOVS     r0,#0x80              ;73
00003a  f7fffffe          BL       RCC_APB1PeriphResetCmd
00003e  2100              MOVS     r1,#0                 ;75
000040  2080              MOVS     r0,#0x80              ;75
000042  f7fffffe          BL       RCC_APB1PeriphResetCmd
                  |L4.70|
000046  bd10              POP      {r4,pc}
                  |L4.72|
000048  4907              LDR      r1,|L4.104|
00004a  4288              CMP      r0,r1                 ;77
00004c  d1fb              BNE      |L4.70|
00004e  2101              MOVS     r1,#1                 ;80
000050  2004              MOVS     r0,#4                 ;80
000052  f7fffffe          BL       RCC_APB2PeriphResetCmd
000056  2100              MOVS     r1,#0                 ;82
000058  2004              MOVS     r0,#4                 ;82
00005a  f7fffffe          BL       RCC_APB2PeriphResetCmd
00005e  bd10              POP      {r4,pc}
;;;102    
                          ENDP

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

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

                  UART_GetFlagStatus PROC
;;;414     */
;;;415    FlagStatus UART_GetFlagStatus ( UART_TypeDef* UARTx, UART_FLAG_TypeDef UART_FLAG )
000000  4602              MOV      r2,r0
;;;416    {
;;;417        ITStatus bitstatus = RESET;
;;;418        /* Check the parameters */
;;;419        assert_param ( IS_UART_ALL_PERIPH ( UARTx ) );
;;;420        assert_param ( IS_GET_UART_FLAG ( UART_FLAG ) );
;;;421    
;;;422        if ( ( UARTx->UART_STS & UART_FLAG ) != ( uint16_t ) RESET )
000002  6852              LDR      r2,[r2,#4]
000004  2000              MOVS     r0,#0                 ;417
000006  420a              TST      r2,r1
000008  d000              BEQ      |L5.12|
;;;423        {
;;;424            bitstatus = SET;
00000a  2001              MOVS     r0,#1
                  |L5.12|
;;;425        }
;;;426        else
;;;427        {
;;;428            bitstatus = RESET;
;;;429        }
;;;430        return bitstatus;
;;;431    }
00000c  4770              BX       lr
;;;432    
                          ENDP


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

                  UART_ITConfig PROC
;;;375     */
;;;376    void UART_ITConfig ( UART_TypeDef* UARTx, uint16_t UART_IT, FunctionalState NewState )
000000  2a00              CMP      r2,#0
;;;377    {
;;;378        /* Check the parameters */
;;;379        assert_param ( IS_UART_ALL_PERIPH ( UARTx ) );
;;;380        assert_param ( IS_UART_IT ( UART_IT ) );
;;;381        assert_param ( IS_FUNCTIONAL_STATE ( NewState ) );
;;;382    
;;;383        if ( NewState != DISABLE )
;;;384        {
;;;385            /* Enable the Interrupt sources */
;;;386            UARTx->UART_IDE |= UART_IT;
;;;387        }
;;;388        else
;;;389        {
;;;390            /* Disable the Interrupt sources */
;;;391            UARTx->UART_IDE &= ( uint16_t ) ~UART_IT;
000002  6902              LDR      r2,[r0,#0x10]
000004  d001              BEQ      |L6.10|
000006  430a              ORRS     r2,r2,r1              ;386
000008  e002              B        |L6.16|
                  |L6.10|
00000a  43c9              MVNS     r1,r1
00000c  b289              UXTH     r1,r1
00000e  400a              ANDS     r2,r2,r1
                  |L6.16|
000010  6102              STR      r2,[r0,#0x10]         ;386
;;;392        }
;;;393    }
000012  4770              BX       lr
;;;394    
                          ENDP


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

                  UART_Init PROC
;;;118     */
;;;119    void UART_Init ( UART_TypeDef* UARTx, UART_InitTypeDef* UART_InitStruct )
000000  b570              PUSH     {r4-r6,lr}
;;;120    {
000002  4604              MOV      r4,r0
;;;121        uint32_t tmpreg;
;;;122        /* Check the parameters */
;;;123        assert_param ( IS_UART_ALL_PERIPH ( UARTx ) );
;;;124        assert_param ( IS_UART_Mode ( UART_InitStruct->UART_Mode ) );
;;;125    
;;;126        tmpreg = UARTx->UART_CON;
000004  6800              LDR      r0,[r0,#0]
;;;127        tmpreg &= ( uint32_t ) ~ ( UART_CON_SM01 | UART_CON_SM2 );
;;;128        tmpreg |= ( uint32_t ) ( UART_InitStruct->UART_Mode );
000006  688a              LDR      r2,[r1,#8]
000008  08c0              LSRS     r0,r0,#3              ;127
00000a  00c0              LSLS     r0,r0,#3              ;127
00000c  4302              ORRS     r2,r2,r0
;;;129        UARTx->UART_CON = tmpreg;
00000e  6022              STR      r2,[r4,#0]
;;;130    
;;;131        if ( UART_InitStruct->UART_Mode == UART_Mode_8B )
000010  6888              LDR      r0,[r1,#8]
;;;132        {
;;;133            assert_param ( IS_UART_PRESCALER ( UART_InitStruct->UART_BaudRate ) );
;;;134    
;;;135            UARTx->UART_CON &= ~ ( uint32_t ) UART_CON_PERSCALER;
000012  2510              MOVS     r5,#0x10
000014  2800              CMP      r0,#0                 ;131
000016  d00c              BEQ      |L7.50|
000018  c905              LDM      r1!,{r0,r2}           ;120
00001a  4611              MOV      r1,r2                 ;120
;;;136            UARTx->UART_CON |= ( uint32_t ) UART_InitStruct->UART_BaudRate;
;;;137        }
;;;138        else
;;;139        {
;;;140            tmpreg = ( UART_InitStruct->UART_ClockFrequency / UART_InitStruct->UART_BaudRate );
00001c  f7fffffe          BL       __aeabi_uidivmod
;;;141            if ( tmpreg > 65535 )
000020  4908              LDR      r1,|L7.68|
000022  4288              CMP      r0,r1
000024  d903              BLS      |L7.46|
;;;142            {
;;;143                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]
;;;144                tmpreg = tmpreg / 16;
00002c  0900              LSRS     r0,r0,#4
                  |L7.46|
;;;145            }
;;;146            UARTx->UART_BAUD = tmpreg;
00002e  60a0              STR      r0,[r4,#8]
;;;147        }
;;;148    }
000030  bd70              POP      {r4-r6,pc}
                  |L7.50|
000032  6820              LDR      r0,[r4,#0]            ;135
000034  43a8              BICS     r0,r0,r5              ;135
000036  6020              STR      r0,[r4,#0]            ;135
000038  6820              LDR      r0,[r4,#0]            ;136
00003a  6849              LDR      r1,[r1,#4]            ;136
00003c  4308              ORRS     r0,r0,r1              ;136
00003e  6020              STR      r0,[r4,#0]            ;136
000040  bd70              POP      {r4-r6,pc}
;;;149    
                          ENDP

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

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

                  UART_PinRemapConfig PROC
;;;308     */
;;;309    void UART_PinRemapConfig ( UART_TypeDef* UARTx, UART_PinRemap_TypeDef UART_Remap )
000000  4a04              LDR      r2,|L8.20|
;;;310    {
;;;311        uint32_t tmpreg;
;;;312    
;;;313        /* Check the parameters */
;;;314    #if defined(SC32f10xx)
;;;315        if ( UARTx == UART2 )
000002  4290              CMP      r0,r2
000004  d105              BNE      |L8.18|
;;;316        {
;;;317            tmpreg = UARTx->UART_CON;
000006  6802              LDR      r2,[r0,#0]
;;;318    
;;;319            tmpreg &= ( uint32_t ) ( ~UART_CON_SPOS );
000008  2303              MOVS     r3,#3
00000a  039b              LSLS     r3,r3,#14
00000c  439a              BICS     r2,r2,r3
;;;320    
;;;321            tmpreg |= UART_Remap;
00000e  430a              ORRS     r2,r2,r1
;;;322    
;;;323            UARTx->UART_CON = tmpreg;
000010  6002              STR      r2,[r0,#0]
                  |L8.18|
;;;324        }
;;;325    
;;;326    #elif defined(SC32f12xx)
;;;327        tmpreg = UARTx->UART_CON;
;;;328    
;;;329        tmpreg &= ( uint32_t ) ( ~UART_CON_SPOS );
;;;330    
;;;331        tmpreg |= UART_Remap;
;;;332    
;;;333        UARTx->UART_CON = tmpreg;
;;;334    #endif
;;;335    }
000012  4770              BX       lr
;;;336    
                          ENDP

                  |L8.20|
                          DCD      0x40021020

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

                  UART_RXCmd PROC
;;;199     */
;;;200    void UART_RXCmd ( UART_TypeDef* UARTx, FunctionalState NewState )
000000  2900              CMP      r1,#0
;;;201    {
;;;202        /* Check the parameters */
;;;203        assert_param ( IS_UART_ALL_PERIPH ( UARTx ) );
;;;204        assert_param ( IS_FUNCTIONAL_STATE ( NewState ) );
;;;205    
;;;206        if ( NewState != DISABLE )
;;;207        {
;;;208            /* Enable the UART RX Function */
;;;209            UARTx->UART_CON |= UART_CON_RXEN;
;;;210        }
;;;211        else
;;;212        {
;;;213            /* Disable the UART RX Function */
;;;214            UARTx->UART_CON &= ( uint16_t ) ~UART_CON_RXEN;
000002  6801              LDR      r1,[r0,#0]
000004  d002              BEQ      |L9.12|
000006  2240              MOVS     r2,#0x40              ;209
000008  4311              ORRS     r1,r1,r2              ;209
00000a  e001              B        |L9.16|
                  |L9.12|
00000c  4a01              LDR      r2,|L9.20|
00000e  4011              ANDS     r1,r1,r2
                  |L9.16|
000010  6001              STR      r1,[r0,#0]            ;209
;;;215        }
;;;216    }
000012  4770              BX       lr
;;;217    
                          ENDP

                  |L9.20|
                          DCD      0x0000ffbf

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

                  UART_ReceiveData PROC
;;;268     */
;;;269    uint16_t UART_ReceiveData ( UART_TypeDef* UARTx )
000000  68c0              LDR      r0,[r0,#0xc]
;;;270    {
;;;271        /* Check the parameters */
;;;272        assert_param ( IS_UART_ALL_PERIPH ( UARTx ) );
;;;273    
;;;274        /* Receive Data */
;;;275        return ( uint16_t ) ( UARTx->UART_DATA & ( uint16_t ) 0x01FF );
000002  05c0              LSLS     r0,r0,#23
000004  0dc0              LSRS     r0,r0,#23
;;;276    }
000006  4770              BX       lr
;;;277    
                          ENDP


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

                  UART_SendData PROC
;;;246     */
;;;247    void UART_SendData ( UART_TypeDef* UARTx, uint16_t Data )
000000  05c9              LSLS     r1,r1,#23
;;;248    {
;;;249        /* Check the parameters */
;;;250        assert_param ( IS_UART_ALL_PERIPH ( UARTx ) );
;;;251    
;;;252        /* Transmit Data */
;;;253        UARTx->UART_DATA = ( Data & ( uint16_t ) 0x01FF );
000002  0dc9              LSRS     r1,r1,#23
000004  60c1              STR      r1,[r0,#0xc]
;;;254    }
000006  4770              BX       lr
;;;255    
                          ENDP


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

                  UART_TXCmd PROC
;;;165     */
;;;166    void UART_TXCmd ( UART_TypeDef* UARTx, FunctionalState NewState )
000000  2900              CMP      r1,#0
;;;167    {
;;;168        /* Check the parameters */
;;;169        assert_param ( IS_UART_ALL_PERIPH ( UARTx ) );
;;;170        assert_param ( IS_FUNCTIONAL_STATE ( NewState ) );
;;;171    
;;;172        if ( NewState != DISABLE )
;;;173        {
;;;174            /* Enable the UART TX Function */
;;;175            UARTx->UART_CON |= UART_CON_TXEN;
;;;176        }
;;;177        else
;;;178        {
;;;179            /* Disable the UART TX Function */
;;;180            UARTx->UART_CON &= ( uint16_t ) ~UART_CON_TXEN;
000002  6801              LDR      r1,[r0,#0]
000004  d002              BEQ      |L12.12|
000006  2280              MOVS     r2,#0x80              ;175
000008  4311              ORRS     r1,r1,r2              ;175
00000a  e001              B        |L12.16|
                  |L12.12|
00000c  4a01              LDR      r2,|L12.20|
00000e  4011              ANDS     r1,r1,r2
                  |L12.16|
000010  6001              STR      r1,[r0,#0]            ;175
;;;181        }
;;;182    }
000012  4770              BX       lr
;;;183    
                          ENDP

                  |L12.20|
                          DCD      0x0000ff7f

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

                  fputc PROC
;;;720    #if defined (__ARMCC_VERSION)||defined (__ICCARM__)
;;;721    __attribute__((weak)) int fputc ( int c, FILE* f )
000000  b510              PUSH     {r4,lr}
;;;722    {
;;;723        UART_SendData ( Printf_Uart, ( uint8_t ) c );
000002  4b08              LDR      r3,|L13.36|
000004  4604              MOV      r4,r0                 ;722
000006  6819              LDR      r1,[r3,#0]            ;722  ; Printf_Uart
000008  b2c0              UXTB     r0,r0
00000a  60c8              STR      r0,[r1,#0xc]
                  |L13.12|
;;;724        while ( !UART_GetFlagStatus ( Printf_Uart, UART_Flag_TX ) );
00000c  2102              MOVS     r1,#2
00000e  6818              LDR      r0,[r3,#0]  ; Printf_Uart
000010  f7fffffe          BL       UART_GetFlagStatus
000014  2800              CMP      r0,#0
000016  d0f9              BEQ      |L13.12|
000018  6819              LDR      r1,[r3,#0]  ; Printf_Uart
;;;725        UART_ClearFlag ( Printf_Uart, UART_Flag_TX );
00001a  2002              MOVS     r0,#2
00001c  6048              STR      r0,[r1,#4]
;;;726        return c;
00001e  4620              MOV      r0,r4
;;;727    }
000020  bd10              POP      {r4,pc}
;;;728    #elif defined (__GNUC__)
                          ENDP

000022  0000              DCW      0x0000
                  |L13.36|
                          DCD      ||.data||

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

                  Printf_Uart
                          DCD      0x00000000

;*** 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 ***
