stm32l1xx_hal_rtc_ex.h 72 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291
  1. /**
  2. ******************************************************************************
  3. * @file stm32l1xx_hal_rtc_ex.h
  4. * @author MCD Application Team
  5. * @brief Header file of RTC HAL Extension module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; COPYRIGHT(c) 2017 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. /* Define to prevent recursive inclusion -------------------------------------*/
  36. #ifndef __STM32L1xx_HAL_RTC_EX_H
  37. #define __STM32L1xx_HAL_RTC_EX_H
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41. /* Includes ------------------------------------------------------------------*/
  42. #include "stm32l1xx_hal_def.h"
  43. /** @addtogroup STM32L1xx_HAL_Driver
  44. * @{
  45. */
  46. /** @addtogroup RTCEx
  47. * @{
  48. */
  49. /* Exported types ------------------------------------------------------------*/
  50. /** @defgroup RTCEx_Exported_Types RTCEx Exported Types
  51. * @{
  52. */
  53. /**
  54. * @brief RTC Tamper structure definition
  55. */
  56. typedef struct
  57. {
  58. uint32_t Tamper; /*!< Specifies the Tamper Pin.
  59. This parameter can be a value of @ref RTCEx_Tamper_Pins_Definitions */
  60. uint32_t Trigger; /*!< Specifies the Tamper Trigger.
  61. This parameter can be a value of @ref RTCEx_Tamper_Trigger_Definitions */
  62. #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(STM32L151xDX) || defined (STM32L152xE) || defined (STM32L152xDX) || defined (STM32L162xE) || defined (STM32L162xDX)
  63. uint32_t Filter; /*!< Specifies the RTC Filter Tamper.
  64. This parameter can be a value of @ref RTCEx_Tamper_Filter_Definitions */
  65. uint32_t SamplingFrequency; /*!< Specifies the sampling frequency.
  66. This parameter can be a value of @ref RTCEx_Tamper_Sampling_Frequencies_Definitions */
  67. uint32_t PrechargeDuration; /*!< Specifies the Precharge Duration .
  68. This parameter can be a value of @ref RTCEx_Tamper_Pin_Precharge_Duration_Definitions */
  69. uint32_t TamperPullUp; /*!< Specifies the Tamper PullUp .
  70. This parameter can be a value of @ref RTCEx_Tamper_Pull_Up_Definitions */
  71. uint32_t TimeStampOnTamperDetection; /*!< Specifies the TimeStampOnTamperDetection.
  72. This parameter can be a value of @ref RTCEx_Tamper_TimeStampOnTamperDetection_Definitions */
  73. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  74. }RTC_TamperTypeDef;
  75. /**
  76. * @brief RTC Time structure definition
  77. */
  78. typedef struct
  79. {
  80. uint8_t Hours; /*!< Specifies the RTC Time Hour.
  81. This parameter must be a number between Min_Data = 0 and Max_Data = 12 if the RTC_HourFormat_12 is selected
  82. This parameter must be a number between Min_Data = 0 and Max_Data = 23 if the RTC_HourFormat_24 is selected */
  83. uint8_t Minutes; /*!< Specifies the RTC Time Minutes.
  84. This parameter must be a number between Min_Data = 0 and Max_Data = 59 */
  85. uint8_t Seconds; /*!< Specifies the RTC Time Seconds.
  86. This parameter must be a number between Min_Data = 0 and Max_Data = 59 */
  87. uint8_t TimeFormat; /*!< Specifies the RTC AM/PM Time.
  88. This parameter can be a value of @ref RTC_AM_PM_Definitions */
  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(STM32L151xDX) || defined (STM32L152xE) || defined (STM32L152xDX) || defined (STM32L162xE) || defined (STM32L162xDX)
  90. uint32_t SubSeconds; /*!< Specifies the RTC_SSR RTC Sub Second register content.
  91. This parameter corresponds to a time unit range between [0-1] Second
  92. with [1 Sec / SecondFraction +1] granularity */
  93. uint32_t SecondFraction; /*!< Specifies the range or granularity of Sub Second register content
  94. corresponding to Synchronous pre-scaler factor value (PREDIV_S)
  95. This parameter corresponds to a time unit range between [0-1] Second
  96. with [1 Sec / SecondFraction +1] granularity.
  97. This field will be used only by HAL_RTC_GetTime function */
  98. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  99. uint32_t DayLightSaving; /*!< Specifies RTC_DayLightSaveOperation: the value of hour adjustment.
  100. This parameter can be a value of @ref RTC_DayLightSaving_Definitions */
  101. uint32_t StoreOperation; /*!< Specifies RTC_StoreOperation value to be written in the BKP bit
  102. in CR register to store the operation.
  103. This parameter can be a value of @ref RTC_StoreOperation_Definitions */
  104. }RTC_TimeTypeDef;
  105. /**
  106. * @brief RTC Alarm structure definition
  107. */
  108. typedef struct
  109. {
  110. RTC_TimeTypeDef AlarmTime; /*!< Specifies the RTC Alarm Time members */
  111. uint32_t AlarmMask; /*!< Specifies the RTC Alarm Masks.
  112. This parameter can be a value of @ref RTC_AlarmMask_Definitions */
  113. #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(STM32L151xDX) || defined (STM32L152xE) || defined (STM32L152xDX) || defined (STM32L162xE) || defined (STM32L162xDX)
  114. uint32_t AlarmSubSecondMask; /*!< Specifies the RTC Alarm SubSeconds Masks.
  115. This parameter can be a value of @ref RTC_Alarm_Sub_Seconds_Masks_Definitions */
  116. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  117. uint32_t AlarmDateWeekDaySel; /*!< Specifies the RTC Alarm is on Date or WeekDay.
  118. This parameter can be a value of @ref RTC_AlarmDateWeekDay_Definitions */
  119. uint8_t AlarmDateWeekDay; /*!< Specifies the RTC Alarm Date/WeekDay.
  120. If the Alarm Date is selected, this parameter must be set to a value in the 1-31 range.
  121. If the Alarm WeekDay is selected, this parameter can be a value of @ref RTC_WeekDay_Definitions */
  122. uint32_t Alarm; /*!< Specifies the alarm .
  123. This parameter can be a value of @ref RTC_Alarms_Definitions */
  124. }RTC_AlarmTypeDef;
  125. /**
  126. * @}
  127. */
  128. /* Exported constants --------------------------------------------------------*/
  129. /** @defgroup RTCEx_Exported_Constants RTCEx Exported Constants
  130. * @{
  131. */
  132. /** @defgroup RTC_Masks_Definitions Masks Definitions
  133. * @{
  134. */
  135. #define RTC_TR_RESERVED_MASK (0x007F7F7FU)
  136. #define RTC_DR_RESERVED_MASK (0x00FFFF3FU)
  137. #define RTC_INIT_MASK (0xFFFFFFFFU)
  138. #define RTC_RSF_MASK (0xFFFFFF5FU)
  139. #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(STM32L151xDX) || defined (STM32L152xE) || defined (STM32L152xDX) || defined (STM32L162xE) || defined (STM32L162xDX)
  140. #define RTC_FLAGS_MASK ((uint32_t)(RTC_FLAG_ALRAWF | RTC_FLAG_ALRBWF | RTC_FLAG_WUTWF | \
  141. RTC_FLAG_SHPF | RTC_FLAG_INITS | RTC_FLAG_RSF | \
  142. RTC_FLAG_INITF | RTC_FLAG_ALRAF | RTC_FLAG_ALRBF | \
  143. RTC_FLAG_WUTF | RTC_FLAG_TSF | RTC_FLAG_TSOVF | \
  144. RTC_FLAG_TAMP1F | RTC_FLAG_TAMP2F | RTC_FLAG_TAMP3F | \
  145. RTC_FLAG_RECALPF))
  146. #else
  147. #define RTC_FLAGS_MASK ((uint32_t)(RTC_FLAG_ALRAWF | RTC_FLAG_ALRBWF | RTC_FLAG_WUTWF | \
  148. RTC_FLAG_SHPF | RTC_FLAG_INITS | RTC_FLAG_RSF | \
  149. RTC_FLAG_INITF | RTC_FLAG_ALRAF | RTC_FLAG_ALRBF | \
  150. RTC_FLAG_WUTF | RTC_FLAG_TSF | RTC_FLAG_TSOVF | \
  151. RTC_FLAG_TAMP1F | \
  152. RTC_FLAG_RECALPF))
  153. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  154. /**
  155. * @}
  156. */
  157. /** @defgroup RTC_Synchronous_Predivider Synchronous Predivider
  158. * @{
  159. */
  160. #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(STM32L151xDX) || defined (STM32L152xE) || defined (STM32L152xDX) || defined (STM32L162xE) || defined (STM32L162xDX)
  161. #define IS_RTC_SYNCH_PREDIV(PREDIV) ((PREDIV) <= 0x7FFFU)
  162. #elif defined(STM32L100xB) || defined (STM32L151xB) || defined (STM32L152xB)
  163. #define IS_RTC_SYNCH_PREDIV(PREDIV) ((PREDIV) <= 0x1FFFU)
  164. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  165. /**
  166. * @}
  167. */
  168. /** @defgroup RTC_Interrupts_Definitions Interrupts Definitions
  169. * @{
  170. */
  171. #define RTC_IT_TS ((uint32_t)RTC_CR_TSIE)
  172. #define RTC_IT_WUT ((uint32_t)RTC_CR_WUTIE)
  173. #define RTC_IT_ALRB ((uint32_t)RTC_CR_ALRBIE)
  174. #define RTC_IT_ALRA ((uint32_t)RTC_CR_ALRAIE)
  175. #define RTC_IT_TAMP1 ((uint32_t)(RTC_TAFCR_TAMPIE | RTC_TAFCR_TAMP1E))
  176. #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(STM32L151xDX) || defined (STM32L152xE) || defined (STM32L152xDX) || defined (STM32L162xE) || defined (STM32L162xDX)
  177. #define RTC_IT_TAMP2 ((uint32_t)(RTC_TAFCR_TAMPIE | RTC_TAFCR_TAMP2E))
  178. #define RTC_IT_TAMP3 ((uint32_t)(RTC_TAFCR_TAMPIE | RTC_TAFCR_TAMP3E))
  179. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  180. /**
  181. * @}
  182. */
  183. /** @defgroup RTC_Flags_Definitions Flags Definitions
  184. * @{
  185. */
  186. #define RTC_FLAG_RECALPF ((uint32_t)RTC_ISR_RECALPF)
  187. #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(STM32L151xDX) || defined (STM32L152xE) || defined (STM32L152xDX) || defined (STM32L162xE) || defined (STM32L162xDX)
  188. #define RTC_FLAG_TAMP3F ((uint32_t)RTC_ISR_TAMP3F)
  189. #define RTC_FLAG_TAMP2F ((uint32_t)RTC_ISR_TAMP2F)
  190. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  191. #define RTC_FLAG_TAMP1F ((uint32_t)RTC_ISR_TAMP1F)
  192. #define RTC_FLAG_TSOVF ((uint32_t)RTC_ISR_TSOVF)
  193. #define RTC_FLAG_TSF ((uint32_t)RTC_ISR_TSF)
  194. #define RTC_FLAG_WUTF ((uint32_t)RTC_ISR_WUTF)
  195. #define RTC_FLAG_ALRBF ((uint32_t)RTC_ISR_ALRBF)
  196. #define RTC_FLAG_ALRAF ((uint32_t)RTC_ISR_ALRAF)
  197. #define RTC_FLAG_INITF ((uint32_t)RTC_ISR_INITF)
  198. #define RTC_FLAG_RSF ((uint32_t)RTC_ISR_RSF)
  199. #define RTC_FLAG_INITS ((uint32_t)RTC_ISR_INITS)
  200. #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(STM32L151xDX) || defined (STM32L152xE) || defined (STM32L152xDX) || defined (STM32L162xE) || defined (STM32L162xDX)
  201. #define RTC_FLAG_SHPF ((uint32_t)RTC_ISR_SHPF)
  202. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  203. #define RTC_FLAG_WUTWF ((uint32_t)RTC_ISR_WUTWF)
  204. #define RTC_FLAG_ALRBWF ((uint32_t)RTC_ISR_ALRBWF)
  205. #define RTC_FLAG_ALRAWF ((uint32_t)RTC_ISR_ALRAWF)
  206. /**
  207. * @}
  208. */
  209. /** @defgroup RTCEx_Output_selection_Definitions Output selection Definitions
  210. * @{
  211. */
  212. #define RTC_OUTPUT_DISABLE (0x00000000U)
  213. #define RTC_OUTPUT_ALARMA (0x00200000U)
  214. #define RTC_OUTPUT_ALARMB (0x00400000U)
  215. #define RTC_OUTPUT_WAKEUP (0x00600000U)
  216. #define IS_RTC_OUTPUT(OUTPUT) (((OUTPUT) == RTC_OUTPUT_DISABLE) || \
  217. ((OUTPUT) == RTC_OUTPUT_ALARMA) || \
  218. ((OUTPUT) == RTC_OUTPUT_ALARMB) || \
  219. ((OUTPUT) == RTC_OUTPUT_WAKEUP))
  220. /**
  221. * @}
  222. */
  223. /** @defgroup RTCEx_Backup_Registers_Definitions Backup Registers Definitions
  224. * @{
  225. */
  226. #if RTC_BKP_NUMBER > 0
  227. #define RTC_BKP_DR0 (0x00000000U)
  228. #define RTC_BKP_DR1 (0x00000001U)
  229. #define RTC_BKP_DR2 (0x00000002U)
  230. #define RTC_BKP_DR3 (0x00000003U)
  231. #define RTC_BKP_DR4 (0x00000004U)
  232. #endif /* RTC_BKP_NUMBER > 0 */
  233. #if RTC_BKP_NUMBER > 5
  234. #define RTC_BKP_DR5 (0x00000005U)
  235. #define RTC_BKP_DR6 (0x00000006U)
  236. #define RTC_BKP_DR7 (0x00000007U)
  237. #define RTC_BKP_DR8 (0x00000008U)
  238. #define RTC_BKP_DR9 (0x00000009U)
  239. #define RTC_BKP_DR10 (0x0000000AU)
  240. #define RTC_BKP_DR11 (0x0000000BU)
  241. #define RTC_BKP_DR12 (0x0000000CU)
  242. #define RTC_BKP_DR13 (0x0000000DU)
  243. #define RTC_BKP_DR14 (0x0000000EU)
  244. #define RTC_BKP_DR15 (0x0000000FU)
  245. #define RTC_BKP_DR16 (0x00000010U)
  246. #define RTC_BKP_DR17 (0x00000011U)
  247. #define RTC_BKP_DR18 (0x00000012U)
  248. #define RTC_BKP_DR19 (0x00000013U)
  249. #endif /* RTC_BKP_NUMBER > 5 */
  250. #if RTC_BKP_NUMBER > 20
  251. #define RTC_BKP_DR20 (0x00000014U)
  252. #define RTC_BKP_DR21 (0x00000015U)
  253. #define RTC_BKP_DR22 (0x00000016U)
  254. #define RTC_BKP_DR23 (0x00000017U)
  255. #define RTC_BKP_DR24 (0x00000018U)
  256. #define RTC_BKP_DR25 (0x00000019U)
  257. #define RTC_BKP_DR26 (0x0000001AU)
  258. #define RTC_BKP_DR27 (0x0000001BU)
  259. #define RTC_BKP_DR28 (0x0000001CU)
  260. #define RTC_BKP_DR29 (0x0000001DU)
  261. #define RTC_BKP_DR30 (0x0000001EU)
  262. #define RTC_BKP_DR31 (0x0000001FU)
  263. #endif /* RTC_BKP_NUMBER > 20 */
  264. #define IS_RTC_BKP(BKP) ((BKP) < (uint32_t) RTC_BKP_NUMBER)
  265. /**
  266. * @}
  267. */
  268. /** @defgroup RTCEx_Time_Stamp_Edges_Definitions Time Stamp Edges Definitions
  269. * @{
  270. */
  271. #define RTC_TIMESTAMPEDGE_RISING (0x00000000U)
  272. #define RTC_TIMESTAMPEDGE_FALLING (0x00000008U)
  273. #define IS_TIMESTAMP_EDGE(EDGE) (((EDGE) == RTC_TIMESTAMPEDGE_RISING) || \
  274. ((EDGE) == RTC_TIMESTAMPEDGE_FALLING))
  275. /**
  276. * @}
  277. */
  278. /** @defgroup RTCEx_Tamper_Pins_Definitions Tamper Pins Definitions
  279. * @{
  280. */
  281. #define RTC_TAMPER_1 RTC_TAFCR_TAMP1E
  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(STM32L151xDX) || defined (STM32L152xE) || defined (STM32L152xDX) || defined (STM32L162xE) || defined (STM32L162xDX)
  283. #define RTC_TAMPER_2 RTC_TAFCR_TAMP2E
  284. #define RTC_TAMPER_3 RTC_TAFCR_TAMP3E
  285. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  286. #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(STM32L151xDX) || defined (STM32L152xE) || defined (STM32L152xDX) || defined (STM32L162xE) || defined (STM32L162xDX)
  287. #define IS_RTC_TAMPER(TAMPER) (((~(RTC_TAMPER_1|RTC_TAMPER_2|RTC_TAMPER_3) & (TAMPER)) == (uint32_t)RESET) && ((TAMPER) != (uint32_t)RESET))
  288. #else
  289. #define IS_RTC_TAMPER(TAMPER) ((TAMPER) == RTC_TAMPER_1)
  290. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  291. /**
  292. * @}
  293. */
  294. /** @defgroup RTCEx_Tamper_Trigger_Definitions Tamper Trigger Definitions
  295. * @{
  296. */
  297. #define RTC_TAMPERTRIGGER_RISINGEDGE (0x00000000U)
  298. #define RTC_TAMPERTRIGGER_FALLINGEDGE (0x00000002U)
  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(STM32L151xDX) || defined (STM32L152xE) || defined (STM32L152xDX) || defined (STM32L162xE) || defined (STM32L162xDX)
  300. #define RTC_TAMPERTRIGGER_LOWLEVEL RTC_TAMPERTRIGGER_RISINGEDGE
  301. #define RTC_TAMPERTRIGGER_HIGHLEVEL RTC_TAMPERTRIGGER_FALLINGEDGE
  302. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  303. #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(STM32L151xDX) || defined (STM32L152xE) || defined (STM32L152xDX) || defined (STM32L162xE) || defined (STM32L162xDX)
  304. #define IS_RTC_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TAMPERTRIGGER_RISINGEDGE) || \
  305. ((TRIGGER) == RTC_TAMPERTRIGGER_FALLINGEDGE) || \
  306. ((TRIGGER) == RTC_TAMPERTRIGGER_LOWLEVEL) || \
  307. ((TRIGGER) == RTC_TAMPERTRIGGER_HIGHLEVEL))
  308. #elif defined(STM32L100xB) || defined (STM32L151xB) || defined (STM32L152xB)
  309. #define IS_RTC_TAMPER_TRIGGER(TRIGGER) (((TRIGGER) == RTC_TAMPERTRIGGER_RISINGEDGE) || \
  310. ((TRIGGER) == RTC_TAMPERTRIGGER_FALLINGEDGE))
  311. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  312. /**
  313. * @}
  314. */
  315. #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(STM32L151xDX) || defined (STM32L152xE) || defined (STM32L152xDX) || defined (STM32L162xE) || defined (STM32L162xDX)
  316. /** @defgroup RTCEx_Tamper_Filter_Definitions Tamper Filter Definitions
  317. * @{
  318. */
  319. #define RTC_TAMPERFILTER_DISABLE (0x00000000U) /*!< Tamper filter is disabled */
  320. #define RTC_TAMPERFILTER_2SAMPLE (0x00000800U) /*!< Tamper is activated after 2
  321. consecutive samples at the active level */
  322. #define RTC_TAMPERFILTER_4SAMPLE (0x00001000U) /*!< Tamper is activated after 4
  323. consecutive samples at the active level */
  324. #define RTC_TAMPERFILTER_8SAMPLE (0x00001800U) /*!< Tamper is activated after 8
  325. consecutive samples at the active level. */
  326. #define IS_RTC_TAMPER_FILTER(FILTER) (((FILTER) == RTC_TAMPERFILTER_DISABLE) || \
  327. ((FILTER) == RTC_TAMPERFILTER_2SAMPLE) || \
  328. ((FILTER) == RTC_TAMPERFILTER_4SAMPLE) || \
  329. ((FILTER) == RTC_TAMPERFILTER_8SAMPLE))
  330. /**
  331. * @}
  332. */
  333. /** @defgroup RTCEx_Tamper_Sampling_Frequencies_Definitions Tamper Sampling Frequencies
  334. * @{
  335. */
  336. #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768 (0x00000000U) /*!< Each of the tamper inputs are sampled
  337. with a frequency = RTCCLK / 32768 */
  338. #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384 (0x00000100U) /*!< Each of the tamper inputs are sampled
  339. with a frequency = RTCCLK / 16384 */
  340. #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192 (0x00000200U) /*!< Each of the tamper inputs are sampled
  341. with a frequency = RTCCLK / 8192 */
  342. #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096 (0x00000300U) /*!< Each of the tamper inputs are sampled
  343. with a frequency = RTCCLK / 4096 */
  344. #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048 (0x00000400U) /*!< Each of the tamper inputs are sampled
  345. with a frequency = RTCCLK / 2048 */
  346. #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024 (0x00000500U) /*!< Each of the tamper inputs are sampled
  347. with a frequency = RTCCLK / 1024 */
  348. #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512 (0x00000600U) /*!< Each of the tamper inputs are sampled
  349. with a frequency = RTCCLK / 512 */
  350. #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256 (0x00000700U) /*!< Each of the tamper inputs are sampled
  351. with a frequency = RTCCLK / 256 */
  352. #define IS_RTC_TAMPER_SAMPLING_FREQ(FREQ) (((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768)|| \
  353. ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384)|| \
  354. ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192) || \
  355. ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096) || \
  356. ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048) || \
  357. ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024) || \
  358. ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512) || \
  359. ((FREQ) == RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256))
  360. /**
  361. * @}
  362. */
  363. /** @defgroup RTCEx_Tamper_Pin_Precharge_Duration_Definitions Tamper Pin Precharge Duration
  364. * @{
  365. */
  366. #define RTC_TAMPERPRECHARGEDURATION_1RTCCLK (0x00000000U) /*!< Tamper pins are pre-charged before
  367. sampling during 1 RTCCLK cycle */
  368. #define RTC_TAMPERPRECHARGEDURATION_2RTCCLK (0x00002000U) /*!< Tamper pins are pre-charged before
  369. sampling during 2 RTCCLK cycles */
  370. #define RTC_TAMPERPRECHARGEDURATION_4RTCCLK (0x00004000U) /*!< Tamper pins are pre-charged before
  371. sampling during 4 RTCCLK cycles */
  372. #define RTC_TAMPERPRECHARGEDURATION_8RTCCLK (0x00006000U) /*!< Tamper pins are pre-charged before
  373. sampling during 8 RTCCLK cycles */
  374. #define IS_RTC_TAMPER_PRECHARGE_DURATION(DURATION) (((DURATION) == RTC_TAMPERPRECHARGEDURATION_1RTCCLK) || \
  375. ((DURATION) == RTC_TAMPERPRECHARGEDURATION_2RTCCLK) || \
  376. ((DURATION) == RTC_TAMPERPRECHARGEDURATION_4RTCCLK) || \
  377. ((DURATION) == RTC_TAMPERPRECHARGEDURATION_8RTCCLK))
  378. /**
  379. * @}
  380. */
  381. /** @defgroup RTCEx_Tamper_TimeStampOnTamperDetection_Definitions TimeStampOnTamperDetection Definitions
  382. * @{
  383. */
  384. #define RTC_TIMESTAMPONTAMPERDETECTION_ENABLE ((uint32_t)RTC_TAFCR_TAMPTS) /*!< TimeStamp on Tamper Detection event saved */
  385. #define RTC_TIMESTAMPONTAMPERDETECTION_DISABLE (0x00000000U) /*!< TimeStamp on Tamper Detection event is not saved */
  386. #define IS_RTC_TAMPER_TIMESTAMPONTAMPER_DETECTION(DETECTION) (((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_ENABLE) || \
  387. ((DETECTION) == RTC_TIMESTAMPONTAMPERDETECTION_DISABLE))
  388. /**
  389. * @}
  390. */
  391. /** @defgroup RTCEx_Tamper_Pull_Up_Definitions Tamper Pull-Up Definitions
  392. * @{
  393. */
  394. #define RTC_TAMPER_PULLUP_ENABLE (0x00000000U) /*!< TimeStamp on Tamper Detection event saved */
  395. #define RTC_TAMPER_PULLUP_DISABLE (RTC_TAFCR_TAMPPUDIS) /*!< TimeStamp on Tamper Detection event is not saved */
  396. #define IS_RTC_TAMPER_PULLUP_STATE(STATE) (((STATE) == RTC_TAMPER_PULLUP_ENABLE) || \
  397. ((STATE) == RTC_TAMPER_PULLUP_DISABLE))
  398. /**
  399. * @}
  400. */
  401. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  402. /** @defgroup RTCEx_Wakeup_Timer_Definitions Wakeup Timer Definitions
  403. * @{
  404. */
  405. #define RTC_WAKEUPCLOCK_RTCCLK_DIV16 (0x00000000U)
  406. #define RTC_WAKEUPCLOCK_RTCCLK_DIV8 (0x00000001U)
  407. #define RTC_WAKEUPCLOCK_RTCCLK_DIV4 (0x00000002U)
  408. #define RTC_WAKEUPCLOCK_RTCCLK_DIV2 (0x00000003U)
  409. #define RTC_WAKEUPCLOCK_CK_SPRE_16BITS (0x00000004U)
  410. #define RTC_WAKEUPCLOCK_CK_SPRE_17BITS (0x00000006U)
  411. #define IS_RTC_WAKEUP_CLOCK(CLOCK) (((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV16) || \
  412. ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV8) || \
  413. ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV4) || \
  414. ((CLOCK) == RTC_WAKEUPCLOCK_RTCCLK_DIV2) || \
  415. ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_16BITS) || \
  416. ((CLOCK) == RTC_WAKEUPCLOCK_CK_SPRE_17BITS))
  417. #define IS_RTC_WAKEUP_COUNTER(COUNTER) ((COUNTER) <= 0xFFFF)
  418. /**
  419. * @}
  420. */
  421. /** @defgroup RTCEx_Digital_Calibration_Definitions Digital Calibration Definitions
  422. * @{
  423. */
  424. #define RTC_CALIBSIGN_POSITIVE (0x00000000U)
  425. #define RTC_CALIBSIGN_NEGATIVE (0x00000080U)
  426. #define IS_RTC_CALIB_SIGN(SIGN) (((SIGN) == RTC_CALIBSIGN_POSITIVE) || \
  427. ((SIGN) == RTC_CALIBSIGN_NEGATIVE))
  428. #define IS_RTC_CALIB_VALUE(VALUE) ((VALUE) < 0x20)
  429. /**
  430. * @}
  431. */
  432. /** @defgroup RTCEx_Smooth_Calib_Period_Definitions Smooth Calib Period Definitions
  433. * @{
  434. */
  435. #define RTC_SMOOTHCALIB_PERIOD_32SEC (0x00000000U) /*!< If RTCCLK = 32768 Hz, Smooth calibation
  436. period is 32s, else 2exp20 RTCCLK seconds */
  437. #define RTC_SMOOTHCALIB_PERIOD_16SEC (0x00002000U) /*!< If RTCCLK = 32768 Hz, Smooth calibation
  438. period is 16s, else 2exp19 RTCCLK seconds */
  439. #define RTC_SMOOTHCALIB_PERIOD_8SEC (0x00004000U) /*!< If RTCCLK = 32768 Hz, Smooth calibation
  440. period is 8s, else 2exp18 RTCCLK seconds */
  441. #define IS_RTC_SMOOTH_CALIB_PERIOD(PERIOD) (((PERIOD) == RTC_SMOOTHCALIB_PERIOD_32SEC) || \
  442. ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_16SEC) || \
  443. ((PERIOD) == RTC_SMOOTHCALIB_PERIOD_8SEC))
  444. /**
  445. * @}
  446. */
  447. /** @defgroup RTCEx_Smooth_Calib_Plus_Pulses_Definitions Smooth Calib Plus Pulses Definitions
  448. * @{
  449. */
  450. #define RTC_SMOOTHCALIB_PLUSPULSES_SET (0x00008000U) /*!< The number of RTCCLK pulses added
  451. during a X -second window = Y - CALM[8:0]
  452. with Y = 512, 256, 128 when X = 32, 16, 8 */
  453. #define RTC_SMOOTHCALIB_PLUSPULSES_RESET (0x00000000U) /*!< The number of RTCCLK pulses subbstited
  454. during a 32-second window = CALM[8:0] */
  455. #define IS_RTC_SMOOTH_CALIB_PLUS(PLUS) (((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_SET) || \
  456. ((PLUS) == RTC_SMOOTHCALIB_PLUSPULSES_RESET))
  457. /**
  458. * @}
  459. */
  460. /** @defgroup RTCEx_Smooth_Calib_Minus_Pulses_Definitions Smooth Calib Minus Pulses Definitions
  461. * @{
  462. */
  463. #define IS_RTC_SMOOTH_CALIB_MINUS(VALUE) ((VALUE) <= 0x000001FFU)
  464. /**
  465. * @}
  466. */
  467. /** @defgroup RTCEx_Add_1_Second_Parameter_Definitions Add 1 Second Parameter Definitions
  468. * @{
  469. */
  470. #define RTC_SHIFTADD1S_RESET (0x00000000U)
  471. #define RTC_SHIFTADD1S_SET (0x80000000U)
  472. #define IS_RTC_SHIFT_ADD1S(SEL) (((SEL) == RTC_SHIFTADD1S_RESET) || \
  473. ((SEL) == RTC_SHIFTADD1S_SET))
  474. /**
  475. * @}
  476. */
  477. /** @defgroup RTCEx_Substract_Fraction_Of_Second_Value Substract Fraction Of Second Value
  478. * @{
  479. */
  480. #define IS_RTC_SHIFT_SUBFS(FS) ((FS) <= 0x00007FFFU)
  481. /**
  482. * @}
  483. */
  484. /** @defgroup RTCEx_Calib_Output_Selection_Definitions Calib Output Selection Definitions
  485. * @{
  486. */
  487. #define RTC_CALIBOUTPUT_512HZ (0x00000000U)
  488. #define RTC_CALIBOUTPUT_1HZ (0x00080000U)
  489. #define IS_RTC_CALIB_OUTPUT(OUTPUT) (((OUTPUT) == RTC_CALIBOUTPUT_512HZ) || \
  490. ((OUTPUT) == RTC_CALIBOUTPUT_1HZ))
  491. /**
  492. * @}
  493. */
  494. #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(STM32L151xDX) || defined (STM32L152xE) || defined (STM32L152xDX) || defined (STM32L162xE) || defined (STM32L162xDX)
  495. /** @defgroup RTC_Alarm_Sub_Seconds_Value Alarm Sub Seconds Value
  496. * @{
  497. */
  498. #define IS_RTC_ALARM_SUB_SECOND_VALUE(VALUE) ((VALUE) <= 0x00007FFFU)
  499. /**
  500. * @}
  501. */
  502. /** @defgroup RTC_Alarm_Sub_Seconds_Masks_Definitions Alarm Sub Seconds Masks Definitions
  503. * @{
  504. */
  505. #define RTC_ALARMSUBSECONDMASK_ALL (0x00000000U) /*!< All Alarm SS fields are masked.
  506. There is no comparison on sub seconds
  507. for Alarm */
  508. #define RTC_ALARMSUBSECONDMASK_SS14_1 (0x01000000U) /*!< SS[14:1] are don't care in Alarm
  509. comparison. Only SS[0] is compared. */
  510. #define RTC_ALARMSUBSECONDMASK_SS14_2 (0x02000000U) /*!< SS[14:2] are don't care in Alarm
  511. comparison. Only SS[1:0] are compared */
  512. #define RTC_ALARMSUBSECONDMASK_SS14_3 (0x03000000U) /*!< SS[14:3] are don't care in Alarm
  513. comparison. Only SS[2:0] are compared */
  514. #define RTC_ALARMSUBSECONDMASK_SS14_4 (0x04000000U) /*!< SS[14:4] are don't care in Alarm
  515. comparison. Only SS[3:0] are compared */
  516. #define RTC_ALARMSUBSECONDMASK_SS14_5 (0x05000000U) /*!< SS[14:5] are don't care in Alarm
  517. comparison. Only SS[4:0] are compared */
  518. #define RTC_ALARMSUBSECONDMASK_SS14_6 (0x06000000U) /*!< SS[14:6] are don't care in Alarm
  519. comparison. Only SS[5:0] are compared */
  520. #define RTC_ALARMSUBSECONDMASK_SS14_7 (0x07000000U) /*!< SS[14:7] are don't care in Alarm
  521. comparison. Only SS[6:0] are compared */
  522. #define RTC_ALARMSUBSECONDMASK_SS14_8 (0x08000000U) /*!< SS[14:8] are don't care in Alarm
  523. comparison. Only SS[7:0] are compared */
  524. #define RTC_ALARMSUBSECONDMASK_SS14_9 (0x09000000U) /*!< SS[14:9] are don't care in Alarm
  525. comparison. Only SS[8:0] are compared */
  526. #define RTC_ALARMSUBSECONDMASK_SS14_10 (0x0A000000U) /*!< SS[14:10] are don't care in Alarm
  527. comparison. Only SS[9:0] are compared */
  528. #define RTC_ALARMSUBSECONDMASK_SS14_11 (0x0B000000U) /*!< SS[14:11] are don't care in Alarm
  529. comparison. Only SS[10:0] are compared */
  530. #define RTC_ALARMSUBSECONDMASK_SS14_12 (0x0C000000U) /*!< SS[14:12] are don't care in Alarm
  531. comparison.Only SS[11:0] are compared */
  532. #define RTC_ALARMSUBSECONDMASK_SS14_13 (0x0D000000U) /*!< SS[14:13] are don't care in Alarm
  533. comparison. Only SS[12:0] are compared */
  534. #define RTC_ALARMSUBSECONDMASK_SS14 (0x0E000000U) /*!< SS[14] is don't care in Alarm
  535. comparison.Only SS[13:0] are compared */
  536. #define RTC_ALARMSUBSECONDMASK_NONE (0x0F000000U) /*!< SS[14:0] are compared and must match
  537. to activate alarm. */
  538. #define IS_RTC_ALARM_SUB_SECOND_MASK(MASK) (((MASK) == RTC_ALARMSUBSECONDMASK_ALL) || \
  539. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_1) || \
  540. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_2) || \
  541. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_3) || \
  542. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_4) || \
  543. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_5) || \
  544. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_6) || \
  545. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_7) || \
  546. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_8) || \
  547. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_9) || \
  548. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_10) || \
  549. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_11) || \
  550. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_12) || \
  551. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14_13) || \
  552. ((MASK) == RTC_ALARMSUBSECONDMASK_SS14) || \
  553. ((MASK) == RTC_ALARMSUBSECONDMASK_NONE))
  554. /**
  555. * @}
  556. */
  557. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  558. /**
  559. * @}
  560. */
  561. /* Exported macro ------------------------------------------------------------*/
  562. /** @defgroup RTCEx_Exported_Macros RTCEx Exported Macros
  563. * @{
  564. */
  565. /**
  566. * @brief Enable the RTC WakeUp Timer peripheral.
  567. * @param __HANDLE__: specifies the RTC handle.
  568. * @retval None
  569. */
  570. #define __HAL_RTC_WAKEUPTIMER_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_WUTE))
  571. /**
  572. * @brief Enable the RTC TimeStamp peripheral.
  573. * @param __HANDLE__: specifies the RTC handle.
  574. * @retval None
  575. */
  576. #define __HAL_RTC_TIMESTAMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_TSE))
  577. /**
  578. * @brief Disable the RTC WakeUp Timer peripheral.
  579. * @param __HANDLE__: specifies the RTC handle.
  580. * @retval None
  581. */
  582. #define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_WUTE))
  583. /**
  584. * @brief Disable the RTC TimeStamp peripheral.
  585. * @param __HANDLE__: specifies the RTC handle.
  586. * @retval None
  587. */
  588. #define __HAL_RTC_TIMESTAMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_TSE))
  589. /**
  590. * @brief Enable the Coarse calibration process.
  591. * @param __HANDLE__: specifies the RTC handle.
  592. * @retval None
  593. */
  594. #define __HAL_RTC_COARSE_CALIB_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_DCE))
  595. /**
  596. * @brief Disable the Coarse calibration process.
  597. * @param __HANDLE__: specifies the RTC handle.
  598. * @retval None
  599. */
  600. #define __HAL_RTC_COARSE_CALIB_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_DCE))
  601. /**
  602. * @brief Enable the RTC calibration output.
  603. * @param __HANDLE__: specifies the RTC handle.
  604. * @retval None
  605. */
  606. #define __HAL_RTC_CALIBRATION_OUTPUT_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_COE))
  607. /**
  608. * @brief Disable the calibration output.
  609. * @param __HANDLE__: specifies the RTC handle.
  610. * @retval None
  611. */
  612. #define __HAL_RTC_CALIBRATION_OUTPUT_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_COE))
  613. /**
  614. * @brief Enable the clock reference detection.
  615. * @param __HANDLE__: specifies the RTC handle.
  616. * @retval None
  617. */
  618. #define __HAL_RTC_CLOCKREF_DETECTION_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_REFCKON))
  619. /**
  620. * @brief Disable the clock reference detection.
  621. * @param __HANDLE__: specifies the RTC handle.
  622. * @retval None
  623. */
  624. #define __HAL_RTC_CLOCKREF_DETECTION_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_REFCKON))
  625. /**
  626. * @brief Enable the RTC TimeStamp interrupt.
  627. * @param __HANDLE__: specifies the RTC handle.
  628. * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled.
  629. * This parameter can be:
  630. * @arg RTC_IT_TS: TimeStamp interrupt
  631. * @retval None
  632. */
  633. #define __HAL_RTC_TIMESTAMP_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
  634. /**
  635. * @brief Enable the RTC WakeUpTimer interrupt.
  636. * @param __HANDLE__: specifies the RTC handle.
  637. * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled.
  638. * This parameter can be:
  639. * @arg RTC_IT_WUT: WakeUpTimer A interrupt
  640. * @retval None
  641. */
  642. #define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
  643. /**
  644. * @brief Disable the RTC TimeStamp interrupt.
  645. * @param __HANDLE__: specifies the RTC handle.
  646. * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled.
  647. * This parameter can be:
  648. * @arg RTC_IT_TS: TimeStamp interrupt
  649. * @retval None
  650. */
  651. #define __HAL_RTC_TIMESTAMP_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
  652. /**
  653. * @brief Disable the RTC WakeUpTimer interrupt.
  654. * @param __HANDLE__: specifies the RTC handle.
  655. * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled.
  656. * This parameter can be:
  657. * @arg RTC_IT_WUT: WakeUpTimer A interrupt
  658. * @retval None
  659. */
  660. #define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
  661. /**
  662. * @brief Enable the RTC Tamper1 input detection.
  663. * @param __HANDLE__: specifies the RTC handle.
  664. * @retval None
  665. */
  666. #define __HAL_RTC_TAMPER1_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->TAFCR, RTC_TAFCR_TAMP1E)
  667. /**
  668. * @brief Disable the RTC Tamper1 input detection.
  669. * @param __HANDLE__: specifies the RTC handle.
  670. * @retval None
  671. */
  672. #define __HAL_RTC_TAMPER1_DISABLE(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->TAFCR, RTC_TAFCR_TAMP1E)
  673. #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC)\
  674. || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA)\
  675. || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA)\
  676. || defined (STM32L162xD) || defined(STM32L151xE) || defined(STM32L151xDX) || defined (STM32L152xE) || defined (STM32L152xDX) || defined (STM32L162xE) || defined (STM32L162xDX)
  677. /**
  678. * @brief Enable the RTC Tamper2 input detection.
  679. * @param __HANDLE__: specifies the RTC handle.
  680. * @retval None
  681. */
  682. #define __HAL_RTC_TAMPER2_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->TAFCR, RTC_TAFCR_TAMP2E)
  683. /**
  684. * @brief Disable the RTC Tamper2 input detection.
  685. * @param __HANDLE__: specifies the RTC handle.
  686. * @retval None
  687. */
  688. #define __HAL_RTC_TAMPER2_DISABLE(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->TAFCR, RTC_TAFCR_TAMP2E)
  689. /**
  690. * @brief Enable the RTC Tamper3 input detection.
  691. * @param __HANDLE__: specifies the RTC handle.
  692. * @retval None
  693. */
  694. #define __HAL_RTC_TAMPER3_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->TAFCR, RTC_TAFCR_TAMP3E)
  695. /**
  696. * @brief Disable the RTC Tamper3 input detection.
  697. * @param __HANDLE__: specifies the RTC handle.
  698. * @retval None
  699. */
  700. #define __HAL_RTC_TAMPER3_DISABLE(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->TAFCR, RTC_TAFCR_TAMP3E)
  701. /**
  702. * @brief Check whether the specified RTC Tamper interrupt has occurred or not.
  703. * @param __HANDLE__: specifies the RTC handle.
  704. * @param __INTERRUPT__: specifies the RTC Tamper interrupt to check.
  705. * This parameter can be:
  706. * @arg RTC_IT_TAMP1: Tamper1 interrupt
  707. * @arg RTC_IT_TAMP2: Tamper2 interrupt
  708. * @arg RTC_IT_TAMP3: Tamper3 interrupt
  709. * @retval None
  710. */
  711. #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) == RTC_IT_TAMP1) ? (((((__HANDLE__)->Instance->ISR) & RTC_ISR_TAMP1F) != RESET) ? SET : RESET) : \
  712. ((__INTERRUPT__) == RTC_IT_TAMP2) ? (((((__HANDLE__)->Instance->ISR) & RTC_ISR_TAMP2F) != RESET) ? SET : RESET) : \
  713. (((((__HANDLE__)->Instance->ISR) & RTC_ISR_TAMP3F) != RESET) ? SET : RESET))
  714. #else
  715. /**
  716. * @brief Check whether the specified RTC Tamper interrupt has occurred or not.
  717. * @param __HANDLE__: specifies the RTC handle.
  718. * @param __INTERRUPT__: specifies the RTC Tamper interrupt to check.
  719. * This parameter can be:
  720. * @arg RTC_IT_TAMP1: Tamper1 interrupt
  721. * @retval None
  722. */
  723. #define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & RTC_ISR_TAMP1F) != RESET) ? SET : RESET)
  724. #endif
  725. /**
  726. * @brief Enable the RTC Tamper interrupt.
  727. * @param __HANDLE__: specifies the RTC handle.
  728. * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be enabled
  729. * This parameter can be any combination of the following values:
  730. * @arg RTC_IT_TAMP1: Tamper1 interrupt
  731. * @arg RTC_IT_TAMP2: Tamper2 interrupt (*)
  732. * @arg RTC_IT_TAMP3: Tamper3 interrupt (*)
  733. * @note (*) Available only on devices STM32L100xBA, STM32L151xBA, STM32L152xBA, STM32L100xC,
  734. * STM32L151xC, STM32L152xC, STM32L162xC, STM32L151xCA, STM32L151xD, STM32L152xCA,
  735. * STM32L152xD, STM32L162xCA, STM32L162xD, STM32L151xE, STM32L152xE, STM32L162xE
  736. * STM32L151xDX, STM32L152xDX, STM32L162xDX
  737. * @retval None
  738. */
  739. #define __HAL_RTC_TAMPER_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT(((__HANDLE__)->Instance->TAFCR), RTC_TAFCR_TAMPIE)
  740. /**
  741. * @brief Disable the RTC Tamper interrupt.
  742. * @param __HANDLE__: specifies the RTC handle.
  743. * @param __INTERRUPT__: specifies the RTC Tamper interrupt sources to be disabled.
  744. * This parameter can be any combination of the following values:
  745. * @arg RTC_IT_TAMP1: Tamper1 interrupt
  746. * @arg RTC_IT_TAMP2: Tamper2 interrupt (*)
  747. * @arg RTC_IT_TAMP3: Tamper3 interrupt (*)
  748. * @note (*) Available only on devices STM32L100xBA, STM32L151xBA, STM32L152xBA, STM32L100xC,
  749. * STM32L151xC, STM32L152xC, STM32L162xC, STM32L151xCA, STM32L151xD, STM32L152xCA,
  750. * STM32L152xD, STM32L162xCA, STM32L162xD, STM32L151xE, STM32L152xE, STM32L162xE
  751. * STM32L151xDX, STM32L152xDX, STM32L162xDX
  752. * @retval None
  753. */
  754. #define __HAL_RTC_TAMPER_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BIT(((__HANDLE__)->Instance->TAFCR), RTC_TAFCR_TAMPIE)
  755. /**
  756. * @brief Check whether the specified RTC Tamper interrupt has been enabled or not.
  757. * @param __HANDLE__: specifies the RTC handle.
  758. * @param __INTERRUPT__: specifies the RTC Tamper interrupt source to check.
  759. * This parameter can be:
  760. * @arg RTC_IT_TAMP1: Tamper1 interrupt
  761. * @arg RTC_IT_TAMP2: Tamper2 interrupt (*)
  762. * @arg RTC_IT_TAMP3: Tamper3 interrupt (*)
  763. * @note (*) Available only on devices STM32L100xBA, STM32L151xBA, STM32L152xBA, STM32L100xC,
  764. * STM32L151xC, STM32L152xC, STM32L162xC, STM32L151xCA, STM32L151xD, STM32L152xCA,
  765. * STM32L152xD, STM32L162xCA, STM32L162xD, STM32L151xE, STM32L152xE, STM32L162xE
  766. * STM32L151xDX, STM32L152xDX, STM32L162xDX
  767. * @retval None
  768. */
  769. #define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->TAFCR) & RTC_TAFCR_TAMPIE) != RESET) ? SET : RESET)
  770. /**
  771. * @brief Check whether the specified RTC WakeUpTimer interrupt has occurred or not.
  772. * @param __HANDLE__: specifies the RTC handle.
  773. * @param __FLAG__: specifies the RTC WakeUpTimer interrupt sources to be enabled or disabled.
  774. * This parameter can be:
  775. * @arg RTC_IT_WUT: WakeUpTimer A interrupt
  776. * @retval None
  777. */
  778. #define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & ((__FLAG__)>> 4)) != RESET)? SET : RESET)
  779. /**
  780. * @brief Check whether the specified RTC Wake Up timer interrupt has been enabled or not.
  781. * @param __HANDLE__: specifies the RTC handle.
  782. * @param __INTERRUPT__: specifies the RTC Wake Up timer interrupt sources to check.
  783. * This parameter can be:
  784. * @arg RTC_IT_WUT: WakeUpTimer interrupt
  785. * @retval None
  786. */
  787. #define __HAL_RTC_WAKEUPTIMER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
  788. /**
  789. * @brief Check whether the specified RTC TimeStamp interrupt has occurred or not.
  790. * @param __HANDLE__: specifies the RTC handle.
  791. * @param __INTERRUPT__: specifies the RTC TimeStamp interrupt sources to be enabled or disabled.
  792. * This parameter can be:
  793. * @arg RTC_IT_TS: TimeStamp interrupt
  794. * @retval None
  795. */
  796. #define __HAL_RTC_TIMESTAMP_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4)) != RESET)? SET : RESET)
  797. /**
  798. * @brief Check whether the specified RTC Time Stamp interrupt has been enabled or not.
  799. * @param __HANDLE__: specifies the RTC handle.
  800. * @param __INTERRUPT__: specifies the RTC Time Stamp interrupt source to check.
  801. * This parameter can be:
  802. * @arg RTC_IT_TS: TimeStamp interrupt
  803. * @retval None
  804. */
  805. #define __HAL_RTC_TIMESTAMP_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
  806. /**
  807. * @brief Get the selected RTC TimeStamp's flag status.
  808. * @param __HANDLE__: specifies the RTC handle.
  809. * @param __FLAG__: specifies the RTC TimeStamp Flag sources to be enabled or disabled.
  810. * This parameter can be:
  811. * @arg RTC_FLAG_TSF
  812. * @arg RTC_FLAG_TSOVF
  813. * @retval None
  814. */
  815. #define __HAL_RTC_TIMESTAMP_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
  816. /**
  817. * @brief Get the selected RTC WakeUpTimer's flag status.
  818. * @param __HANDLE__: specifies the RTC handle.
  819. * @param __FLAG__: specifies the RTC WakeUpTimer Flag sources to be enabled or disabled.
  820. * This parameter can be:
  821. * @arg RTC_FLAG_WUTF
  822. * @arg RTC_FLAG_WUTWF
  823. * @retval None
  824. */
  825. #define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
  826. /**
  827. * @brief Get the selected RTC Tamper's flag status.
  828. * @param __HANDLE__: specifies the RTC handle.
  829. * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled.
  830. * This parameter can be:
  831. * @arg RTC_FLAG_TAMP1F
  832. * @arg RTC_FLAG_TAMP2F (*)
  833. * @arg RTC_FLAG_TAMP3F (*)
  834. * @note (*) Available only on devices STM32L100xBA, STM32L151xBA, STM32L152xBA, STM32L100xC,
  835. * STM32L151xC, STM32L152xC, STM32L162xC, STM32L151xCA, STM32L151xD, STM32L152xCA,
  836. * STM32L152xD, STM32L162xCA, STM32L162xD, STM32L151xE, STM32L152xE, STM32L162xE
  837. * STM32L151xDX, STM32L152xDX, STM32L162xDX
  838. * @retval None
  839. */
  840. #define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
  841. #if defined(STM32L100xBA) || defined (STM32L151xBA) || defined (STM32L152xBA) || defined(STM32L100xC)\
  842. || defined (STM32L151xC) || defined (STM32L152xC) || defined (STM32L162xC) || defined(STM32L151xCA)\
  843. || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA)\
  844. || defined (STM32L162xD) || defined(STM32L151xE) || defined(STM32L151xDX) || defined (STM32L152xE) || defined (STM32L152xDX) || defined (STM32L162xE) || defined (STM32L162xDX)
  845. /**
  846. * @brief Get the selected RTC shift operation's flag status.
  847. * @param __HANDLE__: specifies the RTC handle.
  848. * @param __FLAG__: specifies the RTC shift operation Flag is pending or not.
  849. * This parameter can be:
  850. * @arg RTC_FLAG_SHPF
  851. * @retval None
  852. */
  853. #define __HAL_RTC_SHIFT_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET)? SET : RESET)
  854. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  855. /**
  856. * @brief Clear the RTC Time Stamp's pending flags.
  857. * @param __HANDLE__: specifies the RTC handle.
  858. * @param __FLAG__: specifies the RTC Alarm Flag sources to be enabled or disabled.
  859. * This parameter can be:
  860. * @arg RTC_FLAG_TSF
  861. * @retval None
  862. */
  863. #define __HAL_RTC_TIMESTAMP_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
  864. /**
  865. * @brief Clear the RTC Tamper's pending flags.
  866. * @param __HANDLE__: specifies the RTC handle.
  867. * @param __FLAG__: specifies the RTC Tamper Flag sources to be enabled or disabled.
  868. * This parameter can be:
  869. * @arg RTC_FLAG_TAMP1F
  870. * @arg RTC_FLAG_TAMP2F (*)
  871. * @arg RTC_FLAG_TAMP3F (*)
  872. * @note (*) Available only on devices STM32L100xBA, STM32L151xBA, STM32L152xBA, STM32L100xC,
  873. * STM32L151xC, STM32L152xC, STM32L162xC, STM32L151xCA, STM32L151xD, STM32L152xCA,
  874. * STM32L152xD, STM32L162xCA, STM32L162xD, STM32L151xE, STM32L152xE, STM32L162xE
  875. * STM32L151xDX, STM32L152xDX, STM32L162xDX
  876. * @retval None
  877. */
  878. #define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
  879. /**
  880. * @brief Clear the RTC Wake Up timer's pending flags.
  881. * @param __HANDLE__: specifies the RTC handle.
  882. * @param __FLAG__: specifies the RTC WakeUpTimer Flag to clear.
  883. * This parameter can be:
  884. * @arg RTC_FLAG_WUTF
  885. * @retval None
  886. */
  887. #define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
  888. /**
  889. * @brief Enable interrupt on the RTC WakeUp Timer associated Exti line.
  890. * @retval None
  891. */
  892. #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
  893. /**
  894. * @brief Disable interrupt on the RTC WakeUp Timer associated Exti line.
  895. * @retval None
  896. */
  897. #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
  898. /**
  899. * @brief Enable event on the RTC WakeUp Timer associated Exti line.
  900. * @retval None.
  901. */
  902. #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
  903. /**
  904. * @brief Disable event on the RTC WakeUp Timer associated Exti line.
  905. * @retval None.
  906. */
  907. #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
  908. /**
  909. * @brief Enable falling edge trigger on the RTC WakeUp Timer associated Exti line.
  910. * @retval None.
  911. */
  912. #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
  913. /**
  914. * @brief Disable falling edge trigger on the RTC WakeUp Timer associated Exti line.
  915. * @retval None.
  916. */
  917. #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
  918. /**
  919. * @brief Enable rising edge trigger on the RTC WakeUp Timer associated Exti line.
  920. * @retval None.
  921. */
  922. #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
  923. /**
  924. * @brief Disable rising edge trigger on the RTC WakeUp Timer associated Exti line.
  925. * @retval None.
  926. */
  927. #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
  928. /**
  929. * @brief Enable rising & falling edge trigger on the RTC WakeUp Timer associated Exti line.
  930. * @retval None.
  931. */
  932. #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_FALLING_EDGE() do { __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE();__HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE(); } while(0);
  933. /**
  934. * @brief Disable rising & falling edge trigger on the RTC WakeUp Timer associated Exti line.
  935. * This parameter can be:
  936. * @retval None.
  937. */
  938. #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_FALLING_EDGE() do { __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE();__HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE(); } while(0);
  939. /**
  940. * @brief Check whether the RTC WakeUp Timer associated Exti line interrupt flag is set or not.
  941. * @retval Line Status.
  942. */
  943. #define __HAL_RTC_WAKEUPTIMER_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
  944. /**
  945. * @brief Clear the RTC WakeUp Timer associated Exti line flag.
  946. * @retval None.
  947. */
  948. #define __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
  949. /**
  950. * @brief Generate a Software interrupt on the RTC WakeUp Timer associated Exti line.
  951. * @retval None.
  952. */
  953. #define __HAL_RTC_WAKEUPTIMER_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
  954. /**
  955. * @brief Enable interrupt on the RTC Tamper and Timestamp associated Exti line.
  956. * @retval None
  957. */
  958. #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
  959. /**
  960. * @brief Disable interrupt on the RTC Tamper and Timestamp associated Exti line.
  961. * @retval None
  962. */
  963. #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
  964. /**
  965. * @brief Enable event on the RTC Tamper and Timestamp associated Exti line.
  966. * @retval None.
  967. */
  968. #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
  969. /**
  970. * @brief Disable event on the RTC Tamper and Timestamp associated Exti line.
  971. * @retval None.
  972. */
  973. #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
  974. /**
  975. * @brief Enable falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
  976. * @retval None.
  977. */
  978. #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
  979. /**
  980. * @brief Disable falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
  981. * @retval None.
  982. */
  983. #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
  984. /**
  985. * @brief Enable rising edge trigger on the RTC Tamper and Timestamp associated Exti line.
  986. * @retval None.
  987. */
  988. #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
  989. /**
  990. * @brief Disable rising edge trigger on the RTC Tamper and Timestamp associated Exti line.
  991. * @retval None.
  992. */
  993. #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT))
  994. /**
  995. * @brief Enable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
  996. * @retval None.
  997. */
  998. #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_FALLING_EDGE() do { __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_RISING_EDGE();__HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_FALLING_EDGE(); } while(0);
  999. /**
  1000. * @brief Disable rising & falling edge trigger on the RTC Tamper and Timestamp associated Exti line.
  1001. * This parameter can be:
  1002. * @retval None.
  1003. */
  1004. #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_FALLING_EDGE() do { __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_RISING_EDGE();__HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_FALLING_EDGE(); } while(0);
  1005. /**
  1006. * @brief Check whether the RTC Tamper and Timestamp associated Exti line interrupt flag is set or not.
  1007. * @retval Line Status.
  1008. */
  1009. #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
  1010. /**
  1011. * @brief Clear the RTC Tamper and Timestamp associated Exti line flag.
  1012. * @retval None.
  1013. */
  1014. #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
  1015. /**
  1016. * @brief Generate a Software interrupt on the RTC Tamper and Timestamp associated Exti line
  1017. * @retval None.
  1018. */
  1019. #define __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT)
  1020. /**
  1021. * @}
  1022. */
  1023. /* Exported functions --------------------------------------------------------*/
  1024. /** @addtogroup RTCEx_Exported_Functions
  1025. * @{
  1026. */
  1027. /* RTC TimeStamp and Tamper functions *****************************************/
  1028. /** @addtogroup RTCEx_Exported_Functions_Group4
  1029. * @{
  1030. */
  1031. HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge);
  1032. HAL_StatusTypeDef HAL_RTCEx_SetTimeStamp_IT(RTC_HandleTypeDef *hrtc, uint32_t TimeStampEdge);
  1033. HAL_StatusTypeDef HAL_RTCEx_DeactivateTimeStamp(RTC_HandleTypeDef *hrtc);
  1034. HAL_StatusTypeDef HAL_RTCEx_GetTimeStamp(RTC_HandleTypeDef *hrtc, RTC_TimeTypeDef *sTimeStamp, RTC_DateTypeDef *sTimeStampDate, uint32_t Format);
  1035. HAL_StatusTypeDef HAL_RTCEx_SetTamper(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
  1036. HAL_StatusTypeDef HAL_RTCEx_SetTamper_IT(RTC_HandleTypeDef *hrtc, RTC_TamperTypeDef* sTamper);
  1037. HAL_StatusTypeDef HAL_RTCEx_DeactivateTamper(RTC_HandleTypeDef *hrtc, uint32_t Tamper);
  1038. void HAL_RTCEx_TamperTimeStampIRQHandler(RTC_HandleTypeDef *hrtc);
  1039. void HAL_RTCEx_Tamper1EventCallback(RTC_HandleTypeDef *hrtc);
  1040. #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(STM32L151xDX) || defined (STM32L152xE) || defined (STM32L152xDX) || defined (STM32L162xE) || defined (STM32L162xDX)
  1041. void HAL_RTCEx_Tamper2EventCallback(RTC_HandleTypeDef *hrtc);
  1042. void HAL_RTCEx_Tamper3EventCallback(RTC_HandleTypeDef *hrtc);
  1043. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  1044. void HAL_RTCEx_TimeStampEventCallback(RTC_HandleTypeDef *hrtc);
  1045. HAL_StatusTypeDef HAL_RTCEx_PollForTimeStampEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
  1046. HAL_StatusTypeDef HAL_RTCEx_PollForTamper1Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
  1047. #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(STM32L151xDX) || defined (STM32L152xE) || defined (STM32L152xDX) || defined (STM32L162xE) || defined (STM32L162xDX)
  1048. HAL_StatusTypeDef HAL_RTCEx_PollForTamper2Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
  1049. HAL_StatusTypeDef HAL_RTCEx_PollForTamper3Event(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
  1050. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  1051. /**
  1052. * @}
  1053. */
  1054. /* RTC Wake-up functions ******************************************************/
  1055. /** @addtogroup RTCEx_Exported_Functions_Group5
  1056. * @{
  1057. */
  1058. HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
  1059. HAL_StatusTypeDef HAL_RTCEx_SetWakeUpTimer_IT(RTC_HandleTypeDef *hrtc, uint32_t WakeUpCounter, uint32_t WakeUpClock);
  1060. uint32_t HAL_RTCEx_DeactivateWakeUpTimer(RTC_HandleTypeDef *hrtc);
  1061. uint32_t HAL_RTCEx_GetWakeUpTimer(RTC_HandleTypeDef *hrtc);
  1062. void HAL_RTCEx_WakeUpTimerIRQHandler(RTC_HandleTypeDef *hrtc);
  1063. void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc);
  1064. HAL_StatusTypeDef HAL_RTCEx_PollForWakeUpTimerEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
  1065. /**
  1066. * @}
  1067. */
  1068. /* Extension Control functions ************************************************/
  1069. /** @addtogroup RTCEx_Exported_Functions_Group7
  1070. * @{
  1071. */
  1072. void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data);
  1073. uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister);
  1074. HAL_StatusTypeDef HAL_RTCEx_SetCoarseCalib(RTC_HandleTypeDef *hrtc, uint32_t CalibSign, uint32_t Value);
  1075. HAL_StatusTypeDef HAL_RTCEx_DeactivateCoarseCalib(RTC_HandleTypeDef *hrtc);
  1076. #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(STM32L151xDX) || defined (STM32L152xE) || defined (STM32L152xDX) || defined (STM32L162xE) || defined (STM32L162xDX)
  1077. HAL_StatusTypeDef HAL_RTCEx_SetSmoothCalib(RTC_HandleTypeDef *hrtc, uint32_t SmoothCalibPeriod, uint32_t SmoothCalibPlusPulses, uint32_t SmoothCalibMinusPulsesValue);
  1078. HAL_StatusTypeDef HAL_RTCEx_SetSynchroShift(RTC_HandleTypeDef *hrtc, uint32_t ShiftAdd1S, uint32_t ShiftSubFS);
  1079. HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc, uint32_t CalibOutput);
  1080. #else
  1081. HAL_StatusTypeDef HAL_RTCEx_SetCalibrationOutPut(RTC_HandleTypeDef *hrtc);
  1082. #endif /* STM32L100xBA || STM32L151xBA || STM32L152xBA || STM32L100xC || STM32L151xC || STM32L152xC || STM32L162xC || STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX */
  1083. HAL_StatusTypeDef HAL_RTCEx_DeactivateCalibrationOutPut(RTC_HandleTypeDef *hrtc);
  1084. HAL_StatusTypeDef HAL_RTCEx_SetRefClock(RTC_HandleTypeDef *hrtc);
  1085. HAL_StatusTypeDef HAL_RTCEx_DeactivateRefClock(RTC_HandleTypeDef *hrtc);
  1086. HAL_StatusTypeDef HAL_RTCEx_EnableBypassShadow(RTC_HandleTypeDef *hrtc);
  1087. HAL_StatusTypeDef HAL_RTCEx_DisableBypassShadow(RTC_HandleTypeDef *hrtc);
  1088. /**
  1089. * @}
  1090. */
  1091. /* Extension RTC features functions *******************************************/
  1092. /** @addtogroup RTCEx_Exported_Functions_Group8
  1093. * @{
  1094. */
  1095. void HAL_RTCEx_AlarmBEventCallback(RTC_HandleTypeDef *hrtc);
  1096. HAL_StatusTypeDef HAL_RTCEx_PollForAlarmBEvent(RTC_HandleTypeDef *hrtc, uint32_t Timeout);
  1097. /**
  1098. * @}
  1099. */
  1100. /**
  1101. * @}
  1102. */
  1103. /* Private types -------------------------------------------------------------*/
  1104. /* Private variables ---------------------------------------------------------*/
  1105. /* Private constants ---------------------------------------------------------*/
  1106. /** @defgroup RTCEx_Private_Constants RTCEx Private Constants
  1107. * @{
  1108. */
  1109. #define RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT (0x00080000U) /*!< External interrupt line 19 Connected to the RTC Tamper and Time Stamp events */
  1110. #define RTC_EXTI_LINE_WAKEUPTIMER_EVENT (0x00100000U) /*!< External interrupt line 20 Connected to the RTC Wakeup event */
  1111. /**
  1112. * @}
  1113. */
  1114. /* Private macros ------------------------------------------------------------*/
  1115. /** @defgroup RTCEx_Private_Macros RTCEx Private Macros
  1116. * @{
  1117. */
  1118. /**
  1119. * @}
  1120. */
  1121. /**
  1122. * @}
  1123. */
  1124. /**
  1125. * @}
  1126. */
  1127. #ifdef __cplusplus
  1128. }
  1129. #endif
  1130. #endif /* __STM32L1xx_HAL_RTC_EX_H */
  1131. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/