mbed library sources

Dependents:   frdm_kl05z_gpio_test

Fork of mbed-src by mbed official

Committer:
shaoziyang
Date:
Sat Sep 13 14:25:46 2014 +0000
Revision:
323:9e901b0a5aa1
Parent:
130:1dec54e4aec3
test with CLOCK_SETUP = 0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 130:1dec54e4aec3 1 /**
mbed_official 130:1dec54e4aec3 2 ******************************************************************************
mbed_official 130:1dec54e4aec3 3 * @file stm32f0xx_rtc.h
mbed_official 130:1dec54e4aec3 4 * @author MCD Application Team
mbed_official 130:1dec54e4aec3 5 * @version V1.3.0
mbed_official 130:1dec54e4aec3 6 * @date 16-January-2014
mbed_official 130:1dec54e4aec3 7 * @brief This file contains all the functions prototypes for the RTC firmware
mbed_official 130:1dec54e4aec3 8 * library.
mbed_official 130:1dec54e4aec3 9 ******************************************************************************
mbed_official 130:1dec54e4aec3 10 * @attention
mbed_official 130:1dec54e4aec3 11 *
mbed_official 130:1dec54e4aec3 12 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 130:1dec54e4aec3 13 *
mbed_official 130:1dec54e4aec3 14 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 130:1dec54e4aec3 15 * are permitted provided that the following conditions are met:
mbed_official 130:1dec54e4aec3 16 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 130:1dec54e4aec3 17 * this list of conditions and the following disclaimer.
mbed_official 130:1dec54e4aec3 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 130:1dec54e4aec3 19 * this list of conditions and the following disclaimer in the documentation
mbed_official 130:1dec54e4aec3 20 * and/or other materials provided with the distribution.
mbed_official 130:1dec54e4aec3 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 130:1dec54e4aec3 22 * may be used to endorse or promote products derived from this software
mbed_official 130:1dec54e4aec3 23 * without specific prior written permission.
mbed_official 130:1dec54e4aec3 24 *
mbed_official 130:1dec54e4aec3 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 130:1dec54e4aec3 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 130:1dec54e4aec3 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 130:1dec54e4aec3 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 130:1dec54e4aec3 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 130:1dec54e4aec3 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 130:1dec54e4aec3 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 130:1dec54e4aec3 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 130:1dec54e4aec3 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 130:1dec54e4aec3 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 130:1dec54e4aec3 35 *
mbed_official 130:1dec54e4aec3 36 ******************************************************************************
mbed_official 130:1dec54e4aec3 37 */
mbed_official 130:1dec54e4aec3 38
mbed_official 130:1dec54e4aec3 39 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 130:1dec54e4aec3 40 #ifndef __STM32F0XX_RTC_H
mbed_official 130:1dec54e4aec3 41 #define __STM32F0XX_RTC_H
mbed_official 130:1dec54e4aec3 42
mbed_official 130:1dec54e4aec3 43 #ifdef __cplusplus
mbed_official 130:1dec54e4aec3 44 extern "C" {
mbed_official 130:1dec54e4aec3 45 #endif
mbed_official 130:1dec54e4aec3 46
mbed_official 130:1dec54e4aec3 47 /* Includes ------------------------------------------------------------------*/
mbed_official 130:1dec54e4aec3 48 #include "stm32f0xx.h"
mbed_official 130:1dec54e4aec3 49
mbed_official 130:1dec54e4aec3 50 /** @addtogroup STM32F0xx_StdPeriph_Driver
mbed_official 130:1dec54e4aec3 51 * @{
mbed_official 130:1dec54e4aec3 52 */
mbed_official 130:1dec54e4aec3 53
mbed_official 130:1dec54e4aec3 54 /** @addtogroup RTC
mbed_official 130:1dec54e4aec3 55 * @{
mbed_official 130:1dec54e4aec3 56 */
mbed_official 130:1dec54e4aec3 57
mbed_official 130:1dec54e4aec3 58 /* Exported types ------------------------------------------------------------*/
mbed_official 130:1dec54e4aec3 59
mbed_official 130:1dec54e4aec3 60 /**
mbed_official 130:1dec54e4aec3 61 * @brief RTC Init structures definition
mbed_official 130:1dec54e4aec3 62 */
mbed_official 130:1dec54e4aec3 63 typedef struct
mbed_official 130:1dec54e4aec3 64 {
mbed_official 130:1dec54e4aec3 65 uint32_t RTC_HourFormat; /*!< Specifies the RTC Hour Format.
mbed_official 130:1dec54e4aec3 66 This parameter can be a value of @ref RTC_Hour_Formats */
mbed_official 130:1dec54e4aec3 67
mbed_official 130:1dec54e4aec3 68 uint32_t RTC_AsynchPrediv; /*!< Specifies the RTC Asynchronous Predivider value.
mbed_official 130:1dec54e4aec3 69 This parameter must be set to a value lower than 0x7F */
mbed_official 130:1dec54e4aec3 70
mbed_official 130:1dec54e4aec3 71 uint32_t RTC_SynchPrediv; /*!< Specifies the RTC Synchronous Predivider value.
mbed_official 130:1dec54e4aec3 72 This parameter must be set to a value lower than 0x1FFF */
mbed_official 130:1dec54e4aec3 73 }RTC_InitTypeDef;
mbed_official 130:1dec54e4aec3 74
mbed_official 130:1dec54e4aec3 75 /**
mbed_official 130:1dec54e4aec3 76 * @brief RTC Time structure definition
mbed_official 130:1dec54e4aec3 77 */
mbed_official 130:1dec54e4aec3 78 typedef struct
mbed_official 130:1dec54e4aec3 79 {
mbed_official 130:1dec54e4aec3 80 uint8_t RTC_Hours; /*!< Specifies the RTC Time Hour.
mbed_official 130:1dec54e4aec3 81 This parameter must be set to a value in the 0-12 range
mbed_official 130:1dec54e4aec3 82 if the RTC_HourFormat_12 is selected or 0-23 range if
mbed_official 130:1dec54e4aec3 83 the RTC_HourFormat_24 is selected. */
mbed_official 130:1dec54e4aec3 84
mbed_official 130:1dec54e4aec3 85 uint8_t RTC_Minutes; /*!< Specifies the RTC Time Minutes.
mbed_official 130:1dec54e4aec3 86 This parameter must be set to a value in the 0-59 range. */
mbed_official 130:1dec54e4aec3 87
mbed_official 130:1dec54e4aec3 88 uint8_t RTC_Seconds; /*!< Specifies the RTC Time Seconds.
mbed_official 130:1dec54e4aec3 89 This parameter must be set to a value in the 0-59 range. */
mbed_official 130:1dec54e4aec3 90
mbed_official 130:1dec54e4aec3 91 uint8_t RTC_H12; /*!< Specifies the RTC AM/PM Time.
mbed_official 130:1dec54e4aec3 92 This parameter can be a value of @ref RTC_AM_PM_Definitions */
mbed_official 130:1dec54e4aec3 93 }RTC_TimeTypeDef;
mbed_official 130:1dec54e4aec3 94
mbed_official 130:1dec54e4aec3 95 /**
mbed_official 130:1dec54e4aec3 96 * @brief RTC Date structure definition
mbed_official 130:1dec54e4aec3 97 */
mbed_official 130:1dec54e4aec3 98 typedef struct
mbed_official 130:1dec54e4aec3 99 {
mbed_official 130:1dec54e4aec3 100 uint8_t RTC_WeekDay; /*!< Specifies the RTC Date WeekDay.
mbed_official 130:1dec54e4aec3 101 This parameter can be a value of @ref RTC_WeekDay_Definitions */
mbed_official 130:1dec54e4aec3 102
mbed_official 130:1dec54e4aec3 103 uint8_t RTC_Month; /*!< Specifies the RTC Date Month.
mbed_official 130:1dec54e4aec3 104 This parameter can be a value of @ref RTC_Month_Date_Definitions */
mbed_official 130:1dec54e4aec3 105
mbed_official 130:1dec54e4aec3 106 uint8_t RTC_Date; /*!< Specifies the RTC Date.
mbed_official 130:1dec54e4aec3 107 This parameter must be set to a value in the 1-31 range. */
mbed_official 130:1dec54e4aec3 108
mbed_official 130:1dec54e4aec3 109 uint8_t RTC_Year; /*!< Specifies the RTC Date Year.
mbed_official 130:1dec54e4aec3 110 This parameter must be set to a value in the 0-99 range. */
mbed_official 130:1dec54e4aec3 111 }RTC_DateTypeDef;
mbed_official 130:1dec54e4aec3 112
mbed_official 130:1dec54e4aec3 113 /**
mbed_official 130:1dec54e4aec3 114 * @brief RTC Alarm structure definition
mbed_official 130:1dec54e4aec3 115 */
mbed_official 130:1dec54e4aec3 116 typedef struct
mbed_official 130:1dec54e4aec3 117 {
mbed_official 130:1dec54e4aec3 118 RTC_TimeTypeDef RTC_AlarmTime; /*!< Specifies the RTC Alarm Time members. */
mbed_official 130:1dec54e4aec3 119
mbed_official 130:1dec54e4aec3 120 uint32_t RTC_AlarmMask; /*!< Specifies the RTC Alarm Masks.
mbed_official 130:1dec54e4aec3 121 This parameter can be a value of @ref RTC_AlarmMask_Definitions */
mbed_official 130:1dec54e4aec3 122
mbed_official 130:1dec54e4aec3 123 uint32_t RTC_AlarmDateWeekDaySel; /*!< Specifies the RTC Alarm is on Date or WeekDay.
mbed_official 130:1dec54e4aec3 124 This parameter can be a value of @ref RTC_AlarmDateWeekDay_Definitions */
mbed_official 130:1dec54e4aec3 125
mbed_official 130:1dec54e4aec3 126 uint8_t RTC_AlarmDateWeekDay; /*!< Specifies the RTC Alarm Date/WeekDay.
mbed_official 130:1dec54e4aec3 127 This parameter must be set to a value in the 1-31 range
mbed_official 130:1dec54e4aec3 128 if the Alarm Date is selected.
mbed_official 130:1dec54e4aec3 129 This parameter can be a value of @ref RTC_WeekDay_Definitions
mbed_official 130:1dec54e4aec3 130 if the Alarm WeekDay is selected. */
mbed_official 130:1dec54e4aec3 131 }RTC_AlarmTypeDef;
mbed_official 130:1dec54e4aec3 132
mbed_official 130:1dec54e4aec3 133 /* Exported constants --------------------------------------------------------*/
mbed_official 130:1dec54e4aec3 134
mbed_official 130:1dec54e4aec3 135 /** @defgroup RTC_Exported_Constants
mbed_official 130:1dec54e4aec3 136 * @{
mbed_official 130:1dec54e4aec3 137 */
mbed_official 130:1dec54e4aec3 138
mbed_official 130:1dec54e4aec3 139
mbed_official 130:1dec54e4aec3 140 /** @defgroup RTC_Hour_Formats
mbed_official 130:1dec54e4aec3 141 * @{
mbed_official 130:1dec54e4aec3 142 */
mbed_official 130:1dec54e4aec3 143 #define RTC_HourFormat_24 ((uint32_t)0x00000000)
mbed_official 130:1dec54e4aec3 144 #define RTC_HourFormat_12 ((uint32_t)0x00000040)
mbed_official 130:1dec54e4aec3 145 #define IS_RTC_HOUR_FORMAT(FORMAT) (((FORMAT) == RTC_HourFormat_12) || \
mbed_official 130:1dec54e4aec3 146 ((FORMAT) == RTC_HourFormat_24))
mbed_official 130:1dec54e4aec3 147 /**
mbed_official 130:1dec54e4aec3 148 * @}
mbed_official 130:1dec54e4aec3 149 */
mbed_official 130:1dec54e4aec3 150
mbed_official 130:1dec54e4aec3 151 /** @defgroup RTC_Asynchronous_Predivider
mbed_official 130:1dec54e4aec3 152 * @{
mbed_official 130:1dec54e4aec3 153 */
mbed_official 130:1dec54e4aec3 154 #define IS_RTC_ASYNCH_PREDIV(PREDIV) ((PREDIV) <= 0x7F)
mbed_official 130:1dec54e4aec3 155
mbed_official 130:1dec54e4aec3 156 /**
mbed_official 130:1dec54e4aec3 157 * @}
mbed_official 130:1dec54e4aec3 158 */
mbed_official 130:1dec54e4aec3 159
mbed_official 130:1dec54e4aec3 160
mbed_official 130:1dec54e4aec3 161 /** @defgroup RTC_Synchronous_Predivider
mbed_official 130:1dec54e4aec3 162 * @{
mbed_official 130:1dec54e4aec3 163 */
mbed_official 130:1dec54e4aec3 164 #define IS_RTC_SYNCH_PREDIV(PREDIV) ((PREDIV) <= 0x7FFF)
mbed_official 130:1dec54e4aec3 165
mbed_official 130:1dec54e4aec3 166 /**
mbed_official 130:1dec54e4aec3 167 * @}
mbed_official 130:1dec54e4aec3 168 */
mbed_official 130:1dec54e4aec3 169
mbed_official 130:1dec54e4aec3 170 /** @defgroup RTC_Time_Definitions
mbed_official 130:1dec54e4aec3 171 * @{
mbed_official 130:1dec54e4aec3 172 */
mbed_official 130:1dec54e4aec3 173 #define IS_RTC_HOUR12(HOUR) (((HOUR) > 0) && ((HOUR) <= 12))
mbed_official 130:1dec54e4aec3 174 #define IS_RTC_HOUR24(HOUR) ((HOUR) <= 23)
mbed_official 130:1dec54e4aec3 175 #define IS_RTC_MINUTES(MINUTES) ((MINUTES) <= 59)
mbed_official 130:1dec54e4aec3 176 #define IS_RTC_SECONDS(SECONDS) ((SECONDS) <= 59)
mbed_official 130:1dec54e4aec3 177
mbed_official 130:1dec54e4aec3 178 /**
mbed_official 130:1dec54e4aec3 179 * @}
mbed_official 130:1dec54e4aec3 180 */
mbed_official 130:1dec54e4aec3 181
mbed_official 130:1dec54e4aec3 182 /** @defgroup RTC_AM_PM_Definitions
mbed_official 130:1dec54e4aec3 183 * @{
mbed_official 130:1dec54e4aec3 184 */
mbed_official 130:1dec54e4aec3 185 #define RTC_H12_AM ((uint8_t)0x00)
mbed_official 130:1dec54e4aec3 186 #define RTC_H12_PM ((uint8_t)0x40)
mbed_official 130:1dec54e4aec3 187 #define IS_RTC_H12(PM) (((PM) == RTC_H12_AM) || ((PM) == RTC_H12_PM))
mbed_official 130:1dec54e4aec3 188
mbed_official 130:1dec54e4aec3 189 /**
mbed_official 130:1dec54e4aec3 190 * @}
mbed_official 130:1dec54e4aec3 191 */
mbed_official 130:1dec54e4aec3 192
mbed_official 130:1dec54e4aec3 193 /** @defgroup RTC_Year_Date_Definitions
mbed_official 130:1dec54e4aec3 194 * @{
mbed_official 130:1dec54e4aec3 195 */
mbed_official 130:1dec54e4aec3 196 #define IS_RTC_YEAR(YEAR) ((YEAR) <= 99)
mbed_official 130:1dec54e4aec3 197
mbed_official 130:1dec54e4aec3 198 /**
mbed_official 130:1dec54e4aec3 199 * @}
mbed_official 130:1dec54e4aec3 200 */
mbed_official 130:1dec54e4aec3 201
mbed_official 130:1dec54e4aec3 202 /** @defgroup RTC_Month_Date_Definitions
mbed_official 130:1dec54e4aec3 203 * @{
mbed_official 130:1dec54e4aec3 204 */
mbed_official 130:1dec54e4aec3 205 #define RTC_Month_January ((uint8_t)0x01)
mbed_official 130:1dec54e4aec3 206 #define RTC_Month_February ((uint8_t)0x02)
mbed_official 130:1dec54e4aec3 207 #define RTC_Month_March ((uint8_t)0x03)
mbed_official 130:1dec54e4aec3 208 #define RTC_Month_April ((uint8_t)0x04)
mbed_official 130:1dec54e4aec3 209 #define RTC_Month_May ((uint8_t)0x05)
mbed_official 130:1dec54e4aec3 210 #define RTC_Month_June ((uint8_t)0x06)
mbed_official 130:1dec54e4aec3 211 #define RTC_Month_July ((uint8_t)0x07)
mbed_official 130:1dec54e4aec3 212 #define RTC_Month_August ((uint8_t)0x08)
mbed_official 130:1dec54e4aec3 213 #define RTC_Month_September ((uint8_t)0x09)
mbed_official 130:1dec54e4aec3 214 #define RTC_Month_October ((uint8_t)0x10)
mbed_official 130:1dec54e4aec3 215 #define RTC_Month_November ((uint8_t)0x11)
mbed_official 130:1dec54e4aec3 216 #define RTC_Month_December ((uint8_t)0x12)
mbed_official 130:1dec54e4aec3 217 #define IS_RTC_MONTH(MONTH) (((MONTH) >= 1) && ((MONTH) <= 12))
mbed_official 130:1dec54e4aec3 218 #define IS_RTC_DATE(DATE) (((DATE) >= 1) && ((DATE) <= 31))
mbed_official 130:1dec54e4aec3 219
mbed_official 130:1dec54e4aec3 220 /**
mbed_official 130:1dec54e4aec3 221 * @}
mbed_official 130:1dec54e4aec3 222 */
mbed_official 130:1dec54e4aec3 223
mbed_official 130:1dec54e4aec3 224 /** @defgroup RTC_WeekDay_Definitions
mbed_official 130:1dec54e4aec3 225 * @{
mbed_official 130:1dec54e4aec3 226 */
mbed_official 130:1dec54e4aec3 227
mbed_official 130:1dec54e4aec3 228 #define RTC_Weekday_Monday ((uint8_t)0x01)
mbed_official 130:1dec54e4aec3 229 #define RTC_Weekday_Tuesday ((uint8_t)0x02)
mbed_official 130:1dec54e4aec3 230 #define RTC_Weekday_Wednesday ((uint8_t)0x03)
mbed_official 130:1dec54e4aec3 231 #define RTC_Weekday_Thursday ((uint8_t)0x04)
mbed_official 130:1dec54e4aec3 232 #define RTC_Weekday_Friday ((uint8_t)0x05)
mbed_official 130:1dec54e4aec3 233 #define RTC_Weekday_Saturday ((uint8_t)0x6)
mbed_official 130:1dec54e4aec3 234 #define RTC_Weekday_Sunday ((uint8_t)0x07)
mbed_official 130:1dec54e4aec3 235 #define IS_RTC_WEEKDAY(WEEKDAY) (((WEEKDAY) == RTC_Weekday_Monday) || \
mbed_official 130:1dec54e4aec3 236 ((WEEKDAY) == RTC_Weekday_Tuesday) || \
mbed_official 130:1dec54e4aec3 237 ((WEEKDAY) == RTC_Weekday_Wednesday) || \
mbed_official 130:1dec54e4aec3 238 ((WEEKDAY) == RTC_Weekday_Thursday) || \
mbed_official 130:1dec54e4aec3 239 ((WEEKDAY) == RTC_Weekday_Friday) || \
mbed_official 130:1dec54e4aec3 240 ((WEEKDAY) == RTC_Weekday_Saturday) || \
mbed_official 130:1dec54e4aec3 241 ((WEEKDAY) == RTC_Weekday_Sunday))
mbed_official 130:1dec54e4aec3 242 /**
mbed_official 130:1dec54e4aec3 243 * @}
mbed_official 130:1dec54e4aec3 244 */
mbed_official 130:1dec54e4aec3 245
mbed_official 130:1dec54e4aec3 246
mbed_official 130:1dec54e4aec3 247 /** @defgroup RTC_Alarm_Definitions
mbed_official 130:1dec54e4aec3 248 * @{
mbed_official 130:1dec54e4aec3 249 */
mbed_official 130:1dec54e4aec3 250 #define IS_RTC_ALARM_DATE_WEEKDAY_DATE(DATE) (((DATE) > 0) && ((DATE) <= 31))
mbed_official 130:1dec54e4aec3 251 #define IS_RTC_ALARM_DATE_WEEKDAY_WEEKDAY(WEEKDAY) (((WEEKDAY) == RTC_Weekday_Monday) || \
mbed_official 130:1dec54e4aec3 252 ((WEEKDAY) == RTC_Weekday_Tuesday) || \
mbed_official 130:1dec54e4aec3 253 ((WEEKDAY) == RTC_Weekday_Wednesday) || \
mbed_official 130:1dec54e4aec3 254 ((WEEKDAY) == RTC_Weekday_Thursday) || \
mbed_official 130:1dec54e4aec3 255 ((WEEKDAY) == RTC_Weekday_Friday) || \
mbed_official 130:1dec54e4aec3 256 ((WEEKDAY) == RTC_Weekday_Saturday) || \
mbed_official 130:1dec54e4aec3 257 ((WEEKDAY) == RTC_Weekday_Sunday))
mbed_official 130:1dec54e4aec3 258
mbed_official 130:1dec54e4aec3 259 /**
mbed_official 130:1dec54e4aec3 260 * @}
mbed_official 130:1dec54e4aec3 261 */
mbed_official 130:1dec54e4aec3 262
mbed_official 130:1dec54e4aec3 263
mbed_official 130:1dec54e4aec3 264 /** @defgroup RTC_AlarmDateWeekDay_Definitions
mbed_official 130:1dec54e4aec3 265 * @{
mbed_official 130:1dec54e4aec3 266 */
mbed_official 130:1dec54e4aec3 267 #define RTC_AlarmDateWeekDaySel_Date ((uint32_t)0x00000000)
mbed_official 130:1dec54e4aec3 268 #define RTC_AlarmDateWeekDaySel_WeekDay ((uint32_t)0x40000000)
mbed_official 130:1dec54e4aec3 269
mbed_official 130:1dec54e4aec3 270 #define IS_RTC_ALARM_DATE_WEEKDAY_SEL(SEL) (((SEL) == RTC_AlarmDateWeekDaySel_Date) || \
mbed_official 130:1dec54e4aec3 271 ((SEL) == RTC_AlarmDateWeekDaySel_WeekDay))
mbed_official 130:1dec54e4aec3 272
mbed_official 130:1dec54e4aec3 273 /**
mbed_official 130:1dec54e4aec3 274 * @}
mbed_official 130:1dec54e4aec3 275 */
mbed_official 130:1dec54e4aec3 276
mbed_official 130:1dec54e4aec3 277
mbed_official 130:1dec54e4aec3 278 /** @defgroup RTC_AlarmMask_Definitions
mbed_official 130:1dec54e4aec3 279 * @{
mbed_official 130:1dec54e4aec3 280 */
mbed_official 130:1dec54e4aec3 281 #define RTC_AlarmMask_None ((uint32_t)0x00000000)
mbed_official 130:1dec54e4aec3 282 #define RTC_AlarmMask_DateWeekDay ((uint32_t)0x80000000)
mbed_official 130:1dec54e4aec3 283 #define RTC_AlarmMask_Hours ((uint32_t)0x00800000)
mbed_official 130:1dec54e4aec3 284 #define RTC_AlarmMask_Minutes ((uint32_t)0x00008000)
mbed_official 130:1dec54e4aec3 285 #define RTC_AlarmMask_Seconds ((uint32_t)0x00000080)
mbed_official 130:1dec54e4aec3 286 #define RTC_AlarmMask_All ((uint32_t)0x80808080)
mbed_official 130:1dec54e4aec3 287 #define IS_RTC_ALARM_MASK(MASK) (((MASK) & 0x7F7F7F7F) == (uint32_t)RESET)
mbed_official 130:1dec54e4aec3 288
mbed_official 130:1dec54e4aec3 289 /**
mbed_official 130:1dec54e4aec3 290 * @}
mbed_official 130:1dec54e4aec3 291 */
mbed_official 130:1dec54e4aec3 292
mbed_official 130:1dec54e4aec3 293 /** @defgroup RTC_Alarms_Definitions
mbed_official 130:1dec54e4aec3 294 * @{
mbed_official 130:1dec54e4aec3 295 */
mbed_official 130:1dec54e4aec3 296 #define RTC_Alarm_A ((uint32_t)0x00000100)
mbed_official 130:1dec54e4aec3 297 #define IS_RTC_ALARM(ALARM) ((ALARM) == RTC_Alarm_A)
mbed_official 130:1dec54e4aec3 298 #define IS_RTC_CMD_ALARM(ALARM) (((ALARM) & (RTC_Alarm_A)) != (uint32_t)RESET)
mbed_official 130:1dec54e4aec3 299
mbed_official 130:1dec54e4aec3 300 /**
mbed_official 130:1dec54e4aec3 301 * @}
mbed_official 130:1dec54e4aec3 302 */
mbed_official 130:1dec54e4aec3 303
mbed_official 130:1dec54e4aec3 304 /** @defgroup RTC_Alarm_Sub_Seconds_Masks Definitions.
mbed_official 130:1dec54e4aec3 305 * @{
mbed_official 130:1dec54e4aec3 306 */
mbed_official 130:1dec54e4aec3 307 #define RTC_AlarmSubSecondMask_All ((uint8_t)0x00) /*!< All Alarm SS fields are masked.
mbed_official 130:1dec54e4aec3 308 There is no comparison on sub seconds
mbed_official 130:1dec54e4aec3 309 for Alarm */
mbed_official 130:1dec54e4aec3 310 #define RTC_AlarmSubSecondMask_SS14_1 ((uint8_t)0x01) /*!< SS[14:1] are don't care in Alarm
mbed_official 130:1dec54e4aec3 311 comparison. Only SS[0] is compared. */
mbed_official 130:1dec54e4aec3 312 #define RTC_AlarmSubSecondMask_SS14_2 ((uint8_t)0x02) /*!< SS[14:2] are don't care in Alarm
mbed_official 130:1dec54e4aec3 313 comparison. Only SS[1:0] are compared */
mbed_official 130:1dec54e4aec3 314 #define RTC_AlarmSubSecondMask_SS14_3 ((uint8_t)0x03) /*!< SS[14:3] are don't care in Alarm
mbed_official 130:1dec54e4aec3 315 comparison. Only SS[2:0] are compared */
mbed_official 130:1dec54e4aec3 316 #define RTC_AlarmSubSecondMask_SS14_4 ((uint8_t)0x04) /*!< SS[14:4] are don't care in Alarm
mbed_official 130:1dec54e4aec3 317 comparison. Only SS[3:0] are compared */
mbed_official 130:1dec54e4aec3 318 #define RTC_AlarmSubSecondMask_SS14_5 ((uint8_t)0x05) /*!< SS[14:5] are don't care in Alarm
mbed_official 130:1dec54e4aec3 319 comparison. Only SS[4:0] are compared */
mbed_official 130:1dec54e4aec3 320 #define RTC_AlarmSubSecondMask_SS14_6 ((uint8_t)0x06) /*!< SS[14:6] are don't care in Alarm
mbed_official 130:1dec54e4aec3 321 comparison. Only SS[5:0] are compared */
mbed_official 130:1dec54e4aec3 322 #define RTC_AlarmSubSecondMask_SS14_7 ((uint8_t)0x07) /*!< SS[14:7] are don't care in Alarm
mbed_official 130:1dec54e4aec3 323 comparison. Only SS[6:0] are compared */
mbed_official 130:1dec54e4aec3 324 #define RTC_AlarmSubSecondMask_SS14_8 ((uint8_t)0x08) /*!< SS[14:8] are don't care in Alarm
mbed_official 130:1dec54e4aec3 325 comparison. Only SS[7:0] are compared */
mbed_official 130:1dec54e4aec3 326 #define RTC_AlarmSubSecondMask_SS14_9 ((uint8_t)0x09) /*!< SS[14:9] are don't care in Alarm
mbed_official 130:1dec54e4aec3 327 comparison. Only SS[8:0] are compared */
mbed_official 130:1dec54e4aec3 328 #define RTC_AlarmSubSecondMask_SS14_10 ((uint8_t)0x0A) /*!< SS[14:10] are don't care in Alarm
mbed_official 130:1dec54e4aec3 329 comparison. Only SS[9:0] are compared */
mbed_official 130:1dec54e4aec3 330 #define RTC_AlarmSubSecondMask_SS14_11 ((uint8_t)0x0B) /*!< SS[14:11] are don't care in Alarm
mbed_official 130:1dec54e4aec3 331 comparison. Only SS[10:0] are compared */
mbed_official 130:1dec54e4aec3 332 #define RTC_AlarmSubSecondMask_SS14_12 ((uint8_t)0x0C) /*!< SS[14:12] are don't care in Alarm
mbed_official 130:1dec54e4aec3 333 comparison.Only SS[11:0] are compared */
mbed_official 130:1dec54e4aec3 334 #define RTC_AlarmSubSecondMask_SS14_13 ((uint8_t)0x0D) /*!< SS[14:13] are don't care in Alarm
mbed_official 130:1dec54e4aec3 335 comparison. Only SS[12:0] are compared */
mbed_official 130:1dec54e4aec3 336 #define RTC_AlarmSubSecondMask_SS14 ((uint8_t)0x0E) /*!< SS[14] is don't care in Alarm
mbed_official 130:1dec54e4aec3 337 comparison.Only SS[13:0] are compared */
mbed_official 130:1dec54e4aec3 338 #define RTC_AlarmSubSecondMask_None ((uint8_t)0x0F) /*!< SS[14:0] are compared and must match
mbed_official 130:1dec54e4aec3 339 to activate alarm. */
mbed_official 130:1dec54e4aec3 340 #define IS_RTC_ALARM_SUB_SECOND_MASK(MASK) (((MASK) == RTC_AlarmSubSecondMask_All) || \
mbed_official 130:1dec54e4aec3 341 ((MASK) == RTC_AlarmSubSecondMask_SS14_1) || \
mbed_official 130:1dec54e4aec3 342 ((MASK) == RTC_AlarmSubSecondMask_SS14_2) || \
mbed_official 130:1dec54e4aec3 343 ((MASK) == RTC_AlarmSubSecondMask_SS14_3) || \
mbed_official 130:1dec54e4aec3 344 ((MASK) == RTC_AlarmSubSecondMask_SS14_4) || \
mbed_official 130:1dec54e4aec3 345 ((MASK) == RTC_AlarmSubSecondMask_SS14_5) || \
mbed_official 130:1dec54e4aec3 346 ((MASK) == RTC_AlarmSubSecondMask_SS14_6) || \
mbed_official 130:1dec54e4aec3 347 ((MASK) == RTC_AlarmSubSecondMask_SS14_7) || \
mbed_official 130:1dec54e4aec3 348 ((MASK) == RTC_AlarmSubSecondMask_SS14_8) || \
mbed_official 130:1dec54e4aec3 349 ((MASK) == RTC_AlarmSubSecondMask_SS14_9) || \
mbed_official 130:1dec54e4aec3 350 ((MASK) == RTC_AlarmSubSecondMask_SS14_10) || \
mbed_official 130:1dec54e4aec3 351 ((MASK) == RTC_AlarmSubSecondMask_SS14_11) || \
mbed_official 130:1dec54e4aec3 352 ((MASK) == RTC_AlarmSubSecondMask_SS14_12) || \
mbed_official 130:1dec54e4aec3 353 ((MASK) == RTC_AlarmSubSecondMask_SS14_13) || \
mbed_official 130:1dec54e4aec3 354 ((MASK) == RTC_AlarmSubSecondMask_SS14) || \
mbed_official 130:1dec54e4aec3 355 ((MASK) == RTC_AlarmSubSecondMask_None))
mbed_official 130:1dec54e4aec3 356 /**
mbed_official 130:1dec54e4aec3 357 * @}
mbed_official 130:1dec54e4aec3 358 */
mbed_official 130:1dec54e4aec3 359
mbed_official 130:1dec54e4aec3 360 /** @defgroup RTC_Alarm_Sub_Seconds_Value
mbed_official 130:1dec54e4aec3 361 * @{
mbed_official 130:1dec54e4aec3 362 */
mbed_official 130:1dec54e4aec3 363
mbed_official 130:1dec54e4aec3 364 #define IS_RTC_ALARM_SUB_SECOND_VALUE(VALUE) ((VALUE) <= 0x00007FFF)
mbed_official 130:1dec54e4aec3 365
mbed_official 130:1dec54e4aec3 366 /**
mbed_official 130:1dec54e4aec3 367 * @}
mbed_official 130:1dec54e4aec3 368 */
mbed_official 130:1dec54e4aec3 369
mbed_official 130:1dec54e4aec3 370 /** @defgroup RTC_Wakeup_Timer_Definitions
mbed_official 130:1dec54e4aec3 371 * @brief These parameters are only available for STM32F072 devices
mbed_official 130:1dec54e4aec3 372 * @{
mbed_official 130:1dec54e4aec3 373 */
mbed_official 130:1dec54e4aec3 374 #define RTC_WakeUpClock_RTCCLK_Div16 ((uint32_t)0x00000000)
mbed_official 130:1dec54e4aec3 375 #define RTC_WakeUpClock_RTCCLK_Div8 ((uint32_t)0x00000001)
mbed_official 130:1dec54e4aec3 376 #define RTC_WakeUpClock_RTCCLK_Div4 ((uint32_t)0x00000002)
mbed_official 130:1dec54e4aec3 377 #define RTC_WakeUpClock_RTCCLK_Div2 ((uint32_t)0x00000003)
mbed_official 130:1dec54e4aec3 378 #define RTC_WakeUpClock_CK_SPRE_16bits ((uint32_t)0x00000004)
mbed_official 130:1dec54e4aec3 379 #define RTC_WakeUpClock_CK_SPRE_17bits ((uint32_t)0x00000006)
mbed_official 130:1dec54e4aec3 380 #define IS_RTC_WAKEUP_CLOCK(CLOCK) (((CLOCK) == RTC_WakeUpClock_RTCCLK_Div16) || \
mbed_official 130:1dec54e4aec3 381 ((CLOCK) == RTC_WakeUpClock_RTCCLK_Div8) || \
mbed_official 130:1dec54e4aec3 382 ((CLOCK) == RTC_WakeUpClock_RTCCLK_Div4) || \
mbed_official 130:1dec54e4aec3 383 ((CLOCK) == RTC_WakeUpClock_RTCCLK_Div2) || \
mbed_official 130:1dec54e4aec3 384 ((CLOCK) == RTC_WakeUpClock_CK_SPRE_16bits) || \
mbed_official 130:1dec54e4aec3 385 ((CLOCK) == RTC_WakeUpClock_CK_SPRE_17bits))
mbed_official 130:1dec54e4aec3 386 #define IS_RTC_WAKEUP_COUNTER(COUNTER) ((COUNTER) <= 0xFFFF)
mbed_official 130:1dec54e4aec3 387 /**
mbed_official 130:1dec54e4aec3 388 * @}
mbed_official 130:1dec54e4aec3 389 */
mbed_official 130:1dec54e4aec3 390
mbed_official 130:1dec54e4aec3 391 /** @defgroup RTC_Time_Stamp_Edges_definitions
mbed_official 130:1dec54e4aec3 392 * @{
mbed_official 130:1dec54e4aec3 393 */
mbed_official 130:1dec54e4aec3 394 #define RTC_TimeStampEdge_Rising ((uint32_t)0x00000000)
mbed_official 130:1dec54e4aec3 395 #define RTC_TimeStampEdge_Falling ((uint32_t)0x00000008)
mbed_official 130:1dec54e4aec3 396 #define IS_RTC_TIMESTAMP_EDGE(EDGE) (((EDGE) == RTC_TimeStampEdge_Rising) || \
mbed_official 130:1dec54e4aec3 397 ((EDGE) == RTC_TimeStampEdge_Falling))
mbed_official 130:1dec54e4aec3 398 /**
mbed_official 130:1dec54e4aec3 399 * @}
mbed_official 130:1dec54e4aec3 400 */
mbed_official 130:1dec54e4aec3 401
mbed_official 130:1dec54e4aec3 402 /** @defgroup RTC_Output_selection_Definitions
mbed_official 130:1dec54e4aec3 403 * @{
mbed_official 130:1dec54e4aec3 404 */
mbed_official 130:1dec54e4aec3 405 #define RTC_Output_Disable ((uint32_t)0x00000000)
mbed_official 130:1dec54e4aec3 406 #define RTC_Output_AlarmA ((uint32_t)0x00200000)
mbed_official 130:1dec54e4aec3 407 #define RTC_Output_WakeUp ((uint32_t)0x00600000) /*!< available only for STM32F072 devices */
mbed_official 130:1dec54e4aec3 408
mbed_official 130:1dec54e4aec3 409 #define IS_RTC_OUTPUT(OUTPUT) (((OUTPUT) == RTC_Output_Disable) || \
mbed_official 130:1dec54e4aec3 410 ((OUTPUT) == RTC_Output_AlarmA) || \
mbed_official 130:1dec54e4aec3 411 ((OUTPUT) == RTC_Output_WakeUp))
mbed_official 130:1dec54e4aec3 412
mbed_official 130:1dec54e4aec3 413 /**
mbed_official 130:1dec54e4aec3 414 * @}
mbed_official 130:1dec54e4aec3 415 */
mbed_official 130:1dec54e4aec3 416
mbed_official 130:1dec54e4aec3 417 /** @defgroup RTC_Output_Polarity_Definitions
mbed_official 130:1dec54e4aec3 418 * @{
mbed_official 130:1dec54e4aec3 419 */
mbed_official 130:1dec54e4aec3 420 #define RTC_OutputPolarity_High ((uint32_t)0x00000000)
mbed_official 130:1dec54e4aec3 421 #define RTC_OutputPolarity_Low ((uint32_t)0x00100000)
mbed_official 130:1dec54e4aec3 422 #define IS_RTC_OUTPUT_POL(POL) (((POL) == RTC_OutputPolarity_High) || \
mbed_official 130:1dec54e4aec3 423 ((POL) == RTC_OutputPolarity_Low))
mbed_official 130:1dec54e4aec3 424 /**
mbed_official 130:1dec54e4aec3 425 * @}
mbed_official 130:1dec54e4aec3 426 */
mbed_official 130:1dec54e4aec3 427
mbed_official 130:1dec54e4aec3 428
mbed_official 130:1dec54e4aec3 429 /** @defgroup RTC_Calib_Output_selection_Definitions
mbed_official 130:1dec54e4aec3 430 * @{
mbed_official 130:1dec54e4aec3 431 */
mbed_official 130:1dec54e4aec3 432 #define RTC_CalibOutput_512Hz ((uint32_t)0x00000000)
mbed_official 130:1dec54e4aec3 433 #define RTC_CalibOutput_1Hz ((uint32_t)0x00080000)
mbed_official 130:1dec54e4aec3 434 #define IS_RTC_CALIB_OUTPUT(OUTPUT) (((OUTPUT) == RTC_CalibOutput_512Hz) || \
mbed_official 130:1dec54e4aec3 435 ((OUTPUT) == RTC_CalibOutput_1Hz))
mbed_official 130:1dec54e4aec3 436 /**
mbed_official 130:1dec54e4aec3 437 * @}
mbed_official 130:1dec54e4aec3 438 */
mbed_official 130:1dec54e4aec3 439
mbed_official 130:1dec54e4aec3 440 /** @defgroup RTC_Smooth_calib_period_Definitions
mbed_official 130:1dec54e4aec3 441 * @{
mbed_official 130:1dec54e4aec3 442 */
mbed_official 130:1dec54e4aec3 443 #define RTC_SmoothCalibPeriod_32sec ((uint32_t)0x00000000) /*!< if RTCCLK = 32768 Hz, Smooth calibation
mbed_official 130:1dec54e4aec3 444 period is 32s, else 2exp20 RTCCLK seconds */
mbed_official 130:1dec54e4aec3 445 #define RTC_SmoothCalibPeriod_16sec ((uint32_t)0x00002000) /*!< if RTCCLK = 32768 Hz, Smooth calibation
mbed_official 130:1dec54e4aec3 446 period is 16s, else 2exp19 RTCCLK seconds */
mbed_official 130:1dec54e4aec3 447 #define RTC_SmoothCalibPeriod_8sec ((uint32_t)0x00004000) /*!< if RTCCLK = 32768 Hz, Smooth calibation
mbed_official 130:1dec54e4aec3 448 period is 8s, else 2exp18 RTCCLK seconds */
mbed_official 130:1dec54e4aec3 449 #define IS_RTC_SMOOTH_CALIB_PERIOD(PERIOD) (((PERIOD) == RTC_SmoothCalibPeriod_32sec) || \
mbed_official 130:1dec54e4aec3 450 ((PERIOD) == RTC_SmoothCalibPeriod_16sec) || \
mbed_official 130:1dec54e4aec3 451 ((PERIOD) == RTC_SmoothCalibPeriod_8sec))
mbed_official 130:1dec54e4aec3 452
mbed_official 130:1dec54e4aec3 453 /**
mbed_official 130:1dec54e4aec3 454 * @}
mbed_official 130:1dec54e4aec3 455 */
mbed_official 130:1dec54e4aec3 456
mbed_official 130:1dec54e4aec3 457 /** @defgroup RTC_Smooth_calib_Plus_pulses_Definitions
mbed_official 130:1dec54e4aec3 458 * @{
mbed_official 130:1dec54e4aec3 459 */
mbed_official 130:1dec54e4aec3 460 #define RTC_SmoothCalibPlusPulses_Set ((uint32_t)0x00008000) /*!< The number of RTCCLK pulses added
mbed_official 130:1dec54e4aec3 461 during a X -second window = Y - CALM[8:0].
mbed_official 130:1dec54e4aec3 462 with Y = 512, 256, 128 when X = 32, 16, 8 */
mbed_official 130:1dec54e4aec3 463 #define RTC_SmoothCalibPlusPulses_Reset ((uint32_t)0x00000000) /*!< The number of RTCCLK pulses subbstited
mbed_official 130:1dec54e4aec3 464 during a 32-second window = CALM[8:0]. */
mbed_official 130:1dec54e4aec3 465 #define IS_RTC_SMOOTH_CALIB_PLUS(PLUS) (((PLUS) == RTC_SmoothCalibPlusPulses_Set) || \
mbed_official 130:1dec54e4aec3 466 ((PLUS) == RTC_SmoothCalibPlusPulses_Reset))
mbed_official 130:1dec54e4aec3 467
mbed_official 130:1dec54e4aec3 468 /**
mbed_official 130:1dec54e4aec3 469 * @}
mbed_official 130:1dec54e4aec3 470 */
mbed_official 130:1dec54e4aec3 471
mbed_official 130:1dec54e4aec3 472 /** @defgroup RTC_Smooth_calib_Minus_pulses_Definitions
mbed_official 130:1dec54e4aec3 473 * @{
mbed_official 130:1dec54e4aec3 474 */
mbed_official 130:1dec54e4aec3 475 #define IS_RTC_SMOOTH_CALIB_MINUS(VALUE) ((VALUE) <= 0x000001FF)
mbed_official 130:1dec54e4aec3 476
mbed_official 130:1dec54e4aec3 477 /**
mbed_official 130:1dec54e4aec3 478 * @}
mbed_official 130:1dec54e4aec3 479 */
mbed_official 130:1dec54e4aec3 480
mbed_official 130:1dec54e4aec3 481 /** @defgroup RTC_DayLightSaving_Definitions
mbed_official 130:1dec54e4aec3 482 * @{
mbed_official 130:1dec54e4aec3 483 */
mbed_official 130:1dec54e4aec3 484 #define RTC_DayLightSaving_SUB1H ((uint32_t)0x00020000)
mbed_official 130:1dec54e4aec3 485 #define RTC_DayLightSaving_ADD1H ((uint32_t)0x00010000)
mbed_official 130:1dec54e4aec3 486 #define IS_RTC_DAYLIGHT_SAVING(SAVING) (((SAVING) == RTC_DayLightSaving_SUB1H) || \
mbed_official 130:1dec54e4aec3 487 ((SAVING) == RTC_DayLightSaving_ADD1H))
mbed_official 130:1dec54e4aec3 488
mbed_official 130:1dec54e4aec3 489 #define RTC_StoreOperation_Reset ((uint32_t)0x00000000)
mbed_official 130:1dec54e4aec3 490 #define RTC_StoreOperation_Set ((uint32_t)0x00040000)
mbed_official 130:1dec54e4aec3 491 #define IS_RTC_STORE_OPERATION(OPERATION) (((OPERATION) == RTC_StoreOperation_Reset) || \
mbed_official 130:1dec54e4aec3 492 ((OPERATION) == RTC_StoreOperation_Set))
mbed_official 130:1dec54e4aec3 493 /**
mbed_official 130:1dec54e4aec3 494 * @}
mbed_official 130:1dec54e4aec3 495 */
mbed_official 130:1dec54e4aec3 496
mbed_official 130:1dec54e4aec3 497 /** @defgroup RTC_Tamper_Trigger_Definitions
mbed_official 130:1dec54e4aec3 498 * @{
mbed_official 130:1dec54e4aec3 499 */
mbed_official 130:1dec54e4aec3 500 #define RTC_TamperTrigger_RisingEdge ((uint32_t)0x00000000)
mbed_official 130:1dec54e4aec3 501 #define RTC_TamperTrigger_FallingEdge ((uint32_t)0x00000001)
mbed_official 130:1dec54e4aec3 502 #define RTC_TamperTrigger_LowLevel ((uint32_t)0x00000000)
mbed_official 130:1dec54e4aec3 503 #define RTC_TamperTrigger_HighLevel ((uint32_t)0x00000001)
mbed_official 130:1dec54e4aec3 504 #define IS_RTC_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TamperTrigger_RisingEdge) || \
mbed_official 130:1dec54e4aec3 505 ((TRIGGER) == RTC_TamperTrigger_FallingEdge) || \
mbed_official 130:1dec54e4aec3 506 ((TRIGGER) == RTC_TamperTrigger_LowLevel) || \
mbed_official 130:1dec54e4aec3 507 ((TRIGGER) == RTC_TamperTrigger_HighLevel))
mbed_official 130:1dec54e4aec3 508
mbed_official 130:1dec54e4aec3 509 /**
mbed_official 130:1dec54e4aec3 510 * @}
mbed_official 130:1dec54e4aec3 511 */
mbed_official 130:1dec54e4aec3 512
mbed_official 130:1dec54e4aec3 513 /** @defgroup RTC_Tamper_Filter_Definitions
mbed_official 130:1dec54e4aec3 514 * @{
mbed_official 130:1dec54e4aec3 515 */
mbed_official 130:1dec54e4aec3 516 #define RTC_TamperFilter_Disable ((uint32_t)0x00000000) /*!< Tamper filter is disabled */
mbed_official 130:1dec54e4aec3 517
mbed_official 130:1dec54e4aec3 518 #define RTC_TamperFilter_2Sample ((uint32_t)0x00000800) /*!< Tamper is activated after 2
mbed_official 130:1dec54e4aec3 519 consecutive samples at the active level */
mbed_official 130:1dec54e4aec3 520 #define RTC_TamperFilter_4Sample ((uint32_t)0x00001000) /*!< Tamper is activated after 4
mbed_official 130:1dec54e4aec3 521 consecutive samples at the active level */
mbed_official 130:1dec54e4aec3 522 #define RTC_TamperFilter_8Sample ((uint32_t)0x00001800) /*!< Tamper is activated after 8
mbed_official 130:1dec54e4aec3 523 consecutive samples at the active leve. */
mbed_official 130:1dec54e4aec3 524 #define IS_RTC_TAMPER_FILTER(FILTER) (((FILTER) == RTC_TamperFilter_Disable) || \
mbed_official 130:1dec54e4aec3 525 ((FILTER) == RTC_TamperFilter_2Sample) || \
mbed_official 130:1dec54e4aec3 526 ((FILTER) == RTC_TamperFilter_4Sample) || \
mbed_official 130:1dec54e4aec3 527 ((FILTER) == RTC_TamperFilter_8Sample))
mbed_official 130:1dec54e4aec3 528 /**
mbed_official 130:1dec54e4aec3 529 * @}
mbed_official 130:1dec54e4aec3 530 */
mbed_official 130:1dec54e4aec3 531
mbed_official 130:1dec54e4aec3 532 /** @defgroup RTC_Tamper_Sampling_Frequencies_Definitions
mbed_official 130:1dec54e4aec3 533 * @{
mbed_official 130:1dec54e4aec3 534 */
mbed_official 130:1dec54e4aec3 535 #define RTC_TamperSamplingFreq_RTCCLK_Div32768 ((uint32_t)0x00000000) /*!< Each of the tamper inputs are sampled
mbed_official 130:1dec54e4aec3 536 with a frequency = RTCCLK / 32768 */
mbed_official 130:1dec54e4aec3 537 #define RTC_TamperSamplingFreq_RTCCLK_Div16384 ((uint32_t)0x00000100) /*!< Each of the tamper inputs are sampled
mbed_official 130:1dec54e4aec3 538 with a frequency = RTCCLK / 16384 */
mbed_official 130:1dec54e4aec3 539 #define RTC_TamperSamplingFreq_RTCCLK_Div8192 ((uint32_t)0x00000200) /*!< Each of the tamper inputs are sampled
mbed_official 130:1dec54e4aec3 540 with a frequency = RTCCLK / 8192 */
mbed_official 130:1dec54e4aec3 541 #define RTC_TamperSamplingFreq_RTCCLK_Div4096 ((uint32_t)0x00000300) /*!< Each of the tamper inputs are sampled
mbed_official 130:1dec54e4aec3 542 with a frequency = RTCCLK / 4096 */
mbed_official 130:1dec54e4aec3 543 #define RTC_TamperSamplingFreq_RTCCLK_Div2048 ((uint32_t)0x00000400) /*!< Each of the tamper inputs are sampled
mbed_official 130:1dec54e4aec3 544 with a frequency = RTCCLK / 2048 */
mbed_official 130:1dec54e4aec3 545 #define RTC_TamperSamplingFreq_RTCCLK_Div1024 ((uint32_t)0x00000500) /*!< Each of the tamper inputs are sampled
mbed_official 130:1dec54e4aec3 546 with a frequency = RTCCLK / 1024 */
mbed_official 130:1dec54e4aec3 547 #define RTC_TamperSamplingFreq_RTCCLK_Div512 ((uint32_t)0x00000600) /*!< Each of the tamper inputs are sampled
mbed_official 130:1dec54e4aec3 548 with a frequency = RTCCLK / 512 */
mbed_official 130:1dec54e4aec3 549 #define RTC_TamperSamplingFreq_RTCCLK_Div256 ((uint32_t)0x00000700) /*!< Each of the tamper inputs are sampled
mbed_official 130:1dec54e4aec3 550 with a frequency = RTCCLK / 256 */
mbed_official 130:1dec54e4aec3 551 #define IS_RTC_TAMPER_SAMPLING_FREQ(FREQ) (((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div32768) || \
mbed_official 130:1dec54e4aec3 552 ((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div16384) || \
mbed_official 130:1dec54e4aec3 553 ((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div8192) || \
mbed_official 130:1dec54e4aec3 554 ((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div4096) || \
mbed_official 130:1dec54e4aec3 555 ((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div2048) || \
mbed_official 130:1dec54e4aec3 556 ((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div1024) || \
mbed_official 130:1dec54e4aec3 557 ((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div512) || \
mbed_official 130:1dec54e4aec3 558 ((FREQ) ==RTC_TamperSamplingFreq_RTCCLK_Div256))
mbed_official 130:1dec54e4aec3 559
mbed_official 130:1dec54e4aec3 560 /**
mbed_official 130:1dec54e4aec3 561 * @}
mbed_official 130:1dec54e4aec3 562 */
mbed_official 130:1dec54e4aec3 563
mbed_official 130:1dec54e4aec3 564 /** @defgroup RTC_Tamper_Pin_Precharge_Duration_Definitions
mbed_official 130:1dec54e4aec3 565 * @{
mbed_official 130:1dec54e4aec3 566 */
mbed_official 130:1dec54e4aec3 567 #define RTC_TamperPrechargeDuration_1RTCCLK ((uint32_t)0x00000000) /*!< Tamper pins are pre-charged before
mbed_official 130:1dec54e4aec3 568 sampling during 1 RTCCLK cycle */
mbed_official 130:1dec54e4aec3 569 #define RTC_TamperPrechargeDuration_2RTCCLK ((uint32_t)0x00002000) /*!< Tamper pins are pre-charged before
mbed_official 130:1dec54e4aec3 570 sampling during 2 RTCCLK cycles */
mbed_official 130:1dec54e4aec3 571 #define RTC_TamperPrechargeDuration_4RTCCLK ((uint32_t)0x00004000) /*!< Tamper pins are pre-charged before
mbed_official 130:1dec54e4aec3 572 sampling during 4 RTCCLK cycles */
mbed_official 130:1dec54e4aec3 573 #define RTC_TamperPrechargeDuration_8RTCCLK ((uint32_t)0x00006000) /*!< Tamper pins are pre-charged before
mbed_official 130:1dec54e4aec3 574 sampling during 8 RTCCLK cycles */
mbed_official 130:1dec54e4aec3 575
mbed_official 130:1dec54e4aec3 576 #define IS_RTC_TAMPER_PRECHARGE_DURATION(DURATION) (((DURATION) == RTC_TamperPrechargeDuration_1RTCCLK) || \
mbed_official 130:1dec54e4aec3 577 ((DURATION) == RTC_TamperPrechargeDuration_2RTCCLK) || \
mbed_official 130:1dec54e4aec3 578 ((DURATION) == RTC_TamperPrechargeDuration_4RTCCLK) || \
mbed_official 130:1dec54e4aec3 579 ((DURATION) == RTC_TamperPrechargeDuration_8RTCCLK))
mbed_official 130:1dec54e4aec3 580 /**
mbed_official 130:1dec54e4aec3 581 * @}
mbed_official 130:1dec54e4aec3 582 */
mbed_official 130:1dec54e4aec3 583
mbed_official 130:1dec54e4aec3 584 /** @defgroup RTC_Tamper_Pins_Definitions
mbed_official 130:1dec54e4aec3 585 * @{
mbed_official 130:1dec54e4aec3 586 */
mbed_official 130:1dec54e4aec3 587 #define RTC_Tamper_1 RTC_TAFCR_TAMP1E /*!< Tamper detection enable for
mbed_official 130:1dec54e4aec3 588 input tamper 1 */
mbed_official 130:1dec54e4aec3 589 #define RTC_Tamper_2 RTC_TAFCR_TAMP2E /*!< Tamper detection enable for
mbed_official 130:1dec54e4aec3 590 input tamper 2 */
mbed_official 130:1dec54e4aec3 591 #define RTC_Tamper_3 RTC_TAFCR_TAMP3E /*!< Tamper detection enable for
mbed_official 130:1dec54e4aec3 592 input tamper 3, available only
mbed_official 130:1dec54e4aec3 593 for STM32F072 devices */
mbed_official 130:1dec54e4aec3 594 #define IS_RTC_TAMPER(TAMPER) ((((TAMPER) & (uint32_t)0xFFFFFFD6) == 0x00) && ((TAMPER) != (uint32_t)RESET))
mbed_official 130:1dec54e4aec3 595
mbed_official 130:1dec54e4aec3 596 /**
mbed_official 130:1dec54e4aec3 597 * @}
mbed_official 130:1dec54e4aec3 598 */
mbed_official 130:1dec54e4aec3 599
mbed_official 130:1dec54e4aec3 600 /** @defgroup RTC_Output_Type_ALARM_OUT
mbed_official 130:1dec54e4aec3 601 * @{
mbed_official 130:1dec54e4aec3 602 */
mbed_official 130:1dec54e4aec3 603 #define RTC_OutputType_OpenDrain ((uint32_t)0x00000000)
mbed_official 130:1dec54e4aec3 604 #define RTC_OutputType_PushPull ((uint32_t)0x00040000)
mbed_official 130:1dec54e4aec3 605 #define IS_RTC_OUTPUT_TYPE(TYPE) (((TYPE) == RTC_OutputType_OpenDrain) || \
mbed_official 130:1dec54e4aec3 606 ((TYPE) == RTC_OutputType_PushPull))
mbed_official 130:1dec54e4aec3 607
mbed_official 130:1dec54e4aec3 608 /**
mbed_official 130:1dec54e4aec3 609 * @}
mbed_official 130:1dec54e4aec3 610 */
mbed_official 130:1dec54e4aec3 611
mbed_official 130:1dec54e4aec3 612 /** @defgroup RTC_Add_1_Second_Parameter_Definitions
mbed_official 130:1dec54e4aec3 613 * @{
mbed_official 130:1dec54e4aec3 614 */
mbed_official 130:1dec54e4aec3 615 #define RTC_ShiftAdd1S_Reset ((uint32_t)0x00000000)
mbed_official 130:1dec54e4aec3 616 #define RTC_ShiftAdd1S_Set ((uint32_t)0x80000000)
mbed_official 130:1dec54e4aec3 617 #define IS_RTC_SHIFT_ADD1S(SEL) (((SEL) == RTC_ShiftAdd1S_Reset) || \
mbed_official 130:1dec54e4aec3 618 ((SEL) == RTC_ShiftAdd1S_Set))
mbed_official 130:1dec54e4aec3 619 /**
mbed_official 130:1dec54e4aec3 620 * @}
mbed_official 130:1dec54e4aec3 621 */
mbed_official 130:1dec54e4aec3 622
mbed_official 130:1dec54e4aec3 623 /** @defgroup RTC_Substract_Fraction_Of_Second_Value
mbed_official 130:1dec54e4aec3 624 * @{
mbed_official 130:1dec54e4aec3 625 */
mbed_official 130:1dec54e4aec3 626 #define IS_RTC_SHIFT_SUBFS(FS) ((FS) <= 0x00007FFF)
mbed_official 130:1dec54e4aec3 627
mbed_official 130:1dec54e4aec3 628 /**
mbed_official 130:1dec54e4aec3 629 * @}
mbed_official 130:1dec54e4aec3 630 */
mbed_official 130:1dec54e4aec3 631
mbed_official 130:1dec54e4aec3 632 /** @defgroup RTC_Backup_Registers_Definitions
mbed_official 130:1dec54e4aec3 633 * @{
mbed_official 130:1dec54e4aec3 634 */
mbed_official 130:1dec54e4aec3 635
mbed_official 130:1dec54e4aec3 636 #define RTC_BKP_DR0 ((uint32_t)0x00000000)
mbed_official 130:1dec54e4aec3 637 #define RTC_BKP_DR1 ((uint32_t)0x00000001)
mbed_official 130:1dec54e4aec3 638 #define RTC_BKP_DR2 ((uint32_t)0x00000002)
mbed_official 130:1dec54e4aec3 639 #define RTC_BKP_DR3 ((uint32_t)0x00000003)
mbed_official 130:1dec54e4aec3 640 #define RTC_BKP_DR4 ((uint32_t)0x00000004)
mbed_official 130:1dec54e4aec3 641 #define IS_RTC_BKP(BKP) (((BKP) == RTC_BKP_DR0) || \
mbed_official 130:1dec54e4aec3 642 ((BKP) == RTC_BKP_DR1) || \
mbed_official 130:1dec54e4aec3 643 ((BKP) == RTC_BKP_DR2) || \
mbed_official 130:1dec54e4aec3 644 ((BKP) == RTC_BKP_DR3) || \
mbed_official 130:1dec54e4aec3 645 ((BKP) == RTC_BKP_DR4))
mbed_official 130:1dec54e4aec3 646 /**
mbed_official 130:1dec54e4aec3 647 * @}
mbed_official 130:1dec54e4aec3 648 */
mbed_official 130:1dec54e4aec3 649
mbed_official 130:1dec54e4aec3 650 /** @defgroup RTC_Input_parameter_format_definitions
mbed_official 130:1dec54e4aec3 651 * @{
mbed_official 130:1dec54e4aec3 652 */
mbed_official 130:1dec54e4aec3 653 #define RTC_Format_BIN ((uint32_t)0x000000000)
mbed_official 130:1dec54e4aec3 654 #define RTC_Format_BCD ((uint32_t)0x000000001)
mbed_official 130:1dec54e4aec3 655 #define IS_RTC_FORMAT(FORMAT) (((FORMAT) == RTC_Format_BIN) || ((FORMAT) == RTC_Format_BCD))
mbed_official 130:1dec54e4aec3 656
mbed_official 130:1dec54e4aec3 657 /**
mbed_official 130:1dec54e4aec3 658 * @}
mbed_official 130:1dec54e4aec3 659 */
mbed_official 130:1dec54e4aec3 660
mbed_official 130:1dec54e4aec3 661 /** @defgroup RTC_Flags_Definitions
mbed_official 130:1dec54e4aec3 662 * @{
mbed_official 130:1dec54e4aec3 663 */
mbed_official 130:1dec54e4aec3 664 #define RTC_FLAG_RECALPF RTC_ISR_RECALPF
mbed_official 130:1dec54e4aec3 665 #define RTC_FLAG_TAMP3F RTC_ISR_TAMP3F /*!< Only available for STM32F072 devices */
mbed_official 130:1dec54e4aec3 666 #define RTC_FLAG_TAMP2F RTC_ISR_TAMP2F
mbed_official 130:1dec54e4aec3 667 #define RTC_FLAG_TAMP1F RTC_ISR_TAMP1F
mbed_official 130:1dec54e4aec3 668 #define RTC_FLAG_TSOVF RTC_ISR_TSOVF
mbed_official 130:1dec54e4aec3 669 #define RTC_FLAG_TSF RTC_ISR_TSF
mbed_official 130:1dec54e4aec3 670 #define RTC_FLAG_WUTF RTC_ISR_WUTF /*!< Only available for STM32F072 devices */
mbed_official 130:1dec54e4aec3 671 #define RTC_FLAG_ALRAF RTC_ISR_ALRAF
mbed_official 130:1dec54e4aec3 672 #define RTC_FLAG_INITF RTC_ISR_INITF
mbed_official 130:1dec54e4aec3 673 #define RTC_FLAG_RSF RTC_ISR_RSF
mbed_official 130:1dec54e4aec3 674 #define RTC_FLAG_INITS RTC_ISR_INITS
mbed_official 130:1dec54e4aec3 675 #define RTC_FLAG_SHPF RTC_ISR_SHPF
mbed_official 130:1dec54e4aec3 676 #define RTC_FLAG_WUTWF RTC_ISR_WUTWF /*!< Only available for STM32F072 devices */
mbed_official 130:1dec54e4aec3 677 #define RTC_FLAG_ALRAWF RTC_ISR_ALRAWF
mbed_official 130:1dec54e4aec3 678
mbed_official 130:1dec54e4aec3 679 #define IS_RTC_GET_FLAG(FLAG) (((FLAG) == RTC_FLAG_TSOVF) || ((FLAG) == RTC_FLAG_TSF) || \
mbed_official 130:1dec54e4aec3 680 ((FLAG) == RTC_FLAG_WUTF) || ((FLAG) == RTC_FLAG_ALRAWF) || \
mbed_official 130:1dec54e4aec3 681 ((FLAG) == RTC_FLAG_ALRAF) || ((FLAG) == RTC_FLAG_INITF) || \
mbed_official 130:1dec54e4aec3 682 ((FLAG) == RTC_FLAG_RSF) || ((FLAG) == RTC_FLAG_WUTWF) || \
mbed_official 130:1dec54e4aec3 683 ((FLAG) == RTC_FLAG_TAMP1F) || ((FLAG) == RTC_FLAG_TAMP2F) || \
mbed_official 130:1dec54e4aec3 684 ((FLAG) == RTC_FLAG_TAMP3F) || ((FLAG) == RTC_FLAG_RECALPF) || \
mbed_official 130:1dec54e4aec3 685 ((FLAG) == RTC_FLAG_SHPF))
mbed_official 130:1dec54e4aec3 686 #define IS_RTC_CLEAR_FLAG(FLAG) (((FLAG) != (uint32_t)RESET) && (((FLAG) & 0xFFFF02DF) == (uint32_t)RESET))
mbed_official 130:1dec54e4aec3 687
mbed_official 130:1dec54e4aec3 688 /**
mbed_official 130:1dec54e4aec3 689 * @}
mbed_official 130:1dec54e4aec3 690 */
mbed_official 130:1dec54e4aec3 691
mbed_official 130:1dec54e4aec3 692 /** @defgroup RTC_Interrupts_Definitions
mbed_official 130:1dec54e4aec3 693 * @{
mbed_official 130:1dec54e4aec3 694 */
mbed_official 130:1dec54e4aec3 695 #define RTC_IT_TS ((uint32_t)0x00008000)
mbed_official 130:1dec54e4aec3 696 #define RTC_IT_WUT ((uint32_t)0x00004000) /* Available only for STM32F072 devices */
mbed_official 130:1dec54e4aec3 697 #define RTC_IT_ALRA ((uint32_t)0x00001000)
mbed_official 130:1dec54e4aec3 698 #define RTC_IT_TAMP ((uint32_t)0x00000004) /* Used only to Enable the Tamper Interrupt */
mbed_official 130:1dec54e4aec3 699 #define RTC_IT_TAMP1 ((uint32_t)0x00020000)
mbed_official 130:1dec54e4aec3 700 #define RTC_IT_TAMP2 ((uint32_t)0x00040000)
mbed_official 130:1dec54e4aec3 701 #define RTC_IT_TAMP3 ((uint32_t)0x00080000) /* Available only for STM32F072 devices */
mbed_official 130:1dec54e4aec3 702
mbed_official 130:1dec54e4aec3 703 #define IS_RTC_CONFIG_IT(IT) (((IT) != (uint32_t)RESET) && (((IT) & 0xFFFF2FFB) == (uint32_t)RESET))
mbed_official 130:1dec54e4aec3 704 #define IS_RTC_GET_IT(IT) (((IT) == RTC_IT_TS) || ((IT) == RTC_IT_ALRA) || \
mbed_official 130:1dec54e4aec3 705 ((IT) == RTC_IT_TAMP1) || ((IT) == RTC_IT_WUT) || \
mbed_official 130:1dec54e4aec3 706 ((IT) == RTC_IT_TAMP2) || ((IT) == RTC_IT_TAMP3))
mbed_official 130:1dec54e4aec3 707
mbed_official 130:1dec54e4aec3 708 #define IS_RTC_CLEAR_IT(IT) (((IT) != (uint32_t)RESET) && (((IT) & 0xFFF12FFF) == (uint32_t)RESET))
mbed_official 130:1dec54e4aec3 709
mbed_official 130:1dec54e4aec3 710 /**
mbed_official 130:1dec54e4aec3 711 * @}
mbed_official 130:1dec54e4aec3 712 */
mbed_official 130:1dec54e4aec3 713
mbed_official 130:1dec54e4aec3 714 /**
mbed_official 130:1dec54e4aec3 715 * @}
mbed_official 130:1dec54e4aec3 716 */
mbed_official 130:1dec54e4aec3 717
mbed_official 130:1dec54e4aec3 718
mbed_official 130:1dec54e4aec3 719 /* Exported macro ------------------------------------------------------------*/
mbed_official 130:1dec54e4aec3 720 /* Exported functions ------------------------------------------------------- */
mbed_official 130:1dec54e4aec3 721 /* Function used to set the RTC configuration to the default reset state *****/
mbed_official 130:1dec54e4aec3 722 ErrorStatus RTC_DeInit(void);
mbed_official 130:1dec54e4aec3 723
mbed_official 130:1dec54e4aec3 724
mbed_official 130:1dec54e4aec3 725 /* Initialization and Configuration functions *********************************/
mbed_official 130:1dec54e4aec3 726 ErrorStatus RTC_Init(RTC_InitTypeDef* RTC_InitStruct);
mbed_official 130:1dec54e4aec3 727 void RTC_StructInit(RTC_InitTypeDef* RTC_InitStruct);
mbed_official 130:1dec54e4aec3 728 void RTC_WriteProtectionCmd(FunctionalState NewState);
mbed_official 130:1dec54e4aec3 729 ErrorStatus RTC_EnterInitMode(void);
mbed_official 130:1dec54e4aec3 730 void RTC_ExitInitMode(void);
mbed_official 130:1dec54e4aec3 731 ErrorStatus RTC_WaitForSynchro(void);
mbed_official 130:1dec54e4aec3 732 ErrorStatus RTC_RefClockCmd(FunctionalState NewState);
mbed_official 130:1dec54e4aec3 733 void RTC_BypassShadowCmd(FunctionalState NewState);
mbed_official 130:1dec54e4aec3 734
mbed_official 130:1dec54e4aec3 735 /* Time and Date configuration functions **************************************/
mbed_official 130:1dec54e4aec3 736 ErrorStatus RTC_SetTime(uint32_t RTC_Format, RTC_TimeTypeDef* RTC_TimeStruct);
mbed_official 130:1dec54e4aec3 737 void RTC_TimeStructInit(RTC_TimeTypeDef* RTC_TimeStruct);
mbed_official 130:1dec54e4aec3 738 void RTC_GetTime(uint32_t RTC_Format, RTC_TimeTypeDef* RTC_TimeStruct);
mbed_official 130:1dec54e4aec3 739 uint32_t RTC_GetSubSecond(void);
mbed_official 130:1dec54e4aec3 740 ErrorStatus RTC_SetDate(uint32_t RTC_Format, RTC_DateTypeDef* RTC_DateStruct);
mbed_official 130:1dec54e4aec3 741 void RTC_DateStructInit(RTC_DateTypeDef* RTC_DateStruct);
mbed_official 130:1dec54e4aec3 742 void RTC_GetDate(uint32_t RTC_Format, RTC_DateTypeDef* RTC_DateStruct);
mbed_official 130:1dec54e4aec3 743
mbed_official 130:1dec54e4aec3 744 /* Alarms (Alarm A) configuration functions **********************************/
mbed_official 130:1dec54e4aec3 745 void RTC_SetAlarm(uint32_t RTC_Format, uint32_t RTC_Alarm, RTC_AlarmTypeDef* RTC_AlarmStruct);
mbed_official 130:1dec54e4aec3 746 void RTC_AlarmStructInit(RTC_AlarmTypeDef* RTC_AlarmStruct);
mbed_official 130:1dec54e4aec3 747 void RTC_GetAlarm(uint32_t RTC_Format, uint32_t RTC_Alarm, RTC_AlarmTypeDef* RTC_AlarmStruct);
mbed_official 130:1dec54e4aec3 748 ErrorStatus RTC_AlarmCmd(uint32_t RTC_Alarm, FunctionalState NewState);
mbed_official 130:1dec54e4aec3 749 void RTC_AlarmSubSecondConfig(uint32_t RTC_Alarm, uint32_t RTC_AlarmSubSecondValue, uint8_t RTC_AlarmSubSecondMask);
mbed_official 130:1dec54e4aec3 750 uint32_t RTC_GetAlarmSubSecond(uint32_t RTC_Alarm);
mbed_official 130:1dec54e4aec3 751
mbed_official 130:1dec54e4aec3 752 /* WakeUp Timer configuration functions ***************************************/
mbed_official 130:1dec54e4aec3 753 void RTC_WakeUpClockConfig(uint32_t RTC_WakeUpClock); /*!< available only for STM32F072 devices */
mbed_official 130:1dec54e4aec3 754 void RTC_SetWakeUpCounter(uint32_t RTC_WakeUpCounter); /*!< available only for STM32F072 devices */
mbed_official 130:1dec54e4aec3 755 uint32_t RTC_GetWakeUpCounter(void); /*!< available only for STM32F072 devices */
mbed_official 130:1dec54e4aec3 756 ErrorStatus RTC_WakeUpCmd(FunctionalState NewState); /*!< available only for STM32F072 devices */
mbed_official 130:1dec54e4aec3 757
mbed_official 130:1dec54e4aec3 758 /* Daylight Saving configuration functions ************************************/
mbed_official 130:1dec54e4aec3 759 void RTC_DayLightSavingConfig(uint32_t RTC_DayLightSaving, uint32_t RTC_StoreOperation);
mbed_official 130:1dec54e4aec3 760 uint32_t RTC_GetStoreOperation(void);
mbed_official 130:1dec54e4aec3 761
mbed_official 130:1dec54e4aec3 762 /* Output pin Configuration function ******************************************/
mbed_official 130:1dec54e4aec3 763 void RTC_OutputConfig(uint32_t RTC_Output, uint32_t RTC_OutputPolarity);
mbed_official 130:1dec54e4aec3 764
mbed_official 130:1dec54e4aec3 765 /* Digital Calibration configuration functions ********************************/
mbed_official 130:1dec54e4aec3 766 void RTC_CalibOutputCmd(FunctionalState NewState);
mbed_official 130:1dec54e4aec3 767 void RTC_CalibOutputConfig(uint32_t RTC_CalibOutput);
mbed_official 130:1dec54e4aec3 768 ErrorStatus RTC_SmoothCalibConfig(uint32_t RTC_SmoothCalibPeriod,
mbed_official 130:1dec54e4aec3 769 uint32_t RTC_SmoothCalibPlusPulses,
mbed_official 130:1dec54e4aec3 770 uint32_t RTC_SmouthCalibMinusPulsesValue);
mbed_official 130:1dec54e4aec3 771
mbed_official 130:1dec54e4aec3 772 /* TimeStamp configuration functions ******************************************/
mbed_official 130:1dec54e4aec3 773 void RTC_TimeStampCmd(uint32_t RTC_TimeStampEdge, FunctionalState NewState);
mbed_official 130:1dec54e4aec3 774 void RTC_GetTimeStamp(uint32_t RTC_Format, RTC_TimeTypeDef* RTC_StampTimeStruct, RTC_DateTypeDef* RTC_StampDateStruct);
mbed_official 130:1dec54e4aec3 775 uint32_t RTC_GetTimeStampSubSecond(void);
mbed_official 130:1dec54e4aec3 776
mbed_official 130:1dec54e4aec3 777 /* Tampers configuration functions ********************************************/
mbed_official 130:1dec54e4aec3 778 void RTC_TamperTriggerConfig(uint32_t RTC_Tamper, uint32_t RTC_TamperTrigger);
mbed_official 130:1dec54e4aec3 779 void RTC_TamperCmd(uint32_t RTC_Tamper, FunctionalState NewState);
mbed_official 130:1dec54e4aec3 780 void RTC_TamperFilterConfig(uint32_t RTC_TamperFilter);
mbed_official 130:1dec54e4aec3 781 void RTC_TamperSamplingFreqConfig(uint32_t RTC_TamperSamplingFreq);
mbed_official 130:1dec54e4aec3 782 void RTC_TamperPinsPrechargeDuration(uint32_t RTC_TamperPrechargeDuration);
mbed_official 130:1dec54e4aec3 783 void RTC_TimeStampOnTamperDetectionCmd(FunctionalState NewState);
mbed_official 130:1dec54e4aec3 784 void RTC_TamperPullUpCmd(FunctionalState NewState);
mbed_official 130:1dec54e4aec3 785
mbed_official 130:1dec54e4aec3 786 /* Backup Data Registers configuration functions ******************************/
mbed_official 130:1dec54e4aec3 787 void RTC_WriteBackupRegister(uint32_t RTC_BKP_DR, uint32_t Data);
mbed_official 130:1dec54e4aec3 788 uint32_t RTC_ReadBackupRegister(uint32_t RTC_BKP_DR);
mbed_official 130:1dec54e4aec3 789
mbed_official 130:1dec54e4aec3 790 /* Output Type Config configuration functions *********************************/
mbed_official 130:1dec54e4aec3 791 void RTC_OutputTypeConfig(uint32_t RTC_OutputType);
mbed_official 130:1dec54e4aec3 792
mbed_official 130:1dec54e4aec3 793 /* RTC_Shift_control_synchonisation_functions *********************************/
mbed_official 130:1dec54e4aec3 794 ErrorStatus RTC_SynchroShiftConfig(uint32_t RTC_ShiftAdd1S, uint32_t RTC_ShiftSubFS);
mbed_official 130:1dec54e4aec3 795
mbed_official 130:1dec54e4aec3 796 /* Interrupts and flags management functions **********************************/
mbed_official 130:1dec54e4aec3 797 void RTC_ITConfig(uint32_t RTC_IT, FunctionalState NewState);
mbed_official 130:1dec54e4aec3 798 FlagStatus RTC_GetFlagStatus(uint32_t RTC_FLAG);
mbed_official 130:1dec54e4aec3 799 void RTC_ClearFlag(uint32_t RTC_FLAG);
mbed_official 130:1dec54e4aec3 800 ITStatus RTC_GetITStatus(uint32_t RTC_IT);
mbed_official 130:1dec54e4aec3 801 void RTC_ClearITPendingBit(uint32_t RTC_IT);
mbed_official 130:1dec54e4aec3 802
mbed_official 130:1dec54e4aec3 803 #ifdef __cplusplus
mbed_official 130:1dec54e4aec3 804 }
mbed_official 130:1dec54e4aec3 805 #endif
mbed_official 130:1dec54e4aec3 806
mbed_official 130:1dec54e4aec3 807 #endif /*__STM32F0XX_RTC_H */
mbed_official 130:1dec54e4aec3 808
mbed_official 130:1dec54e4aec3 809 /**
mbed_official 130:1dec54e4aec3 810 * @}
mbed_official 130:1dec54e4aec3 811 */
mbed_official 130:1dec54e4aec3 812
mbed_official 130:1dec54e4aec3 813 /**
mbed_official 130:1dec54e4aec3 814 * @}
mbed_official 130:1dec54e4aec3 815 */
mbed_official 130:1dec54e4aec3 816
mbed_official 130:1dec54e4aec3 817 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/