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

📄 stm32f10x_rtc.s79

📁 STM32利用正交编码器实现电机的控制
💻 S79
📖 第 1 页 / 共 2 页
字号:
//////////////////////////////////////////////////////////////////////////////
//                                                                           /
// IAR ARM ANSI C/C++ Compiler V4.42A/W32              15/May/2008  12:06:32 /
// Copyright 1999-2005 IAR Systems. All rights reserved.                     /
//                                                                           /
//    Cpu mode        =  thumb                                               /
//    Endian          =  little                                              /
//    Stack alignment =  4                                                   /
//    Source file     =  C:\David JIANG\ST MCU\Docs\STM32\AN_JIANG\TIM       /
//                       Encoder\example\FWLib\src\stm32f10x_rtc.c           /
//    Command line    =  "C:\David JIANG\ST MCU\Docs\STM32\AN_JIANG\TIM      /
//                       Encoder\example\FWLib\src\stm32f10x_rtc.c" -D       /
//                       VECT_TAB_FLASH -lcN "C:\David JIANG\ST              /
//                       MCU\Docs\STM32\AN_JIANG\TIM                         /
//                       Encoder\example\project\EWARM\BOOT_FLASH\List\"     /
//                       -lb "C:\David JIANG\ST MCU\Docs\STM32\AN_JIANG\TIM  /
//                       Encoder\example\project\EWARM\BOOT_FLASH\List\" -o  /
//                       "C:\David JIANG\ST MCU\Docs\STM32\AN_JIANG\TIM      /
//                       Encoder\example\project\EWARM\BOOT_FLASH\Obj\" -z3  /
//                       --no_cse --no_unroll --no_inline --no_code_motion   /
//                       --no_tbaa --no_clustering --no_scheduling --debug   /
//                       --cpu_mode thumb --endian little --cpu cortex-M3    /
//                       --stack_align 4 --require_prototypes --fpu None     /
//                       --dlib_config "C:\Program Files\IAR                 /
//                       Systems\Embedded Workbench                          /
//                       4.0\arm\LIB\dl7mptnnl8f.h" -I "C:\David JIANG\ST    /
//                       MCU\Docs\STM32\AN_JIANG\TIM                         /
//                       Encoder\example\project\EWARM\" -I "C:\David        /
//                       JIANG\ST MCU\Docs\STM32\AN_JIANG\TIM                /
//                       Encoder\example\project\EWARM\..\include\" -I       /
//                       "C:\David JIANG\ST MCU\Docs\STM32\AN_JIANG\TIM      /
//                       Encoder\example\project\EWARM\..\..\FWLib\inc\" -I  /
//                       "C:\Program Files\IAR Systems\Embedded Workbench    /
//                       4.0\arm\INC\"                                       /
//    List file       =  C:\David JIANG\ST MCU\Docs\STM32\AN_JIANG\TIM       /
//                       Encoder\example\project\EWARM\BOOT_FLASH\List\stm32 /
//                       f10x_rtc.s79                                        /
//                                                                           /
//                                                                           /
//////////////////////////////////////////////////////////////////////////////

        NAME stm32f10x_rtc

        RSEG CSTACK:DATA:NOROOT(2)

??DataTable0 EQU 0
??DataTable1 EQU 0
??DataTable10 EQU 0
??DataTable11 EQU 0
??DataTable12 EQU 0
??DataTable13 EQU 0
??DataTable14 EQU 0
??DataTable15 EQU 0
??DataTable16 EQU 0
??DataTable17 EQU 0
??DataTable18 EQU 0
??DataTable19 EQU 0
??DataTable2 EQU 0
??DataTable20 EQU 0
??DataTable21 EQU 0
??DataTable22 EQU 0
??DataTable23 EQU 0
??DataTable24 EQU 0
??DataTable25 EQU 0
??DataTable26 EQU 0
??DataTable27 EQU 0
??DataTable28 EQU 0
??DataTable29 EQU 0
??DataTable3 EQU 0
??DataTable30 EQU 0
??DataTable31 EQU 0
??DataTable32 EQU 0
??DataTable33 EQU 0
??DataTable34 EQU 0
??DataTable35 EQU 0
??DataTable38 EQU 0
??DataTable4 EQU 0
??DataTable5 EQU 0
??DataTable6 EQU 0
??DataTable7 EQU 0
??DataTable8 EQU 0
??DataTable9 EQU 0
        MULTWEAK ??assert_failed??rT
        PUBLIC RTC_ClearFlag
        PUBLIC RTC_ClearITPendingBit
        PUBLIC RTC_EnterConfigMode
        PUBLIC RTC_ExitConfigMode
        PUBLIC RTC_GetCounter
        PUBLIC RTC_GetDivider
        PUBLIC RTC_GetFlagStatus
        PUBLIC RTC_GetITStatus
        PUBLIC RTC_GetPrescaler
        PUBLIC RTC_ITConfig
        PUBLIC RTC_SetAlarm
        PUBLIC RTC_SetCounter
        PUBLIC RTC_SetPrescaler
        PUBLIC RTC_WaitForLastTask
        PUBLIC RTC_WaitForSynchro

assert_failed       SYMBOL "assert_failed"
??assert_failed??rT SYMBOL "??rT", assert_failed

        EXTERN RTC
        EXTERN assert_failed


        RSEG CODE:CODE:NOROOT(2)
        THUMB
RTC_ITConfig:
        PUSH     {R4,R5,LR}
        MOVS     R4,R0
        MOVS     R5,R1
        LDR.N    R0,??DataTable36  ;; 0xfff8
        TST      R4,R0
        BNE.N    ??RTC_ITConfig_0
        CMP      R4,#+0
        BNE.N    ??RTC_ITConfig_1
