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

📄 stm32f10x_gpio.txt

📁 STM32F103ZET6+UCOSII+UCGUI源码
💻 TXT
📖 第 1 页 / 共 3 页
字号:
000016  2f03              CMP      r7,#3                 ;529
000018  d106              BNE      |L8.40|
00001a  6868              LDR      r0,[r5,#4]            ;532
00001c  f0236270          BIC      r2,r3,#0xf000000      ;531
000020  f0206070          BIC      r0,r0,#0xf000000      ;532
000024  6068              STR      r0,[r5,#4]            ;532
000026  e008              B        |L8.58|
                  |L8.40|
000028  02c0              LSLS     r0,r0,#11             ;534
00002a  d503              BPL      |L8.52|
00002c  2003              MOVS     r0,#3                 ;536
00002e  4090              LSLS     r0,r0,r2              ;536
000030  4383              BICS     r3,r3,r0              ;537
000032  e000              B        |L8.54|
                  |L8.52|
000034  43a3              BICS     r3,r3,r4
                  |L8.54|
000036  f0436270          ORR      r2,r3,#0xf000000      ;538
                  |L8.58|
;;;543        tmpreg |= ~DBGAFR_SWJCFG_MASK;
;;;544      }
;;;545    
;;;546      if (NewState != DISABLE)
00003a  b101              CBZ      r1,|L8.62|
;;;547      {
;;;548        tmpreg |= (tmp << ((GPIO_Remap >> 0x15)*0x10));
00003c  4322              ORRS     r2,r2,r4
                  |L8.62|
;;;549      }
;;;550    
;;;551      AFIO->MAPR = tmpreg;
00003e  606a              STR      r2,[r5,#4]
;;;552    }
000040  bdf0              POP      {r4-r7,pc}
;;;553    
                          ENDP

000042  0000              DCW      0x0000
                  |L8.68|
                          DCD      0x40010000

                          AREA ||i.GPIO_ReadInputData||, CODE, READONLY, ALIGN=1

                  GPIO_ReadInputData PROC
;;;268    *******************************************************************************/
;;;269    u16 GPIO_ReadInputData(GPIO_TypeDef* GPIOx)
000000  6880              LDR      r0,[r0,#8]
;;;270    {
;;;271      /* Check the parameters */
;;;272      assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;273      
;;;274      return ((u16)GPIOx->IDR);
000002  b280              UXTH     r0,r0
;;;275    }
000004  4770              BX       lr
;;;276    
                          ENDP


                          AREA ||i.GPIO_ReadInputDataBit||, CODE, READONLY, ALIGN=1

                  GPIO_ReadInputDataBit PROC
;;;242    *******************************************************************************/
;;;243    u8 GPIO_ReadInputDataBit(GPIO_TypeDef* GPIOx, u16 GPIO_Pin)
000000  4602              MOV      r2,r0
;;;244    {
;;;245      u8 bitstatus = 0x00;
;;;246      
;;;247      /* Check the parameters */
;;;248      assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;249      assert_param(IS_GET_GPIO_PIN(GPIO_Pin)); 
;;;250      
;;;251      if ((GPIOx->IDR & GPIO_Pin) != (u32)Bit_RESET)
000002  6892              LDR      r2,[r2,#8]
000004  2000              MOVS     r0,#0                 ;245
000006  420a              TST      r2,r1
000008  d000              BEQ      |L10.12|
;;;252      {
;;;253        bitstatus = (u8)Bit_SET;
00000a  2001              MOVS     r0,#1
                  |L10.12|
;;;254      }
;;;255      else
;;;256      {
;;;257        bitstatus = (u8)Bit_RESET;
;;;258      }
;;;259      return bitstatus;
;;;260    }
00000c  4770              BX       lr
;;;261    
                          ENDP


                          AREA ||i.GPIO_ReadOutputData||, CODE, READONLY, ALIGN=1

                  GPIO_ReadOutputData PROC
;;;311    *******************************************************************************/
;;;312    u16 GPIO_ReadOutputData(GPIO_TypeDef* GPIOx)
000000  68c0              LDR      r0,[r0,#0xc]
;;;313    {
;;;314      /* Check the parameters */
;;;315      assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;316        
;;;317      return ((u16)GPIOx->ODR);
000002  b280              UXTH     r0,r0
;;;318    }
000004  4770              BX       lr
;;;319    
                          ENDP


                          AREA ||i.GPIO_ReadOutputDataBit||, CODE, READONLY, ALIGN=1

                  GPIO_ReadOutputDataBit PROC
;;;285    *******************************************************************************/
;;;286    u8 GPIO_ReadOutputDataBit(GPIO_TypeDef* GPIOx, u16 GPIO_Pin)
000000  4602              MOV      r2,r0
;;;287    {
;;;288      u8 bitstatus = 0x00;
;;;289    
;;;290      /* Check the parameters */
;;;291      assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;292      assert_param(IS_GET_GPIO_PIN(GPIO_Pin)); 
;;;293      
;;;294      if ((GPIOx->ODR & GPIO_Pin) != (u32)Bit_RESET)
000002  68d2              LDR      r2,[r2,#0xc]
000004  2000              MOVS     r0,#0                 ;288
000006  420a              TST      r2,r1
000008  d000              BEQ      |L12.12|
;;;295      {
;;;296        bitstatus = (u8)Bit_SET;
00000a  2001              MOVS     r0,#1
                  |L12.12|
;;;297      }
;;;298      else
;;;299      {
;;;300        bitstatus = (u8)Bit_RESET;
;;;301      }
;;;302      return bitstatus;
;;;303    }
00000c  4770              BX       lr
;;;304    
                          ENDP


                          AREA ||i.GPIO_ResetBits||, CODE, READONLY, ALIGN=1

                  GPIO_ResetBits PROC
;;;348    *******************************************************************************/
;;;349    void GPIO_ResetBits(GPIO_TypeDef* GPIOx, u16 GPIO_Pin)
000000  6141              STR      r1,[r0,#0x14]
;;;350    {
;;;351      /* Check the parameters */
;;;352      assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;353      assert_param(IS_GPIO_PIN(GPIO_Pin));
;;;354      
;;;355      GPIOx->BRR = GPIO_Pin;
;;;356    }
000002  4770              BX       lr
;;;357    
                          ENDP


                          AREA ||i.GPIO_SetBits||, CODE, READONLY, ALIGN=1

                  GPIO_SetBits PROC
;;;329    *******************************************************************************/
;;;330    void GPIO_SetBits(GPIO_TypeDef* GPIOx, u16 GPIO_Pin)
000000  6101              STR      r1,[r0,#0x10]
;;;331    {
;;;332      /* Check the parameters */
;;;333      assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;334      assert_param(IS_GPIO_PIN(GPIO_Pin));
;;;335      
;;;336      GPIOx->BSRR = GPIO_Pin;
;;;337    }
000002  4770              BX       lr
;;;338    
                          ENDP


                          AREA ||i.GPIO_StructInit||, CODE, READONLY, ALIGN=1

                  GPIO_StructInit PROC
;;;225    *******************************************************************************/
;;;226    void GPIO_StructInit(GPIO_InitTypeDef* GPIO_InitStruct)
000000  f64f71ff          MOV      r1,#0xffff
;;;227    {
;;;228      /* Reset GPIO init structure parameters values */
;;;229      GPIO_InitStruct->GPIO_Pin  = GPIO_Pin_All;
000004  8001              STRH     r1,[r0,#0]
;;;230      GPIO_InitStruct->GPIO_Speed = GPIO_Speed_2MHz;
000006  2102              MOVS     r1,#2
000008  7081              STRB     r1,[r0,#2]
;;;231      GPIO_InitStruct->GPIO_Mode = GPIO_Mode_IN_FLOATING;
00000a  2104              MOVS     r1,#4
00000c  70c1              STRB     r1,[r0,#3]
;;;232    }
00000e  4770              BX       lr
;;;233    
                          ENDP


                          AREA ||i.GPIO_Write||, CODE, READONLY, ALIGN=1

                  GPIO_Write PROC
;;;396    *******************************************************************************/
;;;397    void GPIO_Write(GPIO_TypeDef* GPIOx, u16 PortVal)
000000  60c1              STR      r1,[r0,#0xc]
;;;398    {
;;;399      /* Check the parameters */
;;;400      assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;401      
;;;402      GPIOx->ODR = PortVal;
;;;403    }
000002  4770              BX       lr
;;;404    
                          ENDP


                          AREA ||i.GPIO_WriteBit||, CODE, READONLY, ALIGN=1

                  GPIO_WriteBit PROC
;;;370    *******************************************************************************/
;;;371    void GPIO_WriteBit(GPIO_TypeDef* GPIOx, u16 GPIO_Pin, BitAction BitVal)
000000  b10a              CBZ      r2,|L17.6|
;;;372    {
;;;373      /* Check the parameters */
;;;374      assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
;;;375      assert_param(IS_GET_GPIO_PIN(GPIO_Pin));
;;;376      assert_param(IS_GPIO_BIT_ACTION(BitVal)); 
;;;377      
;;;378      if (BitVal != Bit_RESET)
;;;379      {
;;;380        GPIOx->BSRR = GPIO_Pin;
000002  6101              STR      r1,[r0,#0x10]
;;;381      }
;;;382      else
;;;383      {
;;;384        GPIOx->BRR = GPIO_Pin;
;;;385      }
;;;386    }
000004  4770              BX       lr
                  |L17.6|
000006  6141              STR      r1,[r0,#0x14]         ;384
000008  4770              BX       lr
;;;387    
                          ENDP

⌨️ 快捷键说明

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