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

📄 probe_rs232c.lst

📁 编译环境是 iar EWARM ,STM32 下的UCOSII
💻 LST
📖 第 1 页 / 共 3 页
字号:
##############################################################################
#                                                                            #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32 KICKSTART     26/Dec/2008  18:22:05 #
# Copyright 1999-2005 IAR Systems. All rights reserved.                      #
#                                                                            #
#    Cpu mode        =  thumb                                                #
#    Endian          =  little                                               #
#    Stack alignment =  4                                                    #
#    Source file     =  F:\PROJECT\STM32_UCOSII\uC-Probe\Target\Communicatio #
#                       n\Generic\RS-232\Ports\ST\STM32\probe_rs232c.c       #
#    Command line    =  F:\PROJECT\STM32_UCOSII\uC-Probe\Target\Communicatio #
#                       n\Generic\RS-232\Ports\ST\STM32\probe_rs232c.c -lCN  #
#                       F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\Flash\List\ -o                          #
#                       F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\Flash\Obj\ -z6 --no_unroll --no_inline  #
#                       --no_tbaa --no_scheduling --debug --cpu_mode thumb   #
#                       --endian little --cpu cortex-M3 --stack_align 4 -e   #
#                       --fpu None --dlib_config "E:\Program Files\IAR       #
#                       Systems\Embedded Workbench 4.0                       #
#                       Kickstart\arm\LIB\dl7mptnnl8n.h" -I                  #
#                       F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\ -I F:\PROJECT\STM32_UCOSII\EvalBoards\ #
#                       ST\STM3210E-EVAL\IAR\OS-Probe\..\BSP\ -I             #
#                       F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\..\..\..\..\..\CPU\ST\STM32\inc\ -I     #
#                       F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\..\..\..\..\..\uC-CPU\ -I               #
#                       F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\..\..\..\..\..\uC-CPU\ARM-Cortex-M3\IAR #
#                       \ -I F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E- #
#                       EVAL\IAR\OS-Probe\..\..\..\..\..\uC-LCD\Source\ -I   #
#                       F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\..\..\..\..\..\uC-LIB\ -I               #
#                       F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\..\..\..\..\..\uCOS-II\Ports\ARM-Cortex #
#                       -M3\Generic\IAR\ -I F:\PROJECT\STM32_UCOSII\EvalBoar #
#                       ds\ST\STM3210E-EVAL\IAR\OS-Probe\..\..\..\..\..\uCOS #
#                       -II\Source\ -I F:\PROJECT\STM32_UCOSII\EvalBoards\ST #
#                       \STM3210E-EVAL\IAR\OS-Probe\..\..\..\..\..\uC-Probe\ #
#                       Target\Communication\Generic\RS-232\Source\ -I       #
#                       F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Communic #
#                       ation\Generic\RS-232\Ports\ST\STM32\ -I              #
#                       F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Communic #
#                       ation\Generic\Source\ -I F:\PROJECT\STM32_UCOSII\Eva #
#                       lBoards\ST\STM3210E-EVAL\IAR\OS-Probe\..\..\..\..\.. #
#                       \uC-Probe\Target\Plugins\uCOS-II\ -I "E:\Program     #
#                       Files\IAR Systems\Embedded Workbench 4.0             #
#                       Kickstart\arm\INC\"                                  #
#    List file       =  F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\Flash\List\probe_rs232c.lst             #
#    Object file     =  F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\Flash\Obj\probe_rs232c.r79              #
#                                                                            #
#                                                                            #
##############################################################################

