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

📄 stm32f10x_rtc.txt

📁 stm32 ucos 精简移殖版本 不需作任何修改直接便可运行。包含串口 定时器
💻 TXT
字号:
; generated by ARM/Thumb C/C++ Compiler with , RVCT3.1 [Build 919] for uVision
; commandline ArmCC [--debug -c --asm --interleave -o.\output\stm32f10x_rtc.o --depend=.\output\stm32f10x_rtc.d --device=DARMSTM --apcs=interwork -O1 -I. -I..\BSP -I..\..\..\..\..\uCOS-II\Ports\arm-cortex-m3\Generic\RealView -I..\..\..\..\..\uCOS-II\Source -I..\..\..\..\..\CPU\ST\STM32\inc -I..\..\..\..\..\uC-CPU -I..\..\..\..\..\uC-CPU\Arm-Cortex-M3\RealView -I..\..\..\..\..\uC-LIB -IC:\Keil\ARM\INC\ST\STM32F10x --omf_browse=.\output\stm32f10x_rtc.crf ..\..\..\..\..\CPU\ST\STM32\src\stm32f10x_rtc.c]
                          THUMB

                          AREA ||.text||, CODE, READONLY, ALIGN=2

                  RTC_ITConfig PROC
;;;52       
;;;53       if (NewState != DISABLE)
000000  4a3f              LDR      r2,|L1.256|
000002  b129              CBZ      r1,|L1.16|
;;;54       {
;;;55         RTC->CRH |= RTC_IT;
000004  f8b2f8b2          LDRH     r1,[r2,#0x800]
000008  4301              ORRS     r1,r1,r0
00000a  f8a2f8a2          STRH     r1,[r2,#0x800]
;;;56       }
;;;57       else
;;;58       {
;;;59         RTC->CRH &= (u16)~RTC_IT;
;;;60       }
;;;61     }
00000e  4770              BX       lr
                  |L1.16|
000010  f8b2f8b2          LDRH     r1,[r2,#0x800]        ;59
000014  4381              BICS     r1,r1,r0              ;59
000016  f8a2f8a2          STRH     r1,[r2,#0x800]        ;59
00001a  4770              BX       lr
;;;62     
                          ENDP

                  RTC_EnterConfigMode PROC
;;;72       /* Set the CNF flag to enter in the Configuration Mode */
;;;73       RTC->CRL |= CRL_CNF_Set;
00001c  4839              LDR      r0,|L1.260|
00001e  8801              LDRH     r1,[r0,#0]
000020  f041f041          ORR      r1,r1,#0x10
000024  8001              STRH     r1,[r0,#0]
;;;74     }
000026  4770              BX       lr
;;;75     
                          ENDP

                  RTC_ExitConfigMode PROC
;;;85       /* Reset the CNF flag to exit from the Configuration Mode */
;;;86       RTC->CRL &= CRL_CNF_Reset;
000028  4836              LDR      r0,|L1.260|
00002a  8801              LDRH     r1,[r0,#0]
00002c  f021f021          BIC      r1,r1,#0x10
000030  8001              STRH     r1,[r0,#0]
;;;87     }
000032  4770              BX       lr
;;;88     
                          ENDP

                  RTC_GetCounter PROC
;;;98       u16 tmp = 0;
;;;99       tmp = RTC->CNTL;
000034  4933              LDR      r1,|L1.260|
000036  3114              ADDS     r1,r1,#0x14
000038  8888              LDRH     r0,[r1,#4]
;;;100    
;;;101      return (((u32)RTC->CNTH << 16 ) | tmp) ;
00003a  8809              LDRH     r1,[r1,#0]
00003c  ea40ea40          ORR      r0,r0,r1,LSL #16
;;;102    }
000040  4770              BX       lr
;;;103    
                          ENDP

                  RTC_SetCounter PROC
;;;111    void RTC_SetCounter(u32 CounterValue)
;;;112    { 
000042  b500              PUSH     {lr}
000044  4602              MOV      r2,r0
;;;113      RTC_EnterConfigMode();
000046  f7fff7ff          BL       RTC_EnterConfigMode
;;;114    
;;;115      /* Set RTC COUNTER MSB word */
;;;116      RTC->CNTH = CounterValue >> 16;
00004a  482e              LDR      r0,|L1.260|
00004c  0c11              LSRS     r1,r2,#16
00004e  3014              ADDS     r0,r0,#0x14
000050  8001              STRH     r1,[r0,#0]
;;;117      /* Set RTC COUNTER LSB word */
;;;118      RTC->CNTL = (CounterValue & RTC_LSB_Mask);
000052  8082              STRH     r2,[r0,#4]
;;;119    
;;;120      RTC_ExitConfigMode();
000054  f85df85d          POP      {lr}
000058  e7fe              B        RTC_ExitConfigMode
;;;121    }
;;;122    
                          ENDP

                  RTC_SetPrescaler PROC
;;;130    void RTC_SetPrescaler(u32 PrescalerValue)
;;;131    {
00005a  b500              PUSH     {lr}
00005c  4602              MOV      r2,r0
;;;132      /* Check the parameters */
;;;133      assert_param(IS_RTC_PRESCALER(PrescalerValue));
;;;134      
;;;135      RTC_EnterConfigMode();
00005e  f7fff7ff          BL       RTC_EnterConfigMode
;;;136    
;;;137      /* Set RTC PRESCALER MSB word */
;;;138      RTC->PRLH = (PrescalerValue & PRLH_MSB_Mask) >> 16;
000062  4828              LDR      r0,|L1.260|
000064  f3c2f3c2          UBFX     r1,r2,#16,#4
000068  1d00              ADDS     r0,r0,#4
00006a  8001              STRH     r1,[r0,#0]
;;;139      /* Set RTC PRESCALER LSB word */
;;;140      RTC->PRLL = (PrescalerValue & RTC_LSB_Mask);
00006c  8082              STRH     r2,[r0,#4]
;;;141    
;;;142      RTC_ExitConfigMode();
00006e  f85df85d          POP      {lr}
000072  e7fe              B        RTC_ExitConfigMode
;;;143    }
;;;144    
                          ENDP

                  RTC_SetAlarm PROC
;;;152    void RTC_SetAlarm(u32 AlarmValue)
;;;153    {  
000074  b500              PUSH     {lr}
000076  4602              MOV      r2,r0
;;;154      RTC_EnterConfigMode();
000078  f7fff7ff          BL       RTC_EnterConfigMode
;;;155    
;;;156      /* Set the ALARM MSB word */
;;;157      RTC->ALRH = AlarmValue >> 16;
00007c  4821              LDR      r0,|L1.260|
00007e  0c11              LSRS     r1,r2,#16
000080  301c              ADDS     r0,r0,#0x1c
000082  8001              STRH     r1,[r0,#0]
;;;158      /* Set the ALARM LSB word */
;;;159      RTC->ALRL = (AlarmValue & RTC_LSB_Mask);
000084  8082              STRH     r2,[r0,#4]
;;;160    
;;;161      RTC_ExitConfigMode();
000086  f85df85d          POP      {lr}
00008a  e7fe              B        RTC_ExitConfigMode
;;;162    }
;;;163    
                          ENDP

                  RTC_GetDivider PROC
;;;174    
;;;175      tmp = ((u32)RTC->DIVH & (u32)0x000F) << 16;
00008c  481d              LDR      r0,|L1.260|
00008e  300c              ADDS     r0,r0,#0xc
000090  8801              LDRH     r1,[r0,#0]
000092  0709              LSLS     r1,r1,#28
000094  0b09              LSRS     r1,r1,#12
;;;176      tmp |= RTC->DIVL;
000096  8880              LDRH     r0,[r0,#4]
000098  4308              ORRS     r0,r0,r1
;;;177    
;;;178      return tmp;
;;;179    }
00009a  4770              BX       lr
;;;180    
                          ENDP

                  RTC_WaitForLastTask PROC
;;;189    void RTC_WaitForLastTask(void)
;;;190    {
00009c  4818              LDR      r0,|L1.256|
                  |L1.158|
;;;191      /* Loop until RTOFF flag is set */
;;;192      while ((RTC->CRL & RTC_FLAG_RTOFF) == (u16)RESET)
00009e  f8b0f8b0          LDRH     r1,[r0,#0x804]
0000a2  0689              LSLS     r1,r1,#26
0000a4  d5fb              BPL      |L1.158|
;;;193      {
;;;194      }
;;;195    }
0000a6  4770              BX       lr
;;;196    
                          ENDP

                  RTC_WaitForSynchro PROC
;;;209      /* Clear RSF flag */
;;;210      RTC->CRL &= (u16)~RTC_FLAG_RSF;
0000a8  4815              LDR      r0,|L1.256|
0000aa  f8b0f8b0          LDRH     r1,[r0,#0x804]
0000ae  f021f021          BIC      r1,r1,#8
0000b2  f8a0f8a0          STRH     r1,[r0,#0x804]
                  |L1.182|
;;;211    
;;;212      /* Loop until RSF flag is set */
;;;213      while ((RTC->CRL & RTC_FLAG_RSF) == (u16)RESET)
0000b6  f8b0f8b0          LDRH     r1,[r0,#0x804]
0000ba  0709              LSLS     r1,r1,#28
0000bc  d5fb              BPL      |L1.182|
;;;214      {
;;;215      }
;;;216    }
0000be  4770              BX       lr
;;;217    
                          ENDP

                  RTC_GetFlagStatus PROC
;;;231    FlagStatus RTC_GetFlagStatus(u16 RTC_FLAG)
;;;232    {
0000c0  4602              MOV      r2,r0
;;;233      FlagStatus bitstatus = RESET;
0000c2  2000              MOVS     r0,#0
;;;234      
;;;235      /* Check the parameters */
;;;236      assert_param(IS_RTC_GET_FLAG(RTC_FLAG)); 
;;;237      
;;;238      if ((RTC->CRL & RTC_FLAG) != (u16)RESET)
0000c4  490f              LDR      r1,|L1.260|
0000c6  8809              LDRH     r1,[r1,#0]
0000c8  4211              TST      r1,r2
0000ca  d000              BEQ      |L1.206|
;;;239      {
;;;240        bitstatus = SET;
0000cc  2001              MOVS     r0,#1
                  |L1.206|
;;;241      }
;;;242      else
;;;243      {
;;;244        bitstatus = RESET;
;;;245      }
;;;246      return bitstatus;
;;;247    }
0000ce  4770              BX       lr
;;;248    
                          ENDP

                  RTC_ClearFlag PROC
;;;267      /* Clear the coressponding RTC flag */
;;;268      RTC->CRL &= (u16)~RTC_FLAG;
0000d0  4a0c              LDR      r2,|L1.260|
0000d2  8811              LDRH     r1,[r2,#0]
0000d4  4381              BICS     r1,r1,r0
0000d6  8011              STRH     r1,[r2,#0]
;;;269    }
0000d8  4770              BX       lr
;;;270    
                          ENDP

                  RTC_GetITStatus PROC
;;;288      
;;;289      bitstatus = (ITStatus)(RTC->CRL & RTC_IT);
0000da  4a0a              LDR      r2,|L1.260|
0000dc  1f12              SUBS     r2,r2,#4
0000de  8891              LDRH     r1,[r2,#4]
0000e0  4001              ANDS     r1,r1,r0
0000e2  b2c9              UXTB     r1,r1
;;;290    
;;;291      if (((RTC->CRH & RTC_IT) != (u16)RESET) && (bitstatus != (u16)RESET))
0000e4  8812              LDRH     r2,[r2,#0]
0000e6  4202              TST      r2,r0
0000e8  d002              BEQ      |L1.240|
0000ea  b109              CBZ      r1,|L1.240|
;;;292      {
;;;293        bitstatus = SET;
0000ec  2001              MOVS     r0,#1
;;;294      }
;;;295      else
;;;296      {
;;;297        bitstatus = RESET;
;;;298      }
;;;299      return bitstatus;
;;;300    }
0000ee  4770              BX       lr
                  |L1.240|
0000f0  2000              MOVS     r0,#0                 ;297
0000f2  4770              BX       lr
;;;301    
                          ENDP

                  RTC_ClearITPendingBit PROC
;;;318      /* Clear the coressponding RTC pending bit */
;;;319      RTC->CRL &= (u16)~RTC_IT;
0000f4  4a03              LDR      r2,|L1.260|
0000f6  8811              LDRH     r1,[r2,#0]
0000f8  4381              BICS     r1,r1,r0
0000fa  8011              STRH     r1,[r2,#0]
;;;320    }
0000fc  4770              BX       lr
;;;321    
                          ENDP

0000fe  0000              DCW      0x0000
                  |L1.256|
000100  40002000          DCD      0x40002000
                  |L1.260|
000104  40002804          DCD      0x40002804

⌨️ 快捷键说明

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