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

📄 bsp_ser.lst

📁 stm32+ucos-ii
💻 LST
📖 第 1 页 / 共 4 页
字号:
###############################################################################
#                                                                             #
# IAR ANSI C/C++ Compiler V6.10.2.52244/W32 for ARM     07/Aug/2011  12:10:23 #
# Copyright 1999-2010 IAR Systems AB.                                         #
#                                                                             #
#    Cpu mode     =  thumb                                                    #
#    Endian       =  little                                                   #
#    Source file  =  F:\stm32\我的程序\Micrium\Software\EWARM\BSP\bsp_ser.c   #
#    Command line =  F:\stm32\我的程序\Micrium\Software\EWARM\BSP\bsp_ser.c   #
#                    -D USE_STDPERIPH_DRIVER -D STM32F10X_CL -lCN             #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Lis #
#                    t\ -o F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Fla #
#                    sh\Obj\ --no_cse --no_unroll --no_inline                 #
#                    --no_code_motion --no_tbaa --no_clustering               #
#                    --no_scheduling --debug --endian=little --cpu=Cortex-M3  #
#                    -e --fpu=None --dlib_config                              #
#                    D:\arm\INC\c\DLib_Config_Normal.h -I                     #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\APP\ -I   #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\   #
#                    -I F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP #
#                    \ST\CMSIS\CM3\CoreSupport\ -I                            #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\ST #
#                    \CMSIS\CM3\DeviceSupport\ST\STM32F10x\ -I                #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\ST #
#                    \STM32F10x_StdPeriph_Driver\inc\ -I                      #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\uC #
#                    OS-II\ -I F:\stm32\我的程序\Micrium\Software\EWARM\OS-II #
#                    \..\..\uCOS-II\Ports\ARM-Cortex-M3\Generic\IAR\ -I       #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\..\uCO #
#                    S-II\Source\ -I F:\stm32\我的程序\Micrium\Software\EWARM #
#                    \OS-II\..\..\uC-LIB\ -I F:\stm32\我的程序\Micrium\Softwa #
#                    re\EWARM\OS-II\..\..\uC-LIB\Ports\ARM-Cortex-M3\IAR\ -I  #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\..\uC- #
#                    CPU\ -I F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\. #
#                    .\..\uC-CPU\ARM-Cortex-M3\IAR\ -On --use_c++_inline      #
#    List file    =  F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Lis #
#                    t\bsp_ser.lst                                            #
#    Object file  =  F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Obj #
#                    \bsp_ser.o                                               #
#                                                                             #
#                                                                             #
###############################################################################