F:\PROJECT\STM32_UCOSII\uC-Probe\Target\Communication\Generic\RS-232\Ports\ST\STM32\probe_rs232c.c
      1          /*
      2          *********************************************************************************************************
      3          *                                      uC/Probe Communication
      4          *
      5          *                           (c) Copyright 2007; Micrium, Inc.; Weston, FL
      6          *
      7          *               All rights reserved.  Protected by international copyright laws.
      8          *               Knowledge of the source code may NOT be used to develop a similar product.
      9          *               Please help us continue to provide the Embedded community with the finest
     10          *               software available.  Your honesty is greatly appreciated.
     11          *********************************************************************************************************
     12          */
     13          
     14          /*
     15          *********************************************************************************************************
     16          *
     17          *                                              uC/Probe
     18          *
     19          *                                      Communication: RS-232
     20          *                                      Port for the ST STM32
     21          *
     22          * Filename      : probe_rs232c.c
     23          * Version       : V1.00
     24          * Programmer(s) : BAN
     25          *********************************************************************************************************
     26          */
     27          
     28          /*
     29          *********************************************************************************************************
     30          *                                            INCLUDE FILES
     31          *********************************************************************************************************
     32          */
     33          
     34          #include  <probe_rs232.h>
     35          #include  <includes.h>
     36          
     37          /*
     38          *********************************************************************************************************
     39          *                                            LOCAL DEFINES
     40          *********************************************************************************************************
     41          */
     42          
     43          
     44          /*
     45          *********************************************************************************************************
     46          *                                       LOCAL GLOBAL VARIABLES
     47          *********************************************************************************************************
     48          */
     49          
     50          
     51          /*
     52          *********************************************************************************************************
     53          *                                      LOCAL FUNCTION PROTOTYPES
     54          *********************************************************************************************************
     55          */
     56          
     57          
     58          /*
     59          *********************************************************************************************************
     60          *                                      LOCAL CONFIGURATION ERRORS
     61          *********************************************************************************************************
     62          */
     63          
     64          #ifndef    PROBE_RS232_COMM_SEL
     65          
     66            #error  "PROBE_RS232_COMM_SEL              not #define'd in 'probe_com_cfg.h'     "
     67            #error  "                                  [MUST be  PROBE_RS232_UART_1   ]       "
     68            #error  "                                  [     ||  PROBE_RS232_UART_2   ]       "
     69            #error  "                                  [     ||  PROBE_RS232_UART_3   ]       "
     70          
     71          #elif     (PROBE_RS232_COMM_SEL != PROBE_RS232_UART_1) && \
     72                    (PROBE_RS232_COMM_SEL != PROBE_RS232_UART_2) && \
     73                    (PROBE_RS232_COMM_SEL != PROBE_RS232_UART_3)
     74          
     75            #error  "PROBE_RS232_COMM_SEL        illegally #define'd in 'probe_com_cfg.h'     "
     76            #error  "                                  [MUST be  PROBE_RS232_UART_1   ]       "
     77            #error  "                                  [     ||  PROBE_RS232_UART_2   ]       "
     78            #error  "                                  [     ||  PROBE_RS232_UART_3   ]       "
     79          #endif
     80          
     81          #ifndef    PROBE_RS232_UART_1_REMAP
     82          
     83            #error  "PROBE_RS232_UART_1_REMAP          not #define'd in 'probe_com_cfg.h'     "
     84            #error  "                                  [MUST be  DEF_TRUE   ]                 "
     85            #error  "                                  [     ||  DEF_FALSE  ]                 "
     86          #endif
     87          
     88          #ifndef    PROBE_RS232_UART_2_REMAP
     89          
     90            #error  "PROBE_RS232_UART_2_REMAP          not #define'd in 'probe_com_cfg.h'     "
     91            #error  "                                  [MUST be  DEF_TRUE   ]                 "
     92            #error  "                                  [     ||  DEF_FALSE  ]                 "
     93          #endif
     94          
     95          #ifndef    PROBE_RS232_UART_3_REMAP_PARTIAL
     96          
     97            #error  "PROBE_RS232_UART_3_REMAP_PARTIAL  not #define'd in 'probe_com_cfg.h'     "
     98            #error  "                                  [MUST be  DEF_TRUE   ]                 "
     99            #error  "                                  [     ||  DEF_FALSE  ]                 "
    100          #endif
    101          
    102          #ifndef    PROBE_RS232_UART_3_REMAP_FULL
    103          
    104            #error  "PROBE_RS232_UART_3_REMAP_FULL     not #define'd in 'probe_com_cfg.h'     "
    105            #error  "                                  [MUST be  DEF_TRUE   ]                 "
    106            #error  "                                  [     ||  DEF_FALSE  ]                 "
    107          #endif
    108          
    109          /*
    110          *********************************************************************************************************
    111          *********************************************************************************************************
    112          *                                         GLOBAL FUNCTIONS
    113          *********************************************************************************************************
    114          *********************************************************************************************************
    115          */
    116          
    117          /*
    118          *********************************************************************************************************
    119          *                                      ProbeRS232_InitTarget()
    120          *
    121          * Description : Initialize the UART for uC/Probe communication.
    122          *
    123          * Argument(s) : baud_rate   Intended baud rate of the RS-232.
    124          *
    125          * Return(s)   : none.
    126          *
    127          * Note(s )    : (1) The following constants control the GPIO remap for the USART control lines:
    128          *
    129          *                        PROBE_RS232_UART_1_REMAP
    130          *                        PROBE_RS232_UART_2_REMAP
    131          *                        PROBE_RS232_UART_3_REMAP_PARTIAL
    132          *                        PROBE_RS232_UART_3_REMAP_FULL
    133          *
    134          *                    Though the #error directives in "Local Configuration Errors" will require that
    135          *                    all are defined, the value of those bearing on the USART not used will have no
    136          *                    effect.
    137          *
    138          *                (2) PROBE_RS232_UART_3_REMAP_PARTIAL has precedence over PROBE_RS232_UART_3_REMAP_FULL,
    139          *                    if both are defined to DEF_TRUE.
    140          *********************************************************************************************************
    141          */
    142          

   \                                 In segment CODE, align 4, keep-with-next
    143          void  ProbeRS232_InitTarget (CPU_INT32U baud_rate)
    144          {
   \                     ProbeRS232_InitTarget:
   \   00000000   10B5               PUSH     {R4,LR}
   \   00000002   87B0               SUB      SP,SP,#+28
    145              GPIO_InitTypeDef        gpio_init;
    146              USART_InitTypeDef       usart_init;
    147              USART_ClockInitTypeDef  usart_clk_init;
    148          
    149          
    150                                                                          /* ----------------- INIT USART STRUCT ---------------- */
    151              usart_init.USART_BaudRate            = baud_rate;
   \   00000004   0390               STR      R0,[SP, #+12]
    152              usart_init.USART_WordLength          = USART_WordLength_8b;
   \   00000006   0020               MOVS     R0,#+0
   \   00000008   0490               STR      R0,[SP, #+16]
    153              usart_init.USART_StopBits            = USART_StopBits_1;
    154              usart_init.USART_Parity              = USART_Parity_No ;
   \   0000000A   ADF81400           STRH     R0,[SP, #+20]
    155              usart_init.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
   \   0000000E   ADF81800           STRH     R0,[SP, #+24]
    156              usart_init.USART_Mode                = USART_Mode_Rx | USART_Mode_Tx;
   \   00000012   0C21               MOVS     R1,#+12
   \   00000014   ADF81610           STRH     R1,[SP, #+22]
    157          
    158          
    159              usart_clk_init.USART_Clock           = USART_Clock_Disable;
   \   00000018   0190               STR      R0,[SP, #+4]
    160              usart_clk_init.USART_CPOL            = USART_CPOL_Low;
    161              usart_clk_init.USART_CPHA            = USART_CPHA_2Edge;
   \   0000001A   5FF40074           MOVS     R4,#+512
   \   0000001E   ADF80840           STRH     R4,[SP, #+8]
    162              usart_clk_init.USART_LastBit         = USART_LastBit_Disable;
   \   00000022   ADF80A00           STRH     R0,[SP, #+10]
    163          
    164          
    165          #if (PROBE_RS232_COMM_SEL == PROBE_RS232_UART_1)
    166              BSP_PeriphEn(BSP_PERIPH_ID_USART1);
   \   00000026   2E20               MOVS     R0,#+46
   \   00000028   ........           _BLF     BSP_PeriphEn,??BSP_PeriphEn??rT
    167          
    168                                                                          /* ----------------- SETUP USART1 GPIO ---------------- */
    169          #if (PROBE_RS232_UART_1_REMAP > 0)
    170              BSP_PeriphEn(BSP_PERIPH_ID_IOPB);
    171              BSP_PeriphEn(BSP_PERIPH_ID_IOPD);
    172              BSP_PeriphEn(BSP_PERIPH_ID_AFIO);
    173          
    174              GPIO_PinRemapConfig(GPIO_Remap_USART2, ENABLE);
    175          
    176                                                                          /* Configure GPIOB.6 as push-pull                       */
    177              gpio_init.GPIO_Pin   = GPIO_Pin_6;
    178              gpio_init.GPIO_Speed = GPIO_Speed_50MHz;
    179              gpio_init.GPIO_Mode  = GPIO_Mode_AF_PP;
    180              GPIO_Init(GPIOD, &gpio_init);
    181          
    182                                                                          /* Configure GPIOB.7 as input floating                  */
    183              gpio_init.GPIO_Pin   = GPIO_Pin_7;
    184              gpio_init.GPIO_Mode  = GPIO_Mode_IN_FLOATING;
    185              GPIO_Init(GPIOB, &gpio_init);
    186          #else
    187              BSP_PeriphEn(BSP_PERIPH_ID_IOPA);
   \   0000002C   2220               MOVS     R0,#+34
   \   0000002E   ........           _BLF     BSP_PeriphEn,??BSP_PeriphEn??rT
    188          
    189                                                                          /* Configure GPIOA.9 as push-pull                       */

⌨️ 快捷键说明

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