提交 | 用户 | age
|
8b51c7
|
1 |
/** |
Q |
2 |
****************************************************************************** |
|
3 |
* @file stm32f0xx_hal_rtc.h |
|
4 |
* @author MCD Application Team |
|
5 |
* @brief Header file of RTC HAL module. |
|
6 |
****************************************************************************** |
|
7 |
* @attention |
|
8 |
* |
|
9 |
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
|
10 |
* |
|
11 |
* Redistribution and use in source and binary forms, with or without modification, |
|
12 |
* are permitted provided that the following conditions are met: |
|
13 |
* 1. Redistributions of source code must retain the above copyright notice, |
|
14 |
* this list of conditions and the following disclaimer. |
|
15 |
* 2. Redistributions in binary form must reproduce the above copyright notice, |
|
16 |
* this list of conditions and the following disclaimer in the documentation |
|
17 |
* and/or other materials provided with the distribution. |
|
18 |
* 3. Neither the name of STMicroelectronics nor the names of its contributors |
|
19 |
* may be used to endorse or promote products derived from this software |
|
20 |
* without specific prior written permission. |
|
21 |
* |
|
22 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
|
23 |
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|
24 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|
25 |
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
|
26 |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
|
27 |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
|
28 |
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
|
29 |
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
|
30 |
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
|
31 |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
32 |
* |
|
33 |
****************************************************************************** |
|
34 |
*/ |
|
35 |
|
|
36 |
/* Define to prevent recursive inclusion -------------------------------------*/ |
|
37 |
#ifndef __STM32F0xx_HAL_RTC_H |
|
38 |
#define __STM32F0xx_HAL_RTC_H |
|
39 |
|
|
40 |
#ifdef __cplusplus |
|
41 |
extern "C" { |
|
42 |
#endif |
|
43 |
|
|
44 |
/* Includes ------------------------------------------------------------------*/ |
|
45 |
#include "stm32f0xx_hal_def.h" |
|
46 |
|
|
47 |
/** @addtogroup STM32F0xx_HAL_Driver |
|
48 |
* @{ |
|
49 |
*/ |
|
50 |
|
|
51 |
/** @defgroup RTC RTC |
|
52 |
* @{ |
|
53 |
*/ |
|
54 |
|
|
55 |
/* Exported types ------------------------------------------------------------*/ |
|
56 |
/** @defgroup RTC_Exported_Types RTC Exported Types |
|
57 |
* @{ |
|
58 |
*/ |
|
59 |
|
|
60 |
/** |
|
61 |
* @brief HAL State structures definition |
|
62 |
*/ |
|
63 |
typedef enum |
|
64 |
{ |
|
65 |
HAL_RTC_STATE_RESET = 0x00U, /*!< RTC not yet initialized or disabled */ |
|
66 |
HAL_RTC_STATE_READY = 0x01U, /*!< RTC initialized and ready for use */ |
|
67 |
HAL_RTC_STATE_BUSY = 0x02U, /*!< RTC process is ongoing */ |
|
68 |
HAL_RTC_STATE_TIMEOUT = 0x03U, /*!< RTC timeout state */ |
|
69 |
HAL_RTC_STATE_ERROR = 0x04U /*!< RTC error state */ |
|
70 |
|
|
71 |
}HAL_RTCStateTypeDef; |
|
72 |
|
|
73 |
/** |
|
74 |
* @brief RTC Configuration Structure definition |
|
75 |
*/ |
|
76 |
typedef struct |
|
77 |
{ |
|
78 |
uint32_t HourFormat; /*!< Specifies the RTC Hour Format. |
|
79 |
This parameter can be a value of @ref RTC_Hour_Formats */ |
|
80 |
|
|
81 |
uint32_t AsynchPrediv; /*!< Specifies the RTC Asynchronous Predivider value. |
|
82 |
This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7F */ |
|
83 |
|
|
84 |
uint32_t SynchPrediv; /*!< Specifies the RTC Synchronous Predivider value. |
|
85 |
This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x7FFF */ |
|
86 |
|
|
87 |
uint32_t OutPut; /*!< Specifies which signal will be routed to the RTC output. |
|
88 |
This parameter can be a value of @ref RTCEx_Output_selection_Definitions */ |
|
89 |
|
|
90 |
uint32_t OutPutPolarity; /*!< Specifies the polarity of the output signal. |
|
91 |
This parameter can be a value of @ref RTC_Output_Polarity_Definitions */ |
|
92 |
|
|
93 |
uint32_t OutPutType; /*!< Specifies the RTC Output Pin mode. |
|
94 |
This parameter can be a value of @ref RTC_Output_Type_ALARM_OUT */ |
|
95 |
}RTC_InitTypeDef; |
|
96 |
|
|
97 |
/** |
|
98 |
* @brief RTC Time structure definition |
|
99 |
*/ |
|
100 |
typedef struct |
|
101 |
{ |
|
102 |
uint8_t Hours; /*!< Specifies the RTC Time Hour. |
|
103 |
This parameter must be a number between Min_Data = 0 and Max_Data = 12 if the RTC_HourFormat_12 is selected. |
|
104 |
This parameter must be a number between Min_Data = 0 and Max_Data = 23 if the RTC_HourFormat_24 is selected */ |
|
105 |
|
|
106 |
uint8_t Minutes; /*!< Specifies the RTC Time Minutes. |
|
107 |
This parameter must be a number between Min_Data = 0 and Max_Data = 59 */ |
|
108 |
|
|
109 |
uint8_t Seconds; /*!< Specifies the RTC Time Seconds. |
|
110 |
This parameter must be a number between Min_Data = 0 and Max_Data = 59 */ |
|
111 |
|
|
112 |
uint8_t TimeFormat; /*!< Specifies the RTC AM/PM Time. |
|
113 |
This parameter can be a value of @ref RTC_AM_PM_Definitions */ |
|
114 |
|
|
115 |
uint32_t SubSeconds; /*!< Specifies the RTC_SSR RTC Sub Second register content. |
|
116 |
This parameter corresponds to a time unit range between [0-1] Second |
|
117 |
with [1 Sec / SecondFraction +1] granularity */ |
|
118 |
|
|
119 |
uint32_t SecondFraction; /*!< Specifies the range or granularity of Sub Second register content |
|
120 |
corresponding to Synchronous pre-scaler factor value (PREDIV_S) |
|
121 |
This parameter corresponds to a time unit range between [0-1] Second |
|
122 |
with [1 Sec / SecondFraction +1] granularity. |
|
123 |
This field will be used only by HAL_RTC_GetTime function */ |
|
124 |
|
|
125 |
uint32_t DayLightSaving; /*!< Specifies RTC_DayLightSaveOperation: the value of hour adjustment. |
|
126 |
This parameter can be a value of @ref RTC_DayLightSaving_Definitions */ |
|
127 |
|
|
128 |
uint32_t StoreOperation; /*!< Specifies RTC_StoreOperation value to be written in the BCK bit |
|
129 |
in CR register to store the operation. |
|
130 |
This parameter can be a value of @ref RTC_StoreOperation_Definitions */ |
|
131 |
}RTC_TimeTypeDef; |
|
132 |
|
|
133 |
/** |
|
134 |
* @brief RTC Date structure definition |
|
135 |
*/ |
|
136 |
typedef struct |
|
137 |
{ |
|
138 |
uint8_t WeekDay; /*!< Specifies the RTC Date WeekDay. |
|
139 |
This parameter can be a value of @ref RTC_WeekDay_Definitions */ |
|
140 |
|
|
141 |
uint8_t Month; /*!< Specifies the RTC Date Month (in BCD format). |
|
142 |
This parameter can be a value of @ref RTC_Month_Date_Definitions */ |
|
143 |
|
|
144 |
uint8_t Date; /*!< Specifies the RTC Date. |
|
145 |
This parameter must be a number between Min_Data = 1 and Max_Data = 31 */ |
|
146 |
|
|
147 |
uint8_t Year; /*!< Specifies the RTC Date Year. |
|
148 |
This parameter must be a number between Min_Data = 0 and Max_Data = 99 */ |
|
149 |
|
|
150 |
}RTC_DateTypeDef; |
|
151 |
|
|
152 |
/** |
|
153 |
* @brief RTC Alarm structure definition |
|
154 |
*/ |
|
155 |
typedef struct |
|
156 |
{ |
|
157 |
RTC_TimeTypeDef AlarmTime; /*!< Specifies the RTC Alarm Time members */ |
|
158 |
|
|
159 |
uint32_t AlarmMask; /*!< Specifies the RTC Alarm Masks. |
|
160 |
This parameter can be a value of @ref RTC_AlarmMask_Definitions */ |
|
161 |
|
|
162 |
uint32_t AlarmSubSecondMask; /*!< Specifies the RTC Alarm SubSeconds Masks. |
|
163 |
This parameter can be a value of @ref RTC_Alarm_Sub_Seconds_Masks_Definitions */ |
|
164 |
|
|
165 |
uint32_t AlarmDateWeekDaySel; /*!< Specifies the RTC Alarm is on Date or WeekDay. |
|
166 |
This parameter can be a value of @ref RTC_AlarmDateWeekDay_Definitions */ |
|
167 |
|
|
168 |
uint8_t AlarmDateWeekDay; /*!< Specifies the RTC Alarm Date/WeekDay. |
|
169 |
If the Alarm Date is selected, this parameter must be set to a value in the 1-31 range. |
|
170 |
If the Alarm WeekDay is selected, this parameter can be a value of @ref RTC_WeekDay_Definitions */ |
|
171 |
|
|
172 |
uint32_t Alarm; /*!< Specifies the alarm . |
|
173 |
This parameter can be a value of @ref RTC_Alarms_Definitions */ |
|
174 |
}RTC_AlarmTypeDef; |
|
175 |
|
|
176 |
/** |
|
177 |
* @brief RTC Handle Structure definition |
|
178 |
*/ |
|
179 |
typedef struct |
|
180 |
{ |
|
181 |
RTC_TypeDef *Instance; /*!< Register base address */ |
|
182 |
|
|
183 |
RTC_InitTypeDef Init; /*!< RTC required parameters */ |
|
184 |
|
|
185 |
HAL_LockTypeDef Lock; /*!< RTC locking object */ |
|
186 |
|
|
187 |
__IO HAL_RTCStateTypeDef State; /*!< Time communication state */ |
|
188 |
|
|
189 |
}RTC_HandleTypeDef; |
|
190 |
|
|
191 |
/** |
|
192 |
* @} |
|
193 |
*/ |
|
194 |
|
|
195 |
/* Exported constants --------------------------------------------------------*/ |
|
196 |
/** @defgroup RTC_Exported_Constants RTC Exported Constants |
|
197 |
* @{ |
|
198 |
*/ |
|
199 |
|
|
200 |
/** @defgroup RTC_Hour_Formats RTC Hour Formats |
|
201 |
* @{ |
|
202 |
*/ |
|
203 |
#define RTC_HOURFORMAT_24 0x00000000U |
|
204 |
#define RTC_HOURFORMAT_12 0x00000040U |
|
205 |
|
|
206 |
/** |
|
207 |
* @} |
|
208 |
*/ |
|
209 |
|
|
210 |
/** @defgroup RTC_Output_Polarity_Definitions RTC Output Polarity Definitions |
|
211 |
* @{ |
|
212 |
*/ |
|
213 |
#define RTC_OUTPUT_POLARITY_HIGH 0x00000000U |
|
214 |
#define RTC_OUTPUT_POLARITY_LOW 0x00100000U |
|
215 |
/** |
|
216 |
* @} |
|
217 |
*/ |
|
218 |
|
|
219 |
/** @defgroup RTC_Output_Type_ALARM_OUT RTC Output Type ALARM OUT |
|
220 |
* @{ |
|
221 |
*/ |
|
222 |
#define RTC_OUTPUT_TYPE_OPENDRAIN 0x00000000U |
|
223 |
#define RTC_OUTPUT_TYPE_PUSHPULL 0x00040000U |
|
224 |
/** |
|
225 |
* @} |
|
226 |
*/ |
|
227 |
|
|
228 |
/** @defgroup RTC_AM_PM_Definitions RTC AM PM Definitions |
|
229 |
* @{ |
|
230 |
*/ |
|
231 |
#define RTC_HOURFORMAT12_AM ((uint8_t)0x00) |
|
232 |
#define RTC_HOURFORMAT12_PM ((uint8_t)0x40) |
|
233 |
/** |
|
234 |
* @} |
|
235 |
*/ |
|
236 |
|
|
237 |
/** @defgroup RTC_DayLightSaving_Definitions RTC DayLight Saving Definitions |
|
238 |
* @{ |
|
239 |
*/ |
|
240 |
#define RTC_DAYLIGHTSAVING_SUB1H 0x00020000U |
|
241 |
#define RTC_DAYLIGHTSAVING_ADD1H 0x00010000U |
|
242 |
#define RTC_DAYLIGHTSAVING_NONE 0x00000000U |
|
243 |
/** |
|
244 |
* @} |
|
245 |
*/ |
|
246 |
|
|
247 |
/** @defgroup RTC_StoreOperation_Definitions RTC Store Operation Definitions |
|
248 |
* @{ |
|
249 |
*/ |
|
250 |
#define RTC_STOREOPERATION_RESET 0x00000000U |
|
251 |
#define RTC_STOREOPERATION_SET 0x00040000U |
|
252 |
/** |
|
253 |
* @} |
|
254 |
*/ |
|
255 |
|
|
256 |
/** @defgroup RTC_Input_parameter_format_definitions RTC Input parameter format definitions |
|
257 |
* @{ |
|
258 |
*/ |
|
259 |
#define RTC_FORMAT_BIN 0x000000000U |
|
260 |
#define RTC_FORMAT_BCD 0x000000001U |
|
261 |
/** |
|
262 |
* @} |
|
263 |
*/ |
|
264 |
|
|
265 |
/** @defgroup RTC_Month_Date_Definitions RTC Month Date Definitions |
|
266 |
* @{ |
|
267 |
*/ |
|
268 |
/* Coded in BCD format */ |
|
269 |
#define RTC_MONTH_JANUARY ((uint8_t)0x01) |
|
270 |
#define RTC_MONTH_FEBRUARY ((uint8_t)0x02) |
|
271 |
#define RTC_MONTH_MARCH ((uint8_t)0x03) |
|
272 |
#define RTC_MONTH_APRIL ((uint8_t)0x04) |
|
273 |
#define RTC_MONTH_MAY ((uint8_t)0x05) |
|
274 |
#define RTC_MONTH_JUNE ((uint8_t)0x06) |
|
275 |
#define RTC_MONTH_JULY ((uint8_t)0x07) |
|
276 |
#define RTC_MONTH_AUGUST ((uint8_t)0x08) |
|
277 |
#define RTC_MONTH_SEPTEMBER ((uint8_t)0x09) |
|
278 |
#define RTC_MONTH_OCTOBER ((uint8_t)0x10) |
|
279 |
#define RTC_MONTH_NOVEMBER ((uint8_t)0x11) |
|
280 |
#define RTC_MONTH_DECEMBER ((uint8_t)0x12) |
|
281 |
/** |
|
282 |
* @} |
|
283 |
*/ |
|
284 |
|
|
285 |
/** @defgroup RTC_WeekDay_Definitions RTC WeekDay Definitions |
|
286 |
* @{ |
|
287 |
*/ |
|
288 |
#define RTC_WEEKDAY_MONDAY ((uint8_t)0x01) |
|
289 |
#define RTC_WEEKDAY_TUESDAY ((uint8_t)0x02) |
|
290 |
#define RTC_WEEKDAY_WEDNESDAY ((uint8_t)0x03) |
|
291 |
#define RTC_WEEKDAY_THURSDAY ((uint8_t)0x04) |
|
292 |
#define RTC_WEEKDAY_FRIDAY ((uint8_t)0x05) |
|
293 |
#define RTC_WEEKDAY_SATURDAY ((uint8_t)0x06) |
|
294 |
#define RTC_WEEKDAY_SUNDAY ((uint8_t)0x07) |
|
295 |
/** |
|
296 |
* @} |
|
297 |
*/ |
|
298 |
|
|
299 |
/** @defgroup RTC_AlarmDateWeekDay_Definitions RTC Alarm Date WeekDay Definitions |
|
300 |
* @{ |
|
301 |
*/ |
|
302 |
#define RTC_ALARMDATEWEEKDAYSEL_DATE 0x00000000U |
|
303 |
#define RTC_ALARMDATEWEEKDAYSEL_WEEKDAY 0x40000000U |
|
304 |
/** |
|
305 |
* @} |
|
306 |
*/ |
|
307 |
|
|
308 |
/** @defgroup RTC_AlarmMask_Definitions RTC Alarm Mask Definitions |
|
309 |
* @{ |
|
310 |
*/ |
|
311 |
#define RTC_ALARMMASK_NONE 0x00000000U |
|
312 |
#define RTC_ALARMMASK_DATEWEEKDAY RTC_ALRMAR_MSK4 |
|
313 |
#define RTC_ALARMMASK_HOURS RTC_ALRMAR_MSK3 |
|
314 |
#define RTC_ALARMMASK_MINUTES RTC_ALRMAR_MSK2 |
|
315 |
#define RTC_ALARMMASK_SECONDS RTC_ALRMAR_MSK1 |
|
316 |
#define RTC_ALARMMASK_ALL 0x80808080U |
|
317 |
/** |
|
318 |
* @} |
|
319 |
*/ |
|
320 |
|
|
321 |
/** @defgroup RTC_Alarms_Definitions RTC Alarms Definitions |
|
322 |
* @{ |
|
323 |
*/ |
|
324 |
#define RTC_ALARM_A RTC_CR_ALRAE |
|
325 |
|
|
326 |
/** |
|
327 |
* @} |
|
328 |
*/ |
|
329 |
|
|
330 |
/** @defgroup RTC_Alarm_Sub_Seconds_Masks_Definitions RTC Alarm Sub Seconds Masks Definitions |
|
331 |
* @{ |
|
332 |
*/ |
|
333 |
#define RTC_ALARMSUBSECONDMASK_ALL 0x00000000U /*!< All Alarm SS fields are masked. |
|
334 |
There is no comparison on sub seconds |
|
335 |
for Alarm */ |
|
336 |
#define RTC_ALARMSUBSECONDMASK_SS14_1 0x01000000U /*!< SS[14:1] are don't care in Alarm |
|
337 |
comparison. Only SS[0] is compared. */ |
|
338 |
#define RTC_ALARMSUBSECONDMASK_SS14_2 0x02000000U /*!< SS[14:2] are don't care in Alarm |
|
339 |
comparison. Only SS[1:0] are compared */ |
|
340 |
#define RTC_ALARMSUBSECONDMASK_SS14_3 0x03000000U /*!< SS[14:3] are don't care in Alarm |
|
341 |
comparison. Only SS[2:0] are compared */ |
|
342 |
#define RTC_ALARMSUBSECONDMASK_SS14_4 0x04000000U /*!< SS[14:4] are don't care in Alarm |
|
343 |
comparison. Only SS[3:0] are compared */ |
|
344 |
#define RTC_ALARMSUBSECONDMASK_SS14_5 0x05000000U /*!< SS[14:5] are don't care in Alarm |
|
345 |
comparison. Only SS[4:0] are compared */ |
|
346 |
#define RTC_ALARMSUBSECONDMASK_SS14_6 0x06000000U /*!< SS[14:6] are don't care in Alarm |
|
347 |
comparison. Only SS[5:0] are compared */ |
|
348 |
#define RTC_ALARMSUBSECONDMASK_SS14_7 0x07000000U /*!< SS[14:7] are don't care in Alarm |
|
349 |
comparison. Only SS[6:0] are compared */ |
|
350 |
#define RTC_ALARMSUBSECONDMASK_SS14_8 0x08000000U /*!< SS[14:8] are don't care in Alarm |
|
351 |
comparison. Only SS[7:0] are compared */ |
|
352 |
#define RTC_ALARMSUBSECONDMASK_SS14_9 0x09000000U /*!< SS[14:9] are don't care in Alarm |
|
353 |
comparison. Only SS[8:0] are compared */ |
|
354 |
#define RTC_ALARMSUBSECONDMASK_SS14_10 0x0A000000U /*!< SS[14:10] are don't care in Alarm |
|
355 |
comparison. Only SS[9:0] are compared */ |
|
356 |
#define RTC_ALARMSUBSECONDMASK_SS14_11 0x0B000000U /*!< SS[14:11] are don't care in Alarm |
|
357 |
comparison. Only SS[10:0] are compared */ |
|
358 |
#define RTC_ALARMSUBSECONDMASK_SS14_12 0x0C000000U /*!< SS[14:12] are don't care in Alarm |
|
359 |
comparison.Only SS[11:0] are compared */ |
|
360 |
#define RTC_ALARMSUBSECONDMASK_SS14_13 0x0D000000U /*!< SS[14:13] are don't care in Alarm |
|
361 |
comparison. Only SS[12:0] are compared */ |
|
362 |
#define RTC_ALARMSUBSECONDMASK_SS14 0x0E000000U /*!< SS[14] is don't care in Alarm |
|
363 |
comparison.Only SS[13:0] are compared */ |
|
364 |
#define RTC_ALARMSUBSECONDMASK_NONE 0x0F000000U /*!< SS[14:0] are compared and must match |
|
365 |
to activate alarm. */ |
|
366 |
/** |
|
367 |
* @} |
|
368 |
*/ |
|
369 |
|
|
370 |
/** @defgroup RTC_Interrupts_Definitions RTC Interrupts Definitions |
|
371 |
* @{ |
|
372 |
*/ |
|
373 |
#define RTC_IT_TS 0x00008000U |
|
374 |
#define RTC_IT_WUT 0x00004000U |
|
375 |
#define RTC_IT_ALRA 0x00001000U |
|
376 |
#define RTC_IT_TAMP 0x00000004U /* Used only to Enable the Tamper Interrupt */ |
|
377 |
#define RTC_IT_TAMP1 0x00020000U /*only for RTC_ISR flag check*/ |
|
378 |
#define RTC_IT_TAMP2 0x00040000U /*only for RTC_ISR flag check*/ |
|
379 |
#define RTC_IT_TAMP3 0x00080000U /*only for RTC_ISR flag check*/ |
|
380 |
/** |
|
381 |
* @} |
|
382 |
*/ |
|
383 |
|
|
384 |
/** @defgroup RTC_Flags_Definitions RTC Flags Definitions |
|
385 |
* @{ |
|
386 |
*/ |
|
387 |
#define RTC_FLAG_RECALPF 0x00010000U |
|
388 |
#define RTC_FLAG_TAMP3F 0x00008000U |
|
389 |
#define RTC_FLAG_TAMP2F 0x00004000U |
|
390 |
#define RTC_FLAG_TAMP1F 0x00002000U |
|
391 |
#define RTC_FLAG_TSOVF 0x00001000U |
|
392 |
#define RTC_FLAG_TSF 0x00000800U |
|
393 |
#define RTC_FLAG_WUTF 0x00000400U |
|
394 |
#define RTC_FLAG_ALRAF 0x00000100U |
|
395 |
#define RTC_FLAG_INITF 0x00000040U |
|
396 |
#define RTC_FLAG_RSF 0x00000020U |
|
397 |
#define RTC_FLAG_INITS 0x00000010U |
|
398 |
#define RTC_FLAG_SHPF 0x00000008U |
|
399 |
#define RTC_FLAG_WUTWF 0x00000004U |
|
400 |
#define RTC_FLAG_ALRAWF 0x00000001U |
|
401 |
/** |
|
402 |
* @} |
|
403 |
*/ |
|
404 |
|
|
405 |
/** |
|
406 |
* @} |
|
407 |
*/ |
|
408 |
|
|
409 |
/* Exported macros ------------------------------------------------------------*/ |
|
410 |
/** @defgroup RTC_Exported_Macros RTC Exported Macros |
|
411 |
* @{ |
|
412 |
*/ |
|
413 |
|
|
414 |
/** @brief Reset RTC handle state |
|
415 |
* @param __HANDLE__ RTC handle. |
|
416 |
* @retval None |
|
417 |
*/ |
|
418 |
#define __HAL_RTC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_RTC_STATE_RESET) |
|
419 |
|
|
420 |
/** |
|
421 |
* @brief Disable the write protection for RTC registers. |
|
422 |
* @param __HANDLE__ specifies the RTC handle. |
|
423 |
* @retval None |
|
424 |
*/ |
|
425 |
#define __HAL_RTC_WRITEPROTECTION_DISABLE(__HANDLE__) \ |
|
426 |
do{ \ |
|
427 |
(__HANDLE__)->Instance->WPR = 0xCAU; \ |
|
428 |
(__HANDLE__)->Instance->WPR = 0x53U; \ |
|
429 |
} while(0) |
|
430 |
|
|
431 |
/** |
|
432 |
* @brief Enable the write protection for RTC registers. |
|
433 |
* @param __HANDLE__ specifies the RTC handle. |
|
434 |
* @retval None |
|
435 |
*/ |
|
436 |
#define __HAL_RTC_WRITEPROTECTION_ENABLE(__HANDLE__) \ |
|
437 |
do{ \ |
|
438 |
(__HANDLE__)->Instance->WPR = 0xFFU; \ |
|
439 |
} while(0) |
|
440 |
|
|
441 |
/** |
|
442 |
* @brief Enable the RTC ALARMA peripheral. |
|
443 |
* @param __HANDLE__ specifies the RTC handle. |
|
444 |
* @retval None |
|
445 |
*/ |
|
446 |
#define __HAL_RTC_ALARMA_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_ALRAE)) |
|
447 |
|
|
448 |
/** |
|
449 |
* @brief Disable the RTC ALARMA peripheral. |
|
450 |
* @param __HANDLE__ specifies the RTC handle. |
|
451 |
* @retval None |
|
452 |
*/ |
|
453 |
#define __HAL_RTC_ALARMA_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_ALRAE)) |
|
454 |
|
|
455 |
/** |
|
456 |
* @brief Enable the RTC Alarm interrupt. |
|
457 |
* @param __HANDLE__ specifies the RTC handle. |
|
458 |
* @param __INTERRUPT__ specifies the RTC Alarm interrupt sources to be enabled or disabled. |
|
459 |
* This parameter can be any combination of the following values: |
|
460 |
* @arg RTC_IT_ALRA: Alarm A interrupt |
|
461 |
* @retval None |
|
462 |
*/ |
|
463 |
#define __HAL_RTC_ALARM_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) |
|
464 |
|
|
465 |
/** |
|
466 |
* @brief Disable the RTC Alarm interrupt. |
|
467 |
* @param __HANDLE__ specifies the RTC handle. |
|
468 |
* @param __INTERRUPT__ specifies the RTC Alarm interrupt sources to be enabled or disabled. |
|
469 |
* This parameter can be any combination of the following values: |
|
470 |
* @arg RTC_IT_ALRA: Alarm A interrupt |
|
471 |
* @retval None |
|
472 |
*/ |
|
473 |
#define __HAL_RTC_ALARM_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__)) |
|
474 |
|
|
475 |
/** |
|
476 |
* @brief Check whether the specified RTC Alarm interrupt has occurred or not. |
|
477 |
* @param __HANDLE__ specifies the RTC handle. |
|
478 |
* @param __INTERRUPT__ specifies the RTC Alarm interrupt to check. |
|
479 |
* This parameter can be: |
|
480 |
* @arg RTC_IT_ALRA: Alarm A interrupt |
|
481 |
* @retval None |
|
482 |
*/ |
|
483 |
#define __HAL_RTC_ALARM_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR)& ((__INTERRUPT__)>> 4U)) != RESET)? SET : RESET) |
|
484 |
|
|
485 |
/** |
|
486 |
* @brief Check whether the specified RTC Alarm interrupt has been enabled or not. |
|
487 |
* @param __HANDLE__ specifies the RTC handle. |
|
488 |
* @param __INTERRUPT__ specifies the RTC Alarm interrupt sources to check. |
|
489 |
* This parameter can be: |
|
490 |
* @arg RTC_IT_ALRA: Alarm A interrupt |
|
491 |
* @retval None |
|
492 |
*/ |
|
493 |
#define __HAL_RTC_ALARM_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET) |
|
494 |
|
|
495 |
/** |
|
496 |
* @brief Get the selected RTC Alarm's flag status. |
|
497 |
* @param __HANDLE__ specifies the RTC handle. |
|
498 |
* @param __FLAG__ specifies the RTC Alarm Flag sources to check. |
|
499 |
* This parameter can be: |
|
500 |
* @arg RTC_FLAG_ALRAF |
|
501 |
* @arg RTC_FLAG_ALRAWF |
|
502 |
* @retval None |
|
503 |
*/ |
|
504 |
#define __HAL_RTC_ALARM_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET) |
|
505 |
|
|
506 |
/** |
|
507 |
* @brief Clear the RTC Alarm's pending flags. |
|
508 |
* @param __HANDLE__ specifies the RTC handle. |
|
509 |
* @param __FLAG__ specifies the RTC Alarm Flag sources to clear. |
|
510 |
* This parameter can be: |
|
511 |
* @arg RTC_FLAG_ALRAF |
|
512 |
* @retval None |
|
513 |
*/ |
|
514 |
#define __HAL_RTC_ALARM_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT) | ((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) |
|
515 |
|
|
516 |
/** |
|
517 |
* @brief Enable interrupt on the RTC Alarm associated Exti line. |
|
518 |
* @retval None |
|
519 |
*/ |
|
520 |
#define __HAL_RTC_ALARM_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_ALARM_EVENT) |
|
521 |
|
|
522 |
/** |
|
523 |
* @brief Disable interrupt on the RTC Alarm associated Exti line. |
|
524 |
* @retval None |
|
525 |
*/ |
|
526 |
#define __HAL_RTC_ALARM_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_ALARM_EVENT)) |
|
527 |
|
|
528 |
/** |
|
529 |
* @brief Enable event on the RTC Alarm associated Exti line. |
|
530 |
* @retval None. |
|
531 |
*/ |
|
532 |
#define __HAL_RTC_ALARM_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_ALARM_EVENT) |
|
533 |
|
|
534 |
/** |
|
535 |
* @brief Disable event on the RTC Alarm associated Exti line. |
|
536 |
* @retval None. |
|
537 |
*/ |
|
538 |
#define __HAL_RTC_ALARM_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_ALARM_EVENT)) |
|
539 |
|
|
540 |
/** |
|
541 |
* @brief Enable falling edge trigger on the RTC Alarm associated Exti line. |
|
542 |
* @retval None. |
|
543 |
*/ |
|
544 |
#define __HAL_RTC_ALARM_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_ALARM_EVENT) |
|
545 |
|
|
546 |
/** |
|
547 |
* @brief Disable falling edge trigger on the RTC Alarm associated Exti line. |
|
548 |
* @retval None. |
|
549 |
*/ |
|
550 |
#define __HAL_RTC_ALARM_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_ALARM_EVENT)) |
|
551 |
|
|
552 |
/** |
|
553 |
* @brief Enable rising edge trigger on the RTC Alarm associated Exti line. |
|
554 |
* @retval None. |
|
555 |
*/ |
|
556 |
#define __HAL_RTC_ALARM_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_ALARM_EVENT) |
|
557 |
|
|
558 |
/** |
|
559 |
* @brief Disable rising edge trigger on the RTC Alarm associated Exti line. |
|
560 |
* @retval None. |
|
561 |
*/ |
|
562 |
#define __HAL_RTC_ALARM_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_ALARM_EVENT)) |
|
563 |
|
|
564 |
/** |
|
565 |
* @brief Enable rising & falling edge trigger on the RTC Alarm associated Exti line. |
|
566 |
* @retval None. |
|
567 |
*/ |
|
568 |
#define __HAL_RTC_ALARM_EXTI_ENABLE_RISING_FALLING_EDGE() __HAL_RTC_ALARM_EXTI_ENABLE_RISING_EDGE();__HAL_RTC_ALARM_EXTI_ENABLE_FALLING_EDGE(); |
|
569 |
|
|
570 |
/** |
|
571 |
* @brief Disable rising & falling edge trigger on the RTC Alarm associated Exti line. |
|
572 |
* @retval None. |
|
573 |
*/ |
|
574 |
#define __HAL_RTC_ALARM_EXTI_DISABLE_RISING_FALLING_EDGE() __HAL_RTC_ALARM_EXTI_DISABLE_RISING_EDGE();__HAL_RTC_ALARM_EXTI_DISABLE_FALLING_EDGE(); |
|
575 |
|
|
576 |
/** |
|
577 |
* @brief Check whether the RTC Alarm associated Exti line interrupt flag is set or not. |
|
578 |
* @retval Line Status. |
|
579 |
*/ |
|
580 |
#define __HAL_RTC_ALARM_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_ALARM_EVENT) |
|
581 |
|
|
582 |
/** |
|
583 |
* @brief Clear the RTC Alarm associated Exti line flag. |
|
584 |
* @retval None. |
|
585 |
*/ |
|
586 |
#define __HAL_RTC_ALARM_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_ALARM_EVENT) |
|
587 |
|
|
588 |
/** |
|
589 |
* @brief Generate a Software interrupt on RTC Alarm associated Exti line. |
|
590 |
* @retval None. |
|
591 |
*/ |
|
592 |
#define __HAL_RTC_ALARM_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_ALARM_EVENT) |
|
593 |
/** |
|
594 |
* @} |
|
595 |
*/ |
|
596 |
|
|
597 |
/* Include RTC HAL Extended module */ |
|
598 |
#include "stm32f0xx_hal_rtc_ex.h" |
|
599 |
|
|
600 |
/* Exported functions --------------------------------------------------------*/ |
|
601 |
/** @defgroup RTC_Exported_Functions RTC Exported Functions |
|
602 |
* @{ |
|
603 |
*/ |
|
604 |
|
|
605 |
/** @defgroup RTC_Exported_Functions_Group1 Initialization and de-initialization functions |
|
606 |
* @{ |
|
607 |
*/ |
|
608 |
|
|
609 |
/* Initialization and de-initialization functions ****************************/ |
|
610 |
HAL_StatusTypeDef HAL_RTC_Init(RTC_HandleTypeDef *hrtc); |
|
611 |
HAL_StatusTypeDef HAL_RTC_DeInit(RTC_HandleTypeDef *hrtc); |
|
612 |
void HAL_RTC_MspInit(RTC_HandleTypeDef *hrtc); |
|
613 |
void HAL_RTC_MspDeInit(RTC_HandleTypeDef *hrtc); |
|
614 |
/** |
|
615 |
* @} |
|
616 |
*/ |
|
617 |
|
|
618 |
/** @defgroup RTC_Exported_Functions_Group2 RTC Time and Date functions |
|
619 |
* @{ |
|
620 |
*/ |
|
621 |
|
|
622 |
/* RTC Time and Date functions ************************************************/ |
|
623 |
HAL_StatusTypeDef HAL_RTC_SetTime(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format); |
|
624 |
HAL_StatusTypeDef HAL_RTC_GetTime(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTime, uint32_t Format); |
|
625 |
HAL_StatusTypeDef HAL_RTC_SetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format); |
|
626 |
HAL_StatusTypeDef HAL_RTC_GetDate(RTC_HandleTypeDef *hrtc, RTC_DateTypeDef *sDate, uint32_t Format); |
|
627 |
/** |
|
628 |
* @} |
|
629 |
*/ |
|
630 |
|
|
631 |
/** @defgroup RTC_Exported_Functions_Group3 RTC Alarm functions |
|
632 |
* @{ |
|
633 |
*/ |
|
634 |
/* RTC Alarm functions ********************************************************/ |
|
635 |
HAL_StatusTypeDef HAL_RTC_SetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format); |
|
636 |
HAL_StatusTypeDef HAL_RTC_SetAlarm_IT(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Format); |
|
637 |
HAL_StatusTypeDef HAL_RTC_DeactivateAlarm(RTC_HandleTypeDef *hrtc, uint32_t Alarm); |
|
638 |
HAL_StatusTypeDef HAL_RTC_GetAlarm(RTC_HandleTypeDef *hrtc, RTC_AlarmTypeDef *sAlarm, uint32_t Alarm, uint32_t Format); |
|
639 |
void HAL_RTC_AlarmIRQHandler(RTC_HandleTypeDef *hrtc); |
|
640 |
HAL_StatusTypeDef HAL_RTC_PollForAlarmAEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout); |
|
641 |
void HAL_RTC_AlarmAEventCallback(RTC_HandleTypeDef *hrtc); |
|
642 |
/** |
|
643 |
* @} |
|
644 |
*/ |
|
645 |
|
|
646 |
/** @defgroup RTC_Exported_Functions_Group4 Peripheral Control functions |
|
647 |
* @{ |
|
648 |
*/ |
|
649 |
/* Peripheral Control functions ***********************************************/ |
|
650 |
HAL_StatusTypeDef HAL_RTC_WaitForSynchro(RTC_HandleTypeDef* hrtc); |
|
651 |
/** |
|
652 |
* @} |
|
653 |
*/ |
|
654 |
|
|
655 |
/** @defgroup RTC_Exported_Functions_Group5 Peripheral State functions |
|
656 |
* @{ |
|
657 |
*/ |
|
658 |
/* Peripheral State functions *************************************************/ |
|
659 |
HAL_RTCStateTypeDef HAL_RTC_GetState(RTC_HandleTypeDef *hrtc); |
|
660 |
/** |
|
661 |
* @} |
|
662 |
*/ |
|
663 |
|
|
664 |
/** |
|
665 |
* @} |
|
666 |
*/ |
|
667 |
|
|
668 |
/* Private types -------------------------------------------------------------*/ |
|
669 |
/* Private variables ---------------------------------------------------------*/ |
|
670 |
/* Private constants ---------------------------------------------------------*/ |
|
671 |
/** @defgroup RTC_Private_Constants RTC Private Constants |
|
672 |
* @{ |
|
673 |
*/ |
|
674 |
/* Masks Definition */ |
|
675 |
#define RTC_TR_RESERVED_MASK 0x007F7F7FU |
|
676 |
#define RTC_DR_RESERVED_MASK 0x00FFFF3FU |
|
677 |
#define RTC_INIT_MASK 0xFFFFFFFFU |
|
678 |
#define RTC_RSF_MASK 0xFFFFFF5FU |
|
679 |
#define RTC_FLAGS_MASK ((uint32_t) (RTC_FLAG_RECALPF | RTC_FLAG_TAMP3F | RTC_FLAG_TAMP2F | \ |
|
680 |
RTC_FLAG_TAMP1F| RTC_FLAG_TSOVF | RTC_FLAG_TSF | \ |
|
681 |
RTC_FLAG_WUTF | RTC_FLAG_ALRAF | \ |
|
682 |
RTC_FLAG_INITF | RTC_FLAG_RSF | RTC_FLAG_INITS | \ |
|
683 |
RTC_FLAG_SHPF | RTC_FLAG_WUTWF | RTC_FLAG_ALRAWF)) |
|
684 |
|
|
685 |
#define RTC_TIMEOUT_VALUE 1000U |
|
686 |
|
|
687 |
#define RTC_EXTI_LINE_ALARM_EVENT ((uint32_t)EXTI_IMR_MR17) /*!< External interrupt line 17 Connected to the RTC Alarm event */ |
|
688 |
/** |
|
689 |
* @} |
|
690 |
*/ |
|
691 |
|
|
692 |
/* Private macros ------------------------------------------------------------*/ |
|
693 |
/** @defgroup RTC_Private_Macros RTC Private Macros |
|
694 |
* @{ |
|
695 |
*/ |
|
696 |
|
|
697 |
/** @defgroup RTC_IS_RTC_Definitions RTC Private macros to check input parameters |
|
698 |
* @{ |
|
699 |
*/ |
|
700 |
#define IS_RTC_HOUR_FORMAT(FORMAT) (((FORMAT) == RTC_HOURFORMAT_12) || \ |
|
701 |
((FORMAT) == RTC_HOURFORMAT_24)) |
|
702 |
|
|
703 |
#define IS_RTC_OUTPUT_POL(POL) (((POL) == RTC_OUTPUT_POLARITY_HIGH) || \ |
|
704 |
((POL) == RTC_OUTPUT_POLARITY_LOW)) |
|
705 |
#define IS_RTC_OUTPUT_TYPE(TYPE) (((TYPE) == RTC_OUTPUT_TYPE_OPENDRAIN) || \ |
|
706 |
((TYPE) == RTC_OUTPUT_TYPE_PUSHPULL)) |
|
707 |
#define IS_RTC_HOUR12(HOUR) (((HOUR) > 0U) && ((HOUR) <= 12U)) |
|
708 |
#define IS_RTC_HOUR24(HOUR) ((HOUR) <= 23U) |
|
709 |
#define IS_RTC_ASYNCH_PREDIV(PREDIV) ((PREDIV) <= 0x7FU) |
|
710 |
#define IS_RTC_SYNCH_PREDIV(PREDIV) ((PREDIV) <= 0x7FFFU) |
|
711 |
#define IS_RTC_MINUTES(MINUTES) ((MINUTES) <= 59U) |
|
712 |
#define IS_RTC_SECONDS(SECONDS) ((SECONDS) <= 59U) |
|
713 |
|
|
714 |
#define IS_RTC_HOURFORMAT12(PM) (((PM) == RTC_HOURFORMAT12_AM) || \ |
|
715 |
((PM) == RTC_HOURFORMAT12_PM)) |
|
716 |
|
|
717 |
#define IS_RTC_DAYLIGHT_SAVING(SAVE) (((SAVE) == RTC_DAYLIGHTSAVING_SUB1H) || \ |
|
718 |
((SAVE) == RTC_DAYLIGHTSAVING_ADD1H) || \ |
|
719 |
((SAVE) == RTC_DAYLIGHTSAVING_NONE)) |
|
720 |
#define IS_RTC_STORE_OPERATION(OPERATION) (((OPERATION) == RTC_STOREOPERATION_RESET) || \ |
|
721 |
((OPERATION) == RTC_STOREOPERATION_SET)) |
|
722 |
#define IS_RTC_FORMAT(FORMAT) (((FORMAT) == RTC_FORMAT_BIN) || ((FORMAT) == RTC_FORMAT_BCD)) |
|
723 |
#define IS_RTC_YEAR(YEAR) ((YEAR) <= 99U) |
|
724 |
#define IS_RTC_MONTH(MONTH) (((MONTH) >= 1U) && ((MONTH) <= 12U)) |
|
725 |
#define IS_RTC_DATE(DATE) (((DATE) >= 1U) && ((DATE) <= 31U)) |
|
726 |
#define IS_RTC_WEEKDAY(WEEKDAY) (((WEEKDAY) == RTC_WEEKDAY_MONDAY) || \ |
|
727 |
((WEEKDAY) == RTC_WEEKDAY_TUESDAY) || \ |
|
728 |
((WEEKDAY) == RTC_WEEKDAY_WEDNESDAY) || \ |
|
729 |
((WEEKDAY) == RTC_WEEKDAY_THURSDAY) || \ |
|
730 |
((WEEKDAY) == RTC_WEEKDAY_FRIDAY) || \ |
|
731 |
((WEEKDAY) == RTC_WEEKDAY_SATURDAY) || \ |
|
732 |
((WEEKDAY) == RTC_WEEKDAY_SUNDAY)) |
|
733 |
#define IS_RTC_ALARM_DATE_WEEKDAY_DATE(DATE) (((DATE) > 0U) && ((DATE) <= 31U)) |
|
734 |
#define IS_RTC_ALARM_DATE_WEEKDAY_WEEKDAY(WEEKDAY) (((WEEKDAY) == RTC_WEEKDAY_MONDAY) || \ |
|
735 |
((WEEKDAY) == RTC_WEEKDAY_TUESDAY) || \ |
|
736 |
((WEEKDAY) == RTC_WEEKDAY_WEDNESDAY) || \ |
|
737 |
((WEEKDAY) == RTC_WEEKDAY_THURSDAY) || \ |
|
738 |
((WEEKDAY) == RTC_WEEKDAY_FRIDAY) || \ |
|
739 |
((WEEKDAY) == RTC_WEEKDAY_SATURDAY) || \ |
|
740 |
((WEEKDAY) == RTC_WEEKDAY_SUNDAY)) |
|
741 |
#define IS_RTC_ALARM_DATE_WEEKDAY_SEL(SEL) (((SEL) == RTC_ALARMDATEWEEKDAYSEL_DATE) || \ |
|
742 |
((SEL) == RTC_ALARMDATEWEEKDAYSEL_WEEKDAY)) |
|
743 |
#define IS_RTC_ALARM_MASK(MASK) (((MASK) & 0x7F7F7F7FU) == (uint32_t)RESET) |
|
744 |
#define IS_RTC_ALARM(ALARM) ((ALARM) == RTC_ALARM_A) |
|
745 |
#define IS_RTC_ALARM_SUB_SECOND_VALUE(VALUE) ((VALUE) <= 0x00007FFFU) |
|
746 |
|
|
747 |
#define IS_RTC_ALARM_SUB_SECOND_MASK(MASK) (((MASK) == RTC_ALARMSUBSECONDMASK_ALL) || \ |
|
748 |
((MASK) == RTC_ALARMSUBSECONDMASK_SS14_1) || \ |
|
749 |
((MASK) == RTC_ALARMSUBSECONDMASK_SS14_2) || \ |
|
750 |
((MASK) == RTC_ALARMSUBSECONDMASK_SS14_3) || \ |
|
751 |
((MASK) == RTC_ALARMSUBSECONDMASK_SS14_4) || \ |
|
752 |
((MASK) == RTC_ALARMSUBSECONDMASK_SS14_5) || \ |
|
753 |
((MASK) == RTC_ALARMSUBSECONDMASK_SS14_6) || \ |
|
754 |
((MASK) == RTC_ALARMSUBSECONDMASK_SS14_7) || \ |
|
755 |
((MASK) == RTC_ALARMSUBSECONDMASK_SS14_8) || \ |
|
756 |
((MASK) == RTC_ALARMSUBSECONDMASK_SS14_9) || \ |
|
757 |
((MASK) == RTC_ALARMSUBSECONDMASK_SS14_10) || \ |
|
758 |
((MASK) == RTC_ALARMSUBSECONDMASK_SS14_11) || \ |
|
759 |
((MASK) == RTC_ALARMSUBSECONDMASK_SS14_12) || \ |
|
760 |
((MASK) == RTC_ALARMSUBSECONDMASK_SS14_13) || \ |
|
761 |
((MASK) == RTC_ALARMSUBSECONDMASK_SS14) || \ |
|
762 |
((MASK) == RTC_ALARMSUBSECONDMASK_NONE)) |
|
763 |
/** |
|
764 |
* @} |
|
765 |
*/ |
|
766 |
|
|
767 |
/** |
|
768 |
* @} |
|
769 |
*/ |
|
770 |
|
|
771 |
/* Private functions ---------------------------------------------------------*/ |
|
772 |
/** @defgroup RTC_Private_Functions RTC Private Functions |
|
773 |
* @{ |
|
774 |
*/ |
|
775 |
HAL_StatusTypeDef RTC_EnterInitMode(RTC_HandleTypeDef* hrtc); |
|
776 |
uint8_t RTC_ByteToBcd2(uint8_t Value); |
|
777 |
uint8_t RTC_Bcd2ToByte(uint8_t Value); |
|
778 |
/** |
|
779 |
* @} |
|
780 |
*/ |
|
781 |
|
|
782 |
/** |
|
783 |
* @} |
|
784 |
*/ |
|
785 |
|
|
786 |
/** |
|
787 |
* @} |
|
788 |
*/ |
|
789 |
|
|
790 |
#ifdef __cplusplus |
|
791 |
} |
|
792 |
#endif |
|
793 |
|
|
794 |
#endif /* __STM32F0xx_HAL_RTC_H */ |
|
795 |
|
|
796 |
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
|
797 |
|