Merge pull request #11189 from klutvott123/move-telemetry-displayport-init
[betaflight.git] / lib / main / STM32G4 / Drivers / STM32G4xx_HAL_Driver / Src / stm32g4xx_hal.c
blob19beb14e957feb41262d0f7c59f83d90f42bf495
1 /**
2 ******************************************************************************
3 * @file stm32g4xx_hal.c
4 * @author MCD Application Team
5 * @brief HAL module driver.
6 * This is the common part of the HAL initialization
8 @verbatim
9 ==============================================================================
10 ##### How to use this driver #####
11 ==============================================================================
12 [..]
13 The common HAL driver contains a set of generic and common APIs that can be
14 used by the PPP peripheral drivers and the user to start using the HAL.
15 [..]
16 The HAL contains two APIs' categories:
17 (+) Common HAL APIs
18 (+) Services HAL APIs
20 @endverbatim
21 ******************************************************************************
22 * @attention
24 * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
25 * All rights reserved.</center></h2>
27 * This software component is licensed by ST under BSD 3-Clause license,
28 * the "License"; You may not use this file except in compliance with the
29 * License. You may obtain a copy of the License at:
30 * opensource.org/licenses/BSD-3-Clause
32 ******************************************************************************
35 /* Includes ------------------------------------------------------------------*/
36 #include "stm32g4xx_hal.h"
38 /** @addtogroup STM32G4xx_HAL_Driver
39 * @{
42 /** @defgroup HAL HAL
43 * @brief HAL module driver
44 * @{
47 #ifdef HAL_MODULE_ENABLED
49 /* Private typedef -----------------------------------------------------------*/
50 /* Private define ------------------------------------------------------------*/
51 /**
52 * @brief STM32G4xx HAL Driver version number $VERSION$
54 #define __STM32G4xx_HAL_VERSION_MAIN (0x01U) /*!< [31:24] main version */
55 #define __STM32G4xx_HAL_VERSION_SUB1 (0x00U) /*!< [23:16] sub1 version */
56 #define __STM32G4xx_HAL_VERSION_SUB2 (0x00U) /*!< [15:8] sub2 version */
57 #define __STM32G4xx_HAL_VERSION_RC (0x00U) /*!< [7:0] release candidate */
58 #define __STM32G4xx_HAL_VERSION ((__STM32G4xx_HAL_VERSION_MAIN << 24U)\
59 |(__STM32G4xx_HAL_VERSION_SUB1 << 16U)\
60 |(__STM32G4xx_HAL_VERSION_SUB2 << 8U )\
61 |(__STM32G4xx_HAL_VERSION_RC))
63 #if defined(VREFBUF)
64 #define VREFBUF_TIMEOUT_VALUE 10U /* 10 ms */
65 #endif /* VREFBUF */
67 /* ------------ SYSCFG registers bit address in the alias region ------------ */
68 #define SYSCFG_OFFSET (SYSCFG_BASE - PERIPH_BASE)
69 /* --- MEMRMP Register ---*/
70 /* Alias word address of FB_MODE bit */
71 #define MEMRMP_OFFSET SYSCFG_OFFSET
72 #define FB_MODE_BitNumber ((uint8_t)0x8)
73 #define FB_MODE_BB (PERIPH_BB_BASE + (MEMRMP_OFFSET * 32) + (FB_MODE_BitNumber * 4))
75 /* --- GPC Register ---*/
76 /* Alias word address of CCMER bit */
77 #define SCSR_OFFSET (SYSCFG_OFFSET + 0x18)
78 #define CCMER_BitNumber ((uint8_t)0x0)
79 #define SCSR_CCMER_BB (PERIPH_BB_BASE + (SCSR_OFFSET * 32) + (CCMER_BitNumber * 4))
81 /* Private macro -------------------------------------------------------------*/
82 /* Exported variables ---------------------------------------------------------*/
83 /** @defgroup HAL_Exported_Variables HAL Exported Variables
84 * @{
86 __IO uint32_t uwTick;
87 uint32_t uwTickPrio = (1UL << __NVIC_PRIO_BITS); /* Invalid PRIO */
88 uint32_t uwTickFreq = HAL_TICK_FREQ_DEFAULT; /* 1KHz */
89 /**
90 * @}
93 /* Private function prototypes -----------------------------------------------*/
94 /* Exported functions --------------------------------------------------------*/
96 /** @defgroup HAL_Exported_Functions HAL Exported Functions
97 * @{
100 /** @defgroup HAL_Exported_Functions_Group1 Initialization and de-initialization Functions
101 * @brief HAL Initialization and de-initialization functions
103 @verbatim
104 ===============================================================================
105 ##### Initialization and Configuration functions #####
106 ===============================================================================
107 [..] This section provides functions allowing to:
108 (+) Initialize the Flash interface the NVIC allocation and initial time base
109 clock configuration.
110 (+) De-Initialize common part of the HAL.
111 (+) Configure the time base source to have 1ms time base with a dedicated
112 Tick interrupt priority.
113 (++) SysTick timer is used by default as source of time base, but user
114 can eventually implement his proper time base source (a general purpose
115 timer for example or other time source), keeping in mind that Time base
116 duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and
117 handled in milliseconds basis.
118 (++) Time base configuration function (HAL_InitTick ()) is called automatically
119 at the beginning of the program after reset by HAL_Init() or at any time
120 when clock is configured, by HAL_RCC_ClockConfig().
121 (++) Source of time base is configured to generate interrupts at regular
122 time intervals. Care must be taken if HAL_Delay() is called from a
123 peripheral ISR process, the Tick interrupt line must have higher priority
124 (numerically lower) than the peripheral interrupt. Otherwise the caller
125 ISR process will be blocked.
126 (++) functions affecting time base configurations are declared as __weak
127 to make override possible in case of other implementations in user file.
128 @endverbatim
129 * @{
133 * @brief This function is used to configure the Flash prefetch, the Instruction and Data caches,
134 * the time base source, NVIC and any required global low level hardware
135 * by calling the HAL_MspInit() callback function to be optionally defined in user file
136 * stm32g4xx_hal_msp.c.
138 * @note HAL_Init() function is called at the beginning of program after reset and before
139 * the clock configuration.
141 * @note In the default implementation the System Timer (Systick) is used as source of time base.
142 * The Systick configuration is based on HSI clock, as HSI is the clock
143 * used after a system Reset and the NVIC configuration is set to Priority group 4.
144 * Once done, time base tick starts incrementing: the tick variable counter is incremented
145 * each 1ms in the SysTick_Handler() interrupt handler.
147 * @retval HAL status
149 HAL_StatusTypeDef HAL_Init(void)
151 HAL_StatusTypeDef status = HAL_OK;
152 /* Configure Flash prefetch, Instruction cache, Data cache */
153 /* Default configuration at reset is: */
154 /* - Prefetch disabled */
155 /* - Instruction cache enabled */
156 /* - Data cache enabled */
157 #if (INSTRUCTION_CACHE_ENABLE == 0U)
158 __HAL_FLASH_INSTRUCTION_CACHE_DISABLE();
159 #endif /* INSTRUCTION_CACHE_ENABLE */
161 #if (DATA_CACHE_ENABLE == 0U)
162 __HAL_FLASH_DATA_CACHE_DISABLE();
163 #endif /* DATA_CACHE_ENABLE */
165 #if (PREFETCH_ENABLE != 0U)
166 __HAL_FLASH_PREFETCH_BUFFER_ENABLE();
167 #endif /* PREFETCH_ENABLE */
169 /* Set Interrupt Group Priority */
170 HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4);
172 /* Use SysTick as time base source and configure 1ms tick (default clock after Reset is HSI) */
173 if (HAL_InitTick(TICK_INT_PRIORITY) != HAL_OK)
175 status = HAL_ERROR;
177 else
179 /* Init the low level hardware */
180 HAL_MspInit();
183 /* Return function status */
184 return status;
189 * @brief This function de-initializes common part of the HAL and stops the source of time base.
190 * @note This function is optional.
191 * @retval HAL status
193 HAL_StatusTypeDef HAL_DeInit(void)
195 /* Reset of all peripherals */
196 __HAL_RCC_APB1_FORCE_RESET();
197 __HAL_RCC_APB1_RELEASE_RESET();
199 __HAL_RCC_APB2_FORCE_RESET();
200 __HAL_RCC_APB2_RELEASE_RESET();
202 __HAL_RCC_AHB1_FORCE_RESET();
203 __HAL_RCC_AHB1_RELEASE_RESET();
205 __HAL_RCC_AHB2_FORCE_RESET();
206 __HAL_RCC_AHB2_RELEASE_RESET();
208 __HAL_RCC_AHB3_FORCE_RESET();
209 __HAL_RCC_AHB3_RELEASE_RESET();
211 /* De-Init the low level hardware */
212 HAL_MspDeInit();
214 /* Return function status */
215 return HAL_OK;
219 * @brief Initialize the MSP.
220 * @retval None
222 __weak void HAL_MspInit(void)
224 /* NOTE : This function should not be modified, when the callback is needed,
225 the HAL_MspInit could be implemented in the user file
230 * @brief DeInitializes the MSP.
231 * @retval None
233 __weak void HAL_MspDeInit(void)
235 /* NOTE : This function should not be modified, when the callback is needed,
236 the HAL_MspDeInit could be implemented in the user file
241 * @brief This function configures the source of the time base:
242 * The time source is configured to have 1ms time base with a dedicated
243 * Tick interrupt priority.
244 * @note This function is called automatically at the beginning of program after
245 * reset by HAL_Init() or at any time when clock is reconfigured by HAL_RCC_ClockConfig().
246 * @note In the default implementation, SysTick timer is the source of time base.
247 * It is used to generate interrupts at regular time intervals.
248 * Care must be taken if HAL_Delay() is called from a peripheral ISR process,
249 * The SysTick interrupt must have higher priority (numerically lower)
250 * than the peripheral interrupt. Otherwise the caller ISR process will be blocked.
251 * The function is declared as __weak to be overwritten in case of other
252 * implementation in user file.
253 * @param TickPriority: Tick interrupt priority.
254 * @retval HAL status
256 __weak HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
258 HAL_StatusTypeDef status = HAL_OK;
260 if (uwTickFreq != 0U)
262 /* Configure the SysTick to have interrupt in 1ms time basis*/
263 if (HAL_SYSTICK_Config(SystemCoreClock / (1000U / uwTickFreq)) == 0U)
265 /* Configure the SysTick IRQ priority */
266 if (TickPriority < (1UL << __NVIC_PRIO_BITS))
268 HAL_NVIC_SetPriority(SysTick_IRQn, TickPriority, 0U);
269 uwTickPrio = TickPriority;
271 else
273 status = HAL_ERROR;
276 else
278 status = HAL_ERROR;
281 else
283 status = HAL_ERROR;
286 /* Return function status */
287 return status;
291 * @}
294 /** @defgroup HAL_Exported_Functions_Group2 HAL Control functions
295 * @brief HAL Control functions
297 @verbatim
298 ===============================================================================
299 ##### HAL Control functions #####
300 ===============================================================================
301 [..] This section provides functions allowing to:
302 (+) Provide a tick value in millisecond
303 (+) Provide a blocking delay in millisecond
304 (+) Suspend the time base source interrupt
305 (+) Resume the time base source interrupt
306 (+) Get the HAL API driver version
307 (+) Get the device identifier
308 (+) Get the device revision identifier
310 @endverbatim
311 * @{
315 * @brief This function is called to increment a global variable "uwTick"
316 * used as application time base.
317 * @note In the default implementation, this variable is incremented each 1ms
318 * in SysTick ISR.
319 * @note This function is declared as __weak to be overwritten in case of other
320 * implementations in user file.
321 * @retval None
323 __weak void HAL_IncTick(void)
325 uwTick += uwTickFreq;
329 * @brief Provides a tick value in millisecond.
330 * @note This function is declared as __weak to be overwritten in case of other
331 * implementations in user file.
332 * @retval tick value
334 __weak uint32_t HAL_GetTick(void)
336 return uwTick;
340 * @brief This function returns a tick priority.
341 * @retval tick priority
343 uint32_t HAL_GetTickPrio(void)
345 return uwTickPrio;
349 * @brief Set new tick Freq.
350 * @retval Status
352 HAL_StatusTypeDef HAL_SetTickFreq(uint32_t Freq)
354 HAL_StatusTypeDef status = HAL_OK;
355 assert_param(IS_TICKFREQ(Freq));
357 if (uwTickFreq != Freq)
359 uwTickFreq = Freq;
361 /* Apply the new tick Freq */
362 status = HAL_InitTick(uwTickPrio);
365 return status;
369 * @brief Returns tick frequency.
370 * @retval tick period in Hz
372 uint32_t HAL_GetTickFreq(void)
374 return uwTickFreq;
378 * @brief This function provides minimum delay (in milliseconds) based
379 * on variable incremented.
380 * @note In the default implementation , SysTick timer is the source of time base.
381 * It is used to generate interrupts at regular time intervals where uwTick
382 * is incremented.
383 * @note This function is declared as __weak to be overwritten in case of other
384 * implementations in user file.
385 * @param Delay specifies the delay time length, in milliseconds.
386 * @retval None
388 __weak void HAL_Delay(uint32_t Delay)
390 uint32_t tickstart = HAL_GetTick();
391 uint32_t wait = Delay;
393 /* Add a freq to guarantee minimum wait */
394 if (wait < HAL_MAX_DELAY)
396 wait += (uint32_t)(uwTickFreq);
399 while ((HAL_GetTick() - tickstart) < wait)
405 * @brief Suspends Tick increment.
406 * @note In the default implementation , SysTick timer is the source of time base. It is
407 * used to generate interrupts at regular time intervals. Once HAL_SuspendTick()
408 * is called, the SysTick interrupt will be disabled and so Tick increment
409 * is suspended.
410 * @note This function is declared as __weak to be overwritten in case of other
411 * implementations in user file.
412 * @retval None
414 __weak void HAL_SuspendTick(void)
416 /* Disable SysTick Interrupt */
417 CLEAR_BIT(SysTick->CTRL, SysTick_CTRL_TICKINT_Msk);
421 * @brief Resume Tick increment.
422 * @note In the default implementation , SysTick timer is the source of time base. It is
423 * used to generate interrupts at regular time intervals. Once HAL_ResumeTick()
424 * is called, the SysTick interrupt will be enabled and so Tick increment
425 * is resumed.
426 * @note This function is declared as __weak to be overwritten in case of other
427 * implementations in user file.
428 * @retval None
430 __weak void HAL_ResumeTick(void)
432 /* Enable SysTick Interrupt */
433 SET_BIT(SysTick->CTRL, SysTick_CTRL_TICKINT_Msk);
437 * @brief Returns the HAL revision.
438 * @retval version : 0xXYZR (8bits for each decimal, R for RC)
440 uint32_t HAL_GetHalVersion(void)
442 return __STM32G4xx_HAL_VERSION;
446 * @brief Returns the device revision identifier.
447 * @retval Device revision identifier
449 uint32_t HAL_GetREVID(void)
451 return ((DBGMCU->IDCODE & DBGMCU_IDCODE_REV_ID) >> 16U);
455 * @brief Returns the device identifier.
456 * @retval Device identifier
458 uint32_t HAL_GetDEVID(void)
460 return (DBGMCU->IDCODE & DBGMCU_IDCODE_DEV_ID);
464 * @}
467 /** @defgroup HAL_Exported_Functions_Group3 HAL Debug functions
468 * @brief HAL Debug functions
470 @verbatim
471 ===============================================================================
472 ##### HAL Debug functions #####
473 ===============================================================================
474 [..] This section provides functions allowing to:
475 (+) Enable/Disable Debug module during SLEEP mode
476 (+) Enable/Disable Debug module during STOP0/STOP1/STOP2 modes
477 (+) Enable/Disable Debug module during STANDBY mode
479 @endverbatim
480 * @{
484 * @brief Enable the Debug Module during SLEEP mode.
485 * @retval None
487 void HAL_DBGMCU_EnableDBGSleepMode(void)
489 SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP);
493 * @brief Disable the Debug Module during SLEEP mode.
494 * @retval None
496 void HAL_DBGMCU_DisableDBGSleepMode(void)
498 CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP);
502 * @brief Enable the Debug Module during STOP0/STOP1/STOP2 modes.
503 * @retval None
505 void HAL_DBGMCU_EnableDBGStopMode(void)
507 SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP);
511 * @brief Disable the Debug Module during STOP0/STOP1/STOP2 modes.
512 * @retval None
514 void HAL_DBGMCU_DisableDBGStopMode(void)
516 CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP);
520 * @brief Enable the Debug Module during STANDBY mode.
521 * @retval None
523 void HAL_DBGMCU_EnableDBGStandbyMode(void)
525 SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY);
529 * @brief Disable the Debug Module during STANDBY mode.
530 * @retval None
532 void HAL_DBGMCU_DisableDBGStandbyMode(void)
534 CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY);
538 * @}
541 /** @defgroup HAL_Exported_Functions_Group4 HAL SYSCFG configuration functions
542 * @brief HAL SYSCFG configuration functions
544 @verbatim
545 ===============================================================================
546 ##### HAL SYSCFG configuration functions #####
547 ===============================================================================
548 [..] This section provides functions allowing to:
549 (+) Start a hardware CCMSRAM erase operation
550 (+) Enable/Disable the Internal FLASH Bank Swapping
551 (+) Configure the Voltage reference buffer
552 (+) Enable/Disable the Voltage reference buffer
553 (+) Enable/Disable the I/O analog switch voltage booster
555 @endverbatim
556 * @{
560 * @brief Start a hardware CCMSRAM erase operation.
561 * @note As long as CCMSRAM is not erased the CCMER bit will be set.
562 * This bit is automatically reset at the end of the CCMSRAM erase operation.
563 * @retval None
565 void HAL_SYSCFG_CCMSRAMErase(void)
567 /* unlock the write protection of the CCMER bit */
568 SYSCFG->SKR = 0xCA;
569 SYSCFG->SKR = 0x53;
570 /* Starts a hardware CCMSRAM erase operation*/
571 SET_BIT(SYSCFG->SCSR, SYSCFG_SCSR_CCMER);
575 * @brief Enable the Internal FLASH Bank Swapping.
577 * @note This function can be used only for STM32G4xx devices.
579 * @note Flash Bank2 mapped at 0x08000000 (and aliased @0x00000000)
580 * and Flash Bank1 mapped at 0x08040000 (and aliased at 0x00040000)
582 * @retval None
584 void HAL_SYSCFG_EnableMemorySwappingBank(void)
586 SET_BIT(SYSCFG->MEMRMP, SYSCFG_MEMRMP_FB_MODE);
590 * @brief Disable the Internal FLASH Bank Swapping.
592 * @note This function can be used only for STM32G4xx devices.
594 * @note The default state : Flash Bank1 mapped at 0x08000000 (and aliased @0x0000 0000)
595 * and Flash Bank2 mapped at 0x08040000 (and aliased at 0x00040000)
597 * @retval None
599 void HAL_SYSCFG_DisableMemorySwappingBank(void)
601 CLEAR_BIT(SYSCFG->MEMRMP, SYSCFG_MEMRMP_FB_MODE);
604 #if defined(VREFBUF)
606 * @brief Configure the internal voltage reference buffer voltage scale.
607 * @param VoltageScaling: specifies the output voltage to achieve
608 * This parameter can be one of the following values:
609 * @arg SYSCFG_VREFBUF_VOLTAGE_SCALE0: VREFBUF_OUT around 2.048 V.
610 * This requires VDDA equal to or higher than 2.4 V.
611 * @arg SYSCFG_VREFBUF_VOLTAGE_SCALE1: VREFBUF_OUT around 2.5 V.
612 * This requires VDDA equal to or higher than 2.8 V.
613 * @arg SYSCFG_VREFBUF_VOLTAGE_SCALE2: VREFBUF_OUT around 2.9 V.
614 * This requires VDDA equal to or higher than 3.15 V.
615 * @retval None
617 void HAL_SYSCFG_VREFBUF_VoltageScalingConfig(uint32_t VoltageScaling)
619 /* Check the parameters */
620 assert_param(IS_SYSCFG_VREFBUF_VOLTAGE_SCALE(VoltageScaling));
622 MODIFY_REG(VREFBUF->CSR, VREFBUF_CSR_VRS, VoltageScaling);
626 * @brief Configure the internal voltage reference buffer high impedance mode.
627 * @param Mode: specifies the high impedance mode
628 * This parameter can be one of the following values:
629 * @arg SYSCFG_VREFBUF_HIGH_IMPEDANCE_DISABLE: VREF+ pin is internally connect to VREFINT output.
630 * @arg SYSCFG_VREFBUF_HIGH_IMPEDANCE_ENABLE: VREF+ pin is high impedance.
631 * @retval None
633 void HAL_SYSCFG_VREFBUF_HighImpedanceConfig(uint32_t Mode)
635 /* Check the parameters */
636 assert_param(IS_SYSCFG_VREFBUF_HIGH_IMPEDANCE(Mode));
638 MODIFY_REG(VREFBUF->CSR, VREFBUF_CSR_HIZ, Mode);
642 * @brief Tune the Internal Voltage Reference buffer (VREFBUF).
643 * @param TrimmingValue specifies trimming code for VREFBUF calibration
644 * This parameter can be a number between Min_Data = 0x00 and Max_Data = 0x3F
645 * @retval None
647 void HAL_SYSCFG_VREFBUF_TrimmingConfig(uint32_t TrimmingValue)
649 /* Check the parameters */
650 assert_param(IS_SYSCFG_VREFBUF_TRIMMING(TrimmingValue));
652 MODIFY_REG(VREFBUF->CCR, VREFBUF_CCR_TRIM, TrimmingValue);
656 * @brief Enable the Internal Voltage Reference buffer (VREFBUF).
657 * @retval HAL_OK/HAL_TIMEOUT
659 HAL_StatusTypeDef HAL_SYSCFG_EnableVREFBUF(void)
661 uint32_t tickstart;
663 SET_BIT(VREFBUF->CSR, VREFBUF_CSR_ENVR);
665 /* Get Start Tick*/
666 tickstart = HAL_GetTick();
668 /* Wait for VRR bit */
669 while (READ_BIT(VREFBUF->CSR, VREFBUF_CSR_VRR) == 0x00U)
671 if ((HAL_GetTick() - tickstart) > VREFBUF_TIMEOUT_VALUE)
673 return HAL_TIMEOUT;
677 return HAL_OK;
681 * @brief Disable the Internal Voltage Reference buffer (VREFBUF).
683 * @retval None
685 void HAL_SYSCFG_DisableVREFBUF(void)
687 CLEAR_BIT(VREFBUF->CSR, VREFBUF_CSR_ENVR);
689 #endif /* VREFBUF */
692 * @brief Enable the I/O analog switch voltage booster
694 * @retval None
696 void HAL_SYSCFG_EnableIOSwitchBooster(void)
698 SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_BOOSTEN);
702 * @brief Disable the I/O analog switch voltage booster
704 * @retval None
706 void HAL_SYSCFG_DisableIOSwitchBooster(void)
708 CLEAR_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_BOOSTEN);
712 * @brief Enable the I/O analog switch voltage by VDD
714 * @retval None
716 void HAL_SYSCFG_EnableIOSwitchVDD(void)
718 SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_ANASWVDD);
722 * @brief Disable the I/O analog switch voltage by VDD
724 * @retval None
726 void HAL_SYSCFG_DisableIOSwitchVDD(void)
728 CLEAR_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_ANASWVDD);
732 /** @brief CCMSRAM page write protection enable
733 * @param Page: This parameter is a long 32bit value and can be a value of @ref SYSCFG_CCMSRAMWRP
734 * @note write protection can only be disabled by a system reset
735 * @retval None
737 void HAL_SYSCFG_CCMSRAM_WriteProtectionEnable(uint32_t Page)
739 assert_param(IS_SYSCFG_CCMSRAMWRP_PAGE(Page));
741 SET_BIT(SYSCFG->SWPR, (uint32_t)(Page));
746 * @}
750 * @}
753 #endif /* HAL_MODULE_ENABLED */
755 * @}
759 * @}
762 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/