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

📄 stm32f10x_gpio.lst

📁 完成数据的采集
💻 LST
📖 第 1 页 / 共 4 页
字号:
    136          
    137              for (pinpos = 0x00; pinpos < 0x08; pinpos++)
   \   00000038   0026               MOVS     R6,#+0
   \   0000003A   3200               MOVS     R2,R6
   \                     ??GPIO_Init_2:
   \   0000003C   082A               CMP      R2,#+8
   \   0000003E   20D2               BCS.N    ??GPIO_Init_3
    138              {
    139                pos = ((u32)0x01) << pinpos;
   \   00000040   0126               MOVS     R6,#+1
   \   00000042   9640               LSLS     R6,R6,R2
   \   00000044   3300               MOVS     R3,R6
    140                /* Get the port pins position */
    141                currentpin = (GPIO_InitStruct->GPIO_Pin) & pos;
   \   00000046   0E88               LDRH     R6,[R1, #+0]
   \   00000048   1E40               ANDS     R6,R6,R3
   \   0000004A   0096               STR      R6,[SP, #+0]
    142          
    143                if (currentpin == pos)
   \   0000004C   009E               LDR      R6,[SP, #+0]
   \   0000004E   9E42               CMP      R6,R3
   \   00000050   15D1               BNE.N    ??GPIO_Init_4
    144                {
    145                  pos = pinpos << 2;
   \   00000052   9300               LSLS     R3,R2,#+2
    146                  /* Clear the corresponding low control register bits */
    147                  pinmask = ((u32)0x0F) << pos;
   \   00000054   0F26               MOVS     R6,#+15
   \   00000056   9E40               LSLS     R6,R6,R3
   \   00000058   0196               STR      R6,[SP, #+4]
    148                  tmpreg &= ~pinmask;
   \   0000005A   019E               LDR      R6,[SP, #+4]
   \   0000005C   B443               BICS     R4,R4,R6
    149          
    150                  /* Write the mode configuration in the corresponding bits */
    151                  tmpreg |= (currentmode << pos);
   \   0000005E   2600               MOVS     R6,R4
   \   00000060   2C00               MOVS     R4,R5
   \   00000062   9C40               LSLS     R4,R4,R3
   \   00000064   3443               ORRS     R4,R4,R6
    152          
    153                  /* Reset the corresponding ODR bit */
    154                  if (GPIO_InitStruct->GPIO_Mode == GPIO_Mode_IPD)
   \   00000066   CE78               LDRB     R6,[R1, #+3]
   \   00000068   282E               CMP      R6,#+40
   \   0000006A   02D1               BNE.N    ??GPIO_Init_5
    155                  {
    156                    GPIOx->BRR = (((u32)0x01) << pinpos);
   \   0000006C   0126               MOVS     R6,#+1
   \   0000006E   9640               LSLS     R6,R6,R2
   \   00000070   4661               STR      R6,[R0, #+20]
    157                  }
    158                  /* Set the corresponding ODR bit */
    159                  if (GPIO_InitStruct->GPIO_Mode == GPIO_Mode_IPU)
   \                     ??GPIO_Init_5:
   \   00000072   CE78               LDRB     R6,[R1, #+3]
   \   00000074   482E               CMP      R6,#+72
   \   00000076   02D1               BNE.N    ??GPIO_Init_4
    160                  {
    161                    GPIOx->BSRR = (((u32)0x01) << pinpos);
   \   00000078   0126               MOVS     R6,#+1
   \   0000007A   9640               LSLS     R6,R6,R2
   \   0000007C   0661               STR      R6,[R0, #+16]
    162                  }
    163                }
    164              }
   \                     ??GPIO_Init_4:
   \   0000007E   521C               ADDS     R2,R2,#+1
   \   00000080   DCE7               B.N      ??GPIO_Init_2
    165              GPIOx->CRL = tmpreg;
   \                     ??GPIO_Init_3:
   \   00000082   0460               STR      R4,[R0, #+0]
    166              tmpreg = 0;
   \   00000084   0026               MOVS     R6,#+0
   \   00000086   3400               MOVS     R4,R6
    167            }
    168          
    169          /*---------------------------- GPIO CRH Configuration ------------------------*/
    170            /* Configure the eight high port pins */
    171            if (GPIO_InitStruct->GPIO_Pin > 0x00FF)
   \                     ??GPIO_Init_1:
   \   00000088   0E88               LDRH     R6,[R1, #+0]
   \   0000008A   5FF48077           MOVS     R7,#+256
   \   0000008E   BE42               CMP      R6,R7
   \   00000090   2DD3               BCC.N    ??GPIO_Init_6
    172            {
    173              tmpreg = GPIOx->CRH;
   \   00000092   4668               LDR      R6,[R0, #+4]
   \   00000094   3400               MOVS     R4,R6
    174              for (pinpos = 0x00; pinpos < 0x08; pinpos++)
   \   00000096   0026               MOVS     R6,#+0
   \   00000098   3200               MOVS     R2,R6
   \                     ??GPIO_Init_7:
   \   0000009A   082A               CMP      R2,#+8
   \   0000009C   26D2               BCS.N    ??GPIO_Init_8
    175              {
    176                pos = (((u32)0x01) << (pinpos + 0x08));
   \   0000009E   0126               MOVS     R6,#+1
   \   000000A0   1700               MOVS     R7,R2
   \   000000A2   0837               ADDS     R7,R7,#+8
   \   000000A4   BE40               LSLS     R6,R6,R7
   \   000000A6   3300               MOVS     R3,R6
    177                /* Get the port pins position */
    178                currentpin = ((GPIO_InitStruct->GPIO_Pin) & pos);
   \   000000A8   0E88               LDRH     R6,[R1, #+0]
   \   000000AA   1E40               ANDS     R6,R6,R3
   \   000000AC   0096               STR      R6,[SP, #+0]
    179                if (currentpin == pos)
   \   000000AE   009E               LDR      R6,[SP, #+0]
   \   000000B0   9E42               CMP      R6,R3
   \   000000B2   19D1               BNE.N    ??GPIO_Init_9
    180                {
    181                  pos = pinpos << 2;
   \   000000B4   9300               LSLS     R3,R2,#+2
    182                  /* Clear the corresponding high control register bits */
    183                  pinmask = ((u32)0x0F) << pos;
   \   000000B6   0F26               MOVS     R6,#+15
   \   000000B8   9E40               LSLS     R6,R6,R3
   \   000000BA   0196               STR      R6,[SP, #+4]
    184                  tmpreg &= ~pinmask;
   \   000000BC   019E               LDR      R6,[SP, #+4]
   \   000000BE   B443               BICS     R4,R4,R6
    185          
    186                  /* Write the mode configuration in the corresponding bits */
    187                  tmpreg |= (currentmode << pos);
   \   000000C0   2600               MOVS     R6,R4
   \   000000C2   2C00               MOVS     R4,R5
   \   000000C4   9C40               LSLS     R4,R4,R3
   \   000000C6   3443               ORRS     R4,R4,R6
    188          
    189                  /* Reset the corresponding ODR bit */
    190                  if (GPIO_InitStruct->GPIO_Mode == GPIO_Mode_IPD)
   \   000000C8   CE78               LDRB     R6,[R1, #+3]
   \   000000CA   282E               CMP      R6,#+40
   \   000000CC   04D1               BNE.N    ??GPIO_Init_10
    191                  {
    192                    GPIOx->BRR = (((u32)0x01) << (pinpos + 0x08));
   \   000000CE   0126               MOVS     R6,#+1
   \   000000D0   1700               MOVS     R7,R2
   \   000000D2   0837               ADDS     R7,R7,#+8
   \   000000D4   BE40               LSLS     R6,R6,R7
   \   000000D6   4661               STR      R6,[R0, #+20]
    193                  }
    194                  /* Set the corresponding ODR bit */
    195                  if (GPIO_InitStruct->GPIO_Mode == GPIO_Mode_IPU)
   \                     ??GPIO_Init_10:
   \   000000D8   CE78               LDRB     R6,[R1, #+3]
   \   000000DA   482E               CMP      R6,#+72
   \   000000DC   04D1               BNE.N    ??GPIO_Init_9
    196                  {
    197                    GPIOx->BSRR = (((u32)0x01) << (pinpos + 0x08));
   \   000000DE   0126               MOVS     R6,#+1
   \   000000E0   1700               MOVS     R7,R2
   \   000000E2   0837               ADDS     R7,R7,#+8
   \   000000E4   BE40               LSLS     R6,R6,R7
   \   000000E6   0661               STR      R6,[R0, #+16]
    198                  }
    199                }
    200              }
   \                     ??GPIO_Init_9:
   \   000000E8   521C               ADDS     R2,R2,#+1
   \   000000EA   D6E7               B.N      ??GPIO_Init_7
    201              GPIOx->CRH = tmpreg;
   \                     ??GPIO_Init_8:
   \   000000EC   4460               STR      R4,[R0, #+4]
    202            }
    203          }
   \                     ??GPIO_Init_6:
   \   000000EE   02B0               ADD      SP,SP,#+8
   \   000000F0   F0BC               POP      {R4-R7}
   \   000000F2   7047               BX       LR               ;; return
    204          
    205          /*******************************************************************************
    206          * Function Name  : GPIO_StructInit
    207          * Description    : Fills each GPIO_InitStruct member with its default value.
    208          * Input          : - GPIO_InitStruct : pointer to a GPIO_InitTypeDef structure
    209          *                    which will be initialized.
    210          * Output         : None
    211          * Return         : None
    212          *******************************************************************************/

   \                                 In section .XML, align 4, keep-with-next
    213          void GPIO_StructInit(GPIO_InitTypeDef* GPIO_InitStruct)
    214          {
    215            /* Reset GPIO init structure parameters values */
    216            GPIO_InitStruct->GPIO_Pin  = GPIO_Pin_All;
   \                     GPIO_StructInit:
   \   00000000   0349               LDR.N    R1,??GPIO_StructInit_0  ;; 0xffff
   \   00000002   0180               STRH     R1,[R0, #+0]
    217            GPIO_InitStruct->GPIO_Speed = GPIO_Speed_2MHz;
   \   00000004   0221               MOVS     R1,#+2
   \   00000006   8170               STRB     R1,[R0, #+2]
    218            GPIO_InitStruct->GPIO_Mode = GPIO_Mode_IN_FLOATING;
   \   00000008   0421               MOVS     R1,#+4
   \   0000000A   C170               STRB     R1,[R0, #+3]
    219          }
   \   0000000C   7047               BX       LR               ;; return
   \   0000000E   00BF               Nop      
   \                     ??GPIO_StructInit_0:
   \   00000010   FFFF0000           DC32     0xffff
    220          
    221          /*******************************************************************************
    222          * Function Name  : GPIO_ReadInputDataBit
    223          * Description    : Reads the specified input port pin.
    224          * Input          : - GPIOx: where x can be (A..E) to select the GPIO peripheral.
    225          *                : - GPIO_Pin:  specifies the port bit to read.
    226          *                    This parameter can be GPIO_Pin_x where x can be (0..15).
    227          * Output         : None
    228          * Return         : The input port pin value.
    229          *******************************************************************************/

   \                                 In section .XML, align 4, keep-with-next
    230          u8 GPIO_ReadInputDataBit(GPIO_TypeDef* GPIOx, u16 GPIO_Pin)
    231          {
   \                     GPIO_ReadInputDataBit:
   \   00000000   11B4               PUSH     {R0,R4}
   \   00000002   0200               MOVS     R2,R0
    232            u8 bitstatus = 0x00;
   \   00000004   0023               MOVS     R3,#+0
   \   00000006   1800               MOVS     R0,R3
    233          
    234            /* Check the parameters */
    235            assert_param(IS_GET_GPIO_PIN(GPIO_Pin));
    236          
    237            if ((GPIOx->IDR & GPIO_Pin) != (u32)Bit_RESET)
   \   00000008   9368               LDR      R3,[R2, #+8]
   \   0000000A   0B40               ANDS     R3,R3,R1
   \   0000000C   1C00               MOVS     R4,R3
   \   0000000E   A4B2               UXTH     R4,R4            ;; ZeroExtS R4,R4,#+16,#+16
   \   00000010   641E               SUBS     R4,R4,#+1
   \   00000012   A441               SBCS     R4,R4,R4
   \   00000014   E443               MVNS     R4,R4
   \   00000016   E40F               LSRS     R4,R4,#+31
   \   00000018   2000               MOVS     R0,R4
    238            {
    239              bitstatus = (u8)Bit_SET;
    240            }
    241            else
    242            {
    243              bitstatus = (u8)Bit_RESET;
    244            }
    245            return bitstatus;
   \   0000001A   C0B2               UXTB     R0,R0            ;; ZeroExtS R0,R0,#+24,#+24
   \   0000001C   01B0               ADD      SP,SP,#+4
   \   0000001E   10BC               POP      {R4}
   \   00000020   7047               BX       LR               ;; return
    246          }
    247          
    248          /*******************************************************************************
    249          * Function Name  : GPIO_ReadInputData
    250          * Description    : Reads the specified GPIO input data port.
    251          * Input          : - GPIOx: where x can be (A..E) to select the GPIO peripheral.
    252          * Output         : None
    253          * Return         : GPIO input data port value.
    254          *******************************************************************************/

   \                                 In section .XML, align 4, keep-with-next
    255          u16 GPIO_ReadInputData(GPIO_TypeDef* GPIOx)
    256          {
    257            return ((u16)GPIOx->IDR);
   \                     GPIO_ReadInputData:
   \   00000000   8068               LDR      R0,[R0, #+8]
   \   00000002   80B2               UXTH     R0,R0            ;; ZeroExtS R0,R0,#+16,#+16
   \   00000004   7047               BX       LR               ;; return
    258          }
    259          
    260          /*******************************************************************************
    261          * Function Name  : GPIO_ReadOutputDataBit
    262          * Description    : Reads the specified output data port bit.
    263          * Input          : - GPIOx: where x can be (A..E) to select the GPIO peripheral.
    264          *                : - GPIO_Pin:  specifies the port bit to read.
    265          *                    This parameter can be GPIO_Pin_x where x can be (0..15).

⌨️ 快捷键说明

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