??RTC_ITConfig_0:
        MOVS     R1,#+54
        LDR.N    R0,??DataTable37  ;; `?<Constant "C:\\\\David JIANG\\\\ST MCU...">`
        _BLF     assert_failed,??assert_failed??rT
??RTC_ITConfig_1:
        CMP      R5,#+0
        BEQ.N    ??RTC_ITConfig_2
        CMP      R5,#+1
        BEQ.N    ??RTC_ITConfig_2
        MOVS     R1,#+55
        LDR.N    R0,??DataTable37  ;; `?<Constant "C:\\\\David JIANG\\\\ST MCU...">`
        _BLF     assert_failed,??assert_failed??rT
??RTC_ITConfig_2:
        CMP      R5,#+0
        BEQ.N    ??RTC_ITConfig_3
        LDR.N    R0,??DataTable39  ;; RTC
        LDR      R0,[R0, #+0]
        LDR.N    R1,??DataTable39  ;; RTC
        LDR      R1,[R1, #+0]
        LDRH     R1,[R1, #+0]
        ORRS     R4,R4,R1
        STRH     R4,[R0, #+0]
        B.N      ??RTC_ITConfig_4
??RTC_ITConfig_3:
        LDR.N    R0,??DataTable39  ;; RTC
        LDR      R0,[R0, #+0]
        LDR.N    R1,??DataTable39  ;; RTC
        LDR      R1,[R1, #+0]
        LDRH     R1,[R1, #+0]
        BICS     R1,R1,R4
        STRH     R1,[R0, #+0]
??RTC_ITConfig_4:
        POP      {R4,R5,PC}       ;; return

        RSEG CODE:CODE:NOROOT(2)
        THUMB
RTC_EnterConfigMode:
        LDR.N    R0,??DataTable39  ;; RTC
        LDR      R0,[R0, #+0]
        LDR.N    R1,??DataTable39  ;; RTC
        LDR      R1,[R1, #+0]
        LDRH     R1,[R1, #+4]
        ORRS     R1,R1,#0x10
        STRH     R1,[R0, #+4]
        BX       LR               ;; return

        RSEG CODE:CODE:NOROOT(2)
        THUMB
RTC_ExitConfigMode:
        LDR.N    R0,??DataTable39  ;; RTC
        LDR      R0,[R0, #+0]
        LDR.N    R1,??DataTable39  ;; RTC
        LDR      R1,[R1, #+0]
        LDRH     R1,[R1, #+4]
        LDR.N    R2,??RTC_ExitConfigMode_0  ;; 0xffef
        ANDS     R2,R2,R1
        STRH     R2,[R0, #+4]
        BX       LR               ;; return
        Nop      
        DATA
??RTC_ExitConfigMode_0:
        DC32     0xffef

        RSEG CODE:CODE:NOROOT(2)
        THUMB
RTC_GetCounter:
        MOVS     R0,#+0
        LDR.N    R1,??DataTable39  ;; RTC
        LDR      R1,[R1, #+0]
        LDRH     R1,[R1, #+28]
        MOVS     R0,R1
        LDR.N    R1,??DataTable39  ;; RTC
        LDR      R1,[R1, #+0]
        LDRH     R1,[R1, #+24]
        LSLS     R1,R1,#+16
        ORRS     R0,R0,R1
        BX       LR               ;; return

        RSEG CODE:CODE:NOROOT(2)
        THUMB
RTC_SetCounter:
        PUSH     {R4,LR}
        MOVS     R4,R0
        BL       RTC_EnterConfigMode
        LDR.N    R0,??DataTable39  ;; RTC
        LDR      R0,[R0, #+0]
        MOVS     R1,R4
        LSRS     R1,R1,#+16
        STRH     R1,[R0, #+24]
        LDR.N    R0,??DataTable39  ;; RTC
        LDR      R0,[R0, #+0]
        STRH     R4,[R0, #+28]
        BL       RTC_ExitConfigMode
        POP      {R4,PC}          ;; return

        RSEG CODE:CODE:NOROOT(2)
        THUMB
RTC_GetPrescaler:
        MOVS     R0,#+0
        LDR.N    R1,??DataTable39  ;; RTC
        LDR      R1,[R1, #+0]
        LDRH     R1,[R1, #+8]
        LSLS     R1,R1,#+28       ;; ZeroExtS R1,R1,#+28,#+28
        LSRS     R1,R1,#+28
        LSLS     R1,R1,#+16
        MOVS     R0,R1
        MOVS     R1,R0
        LDR.N    R0,??DataTable39  ;; RTC
        LDR      R0,[R0, #+0]
        LDRH     R0,[R0, #+12]
        ORRS     R0,R0,R1
        BX       LR               ;; return

        RSEG CODE:CODE:NOROOT(2)
        THUMB
RTC_SetPrescaler:
        PUSH     {R4,LR}
        MOVS     R4,R0
        CMP      R4,#+1048576
        BCC.N    ??RTC_SetPrescaler_0
        MOVS     R1,#+154
        LDR.N    R0,??DataTable37  ;; `?<Constant "C:\\\\David JIANG\\\\ST MCU...">`
        _BLF     assert_failed,??assert_failed??rT
??RTC_SetPrescaler_0:
        BL       RTC_EnterConfigMode
        LDR.N    R0,??DataTable39  ;; RTC
        LDR      R0,[R0, #+0]
        ANDS     R1,R4,#0xF0000
        LSRS     R1,R1,#+16
        STRH     R1,[R0, #+8]
        LDR.N    R0,??DataTable39  ;; RTC
        LDR      R0,[R0, #+0]
        STRH     R4,[R0, #+12]
        BL       RTC_ExitConfigMode
        POP      {R4,PC}          ;; return

⌨️ 快捷键说明

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