stm32f10x_rtc.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32f10x_rtc.h
00004   * @author  MCD Application Team
00005   * @version V3.4.0
00006   * @date    10/15/2010
00007   * @brief   This file contains all the functions prototypes for the RTC firmware 
00008   *          library.
00009   ******************************************************************************
00010   * @copy
00011   *
00012   * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
00013   * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
00014   * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
00015   * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
00016   * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
00017   * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
00018   *
00019   * <h2><center>&copy; COPYRIGHT 2010 STMicroelectronics</center></h2>
00020   */ 
00021 
00022 /* Define to prevent recursive inclusion -------------------------------------*/
00023 #ifndef __STM32F10x_RTC_H
00024 #define __STM32F10x_RTC_H
00025 
00026 #ifdef __cplusplus
00027  extern "C" {
00028 #endif
00029 
00030 /* Includes ------------------------------------------------------------------*/
00031 #include "stm32f10x.h"
00032 
00033 /** @addtogroup STM32F10x_StdPeriph_Driver
00034   * @{
00035   */
00036 
00037 /** @addtogroup RTC
00038   * @{
00039   */ 
00040 
00041 /** @defgroup RTC_Exported_Types
00042   * @{
00043   */ 
00044 
00045 /**
00046   * @}
00047   */ 
00048 
00049 /** @defgroup RTC_Exported_Constants
00050   * @{
00051   */
00052 
00053 /** @defgroup RTC_interrupts_define 
00054   * @{
00055   */
00056 
00057 #define RTC_IT_OW            ((uint16_t)0x0004)  /*!< Overflow interrupt */
00058 #define RTC_IT_ALR           ((uint16_t)0x0002)  /*!< Alarm interrupt */
00059 #define RTC_IT_SEC           ((uint16_t)0x0001)  /*!< Second interrupt */
00060 #define IS_RTC_IT(IT) ((((IT) & (uint16_t)0xFFF8) == 0x00) && ((IT) != 0x00))
00061 #define IS_RTC_GET_IT(IT) (((IT) == RTC_IT_OW) || ((IT) == RTC_IT_ALR) || \
00062                            ((IT) == RTC_IT_SEC))
00063 /**
00064   * @}
00065   */ 
00066 
00067 /** @defgroup RTC_interrupts_flags 
00068   * @{
00069   */
00070 
00071 #define RTC_FLAG_RTOFF       ((uint16_t)0x0020)  /*!< RTC Operation OFF flag */
00072 #define RTC_FLAG_RSF         ((uint16_t)0x0008)  /*!< Registers Synchronized flag */
00073 #define RTC_FLAG_OW          ((uint16_t)0x0004)  /*!< Overflow flag */
00074 #define RTC_FLAG_ALR         ((uint16_t)0x0002)  /*!< Alarm flag */
00075 #define RTC_FLAG_SEC         ((uint16_t)0x0001)  /*!< Second flag */
00076 #define IS_RTC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint16_t)0xFFF0) == 0x00) && ((FLAG) != 0x00))
00077 #define IS_RTC_GET_FLAG(FLAG) (((FLAG) == RTC_FLAG_RTOFF) || ((FLAG) == RTC_FLAG_RSF) || \
00078                                ((FLAG) == RTC_FLAG_OW) || ((FLAG) == RTC_FLAG_ALR) || \
00079                                ((FLAG) == RTC_FLAG_SEC))
00080 #define IS_RTC_PRESCALER(PRESCALER) ((PRESCALER) <= 0xFFFFF)
00081 
00082 /**
00083   * @}
00084   */
00085 
00086 /**
00087   * @}
00088   */
00089 
00090 /** @defgroup RTC_Exported_Macros
00091   * @{
00092   */
00093 
00094 /**
00095   * @}
00096   */
00097 
00098 /** @defgroup RTC_Exported_Functions
00099   * @{
00100   */
00101 
00102 void RTC_ITConfig(uint16_t RTC_IT, FunctionalState NewState);
00103 void RTC_EnterConfigMode(void);
00104 void RTC_ExitConfigMode(void);
00105 uint32_t  RTC_GetCounter(void);
00106 void RTC_SetCounter(uint32_t CounterValue);
00107 void RTC_SetPrescaler(uint32_t PrescalerValue);
00108 void RTC_SetAlarm(uint32_t AlarmValue);
00109 uint32_t  RTC_GetDivider(void);
00110 void RTC_WaitForLastTask(void);
00111 void RTC_WaitForSynchro(void);
00112 FlagStatus RTC_GetFlagStatus(uint16_t RTC_FLAG);
00113 void RTC_ClearFlag(uint16_t RTC_FLAG);
00114 ITStatus RTC_GetITStatus(uint16_t RTC_IT);
00115 void RTC_ClearITPendingBit(uint16_t RTC_IT);
00116 
00117 #ifdef __cplusplus
00118 }
00119 #endif
00120 
00121 #endif /* __STM32F10x_RTC_H */
00122 /**
00123   * @}
00124   */
00125 
00126 /**
00127   * @}
00128   */
00129 
00130 /**
00131   * @}
00132   */
00133 
00134 /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/
STM32F10x Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM32(CORTEX M3) 32-bit Microcontrollers platform visit  www.st.com/STM32