📄 stm32f10x_rtc.lst
字号:
179 /* Set the ALARM LSB word */
180 RTC->ALRL = (AlarmValue & RTC_LSB_Mask);
181
182 RTC_ExitConfigMode();
183 }
184
185 /*******************************************************************************
186 * Function Name : RTC_GetDivider
187 * Description : Gets the RTC divider value.
188 * Input : None
189 * Output : None
190 * Return : RTC Divider value.
191 *******************************************************************************/
192 u32 RTC_GetDivider(void)
193 {
194 u32 tmp = 0x00;
195
196 tmp = ((u32)RTC->DIVH & (u32)0x000F) << 0x10;
197 tmp |= RTC->DIVL;
198
199 return tmp;
200 }
201
202 /*******************************************************************************
203 * Function Name : RTC_WaitForLastTask
204 * Description : Waits until last write operation on RTC registers has finished.
205 * This function must be called before any write to RTC registers.
206 * Input : None
207 * Output : None
208 * Return : None
209 *******************************************************************************/
210 void RTC_WaitForLastTask(void)
211 {
212 /* Loop until RTOFF flag is set */
213 while ((RTC->CRL & RTC_FLAG_RTOFF) == (u16)RESET)
214 {
215 }
216 }
217
218 /*******************************************************************************
219 * Function Name : RTC_WaitForSynchro
220 * Description : Waits until the RTC registers (RTC_CNT, RTC_ALR and RTC_PRL)
221 * are synchronized with RTC APB clock.
222 * This function must be called before any read operation after
223 * an APB reset or an APB clock stop.
224 * Input : None
225 * Output : None
226 * Return : None
227 *******************************************************************************/
228 void RTC_WaitForSynchro(void)
229 {
230 /* Clear RSF flag */
231 RTC->CRL &= (u16)~RTC_FLAG_RSF;
232
233 /* Loop until RSF flag is set */
234 while ((RTC->CRL & RTC_FLAG_RSF) == (u16)RESET)
235 {
236 }
237 }
238
239 /*******************************************************************************
240 * Function Name : RTC_GetFlagStatus
241 * Description : Checks whether the specified RTC flag is set or not.
242 * Input : - RTC_FLAG: specifies the flag to check.
243 * This parameter can be one the following values:
244 * - RTC_FLAG_RTOFF: RTC Operation OFF flag
245 * - RTC_FLAG_RSF: Registers Synchronized flag
246 * - RTC_FLAG_OW: Overflow flag
247 * - RTC_FLAG_ALR: Alarm flag
248 * - RTC_FLAG_SEC: Second flag
249 * Output : None
250 * Return : The new state of RTC_FLAG (SET or RESET).
251 *******************************************************************************/
252 FlagStatus RTC_GetFlagStatus(u16 RTC_FLAG)
253 {
254 FlagStatus bitstatus = RESET;
255
256 /* Check the parameters */
257 assert(IS_RTC_GET_FLAG(RTC_FLAG));
258
259 if ((RTC->CRL & RTC_FLAG) != (u16)RESET)
260 {
261 bitstatus = SET;
262 }
263 else
264 {
265 bitstatus = RESET;
266 }
267 return bitstatus;
268 }
269
270 /*******************************************************************************
271 * Function Name : RTC_ClearFlag
272 * Description : Clears the RTC抯 pending flags.
273 * Input : - RTC_FLAG: specifies the flag to clear.
274 * This parameter can be any combination of the following values:
275 * - RTC_FLAG_RSF: Registers Synchronized flag. This flag
276 * is cleared only after an APB reset or an APB Clock stop.
277 * - RTC_FLAG_OW: Overflow flag
278 * - RTC_FLAG_ALR: Alarm flag
279 * - RTC_FLAG_SEC: Second flag
280 * Output : None
281 * Return : None
282 *******************************************************************************/
283 void RTC_ClearFlag(u16 RTC_FLAG)
284 {
285 /* Check the parameters */
286 assert(IS_RTC_CLEAR_FLAG(RTC_FLAG));
287
288 /* Clear the coressponding RTC flag */
289 RTC->CRL &= (u16)~RTC_FLAG;
290 }
291
292 /*******************************************************************************
293 * Function Name : RTC_GetITStatus
294 * Description : Checks whether the specified RTC interrupt has occured or not.
295 * Input : - RTC_IT: specifies the RTC interrupts sources to check.
296 * This parameter can be one of the following values:
297 * - RTC_IT_OW: Overflow interrupt
298 * - RTC_IT_ALR: Alarm interrupt
299 * - RTC_IT_SEC: Second interrupt
300 * Output : None
301 * Return : The new state of the RTC_IT (SET or RESET).
302 *******************************************************************************/
303 ITStatus RTC_GetITStatus(u16 RTC_IT)
304 {
305 ITStatus bitstatus = RESET;
306
307 /* Check the parameters */
308 assert(IS_RTC_GET_IT(RTC_IT));
309
310 bitstatus = (ITStatus)((RTC->CRL & RTC_IT) != (u16)RESET);
311
312 if (((RTC->CRH & RTC_IT) != (u16)RESET) && bitstatus)
313 {
314 bitstatus = SET;
315 }
316 else
317 {
318 bitstatus = RESET;
319 }
320 return bitstatus;
321 }
322
323 /*******************************************************************************
324 * Function Name : RTC_ClearITPendingBit
325 * Description : Clears the RTC抯 interrupt pending bits.
326 * Input : - RTC_IT: specifies the interrupt pending bit to clear.
327 * This parameter can be any combination of the following values:
328 * - RTC_IT_OW: Overflow interrupt
329 * - RTC_IT_ALR: Alarm interrupt
330 * - RTC_IT_SEC: Second interrupt
331 * Output : None
332 * Return : None
333 *******************************************************************************/
334 void RTC_ClearITPendingBit(u16 RTC_IT)
335 {
336 /* Check the parameters */
337 assert(IS_RTC_IT(RTC_IT));
338
339 /* Clear the coressponding RTC pending bit */
340 RTC->CRL &= (u16)~RTC_IT;
341 }
342
343 /******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE****/
Maximum stack usage in bytes:
Function CSTACK
-------- ------
RTC_ClearFlag 8
RTC_ClearITPendingBit 8
RTC_EnterConfigMode 0
RTC_ExitConfigMode 0
RTC_GetCounter 0
RTC_GetDivider 0
RTC_GetFlagStatus 8
RTC_GetITStatus 8
RTC_GetPrescaler 0
RTC_ITConfig 12
RTC_SetAlarm 8
RTC_SetCounter 8
RTC_SetPrescaler 8
RTC_WaitForLastTask 0
RTC_WaitForSynchro 0
Segment part sizes:
Function/Label Bytes
-------------- -----
RTC_ITConfig 76
RTC_EnterConfigMode 18
RTC_ExitConfigMode 24
RTC_GetCounter 22
RTC_SetCounter 30
RTC_GetPrescaler 28
RTC_SetPrescaler 46
RTC_SetAlarm 30
RTC_GetDivider 28
??RTC_WaitForLastTask_0 12
RTC_WaitForSynchro 32
RTC_GetFlagStatus 56
RTC_ClearFlag 44
RTC_GetITStatus 74
RTC_ClearITPendingBit 44
??DataTable36 4
??DataTable37 4
??DataTable39 4
?<Constant "C:\\David JIANG\\ST MCU...">
88
Others 8
584 bytes in segment CODE
88 bytes in segment DATA_C
576 bytes of CODE memory (+ 8 bytes shared)
88 bytes of CONST memory
Errors: none
Warnings: none
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -