; generated by ARM C/C++ Compiler, 5.03 [Build 24]
; commandline ArmCC [--list --debug -c --asm --interleave -o..\OBJ\stm32f10x_usart.o --asm_dir=..\LIST\ --list_dir=..\LIST\ --depend=..\OBJ\stm32f10x_usart.d --cpu=Cortex-M3 --apcs=interwork -O0 -I..\..\Libraries\STM32F10x_StdPeriph_Driver\inc -I..\..\Libraries\CMSIS\CM3\CoreSupport -I..\..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x -I..\..\USER\INC -IC:\Keil\ARM\RV31\INC -IC:\Keil\ARM\CMSIS\Include -IC:\Keil\ARM\Inc\ST\STM32F10x -D__MICROLIB -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD --omf_browse=..\OBJ\stm32f10x_usart.crf ..\..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_usart.c]
                          THUMB

                          AREA ||.text||, CODE, READONLY, ALIGN=2

                  USART_DeInit PROC
;;;129      */
;;;130    void USART_DeInit(USART_TypeDef* USARTx)
000000  b510              PUSH     {r4,lr}
;;;131    {
000002  4604              MOV      r4,r0
;;;132      /* Check the parameters */
;;;133      assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;134    
;;;135      if (USARTx == USART1)
000004  48fb              LDR      r0,|L1.1012|
000006  4284              CMP      r4,r0
000008  d109              BNE      |L1.30|
;;;136      {
;;;137        RCC_APB2PeriphResetCmd(RCC_APB2Periph_USART1, ENABLE);
00000a  2101              MOVS     r1,#1
00000c  0388              LSLS     r0,r1,#14
00000e  f7fffffe          BL       RCC_APB2PeriphResetCmd
;;;138        RCC_APB2PeriphResetCmd(RCC_APB2Periph_USART1, DISABLE);
000012  2100              MOVS     r1,#0
000014  f44f4080          MOV      r0,#0x4000
000018  f7fffffe          BL       RCC_APB2PeriphResetCmd
00001c  e032              B        |L1.132|
                  |L1.30|
;;;139      }
;;;140      else if (USARTx == USART2)
00001e  48f6              LDR      r0,|L1.1016|
000020  4284              CMP      r4,r0
000022  d109              BNE      |L1.56|
;;;141      {
;;;142        RCC_APB1PeriphResetCmd(RCC_APB1Periph_USART2, ENABLE);
000024  2101              MOVS     r1,#1
000026  0448              LSLS     r0,r1,#17
000028  f7fffffe          BL       RCC_APB1PeriphResetCmd
;;;143        RCC_APB1PeriphResetCmd(RCC_APB1Periph_USART2, DISABLE);
00002c  2100              MOVS     r1,#0
00002e  f44f3000          MOV      r0,#0x20000
000032  f7fffffe          BL       RCC_APB1PeriphResetCmd
000036  e025              B        |L1.132|
                  |L1.56|
;;;144      }
;;;145      else if (USARTx == USART3)
000038  48f0              LDR      r0,|L1.1020|
00003a  4284              CMP      r4,r0
00003c  d109              BNE      |L1.82|
;;;146      {
;;;147        RCC_APB1PeriphResetCmd(RCC_APB1Periph_USART3, ENABLE);
00003e  2101              MOVS     r1,#1
000040  0488              LSLS     r0,r1,#18
000042  f7fffffe          BL       RCC_APB1PeriphResetCmd
;;;148        RCC_APB1PeriphResetCmd(RCC_APB1Periph_USART3, DISABLE);
000046  2100              MOVS     r1,#0
000048  f44f2080          MOV      r0,#0x40000
00004c  f7fffffe          BL       RCC_APB1PeriphResetCmd
000050  e018              B        |L1.132|
                  |L1.82|
;;;149      }    
;;;150      else if (USARTx == UART4)
000052  48eb              LDR      r0,|L1.1024|
000054  4284              CMP      r4,r0
000056  d109              BNE      |L1.108|
;;;151      {
;;;152        RCC_APB1PeriphResetCmd(RCC_APB1Periph_UART4, ENABLE);
000058  2101              MOVS     r1,#1
00005a  04c8              LSLS     r0,r1,#19
00005c  f7fffffe          BL       RCC_APB1PeriphResetCmd
;;;153        RCC_APB1PeriphResetCmd(RCC_APB1Periph_UART4, DISABLE);
000060  2100              MOVS     r1,#0
000062  f44f2000          MOV      r0,#0x80000
000066  f7fffffe          BL       RCC_APB1PeriphResetCmd
00006a  e00b              B        |L1.132|
                  |L1.108|
;;;154      }    
;;;155      else
;;;156      {
;;;157        if (USARTx == UART5)
00006c  48e5              LDR      r0,|L1.1028|
00006e  4284              CMP      r4,r0
000070  d108              BNE      |L1.132|
;;;158        { 
;;;159          RCC_APB1PeriphResetCmd(RCC_APB1Periph_UART5, ENABLE);
000072  2101              MOVS     r1,#1
000074  0508              LSLS     r0,r1,#20
000076  f7fffffe          BL       RCC_APB1PeriphResetCmd
;;;160          RCC_APB1PeriphResetCmd(RCC_APB1Periph_UART5, DISABLE);
00007a  2100              MOVS     r1,#0
00007c  f44f1080          MOV      r0,#0x100000
000080  f7fffffe          BL       RCC_APB1PeriphResetCmd
                  |L1.132|
;;;161        }
;;;162      }
;;;163    }
000084  bd10              POP      {r4,pc}
;;;164    
                          ENDP

                  USART_Init PROC
