stm32l0xx_hal.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  1. /**
  2. ******************************************************************************
  3. * @file stm32l0xx_hal.c
  4. * @author MCD Application Team
  5. * @brief HAL module driver.
  6. * This is the common part of the HAL initialization
  7. *
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * Copyright (c) 2016 STMicroelectronics.
  12. * All rights reserved.
  13. *
  14. * This software is licensed under terms that can be found in the LICENSE file
  15. * in the root directory of this software component.
  16. * If no LICENSE file comes with this software, it is provided AS-IS.
  17. *
  18. ******************************************************************************
  19. @verbatim
  20. ==============================================================================
  21. ##### How to use this driver #####
  22. ==============================================================================
  23. [..]
  24. The common HAL driver contains a set of generic and common APIs that can be
  25. used by the PPP peripheral drivers and the user to start using the HAL.
  26. [..]
  27. The HAL contains two APIs categories:
  28. (+) Common HAL APIs
  29. (+) Services HAL APIs
  30. @endverbatim
  31. ******************************************************************************
  32. */
  33. /* Includes ------------------------------------------------------------------*/
  34. #include "stm32l0xx_hal.h"
  35. /** @addtogroup STM32L0xx_HAL_Driver
  36. * @{
  37. */
  38. #ifdef HAL_MODULE_ENABLED
  39. /** @addtogroup HAL
  40. * @brief HAL module driver.
  41. * @{
  42. */
  43. /** @addtogroup HAL_Exported_Constants
  44. * @{
  45. */
  46. /** @defgroup HAL_Version HAL Version
  47. * @{
  48. */
  49. /**
  50. * @brief STM32L0xx HAL Driver version number
  51. */
  52. #define __STM32L0xx_HAL_VERSION_MAIN (0x01U) /*!< [31:24] main version */
  53. #define __STM32L0xx_HAL_VERSION_SUB1 (0x0AU) /*!< [23:16] sub1 version */
  54. #define __STM32L0xx_HAL_VERSION_SUB2 (0x06U) /*!< [15:8] sub2 version */
  55. #define __STM32L0xx_HAL_VERSION_RC (0x00U) /*!< [7:0] release candidate */
  56. #define __STM32L0xx_HAL_VERSION ((__STM32L0xx_HAL_VERSION_MAIN << 24U)\
  57. |(__STM32L0xx_HAL_VERSION_SUB1 << 16U)\
  58. |(__STM32L0xx_HAL_VERSION_SUB2 << 8U )\
  59. |(__STM32L0xx_HAL_VERSION_RC))
  60. #define IDCODE_DEVID_MASK (0x00000FFFU)
  61. /**
  62. * @}
  63. */
  64. /**
  65. * @}
  66. */
  67. /* Exported variables --------------------------------------------------------*/
  68. /** @addtogroup HAL_Exported_Variables
  69. * @{
  70. */
  71. __IO uint32_t uwTick;
  72. uint32_t uwTickPrio = (1UL << __NVIC_PRIO_BITS); /* Invalid PRIO */
  73. HAL_TickFreqTypeDef uwTickFreq = HAL_TICK_FREQ_DEFAULT; /* 1KHz */
  74. /**
  75. * @}
  76. */
  77. /* Exported functions --------------------------------------------------------*/
  78. /** @addtogroup HAL_Exported_Functions
  79. * @{
  80. */
  81. /** @addtogroup HAL_Exported_Functions_Group1
  82. * @brief Initialization and de-initialization functions
  83. *
  84. @verbatim
  85. ===============================================================================
  86. ##### Initialization and de-initialization functions #####
  87. ===============================================================================
  88. [..] This section provides functions allowing to:
  89. (+) Initialize the Flash interface, the NVIC allocation and initial clock
  90. configuration. It initializes the source of time base also when timeout
  91. is needed and the backup domain when enabled.
  92. (+) De-initialize common part of the HAL.
  93. (+) Configure the time base source to have 1ms time base with a dedicated
  94. Tick interrupt priority.
  95. (++) SysTick timer is used by default as source of time base, but user
  96. can eventually implement his proper time base source (a general purpose
  97. timer for example or other time source), keeping in mind that Time base
  98. duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and
  99. handled in milliseconds basis.
  100. (++) Time base configuration function (HAL_InitTick ()) is called automatically
  101. at the beginning of the program after reset by HAL_Init() or at any time
  102. when clock is configured, by HAL_RCC_ClockConfig().
  103. (++) Source of time base is configured to generate interrupts at regular
  104. time intervals. Care must be taken if HAL_Delay() is called from a
  105. peripheral ISR process, the Tick interrupt line must have higher priority
  106. (numerically lower) than the peripheral interrupt. Otherwise the caller
  107. ISR process will be blocked.
  108. (++) functions affecting time base configurations are declared as __weak
  109. to make override possible in case of other implementations in user file.
  110. @endverbatim
  111. * @{
  112. */
  113. /**
  114. * @brief This function configures the Flash prefetch, Flash preread and Buffer cache,
  115. * Configures time base source, NVIC and Low level hardware
  116. * @note This function is called at the beginning of program after reset and before
  117. * the clock configuration
  118. * @note The time base configuration is based on MSI clock when exiting from Reset.
  119. * Once done, time base tick start incrementing.
  120. * In the default implementation,Systick is used as source of time base.
  121. * the tick variable is incremented each 1ms in its ISR.
  122. * @retval HAL status
  123. */
  124. HAL_StatusTypeDef HAL_Init(void)
  125. {
  126. HAL_StatusTypeDef status = HAL_OK;
  127. /* Configure Buffer cache, Flash prefetch, Flash preread */
  128. #if (BUFFER_CACHE_DISABLE != 0)
  129. __HAL_FLASH_BUFFER_CACHE_DISABLE();
  130. #endif /* BUFFER_CACHE_DISABLE */
  131. #if (PREREAD_ENABLE != 0)
  132. __HAL_FLASH_PREREAD_BUFFER_ENABLE();
  133. #endif /* PREREAD_ENABLE */
  134. #if (PREFETCH_ENABLE != 0)
  135. __HAL_FLASH_PREFETCH_BUFFER_ENABLE();
  136. #endif /* PREFETCH_ENABLE */
  137. /* Use SysTick as time base source and configure 1ms tick (default clock after Reset is MSI) */
  138. if (HAL_InitTick(TICK_INT_PRIORITY) != HAL_OK)
  139. {
  140. status = HAL_ERROR;
  141. }
  142. else
  143. {
  144. /* Init the low level hardware */
  145. HAL_MspInit();
  146. }
  147. /* Return function status */
  148. return status;
  149. }
  150. /**
  151. * @brief This function de-initializes common part of the HAL and stops the source
  152. * of time base.
  153. * @note This function is optional.
  154. * @retval HAL status
  155. */
  156. HAL_StatusTypeDef HAL_DeInit(void)
  157. {
  158. /* Reset of all peripherals */
  159. __HAL_RCC_APB1_FORCE_RESET();
  160. __HAL_RCC_APB1_RELEASE_RESET();
  161. __HAL_RCC_APB2_FORCE_RESET();
  162. __HAL_RCC_APB2_RELEASE_RESET();
  163. __HAL_RCC_AHB_FORCE_RESET();
  164. __HAL_RCC_AHB_RELEASE_RESET();
  165. __HAL_RCC_IOP_FORCE_RESET();
  166. __HAL_RCC_IOP_RELEASE_RESET();
  167. /* De-Init the low level hardware */
  168. HAL_MspDeInit();
  169. /* Return function status */
  170. return HAL_OK;
  171. }
  172. /**
  173. * @brief Initializes the MSP.
  174. * @retval None
  175. */
  176. __weak void HAL_MspInit(void)
  177. {
  178. /* NOTE : This function should not be modified, when the callback is needed,
  179. the HAL_MspInit could be implemented in the user file
  180. */
  181. }
  182. /**
  183. * @brief DeInitializes the MSP.
  184. * @retval None
  185. */
  186. __weak void HAL_MspDeInit(void)
  187. {
  188. /* NOTE : This function should not be modified, when the callback is needed,
  189. the HAL_MspDeInit could be implemented in the user file
  190. */
  191. }
  192. /**
  193. * @brief This function configures the source of the time base:
  194. * The time source is configured to have 1ms time base with a dedicated
  195. * Tick interrupt priority.
  196. * @note This function is called automatically at the beginning of program after
  197. * reset by HAL_Init() or at any time when clock is reconfigured by HAL_RCC_ClockConfig().
  198. * @note In the default implementation, SysTick timer is the source of time base.
  199. * It is used to generate interrupts at regular time intervals.
  200. * Care must be taken if HAL_Delay() is called from a peripheral ISR process,
  201. * The SysTick interrupt must have higher priority (numerically lower)
  202. * than the peripheral interrupt. Otherwise the caller ISR process will be blocked.
  203. * The function is declared as __weak to be overwritten in case of other
  204. * implementation in user file.
  205. * @param TickPriority Tick interrupt priority.
  206. * @retval HAL status
  207. */
  208. __weak HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
  209. {
  210. /* Configure the SysTick to have interrupt in 1ms time basis*/
  211. if (HAL_SYSTICK_Config(SystemCoreClock / (1000U / uwTickFreq)) > 0U)
  212. {
  213. return HAL_ERROR;
  214. }
  215. /* Configure the SysTick IRQ priority */
  216. if (TickPriority < (1UL << __NVIC_PRIO_BITS))
  217. {
  218. HAL_NVIC_SetPriority(SysTick_IRQn, TickPriority, 0U);
  219. uwTickPrio = TickPriority;
  220. }
  221. else
  222. {
  223. return HAL_ERROR;
  224. }
  225. /* Return function status */
  226. return HAL_OK;
  227. }
  228. /**
  229. * @}
  230. */
  231. /** @addtogroup HAL_Exported_Functions_Group2
  232. * @brief HAL Control functions
  233. *
  234. @verbatim
  235. ===============================================================================
  236. ##### HAL Control functions #####
  237. ===============================================================================
  238. [..] This section provides functions allowing to:
  239. (+) Provide a tick value in millisecond
  240. (+) Provide a blocking delay in millisecond
  241. (+) Suspend the time base source interrupt
  242. (+) Resume the time base source interrupt
  243. (+) Get the HAL API driver version
  244. (+) Get the device identifier
  245. (+) Get the device revision identifier
  246. @endverbatim
  247. * @{
  248. */
  249. /**
  250. * @brief This function is called to increment a global variable "uwTick"
  251. * used as application time base.
  252. * @note In the default implementation, this variable is incremented each 1ms
  253. * in SysTick ISR.
  254. * @note This function is declared as __weak to be overwritten in case of other
  255. * implementations in user file.
  256. * @retval None
  257. */
  258. __weak void HAL_IncTick(void)
  259. {
  260. uwTick += uwTickFreq;
  261. }
  262. /**
  263. * @brief Provides a tick value in millisecond.
  264. * @note This function is declared as __weak to be overwritten in case of other
  265. * implementations in user file.
  266. * @retval tick value
  267. */
  268. __weak uint32_t HAL_GetTick(void)
  269. {
  270. return uwTick;
  271. }
  272. /**
  273. * @brief This function returns a tick priority.
  274. * @retval tick priority
  275. */
  276. uint32_t HAL_GetTickPrio(void)
  277. {
  278. return uwTickPrio;
  279. }
  280. /**
  281. * @brief Set new tick Freq.
  282. * @retval Status
  283. */
  284. HAL_StatusTypeDef HAL_SetTickFreq(HAL_TickFreqTypeDef Freq)
  285. {
  286. HAL_StatusTypeDef status = HAL_OK;
  287. HAL_TickFreqTypeDef prevTickFreq;
  288. assert_param(IS_TICKFREQ(Freq));
  289. if (uwTickFreq != Freq)
  290. {
  291. /* Back up uwTickFreq frequency */
  292. prevTickFreq = uwTickFreq;
  293. /* Update uwTickFreq global variable used by HAL_InitTick() */
  294. uwTickFreq = Freq;
  295. /* Apply the new tick Freq */
  296. status = HAL_InitTick(uwTickPrio);
  297. if (status != HAL_OK)
  298. {
  299. /* Restore previous tick frequency */
  300. uwTickFreq = prevTickFreq;
  301. }
  302. }
  303. return status;
  304. }
  305. /**
  306. * @brief Return tick frequency.
  307. * @retval Tick frequency.
  308. * Value of @ref HAL_TickFreqTypeDef.
  309. */
  310. HAL_TickFreqTypeDef HAL_GetTickFreq(void)
  311. {
  312. return uwTickFreq;
  313. }
  314. /**
  315. * @brief This function provides minimum delay (in milliseconds) based
  316. * on variable incremented.
  317. * @note In the default implementation , SysTick timer is the source of time base.
  318. * It is used to generate interrupts at regular time intervals where uwTick
  319. * is incremented.
  320. * @note This function is declared as __weak to be overwritten in case of other
  321. * implementations in user file.
  322. * @param Delay specifies the delay time length, in milliseconds.
  323. * @retval None
  324. */
  325. __weak void HAL_Delay(uint32_t Delay)
  326. {
  327. uint32_t tickstart = HAL_GetTick();
  328. uint32_t wait = Delay;
  329. /* Add a freq to guarantee minimum wait */
  330. if (wait < HAL_MAX_DELAY)
  331. {
  332. wait += (uint32_t)(uwTickFreq);
  333. }
  334. while((HAL_GetTick() - tickstart) < wait)
  335. {
  336. }
  337. }
  338. /**
  339. * @brief Suspends the Tick increment.
  340. * @note In the default implementation , SysTick timer is the source of time base. It is
  341. * used to generate interrupts at regular time intervals. Once HAL_SuspendTick()
  342. * is called, the SysTick interrupt will be disabled and so Tick increment
  343. * is suspended.
  344. * @note This function is declared as __weak to be overwritten in case of other
  345. * implementations in user file.
  346. * @retval None
  347. */
  348. __weak void HAL_SuspendTick(void)
  349. {
  350. /* Disable SysTick Interrupt */
  351. SysTick->CTRL &= ~SysTick_CTRL_TICKINT_Msk;
  352. }
  353. /**
  354. * @brief Resumes the Tick increment.
  355. * @note In the default implementation , SysTick timer is the source of time base. It is
  356. * used to generate interrupts at regular time intervals. Once HAL_ResumeTick()
  357. * is called, the SysTick interrupt will be enabled and so Tick increment
  358. * is resumed.
  359. * @note This function is declared as __weak to be overwritten in case of other
  360. * implementations in user file.
  361. * @retval None
  362. */
  363. __weak void HAL_ResumeTick(void)
  364. {
  365. /* Enable SysTick Interrupt */
  366. SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk;
  367. }
  368. /**
  369. * @brief Returns the HAL revision
  370. * @retval version: 0xXYZR (8bits for each decimal, R for RC)
  371. */
  372. uint32_t HAL_GetHalVersion(void)
  373. {
  374. return __STM32L0xx_HAL_VERSION;
  375. }
  376. /**
  377. * @brief Returns the device revision identifier.
  378. * @retval Device revision identifier
  379. */
  380. uint32_t HAL_GetREVID(void)
  381. {
  382. return((DBGMCU->IDCODE) >> 16U);
  383. }
  384. /**
  385. * @brief Returns the device identifier.
  386. * @retval Device identifier
  387. */
  388. uint32_t HAL_GetDEVID(void)
  389. {
  390. return((DBGMCU->IDCODE) & IDCODE_DEVID_MASK);
  391. }
  392. /**
  393. * @brief Returns the first word of the unique device identifier (UID based on 96 bits)
  394. * @retval Device identifier
  395. */
  396. uint32_t HAL_GetUIDw0(void)
  397. {
  398. return(READ_REG(*((uint32_t *)UID_BASE)));
  399. }
  400. /**
  401. * @brief Returns the second word of the unique device identifier (UID based on 96 bits)
  402. * @retval Device identifier
  403. */
  404. uint32_t HAL_GetUIDw1(void)
  405. {
  406. return(READ_REG(*((uint32_t *)(UID_BASE + 0x04U))));
  407. }
  408. /**
  409. * @brief Returns the third word of the unique device identifier (UID based on 96 bits)
  410. * @retval Device identifier
  411. */
  412. uint32_t HAL_GetUIDw2(void)
  413. {
  414. return(READ_REG(*((uint32_t *)(UID_BASE + 0x14U))));
  415. }
  416. /**
  417. * @}
  418. */
  419. /** @addtogroup HAL_Exported_Functions_Group2
  420. * @brief HAL Debug functions
  421. *
  422. @verbatim
  423. ===============================================================================
  424. ##### HAL Debug functions #####
  425. ===============================================================================
  426. [..] This section provides functions allowing to:
  427. (+) Enable/Disable Debug module during SLEEP mode
  428. (+) Enable/Disable Debug module during STOP mode
  429. (+) Enable/Disable Debug module during STANDBY mode
  430. @endverbatim
  431. * @{
  432. */
  433. /**
  434. * @brief Enables the Debug Module during SLEEP mode
  435. * @retval None
  436. */
  437. void HAL_DBGMCU_EnableDBGSleepMode(void)
  438. {
  439. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP);
  440. }
  441. /**
  442. * @brief Disables the Debug Module during SLEEP mode
  443. * @retval None
  444. */
  445. void HAL_DBGMCU_DisableDBGSleepMode(void)
  446. {
  447. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP);
  448. }
  449. /**
  450. * @brief Enables the Debug Module during STOP mode
  451. * @retval None
  452. */
  453. void HAL_DBGMCU_EnableDBGStopMode(void)
  454. {
  455. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP);
  456. }
  457. /**
  458. * @brief Disables the Debug Module during STOP mode
  459. * @retval None
  460. */
  461. void HAL_DBGMCU_DisableDBGStopMode(void)
  462. {
  463. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP);
  464. }
  465. /**
  466. * @brief Enables the Debug Module during STANDBY mode
  467. * @retval None
  468. */
  469. void HAL_DBGMCU_EnableDBGStandbyMode(void)
  470. {
  471. SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY);
  472. }
  473. /**
  474. * @brief Disables the Debug Module during STANDBY mode
  475. * @retval None
  476. */
  477. void HAL_DBGMCU_DisableDBGStandbyMode(void)
  478. {
  479. CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY);
  480. }
  481. /**
  482. * @brief Enable low power mode behavior when the MCU is in Debug mode.
  483. * @param Periph: specifies the low power mode.
  484. * This parameter can be any combination of the following values:
  485. * @arg DBGMCU_SLEEP: Keep debugger connection during SLEEP mode
  486. * @arg DBGMCU_STOP: Keep debugger connection during STOP mode
  487. * @arg DBGMCU_STANDBY: Keep debugger connection during STANDBY mode
  488. * @retval None
  489. */
  490. void HAL_DBGMCU_DBG_EnableLowPowerConfig(uint32_t Periph)
  491. {
  492. /* Check the parameters */
  493. assert_param(IS_DBGMCU_PERIPH(Periph));
  494. DBGMCU->CR |= Periph;
  495. }
  496. /**
  497. * @brief Disable low power mode behavior when the MCU is in Debug mode.
  498. * @param Periph: specifies the low power mode.
  499. * This parameter can be any combination of the following values:
  500. * @arg DBGMCU_SLEEP: Keep debugger connection during SLEEP mode
  501. * @arg DBGMCU_STOP: Keep debugger connection during STOP mode
  502. * @arg DBGMCU_STANDBY: Keep debugger connection during STANDBY mode
  503. * @retval None
  504. */
  505. void HAL_DBGMCU_DBG_DisableLowPowerConfig(uint32_t Periph)
  506. {
  507. /* Check the parameters */
  508. assert_param(IS_DBGMCU_PERIPH(Periph));
  509. {
  510. DBGMCU->CR &= ~Periph;
  511. }
  512. }
  513. /**
  514. * @}
  515. */
  516. /** @addtogroup HAL_Exported_Functions_Group3
  517. * @brief HAL SYSCFG configuration functions
  518. *
  519. @verbatim
  520. ===============================================================================
  521. ##### HAL SYSCFG configuration functions #####
  522. ===============================================================================
  523. [..] This section provides functions allowing to:
  524. (+) Return the boot mode
  525. (+) Select the output of internal reference voltage (VREFINT)
  526. (+) Lock/Unlock the SYSCFG VREF register values
  527. @endverbatim
  528. * @{
  529. */
  530. /**
  531. * @brief Returns the boot mode as configured by user.
  532. * @retval The boot mode as configured by user. The returned value can be one
  533. * of the following values:
  534. * - 0x00000000 : Boot is configured in Main Flash memory
  535. * - 0x00000100 : Boot is configured in System Flash memory
  536. * - 0x00000300 : Boot is configured in Embedded SRAM memory
  537. */
  538. uint32_t HAL_SYSCFG_GetBootMode(void)
  539. {
  540. return (SYSCFG->CFGR1 & SYSCFG_CFGR1_BOOT_MODE);
  541. }
  542. /**
  543. * @brief Selects the output of internal reference voltage (VREFINT).
  544. * The VREFINT output can be routed to(PB0) or
  545. * (PB1) or both.
  546. * @param SYSCFG_Vrefint_OUTPUT: new state of the Vrefint output.
  547. * This parameter can be one of the following values:
  548. * @arg SYSCFG_VREFINT_OUT_NONE
  549. * @arg SYSCFG_VREFINT_OUT_PB0
  550. * @arg SYSCFG_VREFINT_OUT_PB1
  551. * @arg SYSCFG_VREFINT_OUT_PB0_PB1
  552. * @retval None
  553. */
  554. void HAL_SYSCFG_VREFINT_OutputSelect(uint32_t SYSCFG_Vrefint_OUTPUT)
  555. {
  556. /* Check the parameters */
  557. assert_param(IS_SYSCFG_VREFINT_OUT_SELECT(SYSCFG_Vrefint_OUTPUT));
  558. /* Set the output Vrefint pin */
  559. SYSCFG->CFGR3 &= ~(SYSCFG_CFGR3_VREF_OUT);
  560. SYSCFG->CFGR3 |= (uint32_t)(SYSCFG_Vrefint_OUTPUT);
  561. }
  562. /**
  563. * @brief Lock the SYSCFG VREF register values
  564. * @retval None
  565. */
  566. void HAL_SYSCFG_Enable_Lock_VREFINT(void)
  567. {
  568. /* Enable the LOCK by setting REF_LOCK bit in the CFGR3 register */
  569. SET_BIT(SYSCFG->CFGR3, SYSCFG_CFGR3_REF_LOCK);
  570. }
  571. /**
  572. * @brief Unlock the overall SYSCFG VREF register values
  573. * @retval None
  574. */
  575. void HAL_SYSCFG_Disable_Lock_VREFINT(void)
  576. {
  577. /* Disable the LOCK by setting REF_LOCK bit in the CFGR3 register */
  578. CLEAR_BIT(SYSCFG->CFGR3, SYSCFG_CFGR3_REF_LOCK);
  579. }
  580. /**
  581. * @}
  582. */
  583. /**
  584. * @}
  585. */
  586. /**
  587. * @}
  588. */
  589. #endif /* HAL_MODULE_ENABLED */
  590. /**
  591. * @}
  592. */