stm32f1xx_ll_rtc.h 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021
  1. /**
  2. ******************************************************************************
  3. * @file stm32f1xx_ll_rtc.h
  4. * @author MCD Application Team
  5. * @version V1.1.1
  6. * @date 12-May-2017
  7. * @brief Header file of RTC LL module.
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * <h2><center>&copy; COPYRIGHT(c) 2016 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 __STM32F1xx_LL_RTC_H
  39. #define __STM32F1xx_LL_RTC_H
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. /* Includes ------------------------------------------------------------------*/
  44. #include "stm32f1xx.h"
  45. /** @addtogroup STM32F1xx_LL_Driver
  46. * @{
  47. */
  48. #if defined(RTC)
  49. /** @defgroup RTC_LL RTC
  50. * @{
  51. */
  52. /* Private types -------------------------------------------------------------*/
  53. /* Private variables ---------------------------------------------------------*/
  54. /* Private constants ---------------------------------------------------------*/
  55. /* Private macros ------------------------------------------------------------*/
  56. #if defined(USE_FULL_LL_DRIVER)
  57. /** @defgroup RTC_LL_Private_Macros RTC Private Macros
  58. * @{
  59. */
  60. /**
  61. * @}
  62. */
  63. #endif /*USE_FULL_LL_DRIVER*/
  64. /* Exported types ------------------------------------------------------------*/
  65. #if defined(USE_FULL_LL_DRIVER)
  66. /** @defgroup RTC_LL_ES_INIT RTC Exported Init structure
  67. * @{
  68. */
  69. /**
  70. * @brief RTC Init structures definition
  71. */
  72. typedef struct
  73. {
  74. uint32_t AsynchPrescaler; /*!< Specifies the RTC Asynchronous Predivider value.
  75. This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFFFFF
  76. This feature can be modified afterwards using unitary function
  77. @ref LL_RTC_SetAsynchPrescaler(). */
  78. uint32_t OutPutSource; /*!< Specifies which signal will be routed to the RTC Tamper pin.
  79. This parameter can be a value of @ref LL_RTC_Output_Source
  80. This feature can be modified afterwards using unitary function
  81. @ref LL_RTC_SetOutputSource(). */
  82. } LL_RTC_InitTypeDef;
  83. /**
  84. * @brief RTC Time structure definition
  85. */
  86. typedef struct
  87. {
  88. uint8_t Hours; /*!< Specifies the RTC Time Hours.
  89. This parameter must be a number between Min_Data = 0 and Max_Data = 23 */
  90. uint8_t Minutes; /*!< Specifies the RTC Time Minutes.
  91. This parameter must be a number between Min_Data = 0 and Max_Data = 59 */
  92. uint8_t Seconds; /*!< Specifies the RTC Time Seconds.
  93. This parameter must be a number between Min_Data = 0 and Max_Data = 59 */
  94. } LL_RTC_TimeTypeDef;
  95. /**
  96. * @brief RTC Alarm structure definition
  97. */
  98. typedef struct
  99. {
  100. LL_RTC_TimeTypeDef AlarmTime; /*!< Specifies the RTC Alarm Time members. */
  101. } LL_RTC_AlarmTypeDef;
  102. /**
  103. * @}
  104. */
  105. #endif /* USE_FULL_LL_DRIVER */
  106. /* Exported constants --------------------------------------------------------*/
  107. /** @defgroup RTC_LL_Exported_Constants RTC Exported Constants
  108. * @{
  109. */
  110. #if defined(USE_FULL_LL_DRIVER)
  111. /** @defgroup RTC_LL_EC_FORMAT FORMAT
  112. * @{
  113. */
  114. #define LL_RTC_FORMAT_BIN (0x000000000U) /*!< Binary data format */
  115. #define LL_RTC_FORMAT_BCD (0x000000001U) /*!< BCD data format */
  116. /**
  117. * @}
  118. */
  119. #endif /* USE_FULL_LL_DRIVER */
  120. /** @defgroup RTC_LL_EC_BKP BACKUP
  121. * @{
  122. */
  123. #if RTC_BKP_NUMBER > 0
  124. #define LL_RTC_BKP_DR1 (0x00000001U)
  125. #define LL_RTC_BKP_DR2 (0x00000002U)
  126. #define LL_RTC_BKP_DR3 (0x00000003U)
  127. #define LL_RTC_BKP_DR4 (0x00000004U)
  128. #define LL_RTC_BKP_DR5 (0x00000005U)
  129. #define LL_RTC_BKP_DR6 (0x00000006U)
  130. #define LL_RTC_BKP_DR7 (0x00000007U)
  131. #define LL_RTC_BKP_DR8 (0x00000008U)
  132. #define LL_RTC_BKP_DR9 (0x00000009U)
  133. #define LL_RTC_BKP_DR10 (0x0000000AU)
  134. #endif /* RTC_BKP_NUMBER > 0 */
  135. #if RTC_BKP_NUMBER > 10
  136. #define LL_RTC_BKP_DR11 (0x0000000BU)
  137. #define LL_RTC_BKP_DR12 (0x0000000CU)
  138. #define LL_RTC_BKP_DR13 (0x0000000DU)
  139. #define LL_RTC_BKP_DR14 (0x0000000EU)
  140. #define LL_RTC_BKP_DR15 (0x0000000FU)
  141. #define LL_RTC_BKP_DR16 (0x00000010U)
  142. #define LL_RTC_BKP_DR17 (0x00000011U)
  143. #define LL_RTC_BKP_DR18 (0x00000012U)
  144. #define LL_RTC_BKP_DR19 (0x00000013U)
  145. #define LL_RTC_BKP_DR20 (0x00000014U)
  146. #define LL_RTC_BKP_DR21 (0x00000015U)
  147. #define LL_RTC_BKP_DR22 (0x00000016U)
  148. #define LL_RTC_BKP_DR23 (0x00000017U)
  149. #define LL_RTC_BKP_DR24 (0x00000018U)
  150. #define LL_RTC_BKP_DR25 (0x00000019U)
  151. #define LL_RTC_BKP_DR26 (0x0000001AU)
  152. #define LL_RTC_BKP_DR27 (0x0000001BU)
  153. #define LL_RTC_BKP_DR28 (0x0000001CU)
  154. #define LL_RTC_BKP_DR29 (0x0000001DU)
  155. #define LL_RTC_BKP_DR30 (0x0000001EU)
  156. #define LL_RTC_BKP_DR31 (0x0000001FU)
  157. #define LL_RTC_BKP_DR32 (0x00000020U)
  158. #define LL_RTC_BKP_DR33 (0x00000021U)
  159. #define LL_RTC_BKP_DR34 (0x00000022U)
  160. #define LL_RTC_BKP_DR35 (0x00000023U)
  161. #define LL_RTC_BKP_DR36 (0x00000024U)
  162. #define LL_RTC_BKP_DR37 (0x00000025U)
  163. #define LL_RTC_BKP_DR38 (0x00000026U)
  164. #define LL_RTC_BKP_DR39 (0x00000027U)
  165. #define LL_RTC_BKP_DR40 (0x00000028U)
  166. #define LL_RTC_BKP_DR41 (0x00000029U)
  167. #define LL_RTC_BKP_DR42 (0x0000002AU)
  168. #endif /* RTC_BKP_NUMBER > 10 */
  169. /**
  170. * @}
  171. */
  172. /** @defgroup RTC_LL_EC_TAMPLEVEL Tamper Active Level
  173. * @{
  174. */
  175. #define LL_RTC_TAMPER_ACTIVELEVEL_LOW BKP_CR_TPAL /*!< A high level on the TAMPER pin resets all data backup registers (if TPE bit is set) */
  176. #define LL_RTC_TAMPER_ACTIVELEVEL_HIGH (0x00000000U) /*!< A low level on the TAMPER pin resets all data backup registers (if TPE bit is set) */
  177. /**
  178. * @}
  179. */
  180. /** @defgroup LL_RTC_Output_Source Clock Source to output on the Tamper Pin
  181. * @{
  182. */
  183. #define LL_RTC_CALIB_OUTPUT_NONE (0x00000000U) /*!< Calibration output disabled */
  184. #define LL_RTC_CALIB_OUTPUT_RTCCLOCK BKP_RTCCR_CCO /*!< Calibration output is RTC Clock with a frequency divided by 64 on the TAMPER Pin */
  185. #define LL_RTC_CALIB_OUTPUT_ALARM BKP_RTCCR_ASOE /*!< Calibration output is Alarm pulse signal on the TAMPER pin */
  186. #define LL_RTC_CALIB_OUTPUT_SECOND (BKP_RTCCR_ASOS | BKP_RTCCR_ASOE) /*!< Calibration output is Second pulse signal on the TAMPER pin*/
  187. /**
  188. * @}
  189. */
  190. /**
  191. * @}
  192. */
  193. /* Exported macro ------------------------------------------------------------*/
  194. /** @defgroup RTC_LL_Exported_Macros RTC Exported Macros
  195. * @{
  196. */
  197. /** @defgroup RTC_LL_EM_WRITE_READ Common Write and read registers Macros
  198. * @{
  199. */
  200. /**
  201. * @brief Write a value in RTC register
  202. * @param __INSTANCE__ RTC Instance
  203. * @param __REG__ Register to be written
  204. * @param __VALUE__ Value to be written in the register
  205. * @retval None
  206. */
  207. #define LL_RTC_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
  208. /**
  209. * @brief Read a value in RTC register
  210. * @param __INSTANCE__ RTC Instance
  211. * @param __REG__ Register to be read
  212. * @retval Register value
  213. */
  214. #define LL_RTC_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
  215. /**
  216. * @}
  217. */
  218. /** @defgroup RTC_LL_EM_Convert Convert helper Macros
  219. * @{
  220. */
  221. /**
  222. * @brief Helper macro to convert a value from 2 digit decimal format to BCD format
  223. * @param __VALUE__ Byte to be converted
  224. * @retval Converted byte
  225. */
  226. #define __LL_RTC_CONVERT_BIN2BCD(__VALUE__) (uint8_t)((((__VALUE__) / 10U) << 4U) | ((__VALUE__) % 10U))
  227. /**
  228. * @brief Helper macro to convert a value from BCD format to 2 digit decimal format
  229. * @param __VALUE__ BCD value to be converted
  230. * @retval Converted byte
  231. */
  232. #define __LL_RTC_CONVERT_BCD2BIN(__VALUE__) (uint8_t)(((uint8_t)((__VALUE__) & (uint8_t)0xF0U) >> (uint8_t)0x4U) * 10U + ((__VALUE__) & (uint8_t)0x0FU))
  233. /**
  234. * @}
  235. */
  236. /**
  237. * @}
  238. */
  239. /* Exported functions --------------------------------------------------------*/
  240. /** @defgroup RTC_LL_Exported_Functions RTC Exported Functions
  241. * @{
  242. */
  243. /** @defgroup RTC_LL_EF_Configuration Configuration
  244. * @{
  245. */
  246. /**
  247. * @brief Set Asynchronous prescaler factor
  248. * @rmtoll PRLH PRL LL_RTC_SetAsynchPrescaler\n
  249. * @rmtoll PRLL PRL LL_RTC_SetAsynchPrescaler\n
  250. * @param RTCx RTC Instance
  251. * @param AsynchPrescaler Value between Min_Data = 0 and Max_Data = 0xFFFFF
  252. * @retval None
  253. */
  254. __STATIC_INLINE void LL_RTC_SetAsynchPrescaler(RTC_TypeDef *RTCx, uint32_t AsynchPrescaler)
  255. {
  256. MODIFY_REG(RTCx->PRLH, RTC_PRLH_PRL, (AsynchPrescaler >> 16));
  257. MODIFY_REG(RTCx->PRLL, RTC_PRLL_PRL, (AsynchPrescaler & RTC_PRLL_PRL));
  258. }
  259. /**
  260. * @brief Get Asynchronous prescaler factor
  261. * @rmtoll DIVH DIV LL_RTC_GetDivider\n
  262. * @rmtoll DIVL DIV LL_RTC_GetDivider\n
  263. * @param RTCx RTC Instance
  264. * @retval Value between Min_Data = 0 and Max_Data = 0xFFFFF
  265. */
  266. __STATIC_INLINE uint32_t LL_RTC_GetDivider(RTC_TypeDef *RTCx)
  267. {
  268. register uint16_t Highprescaler = 0 , Lowprescaler = 0;
  269. Highprescaler = READ_REG(RTCx->DIVH & RTC_DIVH_RTC_DIV);
  270. Lowprescaler = READ_REG(RTCx->DIVL & RTC_DIVL_RTC_DIV);
  271. return (((uint32_t) Highprescaler << 16U) | Lowprescaler);
  272. }
  273. /**
  274. * @brief Set Output Source
  275. * @rmtoll RTCCR CCO LL_RTC_SetOutputSource
  276. * @rmtoll RTCCR ASOE LL_RTC_SetOutputSource
  277. * @rmtoll RTCCR ASOS LL_RTC_SetOutputSource
  278. * @param BKPx BKP Instance
  279. * @param OutputSource This parameter can be one of the following values:
  280. * @arg @ref LL_RTC_CALIB_OUTPUT_NONE
  281. * @arg @ref LL_RTC_CALIB_OUTPUT_RTCCLOCK
  282. * @arg @ref LL_RTC_CALIB_OUTPUT_ALARM
  283. * @arg @ref LL_RTC_CALIB_OUTPUT_SECOND
  284. * @retval None
  285. */
  286. __STATIC_INLINE void LL_RTC_SetOutputSource(BKP_TypeDef *BKPx, uint32_t OutputSource)
  287. {
  288. MODIFY_REG(BKPx->RTCCR, (BKP_RTCCR_CCO | BKP_RTCCR_ASOE | BKP_RTCCR_ASOS), OutputSource);
  289. }
  290. /**
  291. * @brief Get Output Source
  292. * @rmtoll RTCCR CCO LL_RTC_GetOutPutSource
  293. * @rmtoll RTCCR ASOE LL_RTC_GetOutPutSource
  294. * @rmtoll RTCCR ASOS LL_RTC_GetOutPutSource
  295. * @param BKPx BKP Instance
  296. * @retval Returned value can be one of the following values:
  297. * @arg @ref LL_RTC_CALIB_OUTPUT_NONE
  298. * @arg @ref LL_RTC_CALIB_OUTPUT_RTCCLOCK
  299. * @arg @ref LL_RTC_CALIB_OUTPUT_ALARM
  300. * @arg @ref LL_RTC_CALIB_OUTPUT_SECOND
  301. */
  302. __STATIC_INLINE uint32_t LL_RTC_GetOutPutSource(BKP_TypeDef *BKPx)
  303. {
  304. return (uint32_t)(READ_BIT(BKPx->RTCCR, (BKP_RTCCR_CCO | BKP_RTCCR_ASOE | BKP_RTCCR_ASOS)));
  305. }
  306. /**
  307. * @brief Enable the write protection for RTC registers.
  308. * @rmtoll CRL CNF LL_RTC_EnableWriteProtection
  309. * @param RTCx RTC Instance
  310. * @retval None
  311. */
  312. __STATIC_INLINE void LL_RTC_EnableWriteProtection(RTC_TypeDef *RTCx)
  313. {
  314. CLEAR_BIT(RTCx->CRL, RTC_CRL_CNF);
  315. }
  316. /**
  317. * @brief Disable the write protection for RTC registers.
  318. * @rmtoll CRL RTC_CRL_CNF LL_RTC_DisableWriteProtection
  319. * @param RTCx RTC Instance
  320. * @retval None
  321. */
  322. __STATIC_INLINE void LL_RTC_DisableWriteProtection(RTC_TypeDef *RTCx)
  323. {
  324. SET_BIT(RTCx->CRL, RTC_CRL_CNF);
  325. }
  326. /**
  327. * @}
  328. */
  329. /** @defgroup RTC_LL_EF_Time Time
  330. * @{
  331. */
  332. /**
  333. * @brief Set time counter in BCD format
  334. * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
  335. * @note It can be written in initialization mode only (@ref LL_RTC_EnterInitMode function)
  336. * @rmtoll CNTH CNT LL_RTC_TIME_Set\n
  337. * CNTL CNT LL_RTC_TIME_Set\n
  338. * @param RTCx RTC Instance
  339. * @param TimeCounter Value between Min_Data=0x00 and Max_Data=0xFFFFF
  340. * @retval None
  341. */
  342. __STATIC_INLINE void LL_RTC_TIME_Set(RTC_TypeDef *RTCx, uint32_t TimeCounter)
  343. {
  344. /* Set RTC COUNTER MSB word */
  345. WRITE_REG(RTCx->CNTH, (TimeCounter >> 16U));
  346. /* Set RTC COUNTER LSB word */
  347. WRITE_REG(RTCx->CNTL, (TimeCounter & RTC_CNTL_RTC_CNT));
  348. }
  349. /**
  350. * @brief Get time counter in BCD format
  351. * @rmtoll CNTH CNT LL_RTC_TIME_Get\n
  352. * CNTL CNT LL_RTC_TIME_Get\n
  353. * @param RTCx RTC Instance
  354. * @retval Value between Min_Data = 0 and Max_Data = 0xFFFFF
  355. */
  356. __STATIC_INLINE uint32_t LL_RTC_TIME_Get(RTC_TypeDef *RTCx)
  357. {
  358. register uint16_t high = 0, low = 0;
  359. high = READ_REG(RTCx->CNTH & RTC_CNTH_RTC_CNT);
  360. low = READ_REG(RTCx->CNTL & RTC_CNTL_RTC_CNT);
  361. return ((uint32_t)(((uint32_t) high << 16U) | low));
  362. }
  363. /**
  364. * @}
  365. */
  366. /** @defgroup RTC_LL_EF_ALARM ALARM
  367. * @{
  368. */
  369. /**
  370. * @brief Set Alarm Counter
  371. * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
  372. * @rmtoll ALRH ALR LL_RTC_ALARM_Set\n
  373. * @rmtoll ALRL ALR LL_RTC_ALARM_Set\n
  374. * @param RTCx RTC Instance
  375. * @param AlarmCounter Value between Min_Data=0x00 and Max_Data=0xFFFFF
  376. * @retval None
  377. */
  378. __STATIC_INLINE void LL_RTC_ALARM_Set(RTC_TypeDef *RTCx, uint32_t AlarmCounter)
  379. {
  380. /* Set RTC COUNTER MSB word */
  381. WRITE_REG(RTCx->ALRH, (AlarmCounter >> 16));
  382. /* Set RTC COUNTER LSB word */
  383. WRITE_REG(RTCx->ALRL, (AlarmCounter & RTC_ALRL_RTC_ALR));
  384. }
  385. /**
  386. * @brief Get Alarm Counter
  387. * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
  388. * @rmtoll ALRH ALR LL_RTC_ALARM_Get\n
  389. * @rmtoll ALRL ALR LL_RTC_ALARM_Get\n
  390. * @param RTCx RTC Instance
  391. * @retval None
  392. */
  393. __STATIC_INLINE uint32_t LL_RTC_ALARM_Get(RTC_TypeDef *RTCx)
  394. {
  395. register uint16_t high = 0, low = 0;
  396. high = READ_REG(RTCx->ALRH & RTC_ALRH_RTC_ALR);
  397. low = READ_REG(RTCx->ALRL & RTC_ALRL_RTC_ALR);
  398. return (((uint32_t) high << 16U) | low);
  399. }
  400. /**
  401. * @}
  402. */
  403. /** @defgroup RTC_LL_EF_Tamper Tamper
  404. * @{
  405. */
  406. /**
  407. * @brief Enable RTC_TAMPx input detection
  408. * @rmtoll CR TPE LL_RTC_TAMPER_Enable\n
  409. * @retval None
  410. */
  411. __STATIC_INLINE void LL_RTC_TAMPER_Enable(BKP_TypeDef *BKPx)
  412. {
  413. SET_BIT(BKPx->CR, BKP_CR_TPE);
  414. }
  415. /**
  416. * @brief Disable RTC_TAMPx Tamper
  417. * @rmtoll CR TPE LL_RTC_TAMPER_Disable\n
  418. * @retval None
  419. */
  420. __STATIC_INLINE void LL_RTC_TAMPER_Disable(BKP_TypeDef *BKPx)
  421. {
  422. CLEAR_BIT(BKP->CR, BKP_CR_TPE);
  423. }
  424. /**
  425. * @brief Enable Active level for Tamper input
  426. * @rmtoll CR TPAL LL_RTC_TAMPER_SetActiveLevel\n
  427. * @param BKPx BKP Instance
  428. * @param Tamper This parameter can be a combination of the following values:
  429. * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_LOW
  430. * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_HIGH
  431. * @retval None
  432. */
  433. __STATIC_INLINE void LL_RTC_TAMPER_SetActiveLevel(BKP_TypeDef *BKPx, uint32_t Tamper)
  434. {
  435. MODIFY_REG(BKPx->CR, BKP_CR_TPAL, Tamper);
  436. }
  437. /**
  438. * @brief Disable Active level for Tamper input
  439. * @rmtoll CR TPAL LL_RTC_TAMPER_SetActiveLevel\n
  440. * @retval None
  441. */
  442. __STATIC_INLINE uint32_t LL_RTC_TAMPER_GetActiveLevel(BKP_TypeDef *BKPx)
  443. {
  444. return (uint32_t)(READ_BIT(BKPx->CR, BKP_CR_TPAL));
  445. }
  446. /**
  447. * @}
  448. */
  449. /** @defgroup RTC_LL_EF_Backup_Registers Backup_Registers
  450. * @{
  451. */
  452. /**
  453. * @brief Writes a data in a specified RTC Backup data register.
  454. * @rmtoll BKPDR DR LL_RTC_BKP_SetRegister
  455. * @param BKPx BKP Instance
  456. * @param BackupRegister This parameter can be one of the following values:
  457. * @arg @ref LL_RTC_BKP_DR1
  458. * @arg @ref LL_RTC_BKP_DR2
  459. * @arg @ref LL_RTC_BKP_DR3
  460. * @arg @ref LL_RTC_BKP_DR4
  461. * @arg @ref LL_RTC_BKP_DR5
  462. * @arg @ref LL_RTC_BKP_DR6
  463. * @arg @ref LL_RTC_BKP_DR7
  464. * @arg @ref LL_RTC_BKP_DR8
  465. * @arg @ref LL_RTC_BKP_DR9
  466. * @arg @ref LL_RTC_BKP_DR10
  467. * @arg @ref LL_RTC_BKP_DR11 (*)
  468. * @arg @ref LL_RTC_BKP_DR12 (*)
  469. * @arg @ref LL_RTC_BKP_DR13 (*)
  470. * @arg @ref LL_RTC_BKP_DR14 (*)
  471. * @arg @ref LL_RTC_BKP_DR15 (*)
  472. * @arg @ref LL_RTC_BKP_DR16 (*)
  473. * @arg @ref LL_RTC_BKP_DR17 (*)
  474. * @arg @ref LL_RTC_BKP_DR18 (*)
  475. * @arg @ref LL_RTC_BKP_DR19 (*)
  476. * @arg @ref LL_RTC_BKP_DR20 (*)
  477. * @arg @ref LL_RTC_BKP_DR21 (*)
  478. * @arg @ref LL_RTC_BKP_DR22 (*)
  479. * @arg @ref LL_RTC_BKP_DR23 (*)
  480. * @arg @ref LL_RTC_BKP_DR24 (*)
  481. * @arg @ref LL_RTC_BKP_DR25 (*)
  482. * @arg @ref LL_RTC_BKP_DR26 (*)
  483. * @arg @ref LL_RTC_BKP_DR27 (*)
  484. * @arg @ref LL_RTC_BKP_DR28 (*)
  485. * @arg @ref LL_RTC_BKP_DR29 (*)
  486. * @arg @ref LL_RTC_BKP_DR30 (*)
  487. * @arg @ref LL_RTC_BKP_DR31 (*)
  488. * @arg @ref LL_RTC_BKP_DR32 (*)
  489. * @arg @ref LL_RTC_BKP_DR33 (*)
  490. * @arg @ref LL_RTC_BKP_DR34 (*)
  491. * @arg @ref LL_RTC_BKP_DR35 (*)
  492. * @arg @ref LL_RTC_BKP_DR36 (*)
  493. * @arg @ref LL_RTC_BKP_DR37 (*)
  494. * @arg @ref LL_RTC_BKP_DR38 (*)
  495. * @arg @ref LL_RTC_BKP_DR39 (*)
  496. * @arg @ref LL_RTC_BKP_DR40 (*)
  497. * @arg @ref LL_RTC_BKP_DR41 (*)
  498. * @arg @ref LL_RTC_BKP_DR42 (*)
  499. * (*) value not defined in all devices.
  500. * @param Data Value between Min_Data=0x00 and Max_Data=0xFFFFFFFF
  501. * @retval None
  502. */
  503. __STATIC_INLINE void LL_RTC_BKP_SetRegister(BKP_TypeDef *BKPx, uint32_t BackupRegister, uint32_t Data)
  504. {
  505. register uint32_t tmp = 0U;
  506. tmp = (uint32_t)BKP_BASE;
  507. tmp += (BackupRegister * 4U);
  508. /* Write the specified register */
  509. *(__IO uint32_t *)tmp = (uint32_t)Data;
  510. }
  511. /**
  512. * @brief Reads data from the specified RTC Backup data Register.
  513. * @rmtoll BKPDR DR LL_RTC_BKP_GetRegister
  514. * @param BKPx BKP Instance
  515. * @param BackupRegister This parameter can be one of the following values:
  516. * @arg @ref LL_RTC_BKP_DR1
  517. * @arg @ref LL_RTC_BKP_DR2
  518. * @arg @ref LL_RTC_BKP_DR3
  519. * @arg @ref LL_RTC_BKP_DR4
  520. * @arg @ref LL_RTC_BKP_DR5
  521. * @arg @ref LL_RTC_BKP_DR6
  522. * @arg @ref LL_RTC_BKP_DR7
  523. * @arg @ref LL_RTC_BKP_DR8
  524. * @arg @ref LL_RTC_BKP_DR9
  525. * @arg @ref LL_RTC_BKP_DR10
  526. * @arg @ref LL_RTC_BKP_DR11 (*)
  527. * @arg @ref LL_RTC_BKP_DR12 (*)
  528. * @arg @ref LL_RTC_BKP_DR13 (*)
  529. * @arg @ref LL_RTC_BKP_DR14 (*)
  530. * @arg @ref LL_RTC_BKP_DR15 (*)
  531. * @arg @ref LL_RTC_BKP_DR16 (*)
  532. * @arg @ref LL_RTC_BKP_DR17 (*)
  533. * @arg @ref LL_RTC_BKP_DR18 (*)
  534. * @arg @ref LL_RTC_BKP_DR19 (*)
  535. * @arg @ref LL_RTC_BKP_DR20 (*)
  536. * @arg @ref LL_RTC_BKP_DR21 (*)
  537. * @arg @ref LL_RTC_BKP_DR22 (*)
  538. * @arg @ref LL_RTC_BKP_DR23 (*)
  539. * @arg @ref LL_RTC_BKP_DR24 (*)
  540. * @arg @ref LL_RTC_BKP_DR25 (*)
  541. * @arg @ref LL_RTC_BKP_DR26 (*)
  542. * @arg @ref LL_RTC_BKP_DR27 (*)
  543. * @arg @ref LL_RTC_BKP_DR28 (*)
  544. * @arg @ref LL_RTC_BKP_DR29 (*)
  545. * @arg @ref LL_RTC_BKP_DR30 (*)
  546. * @arg @ref LL_RTC_BKP_DR31 (*)
  547. * @arg @ref LL_RTC_BKP_DR32 (*)
  548. * @arg @ref LL_RTC_BKP_DR33 (*)
  549. * @arg @ref LL_RTC_BKP_DR34 (*)
  550. * @arg @ref LL_RTC_BKP_DR35 (*)
  551. * @arg @ref LL_RTC_BKP_DR36 (*)
  552. * @arg @ref LL_RTC_BKP_DR37 (*)
  553. * @arg @ref LL_RTC_BKP_DR38 (*)
  554. * @arg @ref LL_RTC_BKP_DR39 (*)
  555. * @arg @ref LL_RTC_BKP_DR40 (*)
  556. * @arg @ref LL_RTC_BKP_DR41 (*)
  557. * @arg @ref LL_RTC_BKP_DR42 (*)
  558. * @retval Value between Min_Data=0x00 and Max_Data=0xFFFFFFFF
  559. */
  560. __STATIC_INLINE uint32_t LL_RTC_BKP_GetRegister(BKP_TypeDef *BKPx, uint32_t BackupRegister)
  561. {
  562. register uint32_t tmp = 0U;
  563. tmp = (uint32_t)BKP_BASE;
  564. tmp += (BackupRegister * 4U);
  565. /* Read the specified register */
  566. return ((*(__IO uint32_t *)tmp) & BKP_DR1_D);
  567. }
  568. /**
  569. * @}
  570. */
  571. /** @defgroup RTC_LL_EF_Calibration Calibration
  572. * @{
  573. */
  574. /**
  575. * @brief Set the coarse digital calibration
  576. * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
  577. * @note It can be written in initialization mode only (@ref LL_RTC_EnterInitMode function)
  578. * @rmtoll RTCCR CAL LL_RTC_CAL_SetCoarseDigital\n
  579. * @param BKPx RTC Instance
  580. * @param Value value of coarse calibration expressed in ppm (coded on 5 bits)
  581. * @note This Calibration value should be between 0 and 121 when using positive sign with a 4-ppm step.
  582. * @retval None
  583. */
  584. __STATIC_INLINE void LL_RTC_CAL_SetCoarseDigital(BKP_TypeDef* BKPx, uint32_t Value)
  585. {
  586. MODIFY_REG(BKPx->RTCCR,BKP_RTCCR_CAL, Value);
  587. }
  588. /**
  589. * @brief Get the coarse digital calibration value
  590. * @rmtoll RTCCR CAL LL_RTC_CAL_SetCoarseDigital\n
  591. * @param BKPx BKP Instance
  592. * @retval value of coarse calibration expressed in ppm (coded on 5 bits)
  593. */
  594. __STATIC_INLINE uint32_t LL_RTC_CAL_GetCoarseDigital(BKP_TypeDef *BKPx)
  595. {
  596. return (uint32_t)(READ_BIT(BKPx->RTCCR, BKP_RTCCR_CAL));
  597. }
  598. /**
  599. * @}
  600. */
  601. /** @defgroup RTC_LL_EF_FLAG_Management FLAG_Management
  602. * @{
  603. */
  604. /**
  605. * @brief Get RTC_TAMPI Interruption detection flag
  606. * @rmtoll CSR TIF LL_RTC_IsActiveFlag_TAMPI
  607. * @param BKPx BKP Instance
  608. * @retval State of bit (1 or 0).
  609. */
  610. __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMPI(BKP_TypeDef *BKPx)
  611. {
  612. return (READ_BIT(BKPx->CSR, BKP_CSR_TIF) == (BKP_CSR_TIF));
  613. }
  614. /**
  615. * @brief Clear RTC_TAMP Interruption detection flag
  616. * @rmtoll CSR CTI LL_RTC_ClearFlag_TAMPI
  617. * @param BKPx BKP Instance
  618. * @retval None
  619. */
  620. __STATIC_INLINE void LL_RTC_ClearFlag_TAMPI(BKP_TypeDef *BKPx)
  621. {
  622. SET_BIT(BKPx->CSR, BKP_CSR_CTI);
  623. }
  624. /**
  625. * @brief Get RTC_TAMPE Event detection flag
  626. * @rmtoll CSR TEF LL_RTC_IsActiveFlag_TAMPE
  627. * @param BKPx BKP Instance
  628. * @retval State of bit (1 or 0).
  629. */
  630. __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMPE(BKP_TypeDef *BKPx)
  631. {
  632. return (READ_BIT(BKPx->CSR, BKP_CSR_TEF) == (BKP_CSR_TEF));
  633. }
  634. /**
  635. * @brief Clear RTC_TAMPE Even detection flag
  636. * @rmtoll CSR CTE LL_RTC_ClearFlag_TAMPE
  637. * @param BKPx BKP Instance
  638. * @retval None
  639. */
  640. __STATIC_INLINE void LL_RTC_ClearFlag_TAMPE(BKP_TypeDef *BKPx)
  641. {
  642. SET_BIT(BKPx->CSR, BKP_CSR_CTE);
  643. }
  644. /**
  645. * @brief Get Alarm flag
  646. * @rmtoll CRL ALRF LL_RTC_IsActiveFlag_ALR
  647. * @param RTCx RTC Instance
  648. * @retval State of bit (1 or 0).
  649. */
  650. __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALR(RTC_TypeDef *RTCx)
  651. {
  652. return (READ_BIT(RTCx->CRL, RTC_CRL_ALRF) == (RTC_CRL_ALRF));
  653. }
  654. /**
  655. * @brief Clear Alarm flag
  656. * @rmtoll CRL ALRF LL_RTC_ClearFlag_ALR
  657. * @param RTCx RTC Instance
  658. * @retval None
  659. */
  660. __STATIC_INLINE void LL_RTC_ClearFlag_ALR(RTC_TypeDef *RTCx)
  661. {
  662. CLEAR_BIT(RTCx->CRL, RTC_CRL_ALRF);
  663. }
  664. /**
  665. * @brief Get Registers synchronization flag
  666. * @rmtoll CRL RSF LL_RTC_IsActiveFlag_RS
  667. * @param RTCx RTC Instance
  668. * @retval State of bit (1 or 0).
  669. */
  670. __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_RS(RTC_TypeDef *RTCx)
  671. {
  672. return (READ_BIT(RTCx->CRL, RTC_CRL_RSF) == (RTC_CRL_RSF));
  673. }
  674. /**
  675. * @brief Clear Registers synchronization flag
  676. * @rmtoll CRL RSF LL_RTC_ClearFlag_RS
  677. * @param RTCx RTC Instance
  678. * @retval None
  679. */
  680. __STATIC_INLINE void LL_RTC_ClearFlag_RS(RTC_TypeDef *RTCx)
  681. {
  682. CLEAR_BIT(RTCx->CRL, RTC_CRL_RSF);
  683. }
  684. /**
  685. * @brief Get Registers OverFlow flag
  686. * @rmtoll CRL OWF LL_RTC_IsActiveFlag_OW
  687. * @param RTCx RTC Instance
  688. * @retval State of bit (1 or 0).
  689. */
  690. __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_OW(RTC_TypeDef *RTCx)
  691. {
  692. return (READ_BIT(RTCx->CRL, RTC_CRL_OWF) == (RTC_CRL_OWF));
  693. }
  694. /**
  695. * @brief Clear Registers OverFlow flag
  696. * @rmtoll CRL OWF LL_RTC_ClearFlag_OW
  697. * @param RTCx RTC Instance
  698. * @retval None
  699. */
  700. __STATIC_INLINE void LL_RTC_ClearFlag_OW(RTC_TypeDef *RTCx)
  701. {
  702. CLEAR_BIT(RTCx->CRL, RTC_CRL_OWF);
  703. }
  704. /**
  705. * @brief Get Registers synchronization flag
  706. * @rmtoll CRL SECF LL_RTC_IsActiveFlag_SEC
  707. * @param RTCx RTC Instance
  708. * @retval State of bit (1 or 0).
  709. */
  710. __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_SEC(RTC_TypeDef *RTCx)
  711. {
  712. return (READ_BIT(RTCx->CRL, RTC_CRL_SECF) == (RTC_CRL_SECF));
  713. }
  714. /**
  715. * @brief Clear Registers synchronization flag
  716. * @rmtoll CRL SECF LL_RTC_ClearFlag_SEC
  717. * @param RTCx RTC Instance
  718. * @retval None
  719. */
  720. __STATIC_INLINE void LL_RTC_ClearFlag_SEC(RTC_TypeDef *RTCx)
  721. {
  722. CLEAR_BIT(RTCx->CRL, RTC_CRL_SECF);
  723. }
  724. /**
  725. * @brief Get RTC Operation OFF status flag
  726. * @rmtoll CRL RTOFF LL_RTC_IsActiveFlag_RTOF
  727. * @param RTCx RTC Instance
  728. * @retval State of bit (1 or 0).
  729. */
  730. __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_RTOF(RTC_TypeDef *RTCx)
  731. {
  732. return (READ_BIT(RTCx->CRL, RTC_CRL_RTOFF) == (RTC_CRL_RTOFF));
  733. }
  734. /**
  735. * @}
  736. */
  737. /** @defgroup RTC_LL_EF_IT_Management IT_Management
  738. * @{
  739. */
  740. /**
  741. * @brief Enable Alarm interrupt
  742. * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
  743. * @rmtoll CRH ALRIE LL_RTC_EnableIT_ALR
  744. * @param RTCx RTC Instance
  745. * @retval None
  746. */
  747. __STATIC_INLINE void LL_RTC_EnableIT_ALR(RTC_TypeDef *RTCx)
  748. {
  749. SET_BIT(RTCx->CRH, RTC_CRH_ALRIE);
  750. }
  751. /**
  752. * @brief Disable Alarm interrupt
  753. * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
  754. * @rmtoll CRH ALRIE LL_RTC_DisableIT_ALR
  755. * @param RTCx RTC Instance
  756. * @retval None
  757. */
  758. __STATIC_INLINE void LL_RTC_DisableIT_ALR(RTC_TypeDef *RTCx)
  759. {
  760. CLEAR_BIT(RTCx->CRH, RTC_CRH_ALRIE);
  761. }
  762. /**
  763. * @brief Check if Alarm interrupt is enabled or not
  764. * @rmtoll CRH ALRIE LL_RTC_IsEnabledIT_ALR
  765. * @param RTCx RTC Instance
  766. * @retval State of bit (1 or 0).
  767. */
  768. __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_ALR(RTC_TypeDef *RTCx)
  769. {
  770. return (READ_BIT(RTCx->CRH, RTC_CRH_ALRIE) == (RTC_CRH_ALRIE));
  771. }
  772. /**
  773. * @brief Enable Second Interrupt interrupt
  774. * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
  775. * @rmtoll CRH SECIE LL_RTC_EnableIT_SEC
  776. * @param RTCx RTC Instance
  777. * @retval None
  778. */
  779. __STATIC_INLINE void LL_RTC_EnableIT_SEC(RTC_TypeDef *RTCx)
  780. {
  781. SET_BIT(RTCx->CRH, RTC_CRH_SECIE);
  782. }
  783. /**
  784. * @brief Disable Second interrupt
  785. * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
  786. * @rmtoll CRH SECIE LL_RTC_DisableIT_SEC
  787. * @param RTCx RTC Instance
  788. * @retval None
  789. */
  790. __STATIC_INLINE void LL_RTC_DisableIT_SEC(RTC_TypeDef *RTCx)
  791. {
  792. CLEAR_BIT(RTCx->CRH, RTC_CRH_SECIE);
  793. }
  794. /**
  795. * @brief Check if Second interrupt is enabled or not
  796. * @rmtoll CRH SECIE LL_RTC_IsEnabledIT_SEC
  797. * @param RTCx RTC Instance
  798. * @retval State of bit (1 or 0).
  799. */
  800. __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_SEC(RTC_TypeDef *RTCx)
  801. {
  802. return (READ_BIT(RTCx->CRH, RTC_CRH_SECIE) == (RTC_CRH_SECIE));
  803. }
  804. /**
  805. * @brief Enable OverFlow interrupt
  806. * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
  807. * @rmtoll CRH OWIE LL_RTC_EnableIT_OW
  808. * @param RTCx RTC Instance
  809. * @retval None
  810. */
  811. __STATIC_INLINE void LL_RTC_EnableIT_OW(RTC_TypeDef *RTCx)
  812. {
  813. SET_BIT(RTCx->CRH, RTC_CRH_OWIE);
  814. }
  815. /**
  816. * @brief Disable OverFlow interrupt
  817. * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before.
  818. * @rmtoll CRH OWIE LL_RTC_DisableIT_OW
  819. * @param RTCx RTC Instance
  820. * @retval None
  821. */
  822. __STATIC_INLINE void LL_RTC_DisableIT_OW(RTC_TypeDef *RTCx)
  823. {
  824. CLEAR_BIT(RTCx->CRH, RTC_CRH_OWIE);
  825. }
  826. /**
  827. * @brief Check if OverFlow interrupt is enabled or not
  828. * @rmtoll CRH OWIE LL_RTC_IsEnabledIT_OW
  829. * @param RTCx RTC Instance
  830. * @retval State of bit (1 or 0).
  831. */
  832. __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_OW(RTC_TypeDef *RTCx)
  833. {
  834. return (READ_BIT(RTCx->CRH, RTC_CRH_OWIE) == (RTC_CRH_OWIE));
  835. }
  836. /**
  837. * @brief Enable Tamper interrupt
  838. * @rmtoll CSR TPIE LL_RTC_EnableIT_TAMP
  839. * @param BKPx BKP Instance
  840. * @retval None
  841. */
  842. __STATIC_INLINE void LL_RTC_EnableIT_TAMP(BKP_TypeDef *BKPx)
  843. {
  844. SET_BIT(BKPx->CSR,BKP_CSR_TPIE);
  845. }
  846. /**
  847. * @brief Disable Tamper interrupt
  848. * @rmtoll CSR TPIE LL_RTC_EnableIT_TAMP
  849. * @param BKPx BKP Instance
  850. * @retval None
  851. */
  852. __STATIC_INLINE void LL_RTC_DisableIT_TAMP(BKP_TypeDef *BKPx)
  853. {
  854. CLEAR_BIT(BKPx->CSR,BKP_CSR_TPIE);
  855. }
  856. /**
  857. * @brief Check if all the TAMPER interrupts are enabled or not
  858. * @rmtoll CSR TPIE LL_RTC_IsEnabledIT_TAMP
  859. * @param BKPx BKP Instance
  860. * @retval State of bit (1 or 0).
  861. */
  862. __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TAMP(BKP_TypeDef *BKPx)
  863. {
  864. return (READ_BIT(BKPx->CSR,BKP_CSR_TPIE) == BKP_CSR_TPIE);
  865. }
  866. /**
  867. * @}
  868. */
  869. #if defined(USE_FULL_LL_DRIVER)
  870. /** @defgroup RTC_LL_EF_Init Initialization and de-initialization functions
  871. * @{
  872. */
  873. ErrorStatus LL_RTC_DeInit(RTC_TypeDef *RTCx);
  874. ErrorStatus LL_RTC_Init(RTC_TypeDef *RTCx, LL_RTC_InitTypeDef *RTC_InitStruct);
  875. void LL_RTC_StructInit(LL_RTC_InitTypeDef *RTC_InitStruct);
  876. ErrorStatus LL_RTC_TIME_Init(RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_TimeTypeDef *RTC_TimeStruct);
  877. void LL_RTC_TIME_StructInit(LL_RTC_TimeTypeDef *RTC_TimeStruct);
  878. ErrorStatus LL_RTC_ALARM_Init(RTC_TypeDef *RTCx, uint32_t RTC_Format, LL_RTC_AlarmTypeDef *RTC_AlarmStruct);
  879. void LL_RTC_ALARM_StructInit(LL_RTC_AlarmTypeDef *RTC_AlarmStruct);
  880. ErrorStatus LL_RTC_EnterInitMode(RTC_TypeDef *RTCx);
  881. ErrorStatus LL_RTC_ExitInitMode(RTC_TypeDef *RTCx);
  882. ErrorStatus LL_RTC_WaitForSynchro(RTC_TypeDef *RTCx);
  883. ErrorStatus LL_RTC_TIME_SetCounter(RTC_TypeDef *RTCx, uint32_t TimeCounter);
  884. ErrorStatus LL_RTC_ALARM_SetCounter(RTC_TypeDef *RTCx, uint32_t AlarmCounter);
  885. /**
  886. * @}
  887. */
  888. #endif /* USE_FULL_LL_DRIVER */
  889. /**
  890. * @}
  891. */
  892. /**
  893. * @}
  894. */
  895. /**
  896. * @}
  897. */
  898. #endif /* defined(RTC) */
  899. /**
  900. * @}
  901. */
  902. #ifdef __cplusplus
  903. }
  904. #endif
  905. #endif /* __STM32F1xx_LL_RTC_H */
  906. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/