;;;175      */
;;;176    void USART_Init(USART_TypeDef* USARTx, USART_InitTypeDef* USART_InitStruct)
000086  e92d47f0          PUSH     {r4-r10,lr}
;;;177    {
00008a  b086              SUB      sp,sp,#0x18
00008c  4605              MOV      r5,r0
00008e  460e              MOV      r6,r1
;;;178      uint32_t tmpreg = 0x00, apbclock = 0x00;
000090  2400              MOVS     r4,#0
000092  46a2              MOV      r10,r4
;;;179      uint32_t integerdivider = 0x00;
000094  bf00              NOP      
;;;180      uint32_t fractionaldivider = 0x00;
000096  46a1              MOV      r9,r4
;;;181      uint32_t usartxbase = 0;
000098  2700              MOVS     r7,#0
;;;182      RCC_ClocksTypeDef RCC_ClocksStatus;
;;;183      /* Check the parameters */
;;;184      assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;185      assert_param(IS_USART_BAUDRATE(USART_InitStruct->USART_BaudRate));  
;;;186      assert_param(IS_USART_WORD_LENGTH(USART_InitStruct->USART_WordLength));
;;;187      assert_param(IS_USART_STOPBITS(USART_InitStruct->USART_StopBits));
;;;188      assert_param(IS_USART_PARITY(USART_InitStruct->USART_Parity));
;;;189      assert_param(IS_USART_MODE(USART_InitStruct->USART_Mode));
;;;190      assert_param(IS_USART_HARDWARE_FLOW_CONTROL(USART_InitStruct->USART_HardwareFlowControl));
;;;191      /* The hardware flow control is available only for USART1, USART2 and USART3 */
;;;192      if (USART_InitStruct->USART_HardwareFlowControl != USART_HardwareFlowControl_None)
00009a  89b0              LDRH     r0,[r6,#0xc]
00009c  b100              CBZ      r0,|L1.160|
;;;193      {
;;;194        assert_param(IS_USART_123_PERIPH(USARTx));
00009e  bf00              NOP      
                  |L1.160|
;;;195      }
;;;196    
;;;197      usartxbase = (uint32_t)USARTx;
0000a0  462f              MOV      r7,r5
;;;198    
;;;199    /*---------------------------- USART CR2 Configuration -----------------------*/
;;;200      tmpreg = USARTx->CR2;
0000a2  8a2c              LDRH     r4,[r5,#0x10]
;;;201      /* Clear STOP[13:12] bits */
;;;202      tmpreg &= CR2_STOP_CLEAR_Mask;
0000a4  f64c70ff          MOV      r0,#0xcfff
0000a8  4004              ANDS     r4,r4,r0
;;;203      /* Configure the USART Stop Bits, Clock, CPOL, CPHA and LastBit ------------*/
;;;204      /* Set STOP[13:12] bits according to USART_StopBits value */
;;;205      tmpreg |= (uint32_t)USART_InitStruct->USART_StopBits;
0000aa  88f0              LDRH     r0,[r6,#6]
0000ac  4304              ORRS     r4,r4,r0
;;;206      
;;;207      /* Write to USART CR2 */
;;;208      USARTx->CR2 = (uint16_t)tmpreg;
0000ae  822c              STRH     r4,[r5,#0x10]
;;;209    
;;;210    /*---------------------------- USART CR1 Configuration -----------------------*/
;;;211      tmpreg = USARTx->CR1;
0000b0  89ac              LDRH     r4,[r5,#0xc]
;;;212      /* Clear M, PCE, PS, TE and RE bits */
;;;213      tmpreg &= CR1_CLEAR_Mask;
0000b2  f64e10f3          MOV      r0,#0xe9f3
0000b6  4004              ANDS     r4,r4,r0
;;;214      /* Configure the USART Word Length, Parity and mode ----------------------- */
;;;215      /* Set the M bits according to USART_WordLength value */
;;;216      /* Set PCE and PS bits according to USART_Parity value */
;;;217      /* Set TE and RE bits according to USART_Mode value */
;;;218      tmpreg |= (uint32_t)USART_InitStruct->USART_WordLength | USART_InitStruct->USART_Parity |
0000b8  88b0              LDRH     r0,[r6,#4]
0000ba  8931              LDRH     r1,[r6,#8]
0000bc  4308              ORRS     r0,r0,r1
0000be  8971              LDRH     r1,[r6,#0xa]
0000c0  4308              ORRS     r0,r0,r1
0000c2  4304              ORRS     r4,r4,r0
;;;219                USART_InitStruct->USART_Mode;
;;;220      /* Write to USART CR1 */
;;;221      USARTx->CR1 = (uint16_t)tmpreg;
0000c4  81ac              STRH     r4,[r5,#0xc]
;;;222    
;;;223    /*---------------------------- USART CR3 Configuration -----------------------*/  
;;;224      tmpreg = USARTx->CR3;
0000c6  8aac              LDRH     r4,[r5,#0x14]
;;;225      /* Clear CTSE and RTSE bits */
;;;226      tmpreg &= CR3_CLEAR_Mask;
0000c8  f64f40ff          MOV      r0,#0xfcff
0000cc  4004              ANDS     r4,r4,r0
;;;227      /* Configure the USART HFC -------------------------------------------------*/
;;;228      /* Set CTSE and RTSE bits according to USART_HardwareFlowControl value */
;;;229      tmpreg |= USART_InitStruct->USART_HardwareFlowControl;
0000ce  89b0              LDRH     r0,[r6,#0xc]
0000d0  4304              ORRS     r4,r4,r0
;;;230      /* Write to USART CR3 */
;;;231      USARTx->CR3 = (uint16_t)tmpreg;
0000d2  82ac              STRH     r4,[r5,#0x14]
;;;232    
;;;233    /*---------------------------- USART BRR Configuration -----------------------*/
;;;234      /* Configure the USART Baud Rate -------------------------------------------*/
;;;235      RCC_GetClocksFreq(&RCC_ClocksStatus);
0000d4  a801              ADD      r0,sp,#4
0000d6  f7fffffe          BL       RCC_GetClocksFreq
;;;236      if (usartxbase == USART1_BASE)
0000da  48c6              LDR      r0,|L1.1012|
0000dc  4287              CMP      r7,r0
0000de  d102              BNE      |L1.230|
;;;237      {
;;;238        apbclock = RCC_ClocksStatus.PCLK2_Frequency;
0000e0  f8dda010          LDR      r10,[sp,#0x10]
0000e4  e001              B        |L1.234|
                  |L1.230|
;;;239      }
;;;240      else
;;;241      {
;;;242        apbclock = RCC_ClocksStatus.PCLK1_Frequency;
0000e6  f8dda00c          LDR      r10,[sp,#0xc]
                  |L1.234|
;;;243      }
;;;244      
;;;245      /* Determine the integer part */
;;;246      if ((USARTx->CR1 & CR1_OVER8_Set) != 0)
0000ea  89a8              LDRH     r0,[r5,#0xc]
0000ec  f4104f00          TST      r0,#0x8000
0000f0  d008              BEQ      |L1.260|
;;;247      {
;;;248        /* Integer part computing in case Oversampling mode is 8 Samples */
;;;249        integerdivider = ((25 * apbclock) / (2 * (USART_InitStruct->USART_BaudRate)));    
0000f2  eb0a00ca          ADD      r0,r10,r10,LSL #3
0000f6  eb00100a          ADD      r0,r0,r10,LSL #4
0000fa  6831              LDR      r1,[r6,#0]
0000fc  0049              LSLS     r1,r1,#1
0000fe  fbb0f8f1          UDIV     r8,r0,r1
000102  e007              B        |L1.276|
                  |L1.260|
;;;250      }
;;;251      else /* if ((USARTx->CR1 & CR1_OVER8_Set) == 0) */
;;;252      {
;;;253        /* Integer part computing in case Oversampling mode is 16 Samples */
;;;254        integerdivider = ((25 * apbclock) / (4 * (USART_InitStruct->USART_BaudRate)));    
000104  eb0a00ca          ADD      r0,r10,r10,LSL #3
000108  eb00100a          ADD      r0,r0,r10,LSL #4
00010c  6831              LDR      r1,[r6,#0]
00010e  0089              LSLS     r1,r1,#2
000110  fbb0f8f1          UDIV     r8,r0,r1
                  |L1.276|
;;;255      }
;;;256      tmpreg = (integerdivider / 100) << 4;
000114  2064              MOVS     r0,#0x64
000116  fbb8f0f0          UDIV     r0,r8,r0
00011a  0104              LSLS     r4,r0,#4
;;;257    
;;;258      /* Determine the fractional part */
;;;259      fractionaldivider = integerdivider - (100 * (tmpreg >> 4));
00011c  0920              LSRS     r0,r4,#4
00011e  2164              MOVS     r1,#0x64
000120  fb018910          MLS      r9,r1,r0,r8
;;;260    
;;;261      /* Implement the fractional part in the register */
;;;262      if ((USARTx->CR1 & CR1_OVER8_Set) != 0)
000124  89a8              LDRH     r0,[r5,#0xc]
000126  f4104f00          TST      r0,#0x8000
00012a  d008              BEQ      |L1.318|
;;;263      {
;;;264        tmpreg |= ((((fractionaldivider * 8) + 50) / 100)) & ((uint8_t)0x07);
00012c  2032              MOVS     r0,#0x32
00012e  eb0000c9          ADD      r0,r0,r9,LSL #3
000132  fbb0f0f1          UDIV     r0,r0,r1
000136  f0000007          AND      r0,r0,#7
00013a  4304              ORRS     r4,r4,r0
00013c  e008              B        |L1.336|
                  |L1.318|
;;;265      }
;;;266      else /* if ((USARTx->CR1 & CR1_OVER8_Set) == 0) */
;;;267      {
;;;268        tmpreg |= ((((fractionaldivider * 16) + 50) / 100)) & ((uint8_t)0x0F);
00013e  2032              MOVS     r0,#0x32
000140  eb001009          ADD      r0,r0,r9,LSL #4
000144  2164              MOVS     r1,#0x64
000146  fbb0f0f1          UDIV     r0,r0,r1
00014a  f000000f          AND      r0,r0,#0xf
00014e  4304              ORRS     r4,r4,r0
                  |L1.336|
;;;269      }
;;;270      
;;;271      /* Write to USART BRR */
;;;272      USARTx->BRR = (uint16_t)tmpreg;
000150  812c              STRH     r4,[r5,#8]
;;;273    }
000152  b006              ADD      sp,sp,#0x18
000154  e8bd87f0          POP      {r4-r10,pc}
;;;274    
                          ENDP

                  USART_StructInit PROC
;;;280      */
;;;281    void USART_StructInit(USART_InitTypeDef* USART_InitStruct)
000158  f44f5116          MOV      r1,#0x2580
;;;282    {
;;;283      /* USART_InitStruct members default value */
;;;284      USART_InitStruct->USART_BaudRate = 9600;
00015c  6001              STR      r1,[r0,#0]
;;;285      USART_InitStruct->USART_WordLength = USART_WordLength_8b;
00015e  2100              MOVS     r1,#0
000160  8081              STRH     r1,[r0,#4]
;;;286      USART_InitStruct->USART_StopBits = USART_StopBits_1;
000162  80c1              STRH     r1,[r0,#6]
;;;287      USART_InitStruct->USART_Parity = USART_Parity_No ;
000164  8101              STRH     r1,[r0,#8]
;;;288      USART_InitStruct->USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
000166  210c              MOVS     r1,#0xc
000168  8141              STRH     r1,[r0,#0xa]
;;;289      USART_InitStruct->USART_HardwareFlowControl = USART_HardwareFlowControl_None;  
00016a  2100              MOVS     r1,#0
00016c  8181              STRH     r1,[r0,#0xc]
;;;290    }
00016e  4770              BX       lr
;;;291    
                          ENDP

                  USART_ClockInit PROC
;;;301      */
;;;302    void USART_ClockInit(USART_TypeDef* USARTx, USART_ClockInitTypeDef* USART_ClockInitStruct)
000170  b510              PUSH     {r4,lr}
;;;303    {
000172  4602              MOV      r2,r0
;;;304      uint32_t tmpreg = 0x00;
000174  2000              MOVS     r0,#0
;;;305      /* Check the parameters */
;;;306      assert_param(IS_USART_123_PERIPH(USARTx));
;;;307      assert_param(IS_USART_CLOCK(USART_ClockInitStruct->USART_Clock));
;;;308      assert_param(IS_USART_CPOL(USART_ClockInitStruct->USART_CPOL));
;;;309      assert_param(IS_USART_CPHA(USART_ClockInitStruct->USART_CPHA));
;;;310      assert_param(IS_USART_LASTBIT(USART_ClockInitStruct->USART_LastBit));
;;;311      
;;;312    /*---------------------------- USART CR2 Configuration -----------------------*/
;;;313      tmpreg = USARTx->CR2;
000176  8a10              LDRH     r0,[r2,#0x10]
;;;314      /* Clear CLKEN, CPOL, CPHA and LBCL bits */
;;;315      tmpreg &= CR2_CLOCK_CLEAR_Mask;
000178  f24f03ff          MOV      r3,#0xf0ff
00017c  4018              ANDS     r0,r0,r3
;;;316      /* Configure the USART Clock, CPOL, CPHA and LastBit ------------*/
;;;317      /* Set CLKEN bit according to USART_Clock value */
;;;318      /* Set CPOL bit according to USART_CPOL value */
;;;319      /* Set CPHA bit according to USART_CPHA value */
;;;320      /* Set LBCL bit according to USART_LastBit value */
;;;321      tmpreg |= (uint32_t)USART_ClockInitStruct->USART_Clock | USART_ClockInitStruct->USART_CPOL | 
00017e  880b              LDRH     r3,[r1,#0]
000180  884c              LDRH     r4,[r1,#2]
000182  4323              ORRS     r3,r3,r4
000184  888c              LDRH     r4,[r1,#4]
000186  4323              ORRS     r3,r3,r4
000188  88cc              LDRH     r4,[r1,#6]
00018a  4323              ORRS     r3,r3,r4
00018c  4318              ORRS     r0,r0,r3
;;;322                     USART_ClockInitStruct->USART_CPHA | USART_ClockInitStruct->USART_LastBit;
;;;323      /* Write to USART CR2 */
;;;324      USARTx->CR2 = (uint16_t)tmpreg;
00018e  8210              STRH     r0,[r2,#0x10]
;;;325    }
000190  bd10              POP      {r4,pc}
;;;326    
                          ENDP

                  USART_ClockStructInit PROC
;;;332      */
;;;333    void USART_ClockStructInit(USART_ClockInitTypeDef* USART_ClockInitStruct)
000192  2100              MOVS     r1,#0
;;;334    {
;;;335      /* USART_ClockInitStruct members default value */
;;;336      USART_ClockInitStruct->USART_Clock = USART_Clock_Disable;
000194  8001              STRH     r1,[r0,#0]
;;;337      USART_ClockInitStruct->USART_CPOL = USART_CPOL_Low;
000196  8041              STRH     r1,[r0,#2]
;;;338      USART_ClockInitStruct->USART_CPHA = USART_CPHA_1Edge;
000198  8081              STRH     r1,[r0,#4]
;;;339      USART_ClockInitStruct->USART_LastBit = USART_LastBit_Disable;
00019a  80c1              STRH     r1,[r0,#6]
;;;340    }
00019c  4770              BX       lr
;;;341    
                          ENDP

                  USART_Cmd PROC
;;;350      */
;;;351    void USART_Cmd(USART_TypeDef* USARTx, FunctionalState NewState)
00019e  b121              CBZ      r1,|L1.426|
;;;352    {
;;;353      /* Check the parameters */
;;;354      assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;355      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;356      
;;;357      if (NewState != DISABLE)
;;;358      {
;;;359        /* Enable the selected USART by setting the UE bit in the CR1 register */
;;;360        USARTx->CR1 |= CR1_UE_Set;
0001a0  8982              LDRH     r2,[r0,#0xc]
0001a2  f4425200          ORR      r2,r2,#0x2000
0001a6  8182              STRH     r2,[r0,#0xc]
0001a8  e004              B        |L1.436|
                  |L1.426|
;;;361      }
;;;362      else
;;;363      {
;;;364        /* Disable the selected USART by clearing the UE bit in the CR1 register */
;;;365        USARTx->CR1 &= CR1_UE_Reset;
0001aa  8982              LDRH     r2,[r0,#0xc]
0001ac  f64d73ff          MOV      r3,#0xdfff
0001b0  401a              ANDS     r2,r2,r3
0001b2  8182              STRH     r2,[r0,#0xc]
                  |L1.436|
;;;366      }
;;;367    }
0001b4  4770              BX       lr
;;;368    
                          ENDP

                  USART_ITConfig PROC
;;;387      */
;;;388    void USART_ITConfig(USART_TypeDef* USARTx, uint16_t USART_IT, FunctionalState NewState)
0001b6  b5f0              PUSH     {r4-r7,lr}
;;;389    {
0001b8  4603              MOV      r3,r0
;;;390      uint32_t usartreg = 0x00, itpos = 0x00, itmask = 0x00;
0001ba  2400              MOVS     r4,#0
0001bc  2600              MOVS     r6,#0
0001be  2500              MOVS     r5,#0
;;;391      uint32_t usartxbase = 0x00;
0001c0  2000              MOVS     r0,#0
;;;392      /* Check the parameters */
;;;393      assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;394      assert_param(IS_USART_CONFIG_IT(USART_IT));
;;;395      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;396      /* The CTS interrupt is not available for UART4 and UART5 */
;;;397      if (USART_IT == USART_IT_CTS)
0001c2  f5a16710          SUB      r7,r1,#0x900
0001c6  3f6a              SUBS     r7,r7,#0x6a
0001c8  d100              BNE      |L1.460|
;;;398      {
;;;399        assert_param(IS_USART_123_PERIPH(USARTx));
0001ca  bf00              NOP      
                  |L1.460|
;;;400      }   
;;;401      
;;;402      usartxbase = (uint32_t)USARTx;
0001cc  4618              MOV      r0,r3
;;;403    
;;;404      /* Get the USART register index */
;;;405      usartreg = (((uint8_t)USART_IT) >> 0x05);
0001ce  f3c11442          UBFX     r4,r1,#5,#3
;;;406    
;;;407      /* Get the interrupt position */
;;;408      itpos = USART_IT & IT_Mask;
0001d2  f001061f          AND      r6,r1,#0x1f
;;;409      itmask = (((uint32_t)0x01) << itpos);
0001d6  2701              MOVS     r7,#1
0001d8  fa07f506          LSL      r5,r7,r6
;;;410        
;;;411      if (usartreg == 0x01) /* The IT is in CR1 register */
0001dc  2c01              CMP      r4,#1
0001de  d101              BNE      |L1.484|
;;;412      {
;;;413        usartxbase += 0x0C;
0001e0  300c              ADDS     r0,r0,#0xc
0001e2  e004              B        |L1.494|
                  |L1.484|
;;;414      }
;;;415      else if (usartreg == 0x02) /* The IT is in CR2 register */
0001e4  2c02              CMP      r4,#2
0001e6  d101              BNE      |L1.492|
;;;416      {
;;;417        usartxbase += 0x10;
0001e8  3010              ADDS     r0,r0,#0x10
0001ea  e000              B        |L1.494|
                  |L1.492|
;;;418      }
;;;419      else /* The IT is in CR3 register */
;;;420      {
;;;421        usartxbase += 0x14; 
0001ec  3014              ADDS     r0,r0,#0x14
                  |L1.494|
;;;422      }
;;;423      if (NewState != DISABLE)
0001ee  b11a              CBZ      r2,|L1.504|
;;;424      {
;;;425        *(__IO uint32_t*)usartxbase  |= itmask;
0001f0  6807              LDR      r7,[r0,#0]
0001f2  432f              ORRS     r7,r7,r5
0001f4  6007              STR      r7,[r0,#0]
0001f6  e002              B        |L1.510|
                  |L1.504|
;;;426      }
;;;427      else
;;;428      {
;;;429        *(__IO uint32_t*)usartxbase &= ~itmask;
0001f8  6807              LDR      r7,[r0,#0]
0001fa  43af              BICS     r7,r7,r5
0001fc  6007              STR      r7,[r0,#0]
                  |L1.510|
;;;430      }
;;;431    }
0001fe  bdf0              POP      {r4-r7,pc}
;;;432    
                          ENDP

                  USART_DMACmd PROC
;;;447      */
;;;448    void USART_DMACmd(USART_TypeDef* USARTx, uint16_t USART_DMAReq, FunctionalState NewState)
000200  b11a              CBZ      r2,|L1.522|
;;;449    {
;;;450      /* Check the parameters */
;;;451      assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;452      assert_param(IS_USART_DMAREQ(USART_DMAReq));  
;;;453      assert_param(IS_FUNCTIONAL_STATE(NewState)); 
;;;454      if (NewState != DISABLE)
;;;455      {
;;;456        /* Enable the DMA transfer for selected requests by setting the DMAT and/or
;;;457           DMAR bits in the USART CR3 register */
;;;458        USARTx->CR3 |= USART_DMAReq;
000202  8a83              LDRH     r3,[r0,#0x14]
000204  430b              ORRS     r3,r3,r1
000206  8283              STRH     r3,[r0,#0x14]
000208  e002              B        |L1.528|
                  |L1.522|
;;;459      }
;;;460      else
;;;461      {
;;;462        /* Disable the DMA transfer for selected requests by clearing the DMAT and/or
;;;463           DMAR bits in the USART CR3 register */
;;;464        USARTx->CR3 &= (uint16_t)~USART_DMAReq;
00020a  8a83              LDRH     r3,[r0,#0x14]
00020c  438b              BICS     r3,r3,r1
00020e  8283              STRH     r3,[r0,#0x14]
                  |L1.528|
;;;465      }
;;;466    }
000210  4770              BX       lr
;;;467    
                          ENDP

                  USART_SetAddress PROC
;;;475      */
;;;476    void USART_SetAddress(USART_TypeDef* USARTx, uint8_t USART_Address)
000212  8a02              LDRH     r2,[r0,#0x10]
;;;477    {
;;;478      /* Check the parameters */
;;;479      assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;480      assert_param(IS_USART_ADDRESS(USART_Address)); 
;;;481        
;;;482      /* Clear the USART address */
;;;483      USARTx->CR2 &= CR2_Address_Mask;
000214  f64f73f0          MOV      r3,#0xfff0
000218  401a              ANDS     r2,r2,r3
00021a  8202              STRH     r2,[r0,#0x10]
;;;484      /* Set the USART address node */
;;;485      USARTx->CR2 |= USART_Address;
00021c  8a02              LDRH     r2,[r0,#0x10]
00021e  430a              ORRS     r2,r2,r1
000220  8202              STRH     r2,[r0,#0x10]
;;;486    }
000222  4770              BX       lr
;;;487    
                          ENDP

                  USART_WakeUpConfig PROC
;;;498      */
;;;499    void USART_WakeUpConfig(USART_TypeDef* USARTx, uint16_t USART_WakeUp)
000224  8982              LDRH     r2,[r0,#0xc]
;;;500    {
;;;501      /* Check the parameters */
;;;502      assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;503      assert_param(IS_USART_WAKEUP(USART_WakeUp));
;;;504      
;;;505      USARTx->CR1 &= CR1_WAKE_Mask;
000226  f24f73ff          MOV      r3,#0xf7ff
00022a  401a              ANDS     r2,r2,r3
00022c  8182              STRH     r2,[r0,#0xc]
;;;506      USARTx->CR1 |= USART_WakeUp;
00022e  8982              LDRH     r2,[r0,#0xc]
000230  430a              ORRS     r2,r2,r1
000232  8182              STRH     r2,[r0,#0xc]
;;;507    }
000234  4770              BX       lr
;;;508    
                          ENDP

                  USART_ReceiverWakeUpCmd PROC
;;;517      */
;;;518    void USART_ReceiverWakeUpCmd(USART_TypeDef* USARTx, FunctionalState NewState)
000236  b121              CBZ      r1,|L1.578|
;;;519    {
;;;520      /* Check the parameters */
;;;521      assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;522      assert_param(IS_FUNCTIONAL_STATE(NewState)); 
;;;523      
;;;524      if (NewState != DISABLE)
;;;525      {
;;;526        /* Enable the USART mute mode  by setting the RWU bit in the CR1 register */
;;;527        USARTx->CR1 |= CR1_RWU_Set;
000238  8982              LDRH     r2,[r0,#0xc]
00023a  f0420202          ORR      r2,r2,#2
00023e  8182              STRH     r2,[r0,#0xc]
000240  e004              B        |L1.588|
                  |L1.578|
;;;528      }
;;;529      else
;;;530      {
;;;531        /* Disable the USART mute mode by clearing the RWU bit in the CR1 register */
;;;532        USARTx->CR1 &= CR1_RWU_Reset;
000242  8982              LDRH     r2,[r0,#0xc]
000244  f64f73fd          MOV      r3,#0xfffd
000248  401a              ANDS     r2,r2,r3
00024a  8182              STRH     r2,[r0,#0xc]
                  |L1.588|
;;;533      }
;;;534    }
00024c  4770              BX       lr
;;;535    
                          ENDP

                  USART_LINBreakDetectLengthConfig PROC
;;;546      */
;;;547    void USART_LINBreakDetectLengthConfig(USART_TypeDef* USARTx, uint16_t USART_LINBreakDetectLength)
00024e  8a02              LDRH     r2,[r0,#0x10]
;;;548    {
;;;549      /* Check the parameters */
;;;550      assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;551      assert_param(IS_USART_LIN_BREAK_DETECT_LENGTH(USART_LINBreakDetectLength));
;;;552      
;;;553      USARTx->CR2 &= CR2_LBDL_Mask;
000250  f64f73df          MOV      r3,#0xffdf
000254  401a              ANDS     r2,r2,r3
000256  8202              STRH     r2,[r0,#0x10]
;;;554      USARTx->CR2 |= USART_LINBreakDetectLength;  
000258  8a02              LDRH     r2,[r0,#0x10]
00025a  430a              ORRS     r2,r2,r1
00025c  8202              STRH     r2,[r0,#0x10]
;;;555    }
00025e  4770              BX       lr
;;;556    
                          ENDP

                  USART_LINCmd PROC
;;;565      */
;;;566    void USART_LINCmd(USART_TypeDef* USARTx, FunctionalState NewState)
000260  b121              CBZ      r1,|L1.620|
;;;567    {
;;;568      /* Check the parameters */
;;;569      assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;570      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;571      
;;;572      if (NewState != DISABLE)
;;;573      {
;;;574        /* Enable the LIN mode by setting the LINEN bit in the CR2 register */
;;;575        USARTx->CR2 |= CR2_LINEN_Set;
000262  8a02              LDRH     r2,[r0,#0x10]
000264  f4424280          ORR      r2,r2,#0x4000
000268  8202              STRH     r2,[r0,#0x10]
00026a  e004              B        |L1.630|
                  |L1.620|
;;;576      }
;;;577      else
;;;578      {
;;;579        /* Disable the LIN mode by clearing the LINEN bit in the CR2 register */
;;;580        USARTx->CR2 &= CR2_LINEN_Reset;
00026c  8a02              LDRH     r2,[r0,#0x10]
00026e  f64b73ff          MOV      r3,#0xbfff
000272  401a              ANDS     r2,r2,r3
000274  8202              STRH     r2,[r0,#0x10]
                  |L1.630|
;;;581      }
;;;582    }
000276  4770              BX       lr
;;;583    
                          ENDP

                  USART_SendData PROC
;;;591      */
;;;592    void USART_SendData(USART_TypeDef* USARTx, uint16_t Data)
000278  f3c10208          UBFX     r2,r1,#0,#9
;;;593    {
;;;594      /* Check the parameters */
;;;595      assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;596      assert_param(IS_USART_DATA(Data)); 
;;;597        
;;;598      /* Transmit Data */
;;;599      USARTx->DR = (Data & (uint16_t)0x01FF);
00027c  8082              STRH     r2,[r0,#4]
;;;600    }
00027e  4770              BX       lr
;;;601    
                          ENDP

                  USART_ReceiveData PROC
;;;608      */
;;;609    uint16_t USART_ReceiveData(USART_TypeDef* USARTx)
000280  4601              MOV      r1,r0
;;;610    {
;;;611      /* Check the parameters */
;;;612      assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;613      
;;;614      /* Receive Data */
;;;615      return (uint16_t)(USARTx->DR & (uint16_t)0x01FF);
000282  8888              LDRH     r0,[r1,#4]
000284  f3c00008          UBFX     r0,r0,#0,#9
;;;616    }
000288  4770              BX       lr
;;;617    
                          ENDP

                  USART_SendBreak PROC
;;;624      */
;;;625    void USART_SendBreak(USART_TypeDef* USARTx)
00028a  8981              LDRH     r1,[r0,#0xc]
;;;626    {
;;;627      /* Check the parameters */
;;;628      assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;629      
;;;630      /* Send break characters */
;;;631      USARTx->CR1 |= CR1_SBK_Set;
00028c  f0410101          ORR      r1,r1,#1
000290  8181              STRH     r1,[r0,#0xc]
;;;632    }
000292  4770              BX       lr
;;;633    
                          ENDP

                  USART_SetGuardTime PROC
;;;640      */
;;;641    void USART_SetGuardTime(USART_TypeDef* USARTx, uint8_t USART_GuardTime)
000294  8b02              LDRH     r2,[r0,#0x18]
;;;642    {    
;;;643      /* Check the parameters */
;;;644      assert_param(IS_USART_123_PERIPH(USARTx));
;;;645      
;;;646      /* Clear the USART Guard time */
;;;647      USARTx->GTPR &= GTPR_LSB_Mask;
000296  b2d2              UXTB     r2,r2
000298  8302              STRH     r2,[r0,#0x18]
;;;648      /* Set the USART guard time */
;;;649      USARTx->GTPR |= (uint16_t)((uint16_t)USART_GuardTime << 0x08);
00029a  8b02              LDRH     r2,[r0,#0x18]
00029c  ea422201          ORR      r2,r2,r1,LSL #8
0002a0  8302              STRH     r2,[r0,#0x18]
;;;650    }
0002a2  4770              BX       lr
;;;651    
                          ENDP

                  USART_SetPrescaler PROC
;;;660      */
;;;661    void USART_SetPrescaler(USART_TypeDef* USARTx, uint8_t USART_Prescaler)
0002a4  8b02              LDRH     r2,[r0,#0x18]
;;;662    { 
;;;663      /* Check the parameters */
;;;664      assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;665      
;;;666      /* Clear the USART prescaler */
;;;667      USARTx->GTPR &= GTPR_MSB_Mask;
0002a6  f402427f          AND      r2,r2,#0xff00
0002aa  8302              STRH     r2,[r0,#0x18]
;;;668      /* Set the USART prescaler */
;;;669      USARTx->GTPR |= USART_Prescaler;
0002ac  8b02              LDRH     r2,[r0,#0x18]
0002ae  430a              ORRS     r2,r2,r1
0002b0  8302              STRH     r2,[r0,#0x18]
;;;670    }
0002b2  4770              BX       lr
;;;671    
                          ENDP

                  USART_SmartCardCmd PROC
;;;679      */
;;;680    void USART_SmartCardCmd(USART_TypeDef* USARTx, FunctionalState NewState)
0002b4  b121              CBZ      r1,|L1.704|
;;;681    {
;;;682      /* Check the parameters */
;;;683      assert_param(IS_USART_123_PERIPH(USARTx));
;;;684      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;685      if (NewState != DISABLE)
;;;686      {
;;;687        /* Enable the SC mode by setting the SCEN bit in the CR3 register */
;;;688        USARTx->CR3 |= CR3_SCEN_Set;
0002b6  8a82              LDRH     r2,[r0,#0x14]
0002b8  f0420220          ORR      r2,r2,#0x20
0002bc  8282              STRH     r2,[r0,#0x14]
0002be  e004              B        |L1.714|
                  |L1.704|
;;;689      }
;;;690      else
;;;691      {
;;;692        /* Disable the SC mode by clearing the SCEN bit in the CR3 register */
;;;693        USARTx->CR3 &= CR3_SCEN_Reset;
0002c0  8a82              LDRH     r2,[r0,#0x14]
0002c2  f64f73df          MOV      r3,#0xffdf
0002c6  401a              ANDS     r2,r2,r3
0002c8  8282              STRH     r2,[r0,#0x14]
                  |L1.714|
;;;694      }
;;;695    }
0002ca  4770              BX       lr
;;;696    
                          ENDP

                  USART_SmartCardNACKCmd PROC
;;;704      */
;;;705    void USART_SmartCardNACKCmd(USART_TypeDef* USARTx, FunctionalState NewState)
0002cc  b121              CBZ      r1,|L1.728|
;;;706    {
;;;707      /* Check the parameters */
;;;708      assert_param(IS_USART_123_PERIPH(USARTx));  
;;;709      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;710      if (NewState != DISABLE)
;;;711      {
;;;712        /* Enable the NACK transmission by setting the NACK bit in the CR3 register */
;;;713        USARTx->CR3 |= CR3_NACK_Set;
0002ce  8a82              LDRH     r2,[r0,#0x14]
0002d0  f0420210          ORR      r2,r2,#0x10
0002d4  8282              STRH     r2,[r0,#0x14]
0002d6  e004              B        |L1.738|
                  |L1.728|
;;;714      }
;;;715      else
;;;716      {
;;;717        /* Disable the NACK transmission by clearing the NACK bit in the CR3 register */
;;;718        USARTx->CR3 &= CR3_NACK_Reset;
0002d8  8a82              LDRH     r2,[r0,#0x14]
0002da  f64f73ef          MOV      r3,#0xffef
0002de  401a              ANDS     r2,r2,r3
0002e0  8282              STRH     r2,[r0,#0x14]
                  |L1.738|
;;;719      }
;;;720    }
0002e2  4770              BX       lr
;;;721    
                          ENDP

                  USART_HalfDuplexCmd PROC
;;;730      */
;;;731    void USART_HalfDuplexCmd(USART_TypeDef* USARTx, FunctionalState NewState)
0002e4  b121              CBZ      r1,|L1.752|
;;;732    {
;;;733      /* Check the parameters */
;;;734      assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;735      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;736      
;;;737      if (NewState != DISABLE)
;;;738      {
;;;739        /* Enable the Half-Duplex mode by setting the HDSEL bit in the CR3 register */
;;;740        USARTx->CR3 |= CR3_HDSEL_Set;
0002e6  8a82              LDRH     r2,[r0,#0x14]
0002e8  f0420208          ORR      r2,r2,#8
0002ec  8282              STRH     r2,[r0,#0x14]
0002ee  e004              B        |L1.762|
                  |L1.752|
;;;741      }
;;;742      else
;;;743      {
;;;744        /* Disable the Half-Duplex mode by clearing the HDSEL bit in the CR3 register */
;;;745        USARTx->CR3 &= CR3_HDSEL_Reset;
0002f0  8a82              LDRH     r2,[r0,#0x14]
0002f2  f64f73f7          MOV      r3,#0xfff7
0002f6  401a              ANDS     r2,r2,r3
0002f8  8282              STRH     r2,[r0,#0x14]
                  |L1.762|
;;;746      }
;;;747    }
0002fa  4770              BX       lr
;;;748    
                          ENDP

                  USART_OverSampling8Cmd PROC
;;;761      */
;;;762    void USART_OverSampling8Cmd(USART_TypeDef* USARTx, FunctionalState NewState)
0002fc  b121              CBZ      r1,|L1.776|
;;;763    {
;;;764      /* Check the parameters */
;;;765      assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;766      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;767      
;;;768      if (NewState != DISABLE)
;;;769      {
;;;770        /* Enable the 8x Oversampling mode by setting the OVER8 bit in the CR1 register */
;;;771        USARTx->CR1 |= CR1_OVER8_Set;
0002fe  8982              LDRH     r2,[r0,#0xc]
000300  f4424200          ORR      r2,r2,#0x8000
000304  8182              STRH     r2,[r0,#0xc]
000306  e003              B        |L1.784|
                  |L1.776|
;;;772      }
;;;773      else
;;;774      {
;;;775        /* Disable the 8x Oversampling mode by clearing the OVER8 bit in the CR1 register */
;;;776        USARTx->CR1 &= CR1_OVER8_Reset;
000308  8982              LDRH     r2,[r0,#0xc]
00030a  f3c2020e          UBFX     r2,r2,#0,#15
00030e  8182              STRH     r2,[r0,#0xc]
                  |L1.784|
;;;777      }
;;;778    }
000310  4770              BX       lr
;;;779    
                          ENDP

                  USART_OneBitMethodCmd PROC
;;;788      */
;;;789    void USART_OneBitMethodCmd(USART_TypeDef* USARTx, FunctionalState NewState)
000312  b121              CBZ      r1,|L1.798|
;;;790    {
;;;791      /* Check the parameters */
;;;792      assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;793      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;794      
;;;795      if (NewState != DISABLE)
;;;796      {
;;;797        /* Enable the one bit method by setting the ONEBITE bit in the CR3 register */
;;;798        USARTx->CR3 |= CR3_ONEBITE_Set;
000314  8a82              LDRH     r2,[r0,#0x14]
000316  f4426200          ORR      r2,r2,#0x800
00031a  8282              STRH     r2,[r0,#0x14]
00031c  e004              B        |L1.808|
                  |L1.798|
;;;799      }
;;;800      else
;;;801      {
;;;802        /* Disable tthe one bit method by clearing the ONEBITE bit in the CR3 register */
;;;803        USARTx->CR3 &= CR3_ONEBITE_Reset;
00031e  8a82              LDRH     r2,[r0,#0x14]
000320  f24f73ff          MOV      r3,#0xf7ff
000324  401a              ANDS     r2,r2,r3
000326  8282              STRH     r2,[r0,#0x14]
                  |L1.808|
;;;804      }
;;;805    }
000328  4770              BX       lr
;;;806    
                          ENDP

                  USART_IrDAConfig PROC
;;;817      */
;;;818    void USART_IrDAConfig(USART_TypeDef* USARTx, uint16_t USART_IrDAMode)
00032a  8a82              LDRH     r2,[r0,#0x14]
;;;819    {
;;;820      /* Check the parameters */
;;;821      assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;822      assert_param(IS_USART_IRDA_MODE(USART_IrDAMode));
;;;823        
;;;824      USARTx->CR3 &= CR3_IRLP_Mask;
00032c  f64f73fb          MOV      r3,#0xfffb
000330  401a              ANDS     r2,r2,r3
000332  8282              STRH     r2,[r0,#0x14]
;;;825      USARTx->CR3 |= USART_IrDAMode;
000334  8a82              LDRH     r2,[r0,#0x14]
000336  430a              ORRS     r2,r2,r1
000338  8282              STRH     r2,[r0,#0x14]
;;;826    }
00033a  4770              BX       lr
;;;827    
                          ENDP

                  USART_IrDACmd PROC
;;;836      */
;;;837    void USART_IrDACmd(USART_TypeDef* USARTx, FunctionalState NewState)
00033c  b121              CBZ      r1,|L1.840|
;;;838    {
;;;839      /* Check the parameters */
;;;840      assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;841      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;842        
;;;843      if (NewState != DISABLE)
;;;844      {
;;;845        /* Enable the IrDA mode by setting the IREN bit in the CR3 register */
;;;846        USARTx->CR3 |= CR3_IREN_Set;
00033e  8a82              LDRH     r2,[r0,#0x14]
000340  f0420202          ORR      r2,r2,#2
000344  8282              STRH     r2,[r0,#0x14]
000346  e004              B        |L1.850|
                  |L1.840|
;;;847      }
;;;848      else
;;;849      {
;;;850        /* Disable the IrDA mode by clearing the IREN bit in the CR3 register */
;;;851        USARTx->CR3 &= CR3_IREN_Reset;
000348  8a82              LDRH     r2,[r0,#0x14]
00034a  f64f73fd          MOV      r3,#0xfffd
00034e  401a              ANDS     r2,r2,r3
000350  8282              STRH     r2,[r0,#0x14]
                  |L1.850|
;;;852      }
;;;853    }
000352  4770              BX       lr
;;;854    
                          ENDP

                  USART_GetFlagStatus PROC
;;;873      */
;;;874    FlagStatus USART_GetFlagStatus(USART_TypeDef* USARTx, uint16_t USART_FLAG)
000354  4602              MOV      r2,r0
;;;875    {
;;;876      FlagStatus bitstatus = RESET;
000356  2000              MOVS     r0,#0
;;;877      /* Check the parameters */
;;;878      assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;879      assert_param(IS_USART_FLAG(USART_FLAG));
;;;880      /* The CTS flag is not available for UART4 and UART5 */
;;;881      if (USART_FLAG == USART_FLAG_CTS)
000358  f5b17f00          CMP      r1,#0x200
00035c  d100              BNE      |L1.864|
;;;882      {
;;;883        assert_param(IS_USART_123_PERIPH(USARTx));
00035e  bf00              NOP      
                  |L1.864|
;;;884      }  
;;;885      
;;;886      if ((USARTx->SR & USART_FLAG) != (uint16_t)RESET)
000360  8813              LDRH     r3,[r2,#0]
000362  420b              TST      r3,r1
000364  d001              BEQ      |L1.874|
;;;887      {
;;;888        bitstatus = SET;
000366  2001              MOVS     r0,#1
000368  e000              B        |L1.876|
                  |L1.874|
;;;889      }
;;;890      else
;;;891      {
;;;892        bitstatus = RESET;
00036a  2000              MOVS     r0,#0
                  |L1.876|
;;;893      }
;;;894      return bitstatus;
;;;895    }
00036c  4770              BX       lr
;;;896    
                          ENDP

                  USART_ClearFlag PROC
;;;922      */
;;;923    void USART_ClearFlag(USART_TypeDef* USARTx, uint16_t USART_FLAG)
00036e  f4017200          AND      r2,r1,#0x200
;;;924    {
;;;925      /* Check the parameters */
;;;926      assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;927      assert_param(IS_USART_CLEAR_FLAG(USART_FLAG));
;;;928      /* The CTS flag is not available for UART4 and UART5 */
;;;929      if ((USART_FLAG & USART_FLAG_CTS) == USART_FLAG_CTS)
000372  f5b27f00          CMP      r2,#0x200
000376  d100              BNE      |L1.890|
;;;930      {
;;;931        assert_param(IS_USART_123_PERIPH(USARTx));
000378  bf00              NOP      
                  |L1.890|
;;;932      } 
;;;933       
;;;934      USARTx->SR = (uint16_t)~USART_FLAG;
00037a  43ca              MVNS     r2,r1
00037c  8002              STRH     r2,[r0,#0]
;;;935    }
00037e  4770              BX       lr
;;;936    
                          ENDP

                  USART_GetITStatus PROC
;;;955      */
;;;956    ITStatus USART_GetITStatus(USART_TypeDef* USARTx, uint16_t USART_IT)
000380  b570              PUSH     {r4-r6,lr}
;;;957    {
000382  4602              MOV      r2,r0
;;;958      uint32_t bitpos = 0x00, itmask = 0x00, usartreg = 0x00;
000384  2400              MOVS     r4,#0
000386  2300              MOVS     r3,#0
000388  2500              MOVS     r5,#0
;;;959      ITStatus bitstatus = RESET;
00038a  2000              MOVS     r0,#0
;;;960      /* Check the parameters */
;;;961      assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;962      assert_param(IS_USART_GET_IT(USART_IT));
;;;963      /* The CTS interrupt is not available for UART4 and UART5 */ 
;;;964      if (USART_IT == USART_IT_CTS)
00038c  f5a16610          SUB      r6,r1,#0x900
000390  3e6a              SUBS     r6,r6,#0x6a
000392  d100              BNE      |L1.918|
;;;965      {
;;;966        assert_param(IS_USART_123_PERIPH(USARTx));
000394  bf00              NOP      
                  |L1.918|
;;;967      }   
;;;968      
;;;969      /* Get the USART register index */
;;;970      usartreg = (((uint8_t)USART_IT) >> 0x05);
000396  f3c11542          UBFX     r5,r1,#5,#3
;;;971      /* Get the interrupt position */
;;;972      itmask = USART_IT & IT_Mask;
00039a  f001031f          AND      r3,r1,#0x1f
;;;973      itmask = (uint32_t)0x01 << itmask;
00039e  2601              MOVS     r6,#1
0003a0  fa06f303          LSL      r3,r6,r3
;;;974      
;;;975      if (usartreg == 0x01) /* The IT  is in CR1 register */
0003a4  2d01              CMP      r5,#1
0003a6  d102              BNE      |L1.942|
;;;976      {
;;;977        itmask &= USARTx->CR1;
0003a8  8996              LDRH     r6,[r2,#0xc]
0003aa  4033              ANDS     r3,r3,r6
0003ac  e006              B        |L1.956|
                  |L1.942|
;;;978      }
;;;979      else if (usartreg == 0x02) /* The IT  is in CR2 register */
0003ae  2d02              CMP      r5,#2
0003b0  d102              BNE      |L1.952|
;;;980      {
;;;981        itmask &= USARTx->CR2;
0003b2  8a16              LDRH     r6,[r2,#0x10]
0003b4  4033              ANDS     r3,r3,r6
0003b6  e001              B        |L1.956|
                  |L1.952|
;;;982      }
;;;983      else /* The IT  is in CR3 register */
;;;984      {
;;;985        itmask &= USARTx->CR3;
0003b8  8a96              LDRH     r6,[r2,#0x14]
0003ba  4033              ANDS     r3,r3,r6
                  |L1.956|
;;;986      }
;;;987      
;;;988      bitpos = USART_IT >> 0x08;
0003bc  120c              ASRS     r4,r1,#8
;;;989      bitpos = (uint32_t)0x01 << bitpos;
0003be  2601              MOVS     r6,#1
0003c0  fa06f404          LSL      r4,r6,r4
;;;990      bitpos &= USARTx->SR;
0003c4  8816              LDRH     r6,[r2,#0]
0003c6  4034              ANDS     r4,r4,r6
;;;991      if ((itmask != (uint16_t)RESET)&&(bitpos != (uint16_t)RESET))
0003c8  b113              CBZ      r3,|L1.976|
0003ca  b10c              CBZ      r4,|L1.976|
;;;992      {
;;;993        bitstatus = SET;
0003cc  2001              MOVS     r0,#1
0003ce  e000              B        |L1.978|
                  |L1.976|
;;;994      }
;;;995      else
;;;996      {
;;;997        bitstatus = RESET;
0003d0  2000              MOVS     r0,#0
                  |L1.978|
;;;998      }
;;;999      
;;;1000     return bitstatus;  
;;;1001   }
0003d2  bd70              POP      {r4-r6,pc}
;;;1002   
                          ENDP

                  USART_ClearITPendingBit PROC
;;;1029     */
;;;1030   void USART_ClearITPendingBit(USART_TypeDef* USARTx, uint16_t USART_IT)
0003d4  b510              PUSH     {r4,lr}
;;;1031   {
;;;1032     uint16_t bitpos = 0x00, itmask = 0x00;
0003d6  2200              MOVS     r2,#0
0003d8  2300              MOVS     r3,#0
;;;1033     /* Check the parameters */
;;;1034     assert_param(IS_USART_ALL_PERIPH(USARTx));
;;;1035     assert_param(IS_USART_CLEAR_IT(USART_IT));
;;;1036     /* The CTS interrupt is not available for UART4 and UART5 */
;;;1037     if (USART_IT == USART_IT_CTS)
0003da  f5a16410          SUB      r4,r1,#0x900
0003de  3c6a              SUBS     r4,r4,#0x6a
0003e0  d100              BNE      |L1.996|
;;;1038     {
;;;1039       assert_param(IS_USART_123_PERIPH(USARTx));
0003e2  bf00              NOP      
                  |L1.996|
;;;1040     }   
;;;1041     
;;;1042     bitpos = USART_IT >> 0x08;
0003e4  120a              ASRS     r2,r1,#8
;;;1043     itmask = ((uint16_t)0x01 << (uint16_t)bitpos);
0003e6  2401              MOVS     r4,#1
0003e8  4094              LSLS     r4,r4,r2
0003ea  b2a3              UXTH     r3,r4
;;;1044     USARTx->SR = (uint16_t)~itmask;
0003ec  43dc              MVNS     r4,r3
0003ee  8004              STRH     r4,[r0,#0]
;;;1045   }
0003f0  bd10              POP      {r4,pc}
0003f2  0000              DCW      0x0000
                  |L1.1012|
                          DCD      0x40013800
                  |L1.1016|
                          DCD      0x40004400
                  |L1.1020|
                          DCD      0x40004800
                  |L1.1024|
                          DCD      0x40004c00
                  |L1.1028|
                          DCD      0x40005000
                          ENDP

