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