stm32f10x_gpio.lst

来自「针对STM32F103的UCOS移植」· LST 代码 · 共 1,009 行 · 第 1/4 页

LST
1,009
字号
##############################################################################
#                                                                            #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32 KICKSTART     13/Mar/2009  16:01:09 #
# Copyright 1999-2005 IAR Systems. All rights reserved.                      #
#                                                                            #
#    Cpu mode        =  thumb                                                #
#    Endian          =  little                                               #
#    Stack alignment =  4                                                    #
#    Source file     =  E:\UC_OS\Micrium\Software\CPU\ST\STM32\src\stm32f10x #
#                       _gpio.c                                              #
#    Command line    =  E:\UC_OS\Micrium\Software\CPU\ST\STM32\src\stm32f10x #
#                       _gpio.c -lCN E:\UC_OS\Micrium\Software\EvalBoards\ST #
#                       \STM3210B-EVAL\IAR\OS-Probe\Flash\List\ -o           #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\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          #
#                       "C:\Program Files\IAR Systems\Embedded Workbench     #
#                       4.0 Kickstart\arm\LIB\dl7mptnnl8n.h" -I              #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\ -I E:\UC_OS\Micrium\Software\EvalBoa #
#                       rds\ST\STM3210B-EVAL\IAR\OS-Probe\..\..\..\..\..\uco #
#                       s-ii\ports\arm-cortex-m3\generic\iar\ -I             #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\ucos-ii\source\ -I     #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\uc-lib\ -I             #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\uc-cpu\ -I             #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\uc-cpu\ARM-Cortex-M3\I #
#                       AR\ -I E:\UC_OS\Micrium\Software\EvalBoards\ST\STM32 #
#                       10B-EVAL\IAR\OS-Probe\..\..\..\..\..\cpu\st\stm32\in #
#                       c\ -I E:\UC_OS\Micrium\Software\EvalBoards\ST\STM321 #
#                       0B-EVAL\IAR\OS-Probe\..\BSP\ -I                      #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Commun #
#                       ication\Generic\RS-232\Source\ -I                    #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Commun #
#                       ication\Generic\RS-232\Ports\ST\STM32\ -I            #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Commun #
#                       ication\Generic\Source\ -I                           #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Plugin #
#                       s\uCOS-II\ -I "C:\Program Files\IAR                  #
#                       Systems\Embedded Workbench 4.0 Kickstart\arm\INC\"   #
#    List file       =  E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\Flash\List\stm32f10x_gpio.lst         #
#    Object file     =  E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\Flash\Obj\stm32f10x_gpio.r79          #
#                                                                            #
#                                                                            #
##############################################################################

