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

📄 stm32f10x_gpio.s79

📁 STM32利用正交编码器实现电机的控制
💻 S79
📖 第 1 页 / 共 3 页
字号:
        THUMB
GPIO_StructInit:
        LDR.N    R1,??GPIO_StructInit_0  ;; 0xffff
        STRH     R1,[R0, #+0]
        MOVS     R1,#+2
        STRB     R1,[R0, #+2]
        MOVS     R1,#+4
        STRB     R1,[R0, #+3]
        BX       LR               ;; return
        Nop      
        DATA
??GPIO_StructInit_0:
        DC32     0xffff

        RSEG CODE:CODE:NOROOT(2)
        THUMB
GPIO_ReadInputDataBit:
        PUSH     {R4,R5,LR}
        MOVS     R4,R0
        MOVS     R5,R1
        MOVS     R0,#+0
        CMP      R5,#+1
        BEQ.N    ??GPIO_ReadInputDataBit_0
        CMP      R5,#+2
        BEQ.N    ??GPIO_ReadInputDataBit_0
        CMP      R5,#+4
        BEQ.N    ??GPIO_ReadInputDataBit_0
        CMP      R5,#+8
        BEQ.N    ??GPIO_ReadInputDataBit_0
        CMP      R5,#+16
        BEQ.N    ??GPIO_ReadInputDataBit_0
        CMP      R5,#+32
        BEQ.N    ??GPIO_ReadInputDataBit_0
        CMP      R5,#+64
        BEQ.N    ??GPIO_ReadInputDataBit_0
        CMP      R5,#+128
        BEQ.N    ??GPIO_ReadInputDataBit_0
        MOVS     R0,#+256
        CMP      R5,R0
        BEQ.N    ??GPIO_ReadInputDataBit_0
        MOVS     R0,#+512
        CMP      R5,R0
        BEQ.N    ??GPIO_ReadInputDataBit_0
        MOVS     R0,#+1024
        CMP      R5,R0
        BEQ.N    ??GPIO_ReadInputDataBit_0
        MOVS     R0,#+2048
        CMP      R5,R0
        BEQ.N    ??GPIO_ReadInputDataBit_0
        MOVS     R0,#+4096
        CMP      R5,R0
        BEQ.N    ??GPIO_ReadInputDataBit_0
        MOVS     R0,#+8192
        CMP      R5,R0
        BEQ.N    ??GPIO_ReadInputDataBit_0
        MOVS     R0,#+16384
        CMP      R5,R0
        BEQ.N    ??GPIO_ReadInputDataBit_0
        MOVS     R0,#+32768
        CMP      R5,R0
        BEQ.N    ??GPIO_ReadInputDataBit_0
        MOVS     R1,#+240
        LDR.N    R0,??DataTable9  ;; `?<Constant "C:\\\\David JIANG\\\\ST MCU...">`
        _BLF     assert_failed,??assert_failed??rT
??GPIO_ReadInputDataBit_0:
        LDR      R0,[R4, #+8]
        TST      R0,R5
        BEQ.N    ??GPIO_ReadInputDataBit_1
        MOVS     R0,#+1
        B.N      ??GPIO_ReadInputDataBit_2
??GPIO_ReadInputDataBit_1:
        MOVS     R0,#+0
??GPIO_ReadInputDataBit_2:
        POP      {R4,R5,PC}       ;; return

        RSEG CODE:CODE:NOROOT(2)
        THUMB
GPIO_ReadInputData:
        LDR      R0,[R0, #+8]
        LSLS     R0,R0,#+16       ;; ZeroExtS R0,R0,#+16,#+16
        LSRS     R0,R0,#+16
        BX       LR               ;; return

        RSEG CODE:CODE:NOROOT(2)
        THUMB
GPIO_ReadOutputDataBit:
        PUSH     {R4,R5,LR}
        MOVS     R4,R0
        MOVS     R5,R1
        MOVS     R0,#+0
        CMP      R5,#+1
        BEQ.N    ??GPIO_ReadOutputDataBit_0
        CMP      R5,#+2
        BEQ.N    ??GPIO_ReadOutputDataBit_0
        CMP      R5,#+4
        BEQ.N    ??GPIO_ReadOutputDataBit_0
        CMP      R5,#+8
        BEQ.N    ??GPIO_ReadOutputDataBit_0
        CMP      R5,#+16
        BEQ.N    ??GPIO_ReadOutputDataBit_0
        CMP      R5,#+32
        BEQ.N    ??GPIO_ReadOutputDataBit_0
        CMP      R5,#+64
        BEQ.N    ??GPIO_ReadOutputDataBit_0
        CMP      R5,#+128
        BEQ.N    ??GPIO_ReadOutputDataBit_0
        MOVS     R0,#+256
        CMP      R5,R0
        BEQ.N    ??GPIO_ReadOutputDataBit_0
        MOVS     R0,#+512
        CMP      R5,R0
        BEQ.N    ??GPIO_ReadOutputDataBit_0
        MOVS     R0,#+1024
        CMP      R5,R0
        BEQ.N    ??GPIO_ReadOutputDataBit_0
        MOVS     R0,#+2048
        CMP      R5,R0
        BEQ.N    ??GPIO_ReadOutputDataBit_0
        MOVS     R0,#+4096
        CMP      R5,R0
        BEQ.N    ??GPIO_ReadOutputDataBit_0
        MOVS     R0,#+8192
        CMP      R5,R0
        BEQ.N    ??GPIO_ReadOutputDataBit_0
        MOVS     R0,#+16384
        CMP      R5,R0
        BEQ.N    ??GPIO_ReadOutputDataBit_0
        MOVS     R0,#+32768
        CMP      R5,R0
        BEQ.N    ??GPIO_ReadOutputDataBit_0
        LDR.N    R1,??GPIO_ReadOutputDataBit_1  ;; 0x117
        LDR.N    R0,??DataTable9  ;; `?<Constant "C:\\\\David JIANG\\\\ST MCU...">`
        _BLF     assert_failed,??assert_failed??rT
??GPIO_ReadOutputDataBit_0:
        LDR      R0,[R4, #+12]
        TST      R0,R5
        BEQ.N    ??GPIO_ReadOutputDataBit_2
        MOVS     R0,#+1
        B.N      ??GPIO_ReadOutputDataBit_3
??GPIO_ReadOutputDataBit_2:
        MOVS     R0,#+0
??GPIO_ReadOutputDataBit_3:
        POP      {R4,R5,PC}       ;; return
        Nop      
        DATA
??GPIO_ReadOutputDataBit_1:
        DC32     0x117

        RSEG CODE:CODE:NOROOT(2)
        THUMB
GPIO_ReadOutputData:
        LDR      R0,[R0, #+12]
        LSLS     R0,R0,#+16       ;; ZeroExtS R0,R0,#+16,#+16
        LSRS     R0,R0,#+16
        BX       LR               ;; return

        RSEG CODE:CODE:NOROOT(2)
        THUMB
GPIO_SetBits:
        PUSH     {R4,R5,LR}
        MOVS     R4,R0
        MOVS     R5,R1
        CMP      R5,#+0
        BNE.N    ??GPIO_SetBits_0
        LDR.N    R1,??GPIO_SetBits_1  ;; 0x13d
        LDR.N    R0,??DataTable9  ;; `?<Constant "C:\\\\David JIANG\\\\ST MCU...">`
        _BLF     assert_failed,??assert_failed??rT
??GPIO_SetBits_0:
        STR      R5,[R4, #+16]
        POP      {R4,R5,PC}       ;; return
        Nop      
        DATA
??GPIO_SetBits_1:
        DC32     0x13d

        RSEG CODE:CODE:NOROOT(2)
        THUMB
GPIO_ResetBits:
        PUSH     {R4,R5,LR}
        MOVS     R4,R0
        MOVS     R5,R1
        CMP      R5,#+0
        BNE.N    ??GPIO_ResetBits_0
        MOVS     R1,#+334
        LDR.N    R0,??DataTable9  ;; `?<Constant "C:\\\\David JIANG\\\\ST MCU...">`
        _BLF     assert_failed,??assert_failed??rT
??GPIO_ResetBits_0:
        STR      R5,[R4, #+20]
        POP      {R4,R5,PC}       ;; return

        RSEG CODE:CODE:NOROOT(2)
        THUMB
GPIO_WriteBit:
        PUSH     {R4-R6,LR}
        MOVS     R4,R0
        MOVS     R5,R1
        MOVS     R6,R2
        CMP      R5,#+1
        BEQ.N    ??GPIO_WriteBit_0
        CMP      R5,#+2
        BEQ.N    ??GPIO_WriteBit_0
        CMP      R5,#+4
        BEQ.N    ??GPIO_WriteBit_0
        CMP      R5,#+8
        BEQ.N    ??GPIO_WriteBit_0
        CMP      R5,#+16
        BEQ.N    ??GPIO_WriteBit_0
        CMP      R5,#+32
        BEQ.N    ??GPIO_WriteBit_0
        CMP      R5,#+64
        BEQ.N    ??GPIO_WriteBit_0
        CMP      R5,#+128
        BEQ.N    ??GPIO_WriteBit_0
        MOVS     R0,#+256
        CMP      R5,R0
        BEQ.N    ??GPIO_WriteBit_0
        MOVS     R0,#+512
        CMP      R5,R0
        BEQ.N    ??GPIO_WriteBit_0
        MOVS     R0,#+1024
        CMP      R5,R0
        BEQ.N    ??GPIO_WriteBit_0
        MOVS     R0,#+2048
        CMP      R5,R0
        BEQ.N    ??GPIO_WriteBit_0
        MOVS     R0,#+4096
        CMP      R5,R0
        BEQ.N    ??GPIO_WriteBit_0
        MOVS     R0,#+8192
        CMP      R5,R0
        BEQ.N    ??GPIO_WriteBit_0
        MOVS     R0,#+16384
        CMP      R5,R0
        BEQ.N    ??GPIO_WriteBit_0
        MOVS     R0,#+32768
        CMP      R5,R0
        BEQ.N    ??GPIO_WriteBit_0
        MOVS     R1,#+354
        LDR.N    R0,??DataTable9  ;; `?<Constant "C:\\\\David JIANG\\\\ST MCU...">`
        _BLF     assert_failed,??assert_failed??rT
??GPIO_WriteBit_0:
        CMP      R6,#+0
        BEQ.N    ??GPIO_WriteBit_1
        CMP      R6,#+1
        BEQ.N    ??GPIO_WriteBit_1
        LDR.N    R1,??GPIO_WriteBit_2  ;; 0x163
        LDR.N    R0,??DataTable9  ;; `?<Constant "C:\\\\David JIANG\\\\ST MCU...">`
        _BLF     assert_failed,??assert_failed??rT
??GPIO_WriteBit_1:
        CMP      R6,#+0
        BEQ.N    ??GPIO_WriteBit_3
        STR      R5,[R4, #+16]
        B.N      ??GPIO_WriteBit_4
??GPIO_WriteBit_3:
        STR      R5,[R4, #+20]
??GPIO_WriteBit_4:
        POP      {R4-R6,PC}       ;; return
        Nop      
        DATA
??GPIO_WriteBit_2:
        DC32     0x163

        RSEG CODE:CODE:NOROOT(2)
        THUMB
GPIO_Write:
        STR      R1,[R0, #+12]
        BX       LR               ;; return

        RSEG CODE:CODE:NOROOT(2)
        THUMB
GPIO_PinLockConfig:
        PUSH     {R4-R6,LR}
        MOVS     R4,R0
        MOVS     R5,R1
        MOVS     R6,#+65536
        CMP      R5,#+0
        BNE.N    ??GPIO_PinLockConfig_0
        MOVS     R1,#+396
        LDR.N    R0,??DataTable9  ;; `?<Constant "C:\\\\David JIANG\\\\ST MCU...">`
        _BLF     assert_failed,??assert_failed??rT
??GPIO_PinLockConfig_0:
        LSLS     R5,R5,#+16       ;; ZeroExtS R5,R5,#+16,#+16
        LSRS     R5,R5,#+16
        ORRS     R6,R6,R5
        STR      R6,[R4, #+24]
        STR      R5,[R4, #+24]
        STR      R6,[R4, #+24]
        LDR      R6,[R4, #+24]
        LDR      R0,[R4, #+24]
        MOVS     R6,R0
        POP      {R4-R6,PC}       ;; return

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable9:
        DC32     `?<Constant "C:\\\\David JIANG\\\\ST MCU...">`

        RSEG CODE:CODE:NOROOT(2)
        THUMB
GPIO_EventOutputConfig:
        PUSH     {R4,R5,LR}
        MOVS     R4,R0
        MOVS     R5,R1
        MOVS     R0,#+0
        CMP      R4,#+0
        BEQ.N    ??GPIO_EventOutputConfig_0
        CMP      R4,#+1
        BEQ.N    ??GPIO_EventOutputConfig_0
        CMP      R4,#+2
        BEQ.N    ??GPIO_EventOutputConfig_0
        CMP      R4,#+3
        BEQ.N    ??GPIO_EventOutputConfig_0
        CMP      R4,#+4
        BEQ.N    ??GPIO_EventOutputConfig_0
        MOVS     R1,#+428
        LDR.N    R0,??DataTable20  ;; `?<Constant "C:\\\\David JIANG\\\\ST MCU...">`
        _BLF     assert_failed,??assert_failed??rT
??GPIO_EventOutputConfig_0:
        CMP      R5,#+0
        BEQ.N    ??GPIO_EventOutputConfig_1
        CMP      R5,#+1
        BEQ.N    ??GPIO_EventOutputConfig_1
        CMP      R5,#+2
        BEQ.N    ??GPIO_EventOutputConfig_1
        CMP      R5,#+3
        BEQ.N    ??GPIO_EventOutputConfig_1
        CMP      R5,#+4
        BEQ.N    ??GPIO_EventOutputConfig_1
        CMP      R5,#+5
        BEQ.N    ??GPIO_EventOutputConfig_1
        CMP      R5,#+6
        BEQ.N    ??GPIO_EventOutputConfig_1
        CMP      R5,#+7
        BEQ.N    ??GPIO_EventOutputConfig_1
        CMP      R5,#+8
        BEQ.N    ??GPIO_EventOutputConfig_1
        CMP      R5,#+9
        BEQ.N    ??GPIO_EventOutputConfig_1
        CMP      R5,#+10
        BEQ.N    ??GPIO_EventOutputConfig_1
        CMP      R5,#+11
        BEQ.N    ??GPIO_EventOutputConfig_1
        CMP      R5,#+12
        BEQ.N    ??GPIO_EventOutputConfig_1
        CMP      R5,#+13
        BEQ.N    ??GPIO_EventOutputConfig_1

⌨️ 快捷键说明

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