OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Demo/] [CORTEX_STM32F103_GCC_Rowley/] [ST Library/] [inc/] [stm32f10x_rtc.h] - Blame information for rev 582

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 582 jeremybenn
/******************** (C) COPYRIGHT 2008 STMicroelectronics ********************
2
* File Name          : stm32f10x_rtc.h
3
* Author             : MCD Application Team
4
* Version            : V2.0.1
5
* Date               : 06/13/2008
6
* Description        : This file contains all the functions prototypes for the
7
*                      RTC firmware library.
8
********************************************************************************
9
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
10
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
11
* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
12
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
13
* CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
14
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
15
*******************************************************************************/
16
 
17
/* Define to prevent recursive inclusion -------------------------------------*/
18
#ifndef __STM32F10x_RTC_H
19
#define __STM32F10x_RTC_H
20
 
21
/* Includes ------------------------------------------------------------------*/
22
#include "stm32f10x_map.h"
23
 
24
/* Exported types ------------------------------------------------------------*/
25
/* Exported constants --------------------------------------------------------*/
26
/* RTC interrupts define -----------------------------------------------------*/
27
#define RTC_IT_OW            ((u16)0x0004)  /* Overflow interrupt */
28
#define RTC_IT_ALR           ((u16)0x0002)  /* Alarm interrupt */
29
#define RTC_IT_SEC           ((u16)0x0001)  /* Second interrupt */
30
 
31
#define IS_RTC_IT(IT) ((((IT) & (u16)0xFFF8) == 0x00) && ((IT) != 0x00))
32
 
33
#define IS_RTC_GET_IT(IT) (((IT) == RTC_IT_OW) || ((IT) == RTC_IT_ALR) || \
34
                           ((IT) == RTC_IT_SEC))
35
 
36
/* RTC interrupts flags ------------------------------------------------------*/
37
#define RTC_FLAG_RTOFF       ((u16)0x0020)  /* RTC Operation OFF flag */
38
#define RTC_FLAG_RSF         ((u16)0x0008)  /* Registers Synchronized flag */
39
#define RTC_FLAG_OW          ((u16)0x0004)  /* Overflow flag */
40
#define RTC_FLAG_ALR         ((u16)0x0002)  /* Alarm flag */
41
#define RTC_FLAG_SEC         ((u16)0x0001)  /* Second flag */
42
 
43
#define IS_RTC_CLEAR_FLAG(FLAG) ((((FLAG) & (u16)0xFFF0) == 0x00) && ((FLAG) != 0x00))
44
 
45
#define IS_RTC_GET_FLAG(FLAG) (((FLAG) == RTC_FLAG_RTOFF) || ((FLAG) == RTC_FLAG_RSF) || \
46
                               ((FLAG) == RTC_FLAG_OW) || ((FLAG) == RTC_FLAG_ALR) || \
47
                               ((FLAG) == RTC_FLAG_SEC))
48
 
49
#define IS_RTC_PRESCALER(PRESCALER) ((PRESCALER) <= 0xFFFFF)
50
 
51
/* Exported macro ------------------------------------------------------------*/
52
/* Exported functions ------------------------------------------------------- */
53
void RTC_ITConfig(u16 RTC_IT, FunctionalState NewState);
54
void RTC_EnterConfigMode(void);
55
void RTC_ExitConfigMode(void);
56
u32  RTC_GetCounter(void);
57
void RTC_SetCounter(u32 CounterValue);
58
void RTC_SetPrescaler(u32 PrescalerValue);
59
void RTC_SetAlarm(u32 AlarmValue);
60
u32  RTC_GetDivider(void);
61
void RTC_WaitForLastTask(void);
62
void RTC_WaitForSynchro(void);
63
FlagStatus RTC_GetFlagStatus(u16 RTC_FLAG);
64
void RTC_ClearFlag(u16 RTC_FLAG);
65
ITStatus RTC_GetITStatus(u16 RTC_IT);
66
void RTC_ClearITPendingBit(u16 RTC_IT);
67
 
68
#endif /* __STM32F10x_RTC_H */
69
 
70
/******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.