stm32f1xx_ll_rtc.h 32 KB

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