F:\stm32\我的程序\Micrium\Software\EWARM\BSP\bsp_ser.c
      1          /*
      2          *********************************************************************************************************
      3          *
      4          *                                    MICRIUM BOARD SUPPORT PACKAGE
      5          *
      6          *                          (c) Copyright 2003-2010; Micrium, Inc.; Weston, FL
      7          *
      8          *               All rights reserved.  Protected by international copyright laws.
      9          *
     10          *               This BSP is provided in source form to registered licensees ONLY.  It is
     11          *               illegal to distribute this source code to any third party unless you receive
     12          *               written permission by an authorized Micrium representative.  Knowledge of
     13          *               the source code may NOT be used to develop a similar product.
     14          *
     15          *               Please help us continue to provide the Embedded community with the finest
     16          *               software available.  Your honesty is greatly appreciated.
     17          *
     18          *               You can contact us at www.micrium.com.
     19          *********************************************************************************************************
     20          */
     21          
     22          /*
     23          *********************************************************************************************************
     24          *
     25          *                                    MICRIUM BOARD SUPPORT PACKAGE
     26          *                                       SERIAL (UART) INTERFACE
     27          *
     28          * Filename      : bsp_ser.c
     29          * Version       : V1.00
     30          * Programmer(s) : EHS
     31          *                 SR
     32          *                 AA
     33          *********************************************************************************************************
     34          */
     35          
     36          
     37          /*
     38          *********************************************************************************************************
     39          *                                             INCLUDE FILES
     40          *********************************************************************************************************
     41          */
     42          
     43          #define  BSP_SER_MODULE
     44          #include <bsp.h>
     45          
     46          
     47          /*
     48          *********************************************************************************************************
     49          *                                            LOCAL DEFINES
     50          *********************************************************************************************************
     51          */
     52          
     53          
     54          /*
     55          *********************************************************************************************************
     56          *                                           LOCAL CONSTANTS
     57          *********************************************************************************************************
     58          */
     59          
     60          
     61          /*
     62          *********************************************************************************************************
     63          *                                          LOCAL DATA TYPES
     64          *********************************************************************************************************
     65          */
     66          
     67          
     68          /*
     69          *********************************************************************************************************
     70          *                                            LOCAL TABLES
     71          *********************************************************************************************************
     72          */
     73          
     74          
     75          /*
     76          *********************************************************************************************************
     77          *                                       LOCAL GLOBAL VARIABLES
     78          *********************************************************************************************************
     79          */
     80          

   \                                 In section .bss, align 4
     81          static  BSP_OS_SEM   BSP_SerTxWait;
   \                     BSP_SerTxWait:
   \   00000000                      DS8 4

   \                                 In section .bss, align 4
     82          static  BSP_OS_SEM   BSP_SerRxWait;
   \                     BSP_SerRxWait:
   \   00000000                      DS8 4

   \                                 In section .bss, align 4
     83          static  BSP_OS_SEM   BSP_SerLock;
   \                     BSP_SerLock:
   \   00000000                      DS8 4

   \                                 In section .bss, align 1
     84          static  CPU_INT08U   BSP_SerRxData;
   \                     BSP_SerRxData:
   \   00000000                      DS8 1
     85          
     86          #if (BSP_CFG_SER_CMD_HISTORY_LEN > 0u)
     87          static  CPU_CHAR     BSP_SerCmdHistory[BSP_CFG_SER_CMD_HISTORY_LEN];
     88          #endif
     89          
     90          /*
     91          *********************************************************************************************************
     92          *                                      LOCAL FUNCTION PROTOTYPES
     93          *********************************************************************************************************
     94          */
     95          
     96          static  void        BSP_Ser_WrByteUnlocked  (CPU_INT08U  c);
     97          static  CPU_INT08U  BSP_Ser_RdByteUnlocked  (void);
     98          static  void        BSP_Ser_ISR_Handler     (void);
     99          
    100          
    101          
    102          /*
    103          *********************************************************************************************************
    104          *                                     LOCAL CONFIGURATION ERRORS
    105          *********************************************************************************************************
    106          */
    107          
    108          
    109          /*
    110          *********************************************************************************************************
    111          *********************************************************************************************************
    112          **                                         GLOBAL FUNCTIONS
    113          *********************************************************************************************************
    114          *********************************************************************************************************
    115          */
    116          
    117          
    118          /*
    119          *********************************************************************************************************
    120          *                                          BSP_Ser_Init()
    121          *
    122          * Description : Initialize a serial port for communication.
    123          *
    124          * Argument(s) : baud_rate           The desire RS232 baud rate.
    125          *
    126          * Return(s)   : none.
    127          *
    128          * Caller(s)   : Application.
    129          *
    130          * Note(s)     : none.
    131          *********************************************************************************************************
    132          */
    133          

   \                                 In section .text, align 2, keep-with-next
    134          void  BSP_Ser_Init (CPU_INT32U  baud_rate)
    135          {
   \                     BSP_Ser_Init:
   \   00000000   30B5               PUSH     {R4,R5,LR}
   \   00000002   87B0               SUB      SP,SP,#+28
   \   00000004   0400               MOVS     R4,R0
    136              FlagStatus              tc_status;
    137              GPIO_InitTypeDef        gpio_init;
    138              USART_InitTypeDef       usart_init;
    139              USART_ClockInitTypeDef  usart_clk_init;
    140          
    141          
    142                                                                          /* ------------------ INIT OS OBJECTS ----------------- */
    143              BSP_OS_SemCreate(&BSP_SerTxWait,   0, "Serial Tx Wait");
   \   00000006   ........           ADR.W    R2,`?<Constant "Serial Tx Wait">`
   \   0000000A   0021               MOVS     R1,#+0
   \   0000000C   ....               LDR.N    R0,??DataTable10
   \   0000000E   ........           BL       BSP_OS_SemCreate
    144              BSP_OS_SemCreate(&BSP_SerRxWait,   0, "Serial Rx Wait");
   \   00000012   ........           ADR.W    R2,`?<Constant "Serial Rx Wait">`
   \   00000016   0021               MOVS     R1,#+0
   \   00000018   ....               LDR.N    R0,??DataTable10_1
   \   0000001A   ........           BL       BSP_OS_SemCreate
    145              BSP_OS_SemCreate(&BSP_SerLock,     1, "Serial Lock");
   \   0000001E   ........           ADR.W    R2,`?<Constant "Serial Lock">`
   \   00000022   0121               MOVS     R1,#+1
   \   00000024   ....               LDR.N    R0,??DataTable10_2
   \   00000026   ........           BL       BSP_OS_SemCreate
    146          
    147          #if (BSP_CFG_SER_CMD_HISTORY_LEN > 0u)
    148              BSP_SerCmdHistory[0] = (CPU_CHAR)'\0';
    149          #endif
    150          
    151                                                                          /* ----------------- INIT USART STRUCT ---------------- */
    152              usart_init.USART_BaudRate            = baud_rate;
   \   0000002A   0394               STR      R4,[SP, #+12]
    153              usart_init.USART_WordLength          = USART_WordLength_8b;
   \   0000002C   0020               MOVS     R0,#+0
   \   0000002E   ADF81000           STRH     R0,[SP, #+16]
    154              usart_init.USART_StopBits            = USART_StopBits_1;
   \   00000032   0020               MOVS     R0,#+0
   \   00000034   ADF81200           STRH     R0,[SP, #+18]
    155              usart_init.USART_Parity              = USART_Parity_No ;
   \   00000038   0020               MOVS     R0,#+0
   \   0000003A   ADF81400           STRH     R0,[SP, #+20]
    156              usart_init.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
   \   0000003E   0020               MOVS     R0,#+0
   \   00000040   ADF81800           STRH     R0,[SP, #+24]
    157              usart_init.USART_Mode                = USART_Mode_Rx | USART_Mode_Tx;
   \   00000044   0C20               MOVS     R0,#+12
   \   00000046   ADF81600           STRH     R0,[SP, #+22]
    158          
    159              usart_clk_init.USART_Clock           = USART_Clock_Disable;
   \   0000004A   0020               MOVS     R0,#+0
   \   0000004C   ADF80400           STRH     R0,[SP, #+4]
    160              usart_clk_init.USART_CPOL            = USART_CPOL_Low;
   \   00000050   0020               MOVS     R0,#+0
   \   00000052   ADF80600           STRH     R0,[SP, #+6]
    161              usart_clk_init.USART_CPHA            = USART_CPHA_2Edge;
   \   00000056   4FF40070           MOV      R0,#+512
   \   0000005A   ADF80800           STRH     R0,[SP, #+8]
    162              usart_clk_init.USART_LastBit         = USART_LastBit_Disable;
   \   0000005E   0020               MOVS     R0,#+0
   \   00000060   ADF80A00           STRH     R0,[SP, #+10]
    163          
    164          
    165              BSP_PeriphEn(BSP_PERIPH_ID_USART2);
   \   00000064   5120               MOVS     R0,#+81
   \   00000066   ........           BL       BSP_PeriphEn
    166              BSP_PeriphEn(BSP_PERIPH_ID_IOPD);

⌨️ 快捷键说明

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