mbed library sources

Dependents:   bare

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Wed Mar 19 10:15:22 2014 +0000
Revision:
125:23cc3068a9e4
Synchronized with git revision ace35dfba3748c7cdc102eb38ec6b9e1067c3252

Full URL: https://github.com/mbedmicro/mbed/commit/ace35dfba3748c7cdc102eb38ec6b9e1067c3252/

[NUCLEO_F302R8] Add cmsis and hal files + change F401RE clock to 84MHz

Who changed what in which revision?

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