📄 stm32f10x_rtc.lst
字号:
##############################################################################
# #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32 KICKSTART 13/Mar/2009 16:01:12 #
# Copyright 1999-2005 IAR Systems. All rights reserved. #
# #
# Cpu mode = thumb #
# Endian = little #
# Stack alignment = 4 #
# Source file = E:\UC_OS\Micrium\Software\CPU\ST\STM32\src\stm32f10x #
# _rtc.c #
# Command line = E:\UC_OS\Micrium\Software\CPU\ST\STM32\src\stm32f10x #
# _rtc.c -lCN E:\UC_OS\Micrium\Software\EvalBoards\ST\ #
# STM3210B-EVAL\IAR\OS-Probe\Flash\List\ -o #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\Flash\Obj\ -z6 --no_unroll #
# --no_inline --no_tbaa --no_scheduling --debug #
# --cpu_mode thumb --endian little --cpu cortex-M3 #
# --stack_align 4 -e --fpu None --dlib_config #
# "C:\Program Files\IAR Systems\Embedded Workbench #
# 4.0 Kickstart\arm\LIB\dl7mptnnl8n.h" -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\ -I E:\UC_OS\Micrium\Software\EvalBoa #
# rds\ST\STM3210B-EVAL\IAR\OS-Probe\..\..\..\..\..\uco #
# s-ii\ports\arm-cortex-m3\generic\iar\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\ucos-ii\source\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uc-lib\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uc-cpu\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uc-cpu\ARM-Cortex-M3\I #
# AR\ -I E:\UC_OS\Micrium\Software\EvalBoards\ST\STM32 #
# 10B-EVAL\IAR\OS-Probe\..\..\..\..\..\cpu\st\stm32\in #
# c\ -I E:\UC_OS\Micrium\Software\EvalBoards\ST\STM321 #
# 0B-EVAL\IAR\OS-Probe\..\BSP\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Commun #
# ication\Generic\RS-232\Source\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Commun #
# ication\Generic\RS-232\Ports\ST\STM32\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Commun #
# ication\Generic\Source\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Plugin #
# s\uCOS-II\ -I "C:\Program Files\IAR #
# Systems\Embedded Workbench 4.0 Kickstart\arm\INC\" #
# List file = E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\Flash\List\stm32f10x_rtc.lst #
# Object file = E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\Flash\Obj\stm32f10x_rtc.r79 #
# #
# #
##############################################################################
E:\UC_OS\Micrium\Software\CPU\ST\STM32\src\stm32f10x_rtc.c
1 /******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
2 * File Name : stm32f10x_rtc.c
3 * Author : MCD Application Team
4 * Date First Issued : 09/29/2006
5 * Description : This file provides all the RTC firmware functions.
6 ********************************************************************************
7 * History:
8 * 05/21/2007: V0.3
9 * 04/02/2007: V0.2
10 * 02/05/2007: V0.1
11 * 09/29/2006: V0.01
12 ********************************************************************************
13 * THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
14 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
15 * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
16 * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
17 * CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
18 * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
19 *******************************************************************************/
20
21 /* Includes ------------------------------------------------------------------*/
22 #include "stm32f10x_rtc.h"
23
24 /* Private typedef -----------------------------------------------------------*/
25 /* Private define ------------------------------------------------------------*/
26 #define CRL_CNF_Set ((u16)0x0010) /* Configuration Flag Enable Mask */
27 #define CRL_CNF_Reset ((u16)0xFFEF) /* Configuration Flag Disable Mask */
28 #define RTC_LSB_Mask ((u32)0x0000FFFF) /* RTC LSB Mask */
29 #define RTC_MSB_Mask ((u32)0xFFFF0000) /* RTC MSB Mask */
30 #define PRLH_MSB_Mask ((u32)0x000F0000) /* RTC Prescaler MSB Mask */
31
32 /* Private macro -------------------------------------------------------------*/
33 /* Private variables ---------------------------------------------------------*/
34 /* Private function prototypes -----------------------------------------------*/
35 /* Private functions ---------------------------------------------------------*/
36
37 /*******************************************************************************
38 * Function Name : RTC_ITConfig
39 * Description : Enables or disables the specified RTC interrupts.
40 * Input : - RTC_IT: specifies the RTC interrupts sources to be enabled
41 * or disabled.
42 * This parameter can be any combination of the following values:
43 * - RTC_IT_OW: Overflow interrupt
44 * - RTC_IT_ALR: Alarm interrupt
45 * - RTC_IT_SEC: Second interrupt
46 * - NewState: new state of the specified RTC interrupts.
47 * This parameter can be: ENABLE or DISABLE.
48 * Output : None
49 * Return : None
50 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
51 void RTC_ITConfig(u16 RTC_IT, FunctionalState NewState)
52 {
53 /* Check the parameters */
54 assert(IS_RTC_IT(RTC_IT));
55 assert(IS_FUNCTIONAL_STATE(NewState));
56
57 if (NewState != DISABLE)
\ RTC_ITConfig:
\ 00000000 .... LDR.N R2,??DataTable12 ;; 0x40002800
\ 00000002 0029 CMP R1,#+0
\ 00000004 1188 LDRH R1,[R2, #+0]
\ 00000006 02D0 BEQ.N ??RTC_ITConfig_0
58 {
59 RTC->CRH |= RTC_IT;
\ 00000008 0843 ORRS R0,R0,R1
\ 0000000A 1080 STRH R0,[R2, #+0]
\ 0000000C 7047 BX LR
60 }
61 else
62 {
63 RTC->CRH &= (u16)~RTC_IT;
\ ??RTC_ITConfig_0:
\ 0000000E 8143 BICS R1,R1,R0
\ 00000010 1180 STRH R1,[R2, #+0]
64 }
65 }
\ 00000012 7047 BX LR ;; return
66
67 /*******************************************************************************
68 * Function Name : RTC_EnterConfigMode
69 * Description : Enters the RTC configuration mode.
70 * Input : None
71 * Output : None
72 * Return : None
73 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
74 void RTC_EnterConfigMode(void)
75 {
76 /* Set the CNF flag to enter in the Configuration Mode */
77 RTC->CRL |= CRL_CNF_Set;
\ RTC_EnterConfigMode:
\ 00000000 .... LDR.N R0,??DataTable13 ;; 0x40002804
\ 00000002 0188 LDRH R1,[R0, #+0]
\ 00000004 51F01001 ORRS R1,R1,#0x10
\ 00000008 0180 STRH R1,[R0, #+0]
78 }
\ 0000000A 7047 BX LR ;; return
79
80 /*******************************************************************************
81 * Function Name : RTC_ExitConfigMode
82 * Description : Exits from the RTC configuration mode.
83 * Input : None
84 * Output : None
85 * Return : None
86 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
87 void RTC_ExitConfigMode(void)
88 {
89 /* Reset the CNF flag to exit from the Configuration Mode */
90 RTC->CRL &= CRL_CNF_Reset;
\ RTC_ExitConfigMode:
\ 00000000 .... LDR.N R0,??DataTable13 ;; 0x40002804
\ 00000002 0188 LDRH R1,[R0, #+0]
\ 00000004 014A LDR.N R2,??RTC_ExitConfigMode_0 ;; 0xffef
\ 00000006 0A40 ANDS R2,R2,R1
\ 00000008 0280 STRH R2,[R0, #+0]
91 }
\ 0000000A 7047 BX LR ;; return
\ ??RTC_ExitConfigMode_0:
\ 0000000C EFFF0000 DC32 0xffef
92
93 /*******************************************************************************
94 * Function Name : RTC_GetCounter
95 * Description : Gets the RTC counter value.
96 * Input : None
97 * Output : None
98 * Return : RTC counter value.
99 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
100 u32 RTC_GetCounter(void)
101 {
102 u16 tmp = 0;
103 tmp = RTC->CNTL;
\ RTC_GetCounter:
\ 00000000 0348 LDR.N R0,??RTC_GetCounter_0 ;; 0x4000281c
\ 00000002 0088 LDRH R0,[R0, #+0]
104
105 return (((u32)RTC->CNTH << 16 ) | tmp) ;
\ 00000004 .... LDR.N R1,??DataTable4 ;; 0x40002818
\ 00000006 0988 LDRH R1,[R1, #+0]
\ 00000008 0904 LSLS R1,R1,#+16
\ 0000000A 0843 ORRS R0,R0,R1
\ 0000000C 7047 BX LR ;; return
\ 0000000E 00BF Nop
\ ??RTC_GetCounter_0:
\ 00000010 1C280040 DC32 0x4000281c
106 }
107
108 /*******************************************************************************
109 * Function Name : RTC_SetCounter
110 * Description : Sets the RTC counter value.
111 * Input : - CounterValue: RTC counter new value.
112 * Output : None
113 * Return : None
114 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
115 void RTC_SetCounter(u32 CounterValue)
116 {
\ RTC_SetCounter:
\ 00000000 10B5 PUSH {R4,LR}
\ 00000002 0400 MOVS R4,R0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -