📄 stm32f10x_systick.lst
字号:
###############################################################################
# #
# 30/Jul/2008 11:02:24 #
# IAR ARM ANSI C/C++ Compiler V5.11.0.20622/W32 EVALUATION #
# Copyright 1999-2007 IAR Systems. All rights reserved. #
# #
# Cpu mode = thumb #
# Endian = little #
# Source file = E:\library\src\stm32f10x_systick.c #
# Command line = E:\library\src\stm32f10x_systick.c -D EMB_FLASH -lcN #
# E:\ELE\yten\pro\Release\List\ -o #
# E:\ELE\yten\pro\Release\Obj\ --no_cse --no_unroll #
# --no_inline --no_code_motion --no_tbaa --no_clustering #
# --no_scheduling --debug --endian little --cpu Cortex-M3 #
# -e --fpu None --dlib_config "C:\Program Files\IAR #
# Systems\Embedded Workbench 5.0 #
# Evaluation\ARM\INC\DLib_Config_Normal.h" -I #
# E:\ELE\yten\pro\ -I E:\ELE\yten\pro\..\LIBRARY\INC\ -I #
# "C:\Program Files\IAR Systems\Embedded Workbench 5.0 #
# Evaluation\ARM\INC\" -On #
# List file = E:\ELE\yten\pro\Release\List\stm32f10x_systick.lst #
# Object file = E:\ELE\yten\pro\Release\Obj\stm32f10x_systick.o #
# #
# #
###############################################################################
E:\library\src\stm32f10x_systick.c
1 /******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
2 * File Name : stm32f10x_systick.c
3 * Author : MCD Application Team
4 * Version : V1.0
5 * Date : 10/08/2007
6 * Description : This file provides all the SysTick firmware functions.
7 ********************************************************************************
8 * THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
9 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
10 * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
11 * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
12 * CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
13 * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
14 *******************************************************************************/
15
16 /* Includes ------------------------------------------------------------------*/
17 #include "stm32f10x_systick.h"
18
19 /* Private typedef -----------------------------------------------------------*/
20 /* Private define ------------------------------------------------------------*/
21 /* ---------------------- SysTick registers bit mask -------------------- */
22 /* CTRL TICKINT Mask */
23 #define CTRL_TICKINT_Set ((u32)0x00000002)
24 #define CTRL_TICKINT_Reset ((u32)0xFFFFFFFD)
25
26 /* SysTick Flag Mask */
27 #define FLAG_Mask ((u8)0x1F)
28
29 /* Private macro -------------------------------------------------------------*/
30 /* Private variables ---------------------------------------------------------*/
31 /* Private function prototypes -----------------------------------------------*/
32 /* Private functions ---------------------------------------------------------*/
33
34 /*******************************************************************************
35 * Function Name : SysTick_CLKSourceConfig
36 * Description : Configures the SysTick clock source.
37 * Input : - SysTick_CLKSource: specifies the SysTick clock source.
38 * This parameter can be one of the following values:
39 * - SysTick_CLKSource_HCLK_Div8: AHB clock divided by 8
40 * selected as SysTick clock source.
41 * - SysTick_CLKSource_HCLK: AHB clock selected as
42 * SysTick clock source.
43 * Output : None
44 * Return : None
45 *******************************************************************************/
46 void SysTick_CLKSourceConfig(u32 SysTick_CLKSource)
47 {
48 /* Check the parameters */
49 assert_param(IS_SYSTICK_CLK_SOURCE(SysTick_CLKSource));
50
51 if (SysTick_CLKSource == SysTick_CLKSource_HCLK)
52 {
53 SysTick->CTRL |= SysTick_CLKSource_HCLK;
54 }
55 else
56 {
57 SysTick->CTRL &= SysTick_CLKSource_HCLK_Div8;
58 }
59 }
60
61 /*******************************************************************************
62 * Function Name : SysTick_SetReload
63 * Description : Sets SysTick Reload value.
64 * Input : - Reload: SysTick Reload new value.
65 * This parameter must be a number between 1 and 0xFFFFFF.
66 * Output : None
67 * Return : None
68 *******************************************************************************/
69 void SysTick_SetReload(u32 Reload)
70 {
71 /* Check the parameters */
72 assert_param(IS_SYSTICK_RELOAD(Reload));
73
74 SysTick->LOAD = Reload;
75 }
76
77 /*******************************************************************************
78 * Function Name : SysTick_CounterCmd
79 * Description : Enables or disables the SysTick counter.
80 * Input : - SysTick_Counter: new state of the SysTick counter.
81 * This parameter can be one of the following values:
82 * - SysTick_Counter_Disable: Disable counter
83 * - SysTick_Counter_Enable: Enable counter
84 * - SysTick_Counter_Clear: Clear counter value to 0
85 * Output : None
86 * Return : None
87 *******************************************************************************/
88 void SysTick_CounterCmd(u32 SysTick_Counter)
89 {
90 /* Check the parameters */
91 assert_param(IS_SYSTICK_COUNTER(SysTick_Counter));
92
93 if (SysTick_Counter == SysTick_Counter_Clear)
94 {
95 SysTick->VAL = SysTick_Counter_Clear;
96 }
97 else
98 {
99 if (SysTick_Counter == SysTick_Counter_Enable)
100 {
101 SysTick->CTRL |= SysTick_Counter_Enable;
102 }
103 else
104 {
105 SysTick->CTRL &= SysTick_Counter_Disable;
106 }
107 }
108 }
109
110 /*******************************************************************************
111 * Function Name : SysTick_ITConfig
112 * Description : Enables or disables the SysTick Interrupt.
113 * Input : - NewState: new state of the SysTick Interrupt.
114 * This parameter can be: ENABLE or DISABLE.
115 * Output : None
116 * Return : None
117 *******************************************************************************/
118 void SysTick_ITConfig(FunctionalState NewState)
119 {
120 /* Check the parameters */
121 assert_param(IS_FUNCTIONAL_STATE(NewState));
122
123 if (NewState != DISABLE)
124 {
125 SysTick->CTRL |= CTRL_TICKINT_Set;
126 }
127 else
128 {
129 SysTick->CTRL &= CTRL_TICKINT_Reset;
130 }
131 }
132
133 /*******************************************************************************
134 * Function Name : SysTick_GetCounter
135 * Description : Gets SysTick counter value.
136 * Input : None
137 * Output : None
138 * Return : SysTick current value
139 *******************************************************************************/
140 u32 SysTick_GetCounter(void)
141 {
142 return(SysTick->VAL);
143 }
144
145 /*******************************************************************************
146 * Function Name : SysTick_GetFlagStatus
147 * Description : Checks whether the specified SysTick flag is set or not.
148 * Input : - SysTick_FLAG: specifies the flag to check.
149 * This parameter can be one of the following values:
150 * - SysTick_FLAG_COUNT
151 * - SysTick_FLAG_SKEW
152 * - SysTick_FLAG_NOREF
153 * Output : None
154 * Return : None
155 *******************************************************************************/
156 FlagStatus SysTick_GetFlagStatus(u8 SysTick_FLAG)
157 {
158 u32 tmp = 0;
159 u32 statusreg = 0;
160 FlagStatus bitstatus = RESET;
161
162 /* Check the parameters */
163 assert_param(IS_SYSTICK_FLAG(SysTick_FLAG));
164
165 /* Get the SysTick register index */
166 tmp = SysTick_FLAG >> 5;
167
168 if (tmp == 1) /* The flag to check is in CTRL register */
169 {
170 statusreg = SysTick->CTRL;
171 }
172 else /* The flag to check is in CALIB register */
173 {
174 statusreg = SysTick->CALIB;
175 }
176
177 /* Get the flag position */
178 tmp = SysTick_FLAG & FLAG_Mask;
179
180 if ((statusreg & ((u32)1 << tmp)) != (u32)RESET)
181 {
182 bitstatus = SET;
183 }
184 else
185 {
186 bitstatus = RESET;
187 }
188 return bitstatus;
189 }
190
191 /******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE****/
Maximum stack usage in bytes:
Function .cstack
-------- -------
SysTick_CLKSourceConfig 0
SysTick_CounterCmd 0
SysTick_GetCounter 0
SysTick_GetFlagStatus 8
SysTick_ITConfig 0
SysTick_SetReload 0
Section sizes:
Function/Label Bytes
-------------- -----
SysTick_CLKSourceConfig 32
SysTick_SetReload 12
SysTick_CounterCmd 44
SysTick_ITConfig 34
SysTick_GetCounter 6
SysTick_GetFlagStatus 80
??DataTable13 4
??DataTable14 4
216 bytes in section .text
216 bytes of CODE memory
Errors: none
Warnings: none
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -