⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uart.lst

📁 本代码已经经过修改
💻 LST
📖 第 1 页 / 共 4 页
字号:
##############################################################################
#                                                                            #
# IAR ARM ANSI C/C++ Compiler V4.30A/W32 KICKSTART     14/Dec/2005  14:41:50 #
# Copyright 1999-2005 IAR Systems. All rights reserved.                      #
#                                                                            #
#    Cpu mode        =  interwork                                            #
#    Endian          =  little                                               #
#    Stack alignment =  4                                                    #
#    Source file     =  D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR71x_IA #
#                       R\Library\uart.c                                     #
#    Command line    =  D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR71x_IA #
#                       R\Library\uart.c -D _NDEBUG -D STR71X_IAR -lC        #
#                       D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR71x_IA #
#                       R\binary\List\ --diag_suppress pe191,pa082 -o        #
#                       D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR71x_IA #
#                       R\binary\Obj\ -s9 --no_clustering --cpu_mode thumb   #
#                       --endian little --cpu ARM7TDMI --stack_align 4       #
#                       --interwork -e --require_prototypes --fpu None       #
#                       --dlib_config "C:\Program Files\IAR                  #
#                       Systems\Embedded Workbench 4.0                       #
#                       Kickstart\arm\LIB\dl4tptinl8n.h" -I                  #
#                       D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR71x_IA #
#                       R\ -I D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR #
#                       71x_IAR\library\include\ -I                          #
#                       D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR71x_IA #
#                       R\..\common\include\ -I D:\board\FreeRTOSV3.2.3\Free #
#                       RTOS\Demo\ARM7_STR71x_IAR\..\..\source\include\ -I   #
#                       "C:\Program Files\IAR Systems\Embedded Workbench     #
#                       4.0 Kickstart\arm\INC\"                              #
#    List file       =  D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR71x_IA #
#                       R\binary\List\uart.lst                               #
#    Object file     =  D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR71x_IA #
#                       R\binary\Obj\uart.r79                                #
#                                                                            #
#                                                                            #
##############################################################################

D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR71x_IAR\Library\uart.c
      1          /******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
      2          * File Name          : uart.c
      3          * Author             : MCD Application Team
      4          * Date First Issued  : 06/08/2003
      5          * Description        : This file provides all the UART software functions
      6          ********************************************************************************
      7          * History:
      8          *  30/11/2004 : V2.0
      9          *  14/07/2004 : V1.3
     10          *  01/01/2004 : V1.2
     11          *******************************************************************************
     12           THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
     13           CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
     14           AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
     15           OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
     16           OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
     17           CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
     18          *******************************************************************************/
     19          
     20          #include "uart.h"
     21          
     22          /*******************************************************************************
     23          * Function Name  : UART_Init
     24          * Description    : This function initializes the selected UART.
     25          * Input 1        : UARTx (x can be 0,1, 2 or 3) the desired UART
     26          * Output         : None
     27          * Return         : None
     28          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
     29          void UART_Init(UART_TypeDef *UARTx)
     30          {
     31            UARTx->IER = 0x00;
   \                     UART_Init:
   \   00000000   0021               MOV         R1,#+0
   \   00000002   0182               STRH        R1,[R0, #+0x10]
     32            UARTx->CR = 0x00;
   \   00000004   8181               STRH        R1,[R0, #+0xC]
     33            (void)UARTx->RxBUFR;
   \   00000006   0189               LDRH        R1,[R0, #+0x8]
     34            UARTx->RxRSTR = 0xFFFF;
   \   00000008   ....               LDR         R1,??DataTable1    ;; 0xffff
   \   0000000A   8184               STRH        R1,[R0, #+0x24]
     35            UARTx->TxRSTR = 0xFFFF;
   \   0000000C   0184               STRH        R1,[R0, #+0x20]
     36          }
   \   0000000E   7047               BX          LR                 ;; return
     37          
     38          /*******************************************************************************
     39          * Function Name  : UART_BaudRateConfig
     40          * Description    : This function configures the baud rate of the selected UART.
     41          * Input 1        : UARTx (x can be 0,1, 2 or 3) the desired UART
     42          * Input 2        : The baudrate value
     43          * Output         : None
     44          * Return         : None
     45          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
     46          void UART_BaudRateConfig(UART_TypeDef *UARTx, u32 BaudRate)
     47          {
   \                     UART_BaudRateConfig:
   \   00000000   30B5               PUSH        {R4,R5,LR}
   \   00000002   041C               MOV         R4,R0
   \   00000004   0D1C               MOV         R5,R1
     48            UARTx->BR = (u16)(RCCU_FrequencyValue(RCCU_FCLK)/(16*BaudRate));
   \   00000006   0420               MOV         R0,#+0x4
   \   00000008   ........           _BLF        RCCU_FrequencyValue,RCCU_FrequencyValue??rT
   \   0000000C   2901               LSL         R1,R5,#+0x4
   \   0000000E   ........           _BLF        ??divu32_t,??rT??divu32_t
   \   00000012   2180               STRH        R1,[R4, #+0]
     49          }
   \   00000014   30BC               POP         {R4,R5}
   \   00000016   01BC               POP         {R0}
   \   00000018   0047               BX          R0                 ;; return
     50          
     51          /*******************************************************************************
     52          * Function Name  : UART_Config
     53          * Description    : This function configures the baudrate, the mode, the data
     54          *                  parity and the number of stop bits of the selected UART.
     55          * Input 1        : UARTx (x can be 0,1, 2 or 3) the desired UART
     56          * Input 2        : The baudrate value
     57          * Input 3        : The parity type
     58          * Input 4        : The number of stop bits
     59          * Input 5        : The UART mode
     60          * Output         : None
     61          * Return         : None
     62          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
     63          void UART_Config(UART_TypeDef *UARTx, u32 BaudRate, UARTParity_TypeDef Parity,
     64                           UARTStopBits_TypeDef StopBits, UARTMode_TypeDef Mode)
     65          {
   \                     UART_Config:
   \   00000000   F0B5               PUSH        {R4-R7,LR}
   \   00000002   041C               MOV         R4,R0
   \   00000004   0D1C               MOV         R5,R1
   \   00000006   161C               MOV         R6,R2
   \   00000008   1F1C               MOV         R7,R3
   \   0000000A   6846               MOV         R0,SP
   \   0000000C   007D               LDRB        R0,[R0, #+0x14]
     66            UART_ModeConfig(UARTx, Mode);
   \   0000000E   A189               LDRH        R1,[R4, #+0xC]
   \   00000010   0B4A               LDR         R2,??UART_Config_0  ;; 0xfff8
   \   00000012   0A40               AND         R2,R1
   \   00000014   1043               ORR         R0,R2
   \   00000016   A081               STRH        R0,[R4, #+0xC]
     67            UART_BaudRateConfig(UARTx, BaudRate);
   \   00000018   0420               MOV         R0,#+0x4
   \   0000001A   ........           _BLF        RCCU_FrequencyValue,RCCU_FrequencyValue??rT
   \   0000001E   2901               LSL         R1,R5,#+0x4
   \   00000020   ........           _BLF        ??divu32_t,??rT??divu32_t
   \   00000024   2180               STRH        R1,[R4, #+0]
     68            UART_ParityConfig(UARTx, Parity);
   \   00000026   A089               LDRH        R0,[R4, #+0xC]
   \   00000028   0649               LDR         R1,??UART_Config_0+0x4  ;; 0xffdf
   \   0000002A   0140               AND         R1,R0
   \   0000002C   0E43               ORR         R6,R1
   \   0000002E   A681               STRH        R6,[R4, #+0xC]
     69            UART_StopBitsConfig(UARTx, StopBits);
   \   00000030   A089               LDRH        R0,[R4, #+0xC]
   \   00000032   0549               LDR         R1,??UART_Config_0+0x8  ;; 0xffe7
   \   00000034   0140               AND         R1,R0
   \   00000036   0F43               ORR         R7,R1
   \   00000038   A781               STRH        R7,[R4, #+0xC]
     70          }
   \   0000003A   F0BC               POP         {R4-R7}
   \   0000003C   01BC               POP         {R0}
   \   0000003E   0047               BX          R0                 ;; return
   \                     ??UART_Config_0:
   \   00000040   F8FF0000           DC32        0xfff8
   \   00000044   DFFF0000           DC32        0xffdf
   \   00000048   E7FF0000           DC32        0xffe7
     71          
     72          /*******************************************************************************
     73          * Function Name  : UART_ItConfig
     74          * Description    : This function enables or disables the interrupts of the
     75          *                  selected UART.
     76          * Input 1        : UARTx (x can be 0,1, 2 or 3) the desired UART
     77          * Input 2        : The new interrupt flag
     78          * Input 3        : ENABLE or DISABLE
     79          * Output         : None
     80          * Return         : None
     81          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
     82          void UART_ItConfig(UART_TypeDef *UARTx, u16 UART_Flag, FunctionalState NewState)
     83          {
     84            if (NewState==ENABLE) UARTx->IER|=UART_Flag; else UARTx->IER&=~UART_Flag;
   \                     UART_ItConfig:
   \   00000000   012A               CMP         R2,#+0x1
   \   00000002   028A               LDRH        R2,[R0, #+0x10]
   \   00000004   02D1               BNE         ??UART_ItConfig_0
   \   00000006   1143               ORR         R1,R2
   \   00000008   0182               STRH        R1,[R0, #+0x10]
   \   0000000A   02E0               B           ??UART_ItConfig_1
   \                     ??UART_ItConfig_0:
   \   0000000C   CB43               MVN         R3,R1
   \   0000000E   1340               AND         R3,R2
   \   00000010   0382               STRH        R3,[R0, #+0x10]
     85          }
   \                     ??UART_ItConfig_1:
   \   00000012   00B0               ADD         SP,#+0
   \   00000014   7047               BX          LR                 ;; return
     86          
     87          /*******************************************************************************
     88          * Function Name  : UART_FifoConfig
     89          * Description    : This function enables or disables the Rx and Tx FIFOs of
     90          *                  the selected UART.
     91          * Input 1        : UARTx (x can be 0,1, 2 or 3) the desired UART
     92          * Input 2        : ENABLE or DISABLE
     93          * Output         : None
     94          * Return         : None
     95          *******************************************************************************/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -