stm32l1xx_hal_rtc_ex.h 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973
  1. /**
  2. ******************************************************************************
  3. * @file stm32l1xx_hal_rtc_ex.h
  4. * @author MCD Application Team
  5. * @version V1.0.0
  6. * @date 5-September-2014
  7. * @brief Header file of RTC HAL Extension module.
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
  12. *
  13. * Redistribution and use in source and binary forms, with or without modification,
  14. * are permitted provided that the following conditions are met:
  15. * 1. Redistributions of source code must retain the above copyright notice,
  16. * this list of conditions and the following disclaimer.
  17. * 2. Redistributions in binary form must reproduce the above copyright notice,
  18. * this list of conditions and the following disclaimer in the documentation
  19. * and/or other materials provided with the distribution.
  20. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  21. * may be used to endorse or promote products derived from this software
  22. * without specific prior written permission.
  23. *
  24. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  25. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  26. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  27. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  28. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  29. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  30. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  31. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  32. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  33. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  34. *
  35. ******************************************************************************
  36. */
  37. /* Define to prevent recursive inclusion -------------------------------------*/
  38. #ifndef __STM32L1xx_HAL_RTC_EX_H
  39. #define __STM32L1xx_HAL_RTC_EX_H
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. /* Includes ------------------------------------------------------------------*/
  44. #include "stm32l1xx_hal_def.h"
  45. /** @addtogroup STM32L1xx_HAL_Driver
  46. * @{
  47. */
  48. /** @addtogroup RTCEx
  49. * @{
  50. */
  51. /* Exported types ------------------------------------------------------------*/
  52. /** @defgroup RTCEx_Exported_Types RTCEx Exported Types
  53. * @{
  54. */
  55. /**
  56. * @brief RTC Tamper structure definition
  57. */
  58. typedef struct
  59. {
  60. uint32_t Tamper; /*!< Specifies the Tamper Pin.
  61. This parameter can be a value of @ref RTCEx_Tamper_Pins_Definitions */
  62. uint32_t Trigger; /*!< Specifies the Tamper Trigger.
  63. This parameter can be a value of @ref RTCEx_Tamper_Trigger_Definitions */
  64. #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
  65. uint32_t Filter; /*!< Specifies the RTC Filter Tamper.
  66. This parameter can be a value of @ref RTCEx_Tamper_Filter_Definitions */
  67. uint32_t SamplingFrequency; /*!< Specifies the sampling frequency.
  68. This parameter can be a value of @ref RTCEx_Tamper_Sampling_Frequencies_Definitions */
  69. uint32_t PrechargeDuration; /*!< Specifies the Precharge Duration .
  70. This parameter can be a value of @ref RTCEx_Tamper_Pin_Precharge_Duration_Definitions */
  71. uint32_t TamperPullUp; /*!< Specifies the Tamper PullUp .
  72. This parameter can be a value of @ref RTCEx_Tamper_Pull_Up_Definitions */
  73. uint32_t TimeStampOnTamperDetection; /*!< Specifies the TimeStampOnTamperDetection.
  74. This parameter can be a value of @ref RTCEx_Tamper_TimeStampOnTamperDetection_Definitions */
  75. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
  76. }RTC_TamperTypeDef;
  77. /**
  78. * @brief RTC Time structure definition
  79. */
  80. typedef struct
  81. {
  82. uint8_t Hours; /*!< Specifies the RTC Time Hour.
  83. This parameter must be a number between Min_Data = 0 and Max_Data = 12 if the RTC_HourFormat_12 is selected
  84. This parameter must be a number between Min_Data = 0 and Max_Data = 23 if the RTC_HourFormat_24 is selected */
  85. uint8_t Minutes; /*!< Specifies the RTC Time Minutes.
  86. This parameter must be a number between Min_Data = 0 and Max_Data = 59 */
  87. uint8_t Seconds; /*!< Specifies the RTC Time Seconds.
  88. This parameter must be a number between Min_Data = 0 and Max_Data = 59 */
  89. #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
  90. uint32_t SubSeconds; /*!< Specifies the RTC Time SubSeconds.
  91. This parameter must be a number between Min_Data = 0 and Max_Data = 59 */
  92. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
  93. uint8_t TimeFormat; /*!< Specifies the RTC AM/PM Time.
  94. This parameter can be a value of @ref RTC_AM_PM_Definitions */
  95. uint32_t DayLightSaving; /*!< Specifies RTC_DayLightSaveOperation: the value of hour adjustment.
  96. This parameter can be a value of @ref RTC_DayLightSaving_Definitions */
  97. uint32_t StoreOperation; /*!< Specifies RTC_StoreOperation value to be written in the BCK bit
  98. in CR register to store the operation.
  99. This parameter can be a value of @ref RTC_StoreOperation_Definitions */
  100. }RTC_TimeTypeDef;
  101. /**
  102. * @brief RTC Alarm structure definition
  103. */
  104. typedef struct
  105. {
  106. RTC_TimeTypeDef AlarmTime; /*!< Specifies the RTC Alarm Time members */
  107. uint32_t AlarmMask; /*!< Specifies the RTC Alarm Masks.
  108. This parameter can be a value of @ref RTC_AlarmMask_Definitions */
  109. #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
  110. uint32_t AlarmSubSecondMask; /*!< Specifies the RTC Alarm SubSeconds Masks.
  111. This parameter can be a value of @ref RTC_Alarm_Sub_Seconds_Masks_Definitions */
  112. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
  113. uint32_t AlarmDateWeekDaySel; /*!< Specifies the RTC Alarm is on Date or WeekDay.
  114. This parameter can be a value of @ref RTC_AlarmDateWeekDay_Definitions */
  115. uint8_t AlarmDateWeekDay; /*!< Specifies the RTC Alarm Date/WeekDay.
  116. If the Alarm Date is selected, this parameter must be set to a value in the 1-31 range.
  117. If the Alarm WeekDay is selected, this parameter can be a value of @ref RTC_WeekDay_Definitions */
  118. uint32_t Alarm; /*!< Specifies the alarm .
  119. This parameter can be a value of @ref RTC_Alarms_Definitions */
  120. }RTC_AlarmTypeDef;
  121. /**
  122. * @}
  123. */
  124. /* Exported constants --------------------------------------------------------*/
  125. /** @defgroup RTCEx_Exported_Constants RTCEx Exported Constants
  126. * @{
  127. */
  128. /** @defgroup RTC_Masks_Definitions Masks Definitions
  129. * @{
  130. */
  131. #define RTC_TR_RESERVED_MASK ((uint32_t)0x007F7F7F)
  132. #define RTC_DR_RESERVED_MASK ((uint32_t)0x00FFFF3F)
  133. #define RTC_INIT_MASK ((uint32_t)0xFFFFFFFF)
  134. #define RTC_RSF_MASK ((uint32_t)0xFFFFFF5F)
  135. #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
  136. #define RTC_FLAGS_MASK ((uint32_t)(RTC_FLAG_ALRAWF | RTC_FLAG_ALRBWF | RTC_FLAG_WUTWF | \
  137. RTC_FLAG_SHPF | RTC_FLAG_INITS | RTC_FLAG_RSF | \
  138. RTC_FLAG_INITF | RTC_FLAG_ALRAF | RTC_FLAG_ALRBF | \
  139. RTC_FLAG_WUTF | RTC_FLAG_TSF | RTC_FLAG_TSOVF | \
  140. RTC_FLAG_TAMP1F | RTC_FLAG_TAMP2F | RTC_FLAG_TAMP3F | \
  141. RTC_FLAG_RECALPF))
  142. #else
  143. #define RTC_FLAGS_MASK ((uint32_t)(RTC_FLAG_ALRAWF | RTC_FLAG_ALRBWF | RTC_FLAG_WUTWF | \
  144. RTC_FLAG_SHPF | RTC_FLAG_INITS | RTC_FLAG_RSF | \
  145. RTC_FLAG_INITF | RTC_FLAG_ALRAF | RTC_FLAG_ALRBF | \
  146. RTC_FLAG_WUTF | RTC_FLAG_TSF | RTC_FLAG_TSOVF | \
  147. RTC_FLAG_TAMP1F | \
  148. RTC_FLAG_RECALPF))
  149. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
  150. /**
  151. * @}
  152. */
  153. /** @defgroup RTC_Synchronous_Predivider Synchronous Predivider
  154. * @{
  155. */
  156. #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
  157. #define IS_RTC_SYNCH_PREDIV(PREDIV) ((PREDIV) <= (uint32_t)0x7FFF)
  158. #elif defined(STM32L100xB) || defined (STM32L151xB) || defined (STM32L152xB)
  159. #define IS_RTC_SYNCH_PREDIV(PREDIV) ((PREDIV) <= (uint32_t)0x1FFF)
  160. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
  161. /**
  162. * @}
  163. */
  164. /** @defgroup RTC_Interrupts_Definitions Interrupts Definitions
  165. * @{
  166. */
  167. #define RTC_IT_TS ((uint32_t)0x00008000)
  168. #define RTC_IT_WUT ((uint32_t)0x00004000)
  169. #define RTC_IT_ALRB ((uint32_t)0x00002000)
  170. #define RTC_IT_ALRA ((uint32_t)0x00001000)
  171. #define RTC_IT_TAMP1 ((uint32_t)0x00020000)
  172. #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
  173. #define RTC_IT_TAMP2 ((uint32_t)0x00040000)
  174. #define RTC_IT_TAMP3 ((uint32_t)0x00080000)
  175. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
  176. /**
  177. * @}
  178. */
  179. /** @defgroup RTC_Flags_Definitions Flags Definitions
  180. * @{
  181. */
  182. #define RTC_FLAG_RECALPF ((uint32_t)0x00010000)
  183. #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
  184. #define RTC_FLAG_TAMP3F ((uint32_t)0x00008000)
  185. #define RTC_FLAG_TAMP2F ((uint32_t)0x00004000)
  186. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
  187. #define RTC_FLAG_TAMP1F ((uint32_t)0x00002000)
  188. #define RTC_FLAG_TSOVF ((uint32_t)0x00001000)
  189. #define RTC_FLAG_TSF ((uint32_t)0x00000800)
  190. #define RTC_FLAG_WUTF ((uint32_t)0x00000400)
  191. #define RTC_FLAG_ALRBF ((uint32_t)0x00000200)
  192. #define RTC_FLAG_ALRAF ((uint32_t)0x00000100)
  193. #define RTC_FLAG_INITF ((uint32_t)0x00000040)
  194. #define RTC_FLAG_RSF ((uint32_t)0x00000020)
  195. #define RTC_FLAG_INITS ((uint32_t)0x00000010)
  196. #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
  197. #define RTC_FLAG_SHPF ((uint32_t)0x00000008)
  198. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
  199. #define RTC_FLAG_WUTWF ((uint32_t)0x00000004)
  200. #define RTC_FLAG_ALRBWF ((uint32_t)0x00000002)
  201. #define RTC_FLAG_ALRAWF ((uint32_t)0x00000001)
  202. /**
  203. * @}
  204. */
  205. /** @defgroup RTCEx_Output_selection_Definitions Output selection Definitions
  206. * @{
  207. */
  208. #define RTC_OUTPUT_DISABLE ((uint32_t)0x00000000)
  209. #define RTC_OUTPUT_ALARMA ((uint32_t)0x00200000)
  210. #define RTC_OUTPUT_ALARMB ((uint32_t)0x00400000)
  211. #define RTC_OUTPUT_WAKEUP ((uint32_t)0x00600000)
  212. #define IS_RTC_OUTPUT(OUTPUT) (((OUTPUT) == RTC_OUTPUT_DISABLE) || \
  213. ((OUTPUT) == RTC_OUTPUT_ALARMA) || \
  214. ((OUTPUT) == RTC_OUTPUT_ALARMB) || \
  215. ((OUTPUT) == RTC_OUTPUT_WAKEUP))
  216. /**
  217. * @}
  218. */
  219. /** @defgroup RTCEx_Backup_Registers_Definitions Backup Registers Definitions
  220. * @{
  221. */
  222. #if RTC_BKP_NUMBER > 0
  223. #define RTC_BKP_DR0 ((uint32_t)0x00000000)
  224. #define RTC_BKP_DR1 ((uint32_t)0x00000001)
  225. #define RTC_BKP_DR2 ((uint32_t)0x00000002)
  226. #define RTC_BKP_DR3 ((uint32_t)0x00000003)
  227. #define RTC_BKP_DR4 ((uint32_t)0x00000004)
  228. #endif /* RTC_BKP_NUMBER > 0 */
  229. #if RTC_BKP_NUMBER > 5
  230. #define RTC_BKP_DR5 ((uint32_t)0x00000005)
  231. #define RTC_BKP_DR6 ((uint32_t)0x00000006)
  232. #define RTC_BKP_DR7 ((uint32_t)0x00000007)
  233. #define RTC_BKP_DR8 ((uint32_t)0x00000008)
  234. #define RTC_BKP_DR9 ((uint32_t)0x00000009)
  235. #define RTC_BKP_DR10 ((uint32_t)0x0000000A)
  236. #define RTC_BKP_DR11 ((uint32_t)0x0000000B)
  237. #define RTC_BKP_DR12 ((uint32_t)0x0000000C)
  238. #define RTC_BKP_DR13 ((uint32_t)0x0000000D)
  239. #define RTC_BKP_DR14 ((uint32_t)0x0000000E)
  240. #define RTC_BKP_DR15 ((uint32_t)0x0000000F)
  241. #define RTC_BKP_DR16 ((uint32_t)0x00000010)
  242. #define RTC_BKP_DR17 ((uint32_t)0x00000011)
  243. #define RTC_BKP_DR18 ((uint32_t)0x00000012)
  244. #define RTC_BKP_DR19 ((uint32_t)0x00000013)
  245. #endif /* RTC_BKP_NUMBER > 5 */
  246. #if RTC_BKP_NUMBER > 20
  247. #define RTC_BKP_DR20 ((uint32_t)0x00000014)
  248. #define RTC_BKP_DR21 ((uint32_t)0x00000015)
  249. #define RTC_BKP_DR22 ((uint32_t)0x00000016)
  250. #define RTC_BKP_DR23 ((uint32_t)0x00000017)
  251. #define RTC_BKP_DR24 ((uint32_t)0x00000018)
  252. #define RTC_BKP_DR25 ((uint32_t)0x00000019)
  253. #define RTC_BKP_DR26 ((uint32_t)0x0000001A)
  254. #define RTC_BKP_DR27 ((uint32_t)0x0000001B)
  255. #define RTC_BKP_DR28 ((uint32_t)0x0000001C)
  256. #define RTC_BKP_DR29 ((uint32_t)0x0000001D)
  257. #define RTC_BKP_DR30 ((uint32_t)0x0000001E)
  258. #define RTC_BKP_DR31 ((uint32_t)0x0000001F)
  259. #endif /* RTC_BKP_NUMBER > 20 */
  260. #define IS_RTC_BKP(BKP) ((BKP) < (uint32_t) RTC_BKP_NUMBER)
  261. /**
  262. * @}
  263. */
  264. /** @defgroup RTCEx_Time_Stamp_Edges_Definitions Time Stamp Edges Definitions
  265. * @{
  266. */
  267. #define RTC_TIMESTAMPEDGE_RISING ((uint32_t)0x00000000)
  268. #define RTC_TIMESTAMPEDGE_FALLING ((uint32_t)0x00000008)
  269. #define IS_TIMESTAMP_EDGE(EDGE) (((EDGE) == RTC_TIMESTAMPEDGE_RISING) || \
  270. ((EDGE) == RTC_TIMESTAMPEDGE_FALLING))
  271. /**
  272. * @}
  273. */
  274. /** @defgroup RTCEx_Tamper_Pins_Definitions Tamper Pins Definitions
  275. * @{
  276. */
  277. #define RTC_TAMPER_1 RTC_TAFCR_TAMP1E
  278. #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
  279. #define RTC_TAMPER_2 RTC_TAFCR_TAMP2E
  280. #define RTC_TAMPER_3 RTC_TAFCR_TAMP3E
  281. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
  282. #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
  283. #define IS_TAMPER(TAMPER) (((~(RTC_TAMPER_1|RTC_TAMPER_2|RTC_TAMPER_3) & (TAMPER)) == (uint32_t)RESET) && ((TAMPER) != (uint32_t)RESET))
  284. #else
  285. #define IS_TAMPER(TAMPER) ((TAMPER) == RTC_TAMPER_1)
  286. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
  287. /**
  288. * @}
  289. */
  290. /** @defgroup RTCEx_Tamper_Trigger_Definitions Tamper Trigger Definitions
  291. * @{
  292. */
  293. #define RTC_TAMPERTRIGGER_RISINGEDGE ((uint32_t)0x00000000)
  294. #define RTC_TAMPERTRIGGER_FALLINGEDGE ((uint32_t)0x00000002)
  295. #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
  296. #define RTC_TAMPERTRIGGER_LOWLEVEL RTC_TAMPERTRIGGER_RISINGEDGE
  297. #define RTC_TAMPERTRIGGER_HIGHLEVEL RTC_TAMPERTRIGGER_FALLINGEDGE
  298. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
  299. #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
  300. #define IS_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TAMPERTRIGGER_RISINGEDGE) || \
  301. ((TRIGGER) == RTC_TAMPERTRIGGER_FALLINGEDGE) || \
  302. ((TRIGGER) == RTC_TAMPERTRIGGER_LOWLEVEL) || \
  303. ((TRIGGER) == RTC_TAMPERTRIGGER_HIGHLEVEL))
  304. #elif defined(STM32L100xB) || defined (STM32L151xB) || defined (STM32L152xB)
  305. #define IS_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TAMPERTRIGGER_RISINGEDGE) || \
  306. ((TRIGGER) == RTC_TAMPERTRIGGER_FALLINGEDGE))
  307. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
  308. /**
  309. * @}
  310. */
  311. #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
  312. /** @defgroup RTCEx_Tamper_Filter_Definitions Tamper Filter Definitions
  313. * @{
  314. */
  315. #define RTC_TAMPERFILTER_DISABLE ((uint32_t)0x00000000) /*!< Tamper filter is disabled */
  316. #define RTC_TAMPERFILTER_2SAMPLE ((uint32_t)0x00000800) /*!< Tamper is activated after 2
  317. consecutive samples at the active level */
  318. #define RTC_TAMPERFILTER_4SAMPLE ((uint32_t)0x00001000) /*!< Tamper is activated after 4
  319. consecutive samples at the active level */
  320. #define RTC_TAMPERFILTER_8SAMPLE ((uint32_t)0x00001800) /*!< Tamper is activated after 8
  321. consecutive samples at the active level. */
  322. #define IS_TAMPER_FILTER(FILTER) (((FILTER) == RTC_TAMPERFILTER_DISABLE) || \
  323. ((FILTER) == RTC_TAMPERFILTER_2SAMPLE) || \
  324. ((FILTER) == RTC_TAMPERFILTER_4SAMPLE) || \
  325. ((FILTER) == RTC_TAMPERFILTER_8SAMPLE))
  326. /**
  327. * @}
  328. */
  329. /** @defgroup RTCEx_Tamper_Sampling_Frequencies_Definitions Tamper Sampling Frequencies
  330. * @{
  331. */
  332. #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768 ((uint32_t)0x00000000) /*!< Each of the tamper inputs are sampled
  333. with a frequency = RTCCLK / 32768 */
  334. #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384 ((uint32_t)0x00000100) /*!< Each of the tamper inputs are sampled
  335. with a frequency = RTCCLK / 16384 */
  336. #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192 ((uint32_t)0x00000200) /*!< Each of the tamper inputs are sampled
  337. with a frequency = RTCCLK / 8192 */
  338. #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096 ((uint32_t)0x00000300) /*!< Each of the tamper inputs are sampled
  339. with a frequency = RTCCLK / 4096 */
  340. #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048 ((uint32_t)0x00000400) /*!< Each of the tamper inputs are sampled
  341. with a frequency = RTCCLK / 2048 */
  342. #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024 ((uint32_t)0x00000500) /*!< Each of the tamper inputs are sampled
  343. with a frequency = RTCCLK / 1024 */
  344. #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512 ((uint32_t)0x00000600) /*!< Each of the tamper inputs are sampled
  345. with a frequency = RTCCLK / 512 */
  346. #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256 ((uint32_t)0x00000700) /*!< Each of the tamper inputs are sampled
  347. with a frequency = RTCCLK / 256 */
  348. #define IS_TAMPER_SAMPLING_FREQ(FREQ) (((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768)|| \
  349. ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384)|| \
  350. ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192) || \
  351. ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096) || \
  352. ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048) || \
  353. ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024) || \
  354. ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512) || \
  355. ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256))
  356. /**
  357. * @}
  358. */
  359. /** @defgroup RTCEx_Tamper_Pin_Precharge_Duration_Definitions Tamper Pin Precharge Duration
  360. * @{
  361. */
  362. #define RTC_TAMPERPRECHARGEDURATION_1RTCCLK ((uint32_t)0x00000000) /*!< Tamper pins are pre-charged before
  363. sampling during 1 RTCCLK cycle */
  364. #define RTC_TAMPERPRECHARGEDURATION_2RTCCLK ((uint32_t)0x00002000) /*!< Tamper pins are pre-charged before
  365. sampling during 2 RTCCLK cycles */
  366. #define RTC_TAMPERPRECHARGEDURATION_4RTCCLK ((uint32_t)0x00004000) /*!< Tamper pins are pre-charged before
  367. sampling during 4 RTCCLK cycles */
  368. #define RTC_TAMPERPRECHARGEDURATION_8RTCCLK ((uint32_t)0x00006000) /*!< Tamper pins are pre-charged before
  369. sampling during 8 RTCCLK cycles */
  370. #define IS_TAMPER_PRECHARGE_DURATION(DURATION) (((DURATION) == RTC_TAMPERPRECHARGEDURATION_1RTCCLK) || \
  371. ((DURATION) == RTC_TAMPERPRECHARGEDURATION_2RTCCLK) || \
  372. ((DURATION) == RTC_TAMPERPRECHARGEDURATION_4RTCCLK) || \
  373. ((DURATION) == RTC_TAMPERPRECHARGEDURATION_8RTCCLK))
  374. /**
  375. * @}
  376. */
  377. /** @defgroup RTCEx_Tamper_TimeStampOnTamperDetection_Definitions TimeStampOnTamperDetection Definitions
  378. * @{
  379. */
  380. #define RTC_TIMESTAMPONTAMPERDETECTION_ENABLE ((uint32_t)RTC_TAFCR_TAMPTS) /*!< TimeStamp on Tamper Detection event saved */
  381. #define RTC_TIMESTAMPONTAMPERDETECTION_DISABLE ((uint32_t)0x00000000) /*!< TimeStamp on Tamper Detection event is not saved */
  382. #define IS_TAMPER_TIMESTAMPONTAMPER_DETECTION(DETECTION) (((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_ENABLE) || \
  383. ((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_DISABLE))
  384. /**
  385. * @}
  386. */
  387. /** @defgroup RTCEx_Tamper_Pull_Up_Definitions Tamper Pull-Up Definitions
  388. * @{
  389. */
  390. #define RTC_TAMPER_PULLUP_ENABLE ((uint32_t)0x00000000) /*!< TimeStamp on Tamper Detection event saved */
  391. #define RTC_TAMPER_PULLUP_DISABLE ((uint32_t)RTC_TAFCR_TAMPPUDIS) /*!< TimeStamp on Tamper Detection event is not saved */
  392. #define IS_TAMPER_PULLUP_STATE(STATE) (((STATE) == RTC_TAMPER_PULLUP_ENABLE) || \
  393. ((STATE) == RTC_TAMPER_PULLUP_DISABLE))
  394. /**
  395. * @}
  396. */
  397. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
  398. /** @defgroup RTCEx_Wakeup_Timer_Definitions Wakeup Timer Definitions
  399. * @{
  400. */
  401. #define RTC_WAKEUPCLOCK_RTCCLK_DIV16 ((uint32_t)0x00000000)
  402. #define RTC_WAKEUPCLOCK_RTCCLK_DIV8 ((uint32_t)0x00000001)
  403. #define RTC_WAKEUPCLOCK_RTCCLK_DIV4 ((uint32_t)0x00000002)
  404. #define RTC_WAKEUPCLOCK_RTCCLK_DIV2 ((uint32_t)0x00000003)
  405. #define RTC_WAKEUPCLOCK_CK_SPRE_16BITS ((uint32_t)0x00000004)
  406. #define RTC_WAKEUPCLOCK_CK_SPRE_17BITS ((uint32_t)0x00000006)
  407. #define IS_WAKEUP_CLOCK(CLOCK) (((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV16) || \
  408. ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV8) || \
  409. ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV4) || \
  410. ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV2) || \
  411. ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_16BITS) || \
  412. ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_17BITS))
  413. #define IS_WAKEUP_COUNTER(COUNTER) ((COUNTER) <= 0xFFFF)
  414. /**
  415. * @}
  416. */
  417. /** @defgroup RTCEx_Digital_Calibration_Definitions Digital Calibration Definitions
  418. * @{
  419. */
  420. #define RTC_CALIBSIGN_POSITIVE ((uint32_t)0x00000000)
  421. #define RTC_CALIBSIGN_NEGATIVE ((uint32_t)0x00000080)
  422. #define IS_RTC_CALIB_SIGN(SIGN) (((SIGN) == RTC_CALIBSIGN_POSITIVE) || \
  423. ((SIGN) == RTC_CALIBSIGN_NEGATIVE))
  424. #define IS_RTC_CALIB_VALUE(VALUE) ((VALUE) < 0x20)
  425. /**
  426. * @}
  427. */
  428. /** @defgroup RTCEx_Smooth_Calib_Period_Definitions Smooth Calib Period Definitions
  429. * @{
  430. */
  431. #define RTC_SMOOTHCALIB_PERIOD_32SEC ((uint32_t)0x00000000) /*!< If RTCCLK = 32768 Hz, Smooth calibation
  432. period is 32s, else 2exp20 RTCCLK seconds */
  433. #define RTC_SMOOTHCALIB_PERIOD_16SEC ((uint32_t)0x00002000) /*!< If RTCCLK = 32768 Hz, Smooth calibation
  434. period is 16s, else 2exp19 RTCCLK seconds */
  435. #define RTC_SMOOTHCALIB_PERIOD_8SEC ((uint32_t)0x00004000) /*!< If RTCCLK = 32768 Hz, Smooth calibation
  436. period is 8s, else 2exp18 RTCCLK seconds */
  437. #define IS_RTC_SMOOTH_CALIB_PERIOD(PERIOD) (((PERIOD) == RTC_SMOOTHCALIB_PERIOD_32SEC) || \
  438. ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_16SEC) || \
  439. ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_8SEC))
  440. /**
  441. * @}
  442. */
  443. /** @defgroup RTCEx_Smooth_Calib_Plus_Pulses_Definitions Smooth Calib Plus Pulses Definitions
  444. * @{
  445. */
  446. #define RTC_SMOOTHCALIB_PLUSPULSES_SET ((uint32_t)0x00008000) /*!< The number of RTCCLK pulses added
  447. during a X -second window = Y - CALM[8:0]
  448. with Y = 512, 256, 128 when X = 32, 16, 8 */
  449. #define RTC_SMOOTHCALIB_PLUSPULSES_RESET ((uint32_t)0x00000000) /*!< The number of RTCCLK pulses subbstited
  450. during a 32-second window = CALM[8:0] */
  451. #define IS_RTC_SMOOTH_CALIB_PLUS(PLUS) (((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_SET) || \
  452. ((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_RESET))
  453. /**
  454. * @}
  455. */
  456. /** @defgroup RTCEx_Smooth_Calib_Minus_Pulses_Definitions Smooth Calib Minus Pulses Definitions
  457. * @{
  458. */
  459. #define IS_RTC_SMOOTH_CALIB_MINUS(VALUE) ((VALUE) <= 0x000001FF)
  460. /**
  461. * @}
  462. */
  463. /** @defgroup RTCEx_Add_1_Second_Parameter_Definitions Add 1 Second Parameter Definitions
  464. * @{
  465. */
  466. #define RTC_SHIFTADD1S_RESET ((uint32_t)0x00000000)
  467. #define RTC_SHIFTADD1S_SET ((uint32_t)0x80000000)
  468. #define IS_RTC_SHIFT_ADD1S(SEL) (((SEL) == RTC_SHIFTADD1S_RESET) || \
  469. ((SEL) == RTC_SHIFTADD1S_SET))
  470. /**
  471. * @}
  472. */
  473. /** @defgroup RTCEx_Substract_Fraction_Of_Second_Value Substract Fraction Of Second Value
  474. * @{
  475. */
  476. #define IS_RTC_SHIFT_SUBFS(FS) ((FS) <= 0x00007FFF)
  477. /**
  478. * @}
  479. */
  480. /** @defgroup RTCEx_Calib_Output_Selection_Definitions Calib Output Selection Definitions
  481. * @{
  482. */
  483. #define RTC_CALIBOUTPUT_512HZ ((uint32_t)0x00000000)
  484. #define RTC_CALIBOUTPUT_1HZ ((uint32_t)0x00080000)
  485. #define IS_RTC_CALIB_OUTPUT(OUTPUT) (((OUTPUT) == RTC_CALIBOUTPUT_512HZ) || \
  486. ((OUTPUT) == RTC_CALIBOUTPUT_1HZ))
  487. /**
  488. * @}
  489. */
  490. #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
  491. /** @defgroup RTC_Alarm_Sub_Seconds_Value Alarm Sub Seconds Value
  492. * @{
  493. */
  494. #define IS_RTC_ALARM_SUB_SECOND_VALUE(VALUE) ((VALUE) <= (uint32_t)0x00007FFF)
  495. /**
  496. * @}
  497. */
  498. /** @defgroup RTC_Alarm_Sub_Seconds_Masks_Definitions Alarm Sub Seconds Masks Definitions
  499. * @{
  500. */
  501. #define RTC_ALARMSUBSECONDMASK_ALL ((uint32_t)0x00000000) /*!< All Alarm SS fields are masked.
  502. There is no comparison on sub seconds
  503. for Alarm */
  504. #define RTC_ALARMSUBSECONDMASK_SS14_1 ((uint32_t)0x01000000) /*!< SS[14:1] are don't care in Alarm
  505. comparison. Only SS[0] is compared. */
  506. #define RTC_ALARMSUBSECONDMASK_SS14_2 ((uint32_t)0x02000000) /*!< SS[14:2] are don't care in Alarm
  507. comparison. Only SS[1:0] are compared */
  508. #define RTC_ALARMSUBSECONDMASK_SS14_3 ((uint32_t)0x03000000) /*!< SS[14:3] are don't care in Alarm
  509. comparison. Only SS[2:0] are compared */
  510. #define RTC_ALARMSUBSECONDMASK_SS14_4 ((uint32_t)0x04000000) /*!< SS[14:4] are don't care in Alarm
  511. comparison. Only SS[3:0] are compared */
  512. #define RTC_ALARMSUBSECONDMASK_SS14_5 ((uint32_t)0x05000000) /*!< SS[14:5] are don't care in Alarm
  513. comparison. Only SS[4:0] are compared */
  514. #define RTC_ALARMSUBSECONDMASK_SS14_6 ((uint32_t)0x06000000) /*!< SS[14:6] are don't care in Alarm
  515. comparison. Only SS[5:0] are compared */
  516. #define RTC_ALARMSUBSECONDMASK_SS14_7 ((uint32_t)0x07000000) /*!< SS[14:7] are don't care in Alarm
  517. comparison. Only SS[6:0] are compared */
  518. #define RTC_ALARMSUBSECONDMASK_SS14_8 ((uint32_t)0x08000000) /*!< SS[14:8] are don't care in Alarm
  519. comparison. Only SS[7:0] are compared */
  520. #define RTC_ALARMSUBSECONDMASK_SS14_9 ((uint32_t)0x09000000) /*!< SS[14:9] are don't care in Alarm
  521. comparison. Only SS[8:0] are compared */
  522. #define RTC_ALARMSUBSECONDMASK_SS14_10 ((uint32_t)0x0A000000) /*!< SS[14:10] are don't care in Alarm
  523. comparison. Only SS[9:0] are compared */
  524. #define RTC_ALARMSUBSECONDMASK_SS14_11 ((uint32_t)0x0B000000) /*!< SS[14:11] are don't care in Alarm
  525. comparison. Only SS[10:0] are compared */
  526. #define RTC_ALARMSUBSECONDMASK_SS14_12 ((uint32_t)0x0C000000) /*!< SS[14:12] are don't care in Alarm
  527. comparison.Only SS[11:0] are compared */
  528. #define RTC_ALARMSUBSECONDMASK_SS14_13 ((uint32_t)0x0D000000) /*!< SS[14:13] are don't care in Alarm
  529. comparison. Only SS[12:0] are compared */
  530. #define RTC_ALARMSUBSECONDMASK_SS14 ((uint32_t)0x0E000000) /*!< SS[14] is don't care in Alarm
  531. comparison.Only SS[13:0] are compared */
  532. #define RTC_ALARMSUBSECONDMASK_NONE ((uint32_t)0x0F000000) /*!< SS[14:0] are compared and must match
  533. to activate alarm. */
  534. #define IS_RTC_ALARM_SUB_SECOND_MASK(MASK) (((MASK) == RTC_ALARMSUBSECONDMASK_ALL) || \
  535. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_1) || \
  536. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_2) || \
  537. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_3) || \
  538. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_4) || \
  539. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_5) || \
  540. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_6) || \
  541. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_7) || \
  542. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_8) || \
  543. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_9) || \
  544. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_10) || \
  545. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_11) || \
  546. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_12) || \
  547. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_13) || \
  548. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14) || \
  549. ((MASK) == RTC_ALARMSUBSECONDMASK_NONE))
  550. /**
  551. * @}
  552. */
  553. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
  554. /**
  555. * @}
  556. */
  557. /* Exported macro ------------------------------------------------------------*/
  558. /** @defgroup RTCEx_Exported_Macros RTCEx Exported Macros
  559. * @{
  560. */
  561. /**
  562. * @brief Enable the RTC WakeUp Timer peripheral.
  563. * @param __HANDLE__: specifies the RTC handle.
  564. * @retval None
  565. */
  566. #define __HAL_RTC_WAKEUPTIMER_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_WUTE))
  567. /**
  568. * @brief Enable the RTC TimeStamp peripheral.
  569. * @param __HANDLE__: specifies the RTC handle.
  570. * @retval None
  571. */
  572. #define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_TSE))
  573. /**
  574. * @brief Disable the RTC WakeUp Timer peripheral.
  575. * @param __HANDLE__: specifies the RTC handle.
  576. * @retval None
  577. */
  578. #define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_WUTE))
  579. /**
  580. * @brief Disable the RTC TimeStamp peripheral.
  581. * @param __HANDLE__: specifies the RTC handle.
  582. * @retval None
  583. */
  584. #define __HAL_RTC_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_TSE))
  585. /**
  586. * @brief Enable the Coarse calibration process.
  587. * @param __HANDLE__: specifies the RTC handle.
  588. * @retval None
  589. */
  590. #define __HAL_RTC_COARSE_CALIB_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_DCE))
  591. /**
  592. * @brief Disable the Coarse calibration process.
  593. * @param __HANDLE__: specifies the RTC handle.
  594. * @retval None
  595. */
  596. #define __HAL_RTC_COARSE_CALIB_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_DCE))
  597. /**
  598. * @brief Enable the RTC calibration output.
  599. * @param __HANDLE__: specifies the RTC handle.
  600. * @retval None
  601. */
  602. #define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_COE))
  603. /**
  604. * @brief Disable the calibration output.
  605. * @param __HANDLE__: specifies the RTC handle.
  606. * @retval None
  607. */
  608. #define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_COE))
  609. /**
  610. * @brief Enable the clock reference detection.
  611. * @param __HANDLE__: specifies the RTC handle.
  612. * @retval None
  613. */
  614. #define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_REFCKON))
  615. /**
  616. * @brief Disable the clock reference detection.
  617. * @param __HANDLE__: specifies the RTC handle.
  618. * @retval None
  619. */
  620. #define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_REFCKON))
  621. /**
  622. * @brief Enable the RTC TimeStamp interrupt.
  623. * @param __HANDLE__: specifies the RTC handle.
  624. * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled.
  625. * This parameter can be:
  626. * @arg RTC_IT_TS: TimeStamp interrupt
  627. * @retval None
  628. */
  629. #define __HAL_RTC_TIMESTAMP_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
  630. /**
  631. * @brief Enable the RTC WakeUpTimer interrupt.
  632. * @param __HANDLE__: specifies the RTC handle.
  633. * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled.
  634. * This parameter can be:
  635. * @arg RTC_IT_WUT: WakeUpTimer A interrupt
  636. * @retval None
  637. */
  638. #define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
  639. /**
  640. * @brief Disable the RTC TimeStamp interrupt.
  641. * @param __HANDLE__: specifies the RTC handle.
  642. * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled.
  643. * This parameter can be:
  644. * @arg RTC_IT_TS: TimeStamp interrupt
  645. * @retval None
  646. */
  647. #define __HAL_RTC_TIMESTAMP_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
  648. /**
  649. * @brief Disable the RTC WakeUpTimer interrupt.
  650. * @param __HANDLE__: specifies the RTC handle.
  651. * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled.
  652. * This parameter can be:
  653. * @arg RTC_IT_WUT: WakeUpTimer A interrupt
  654. * @retval None
  655. */
  656. #define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
  657. #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
  658. /**
  659. * @brief Check whether the specified RTC Tamper interrupt has occurred or not.
  660. * @param __HANDLE__: specifies the RTC handle.
  661. * @param __FLAG__: specifies the RTC Tamper interrupt sources to be enabled or disabled.
  662. * This parameter can be:
  663. * @arg RTC_IT_TAMP1
  664. * @arg RTC_IT_TAMP2
  665. * @arg RTC_IT_TAMP3
  666. * @retval None
  667. */
  668. #else
  669. /**
  670. * @brief Check whether the specified RTC Tamper interrupt has occurred or not.
  671. * @param __HANDLE__: specifies the RTC handle.
  672. * @param __FLAG__: specifies the RTC Tamper interrupt sources to be enabled or disabled.
  673. * This parameter can be:
  674. * @arg RTC_IT_TAMP1
  675. * @retval None
  676. */
  677. #endif
  678. #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & ((__FLAG__)>> 4)) != RESET)? SET : RESET)
  679. /**
  680. * @brief Check whether the specified RTC WakeUpTimer interrupt has occurred or not.
  681. * @param __HANDLE__: specifies the RTC handle.
  682. * @param __FLAG__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled.
  683. * This parameter can be:
  684. * @arg RTC_IT_WUT: WakeUpTimer A interrupt
  685. * @retval None
  686. */
  687. #define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & ((__FLAG__)>> 4)) != RESET)? SET : RESET)
  688. /**
  689. * @brief Check whether the specified RTC TimeStamp interrupt has occurred or not.
  690. * @param __HANDLE__: specifies the RTC handle.
  691. * @param __FLAG__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled.
  692. * This parameter can be:
  693. * @arg RTC_IT_TS: TimeStamp interrupt
  694. * @retval None
  695. */
  696. #define __HAL_RTC_TIMESTAMP_GET_IT(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & ((__FLAG__)>> 4)) != RESET)? SET : RESET)
  697. /**
  698. * @brief Get the selected RTC TimeStamp's flag status.
  699. * @param __HANDLE__: specifies the RTC handle.
  700. * @param __FLAG__: specifies the RTC TimeStamp Flag sources to be enabled or disabled.
  701. * This parameter can be:
  702. * @arg RTC_FLAG_TSF
  703. * @arg RTC_FLAG_TSOVF
  704. * @retval None
  705. */
  706. #define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
  707. /**
  708. * @brief Get the selected RTC WakeUpTimer's flag status.
  709. * @param __HANDLE__: specifies the RTC handle.
  710. * @param __FLAG__: specifies the RTC WakeUpTimer Flag sources to be enabled or disabled.
  711. * This parameter can be:
  712. * @arg RTC_FLAG_WUTF
  713. * @arg RTC_FLAG_WUTWF
  714. * @retval None
  715. */
  716. #define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
  717. /**
  718. * @brief Get the selected RTC Tamper's flag status.
  719. * @param __HANDLE__: specifies the RTC handle.
  720. * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled.
  721. * This parameter can be:
  722. * @arg RTC_FLAG_TAMP1F
  723. * @retval None
  724. */
  725. #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
  726. #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
  727. /**
  728. * @brief Get the selected RTC shift operation's flag status.
  729. * @param __HANDLE__: specifies the RTC handle.
  730. * @param __FLAG__: specifies the RTC shift operation Flag is pending or not.
  731. * This parameter can be:
  732. * @arg RTC_FLAG_SHPF
  733. * @retval None
  734. */
  735. #define __HAL_RTC_SHIFT_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
  736. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
  737. /**
  738. * @brief Clear the RTC Time Stamp's pending flags.
  739. * @param __HANDLE__: specifies the RTC handle.
  740. * @param __FLAG__: specifies the RTC Alarm Flag sources to be enabled or disabled.
  741. * This parameter can be:
  742. * @arg RTC_FLAG_TSF
  743. * @retval None
  744. */
  745. #define __HAL_RTC_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& 0x0000FFFF)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
  746. /**
  747. * @brief Clear the RTC Tamper's pending flags.
  748. * @param __HANDLE__: specifies the RTC handle.
  749. * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled.
  750. * This parameter can be:
  751. * @arg RTC_FLAG_TAMP1F
  752. * @retval None
  753. */
  754. #define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& 0x0000FFFF)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
  755. /**
  756. * @brief Clear the RTC Wake Up timer's pending flags.
  757. * @param __HANDLE__: specifies the RTC handle.
  758. * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled.
  759. * This parameter can be:
  760. * @arg RTC_FLAG_WUTF
  761. * @retval None
  762. */
  763. #define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& 0x0000FFFF)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
  764. /**
  765. * @}
  766. */
  767. /* Exported functions --------------------------------------------------------*/
  768. /** @addtogroup RTCEx_Exported_Functions
  769. * @{
  770. */
  771. /* RTC TimeStamp and Tamper functions *****************************************/
  772. /** @addtogroup RTCEx_Exported_Functions_Group4
  773. * @{
  774. */
  775. HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge);
  776. HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge);
  777. HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc);
  778. HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format);
  779. HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
  780. HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
  781. HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper);
  782. void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc);
  783. void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc);
  784. #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
  785. void HAL_RTCEx_Tamper2EventCallback(RTC_HandleTypeDef *hrtc);
  786. void HAL_RTCEx_Tamper3EventCallback(RTC_HandleTypeDef *hrtc);
  787. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
  788. void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc);
  789. HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
  790. HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
  791. #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
  792. HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
  793. HAL_StatusTypeDef HAL_RTCEx_PollForTamper3Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
  794. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
  795. /**
  796. * @}
  797. */
  798. /* RTC Wake-up functions ******************************************************/
  799. /** @addtogroup RTCEx_Exported_Functions_Group5
  800. * @{
  801. */
  802. HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
  803. HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
  804. uint32_t HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc);
  805. uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc);
  806. void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc);
  807. void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc);
  808. HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
  809. /**
  810. * @}
  811. */
  812. /* Extension Control functions ************************************************/
  813. /** @addtogroup RTCEx_Exported_Functions_Group7
  814. * @{
  815. */
  816. void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data);
  817. uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister);
  818. HAL_StatusTypeDef HAL_RTCEx_SetCoarseCalib(RTC_HandleTypeDef *hrtc, uint32_t CalibSign, uint32_t Value);
  819. HAL_StatusTypeDef HAL_RTCEx_DeactivateCoarseCalib(RTC_HandleTypeDef *hrtc);
  820. #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC) || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined(STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
  821. HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmouthCalibMinusPulsesValue);
  822. HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS);
  823. HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc, uint32_t CalibOutput);
  824. #else
  825. HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc);
  826. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L152xE || STM32L162xE */
  827. HAL_StatusTypeDef HAL_RTCEx_DeactivateCalibrationOutPut(RTC_HandleTypeDef *hrtc);
  828. HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc);
  829. HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc);
  830. HAL_StatusTypeDef HAL_RTCEx_EnableBypassShadow(RTC_HandleTypeDef *hrtc);
  831. HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef *hrtc);
  832. /**
  833. * @}
  834. */
  835. /* Extension RTC features functions *******************************************/
  836. /** @addtogroup RTCEx_Exported_Functions_Group8
  837. * @{
  838. */
  839. void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc);
  840. HAL_StatusTypeDef HAL_RTCEx_PollForAlarmBEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
  841. /**
  842. * @}
  843. */
  844. /**
  845. * @}
  846. */
  847. /**
  848. * @}
  849. */
  850. /**
  851. * @}
  852. */
  853. #ifdef __cplusplus
  854. }
  855. #endif
  856. #endif /* __STM32L1xx_HAL_RTC_EX_H */
  857. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/