E:\UC_OS\Micrium\Software\CPU\ST\STM32\src\stm32f10x_gpio.c
      1          /******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
      2          * File Name          : stm32f10x_gpio.c
      3          * Author             : MCD Application Team
      4          * Date First Issued  : 09/29/2006
      5          * Description        : This file provides all the GPIO firmware functions.
      6          ********************************************************************************
      7          * History:
      8          * 05/21/2007: V0.3
      9          * 04/02/2007: V0.2
     10          * 02/05/2007: V0.1
     11          * 09/29/2006: V0.01
     12          ********************************************************************************
     13          * THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
     14          * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
     15          * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
     16          * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
     17          * CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
     18          * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
     19          *******************************************************************************/
     20          
     21          /* Includes ------------------------------------------------------------------*/
     22          #include "stm32f10x_gpio.h"
     23          #include "stm32f10x_rcc.h"
     24          
     25          /* Private typedef -----------------------------------------------------------*/
     26          /* Private define ------------------------------------------------------------*/
     27          /* ------------ RCC registers bit address in the alias region ----------- */
     28          #define AFIO_OFFSET                 (AFIO_BASE - PERIPH_BASE)
     29          
     30          /* --- EVENTCR Register ---*/
     31          /* Alias word address of EVOE bit */
     32          #define EVCR_OFFSET                 (AFIO_OFFSET + 0x00)
     33          #define EVOE_BitNumber              ((u8)0x07)
     34          #define EVCR_EVOE_BB                (PERIPH_BB_BASE + (EVCR_OFFSET * 32) + (EVOE_BitNumber * 4))
     35          
     36          #define EVCR_PORTPINCONFIG_MASK     ((u16)0xFF80)
     37          #define LSB_MASK                    ((u16)0xFFFF)
     38          #define DBGAFR_POSITION_MASK        ((u32)0x000F0000)
     39          #define DBGAFR_SWJCFG_MASK          ((u32)0xF8FFFFFF)
     40          #define DBGAFR_LOCATION_MASK        ((u32)0x00200000)
     41          #define DBGAFR_NUMBITS_MASK         ((u32)0x00100000)
     42          
     43          /* Private macro -------------------------------------------------------------*/
     44          /* Private variables ---------------------------------------------------------*/
     45          /* Private function prototypes -----------------------------------------------*/
     46          /* Private functions ---------------------------------------------------------*/
     47          
     48          /*******************************************************************************
     49          * Function Name  : GPIO_DeInit
     50          * Description    : Deinitializes the GPIOx peripheral registers to their default
     51          *                  reset values.
     52          * Input          : - GPIOx: where x can be (A..E) to select the GPIO peripheral.
     53          * Output         : None
     54          * Return         : None
     55          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
     56          void GPIO_DeInit(GPIO_TypeDef* GPIOx)
     57          {
   \                     GPIO_DeInit:
   \   00000000   00B5               PUSH     {LR}
     58            switch (*(u32*)&GPIOx)
   \   00000002   1E49               LDR.N    R1,??GPIO_DeInit_0  ;; 0x40010800
   \   00000004   8842               CMP      R0,R1
   \   00000006   0CD0               BEQ.N    ??GPIO_DeInit_1
   \   00000008   1D49               LDR.N    R1,??GPIO_DeInit_0+0x4  ;; 0x40010c00
   \   0000000A   8842               CMP      R0,R1
   \   0000000C   12D0               BEQ.N    ??GPIO_DeInit_2
   \   0000000E   1D49               LDR.N    R1,??GPIO_DeInit_0+0x8  ;; 0x40011000
   \   00000010   8842               CMP      R0,R1
   \   00000012   18D0               BEQ.N    ??GPIO_DeInit_3
   \   00000014   1C49               LDR.N    R1,??GPIO_DeInit_0+0xC  ;; 0x40011400
   \   00000016   8842               CMP      R0,R1
   \   00000018   1ED0               BEQ.N    ??GPIO_DeInit_4
   \   0000001A   1C49               LDR.N    R1,??GPIO_DeInit_0+0x10  ;; 0x40011800
   \   0000001C   8842               CMP      R0,R1
   \   0000001E   24D0               BEQ.N    ??GPIO_DeInit_5
   \   00000020   00BD               POP      {PC}
     59            {
     60              case GPIOA_BASE:
     61                RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOA, ENABLE);
   \                     ??GPIO_DeInit_1:
   \   00000022   0121               MOVS     R1,#+1
   \   00000024   0420               MOVS     R0,#+4
   \   00000026   ........           _BLF     RCC_APB2PeriphResetCmd,??RCC_APB2PeriphResetCmd??rT
     62                RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOA, DISABLE);
   \   0000002A   0021               MOVS     R1,#+0
   \   0000002C   0420               MOVS     R0,#+4
   \   0000002E   ........           _BLF     RCC_APB2PeriphResetCmd,??RCC_APB2PeriphResetCmd??rT
   \   00000032   00BD               POP      {PC}
     63                break;
     64          
     65              case GPIOB_BASE:
     66                RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOB, ENABLE);
   \                     ??GPIO_DeInit_2:
   \   00000034   0121               MOVS     R1,#+1
   \   00000036   0820               MOVS     R0,#+8
   \   00000038   ........           _BLF     RCC_APB2PeriphResetCmd,??RCC_APB2PeriphResetCmd??rT
     67                RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOB, DISABLE);
   \   0000003C   0021               MOVS     R1,#+0
   \   0000003E   0820               MOVS     R0,#+8
   \   00000040   ........           _BLF     RCC_APB2PeriphResetCmd,??RCC_APB2PeriphResetCmd??rT
   \   00000044   00BD               POP      {PC}
     68                break;
     69          
     70              case GPIOC_BASE:
     71                RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOC, ENABLE);
   \                     ??GPIO_DeInit_3:
   \   00000046   0121               MOVS     R1,#+1
   \   00000048   1020               MOVS     R0,#+16
   \   0000004A   ........           _BLF     RCC_APB2PeriphResetCmd,??RCC_APB2PeriphResetCmd??rT
     72                RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOC, DISABLE);
   \   0000004E   0021               MOVS     R1,#+0
   \   00000050   1020               MOVS     R0,#+16
   \   00000052   ........           _BLF     RCC_APB2PeriphResetCmd,??RCC_APB2PeriphResetCmd??rT
   \   00000056   00BD               POP      {PC}
     73                break;
     74          
     75              case GPIOD_BASE:
     76                RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOD, ENABLE);
   \                     ??GPIO_DeInit_4:
   \   00000058   0121               MOVS     R1,#+1
   \   0000005A   2020               MOVS     R0,#+32
   \   0000005C   ........           _BLF     RCC_APB2PeriphResetCmd,??RCC_APB2PeriphResetCmd??rT
     77                RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOD, DISABLE);
   \   00000060   0021               MOVS     R1,#+0
   \   00000062   2020               MOVS     R0,#+32
   \   00000064   ........           _BLF     RCC_APB2PeriphResetCmd,??RCC_APB2PeriphResetCmd??rT
   \   00000068   00BD               POP      {PC}
     78                break;
     79                
     80              case GPIOE_BASE:
     81                RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOE, ENABLE);
   \                     ??GPIO_DeInit_5:
   \   0000006A   0121               MOVS     R1,#+1
   \   0000006C   4020               MOVS     R0,#+64
   \   0000006E   ........           _BLF     RCC_APB2PeriphResetCmd,??RCC_APB2PeriphResetCmd??rT
     82                RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOE, DISABLE);
   \   00000072   0021               MOVS     R1,#+0
   \   00000074   4020               MOVS     R0,#+64
   \   00000076   ........           _BLF     RCC_APB2PeriphResetCmd,??RCC_APB2PeriphResetCmd??rT
     83                break;            
     84          
     85              default:
     86                break;
     87            }
     88          }
   \   0000007A   00BD               POP      {PC}             ;; return
   \                     ??GPIO_DeInit_0:
   \   0000007C   00080140           DC32     0x40010800
   \   00000080   000C0140           DC32     0x40010c00
   \   00000084   00100140           DC32     0x40011000
   \   00000088   00140140           DC32     0x40011400
   \   0000008C   00180140           DC32     0x40011800
     89          
     90          /*******************************************************************************
     91          * Function Name  : GPIO_AFIODeInit
     92          * Description    : Deinitializes the Alternate Functions (remap, event control
     93          *                  and EXTI configuration) registers to their default reset
     94          *                  values.
     95          * Input          : None
     96          * Output         : None
     97          * Return         : None
     98          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
     99          void GPIO_AFIODeInit(void)
    100          {
   \                     GPIO_AFIODeInit:
   \   00000000   00B5               PUSH     {LR}
    101            RCC_APB2PeriphResetCmd(RCC_APB2Periph_AFIO, ENABLE);
   \   00000002   0121               MOVS     R1,#+1
   \   00000004   0846               MOV      R0,R1
   \   00000006   ........           _BLF     RCC_APB2PeriphResetCmd,??RCC_APB2PeriphResetCmd??rT
    102            RCC_APB2PeriphResetCmd(RCC_APB2Periph_AFIO, DISABLE);
   \   0000000A   0021               MOVS     R1,#+0
   \   0000000C   0120               MOVS     R0,#+1
   \   0000000E   ........           _BLF     RCC_APB2PeriphResetCmd,??RCC_APB2PeriphResetCmd??rT
    103          }
   \   00000012   00BD               POP      {PC}             ;; return
    104          
    105          /*******************************************************************************
    106          * Function Name  : GPIO_Init
    107          * Description    : Initializes the GPIOx peripheral according to the specified
    108          *                  parameters in the GPIO_InitStruct.
    109          * Input          : - GPIOx: where x can be (A..E) to select the GPIO peripheral.
    110          *                  - GPIO_InitStruct: pointer to a GPIO_InitTypeDef structure that
    111          *                    contains the configuration information for the specified GPIO
    112          *                    peripheral.
    113          * Output         : None
    114          * Return         : None
    115          *******************************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    116          void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct)

⌨️ 快捷键说明

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