STM32L4xx_HAL_Driver  1.14.0
HAL SYSCFG configuration functions

HAL SYSCFG configuration functions. More...

Functions

void HAL_SYSCFG_SRAM2Erase (void)
 Start a hardware SRAM2 erase operation. More...
 
void HAL_SYSCFG_EnableMemorySwappingBank (void)
 Enable the Internal FLASH Bank Swapping. More...
 
void HAL_SYSCFG_DisableMemorySwappingBank (void)
 Disable the Internal FLASH Bank Swapping. More...
 
void HAL_SYSCFG_VREFBUF_VoltageScalingConfig (uint32_t VoltageScaling)
 Configure the internal voltage reference buffer voltage scale. More...
 
void HAL_SYSCFG_VREFBUF_HighImpedanceConfig (uint32_t Mode)
 Configure the internal voltage reference buffer high impedance mode. More...
 
void HAL_SYSCFG_VREFBUF_TrimmingConfig (uint32_t TrimmingValue)
 Tune the Internal Voltage Reference buffer (VREFBUF). More...
 
HAL_StatusTypeDef HAL_SYSCFG_EnableVREFBUF (void)
 Enable the Internal Voltage Reference buffer (VREFBUF). More...
 
void HAL_SYSCFG_DisableVREFBUF (void)
 Disable the Internal Voltage Reference buffer (VREFBUF). More...
 
void HAL_SYSCFG_EnableIOAnalogSwitchBooster (void)
 Enable the I/O analog switch voltage booster. More...
 
void HAL_SYSCFG_DisableIOAnalogSwitchBooster (void)
 Disable the I/O analog switch voltage booster. More...
 

Detailed Description

HAL SYSCFG configuration functions.

 ===============================================================================
                      ##### HAL SYSCFG configuration functions #####
 ===============================================================================
    [..]  This section provides functions allowing to:
      (+) Start a hardware SRAM2 erase operation
      (+) Enable/Disable the Internal FLASH Bank Swapping
      (+) Configure the Voltage reference buffer
      (+) Enable/Disable the Voltage reference buffer
      (+) Enable/Disable the I/O analog switch voltage booster

Function Documentation

◆ HAL_SYSCFG_DisableIOAnalogSwitchBooster()

void HAL_SYSCFG_DisableIOAnalogSwitchBooster ( void  )

Disable the I/O analog switch voltage booster.

Return values
None

Definition at line 736 of file stm32l4xx_hal.c.

737 {
738  CLEAR_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_BOOSTEN);
739 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ HAL_SYSCFG_DisableMemorySwappingBank()

void HAL_SYSCFG_DisableMemorySwappingBank ( void  )

Disable the Internal FLASH Bank Swapping.

Note
This function can be used only for STM32L4xx devices.
The default state : Flash Bank1 mapped at 0x08000000 (and aliased @0x0000 0000) and Flash Bank2 mapped at 0x08100000 (and aliased at 0x00100000)
Return values
None

Definition at line 632 of file stm32l4xx_hal.c.

633 {
634 
635  *(__IO uint32_t *)FB_MODE_BB = 0x00000000UL;
636 }

◆ HAL_SYSCFG_DisableVREFBUF()

void HAL_SYSCFG_DisableVREFBUF ( void  )

Disable the Internal Voltage Reference buffer (VREFBUF).

Return values
None

Definition at line 715 of file stm32l4xx_hal.c.

716 {
717  CLEAR_BIT(VREFBUF->CSR, VREFBUF_CSR_ENVR);
718 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ HAL_SYSCFG_EnableIOAnalogSwitchBooster()

void HAL_SYSCFG_EnableIOAnalogSwitchBooster ( void  )

Enable the I/O analog switch voltage booster.

Return values
None

Definition at line 726 of file stm32l4xx_hal.c.

727 {
728  SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_BOOSTEN);
729 }

◆ HAL_SYSCFG_EnableMemorySwappingBank()

void HAL_SYSCFG_EnableMemorySwappingBank ( void  )

Enable the Internal FLASH Bank Swapping.

Note
This function can be used only for STM32L4xx devices.
Flash Bank2 mapped at 0x08000000 (and aliased @0x00000000) and Flash Bank1 mapped at 0x08100000 (and aliased at 0x00100000)
Return values
None

Definition at line 617 of file stm32l4xx_hal.c.

618 {
619  *(__IO uint32_t *)FB_MODE_BB = 0x00000001UL;
620 }

◆ HAL_SYSCFG_EnableVREFBUF()

HAL_StatusTypeDef HAL_SYSCFG_EnableVREFBUF ( void  )

Enable the Internal Voltage Reference buffer (VREFBUF).

Return values
HAL_OK/HAL_TIMEOUT

Definition at line 689 of file stm32l4xx_hal.c.

690 {
691  uint32_t tickstart;
692 
693  SET_BIT(VREFBUF->CSR, VREFBUF_CSR_ENVR);
694 
695  /* Get Start Tick*/
696  tickstart = HAL_GetTick();
697 
698  /* Wait for VRR bit */
699  while(READ_BIT(VREFBUF->CSR, VREFBUF_CSR_VRR) == 0U)
700  {
701  if((HAL_GetTick() - tickstart) > VREFBUF_TIMEOUT_VALUE)
702  {
703  return HAL_TIMEOUT;
704  }
705  }
706 
707  return HAL_OK;
708 }
uint32_t HAL_GetTick(void)
Provide a tick value in millisecond.
return HAL_OK

◆ HAL_SYSCFG_SRAM2Erase()

void HAL_SYSCFG_SRAM2Erase ( void  )

Start a hardware SRAM2 erase operation.

Note
As long as SRAM2 is not erased the SRAM2ER bit will be set. This bit is automatically reset at the end of the SRAM2 erase operation.
Return values
None

Definition at line 598 of file stm32l4xx_hal.c.

599 {
600  /* unlock the write protection of the SRAM2ER bit */
601  SYSCFG->SKR = 0xCA;
602  SYSCFG->SKR = 0x53;
603  /* Starts a hardware SRAM2 erase operation*/
604  *(__IO uint32_t *) SCSR_SRAM2ER_BB = 0x00000001UL;
605 }

◆ HAL_SYSCFG_VREFBUF_HighImpedanceConfig()

void HAL_SYSCFG_VREFBUF_HighImpedanceConfig ( uint32_t  Mode)

Configure the internal voltage reference buffer high impedance mode.

Parameters
Modespecifies the high impedance mode This parameter can be one of the following values:
  • SYSCFG_VREFBUF_HIGH_IMPEDANCE_DISABLE: VREF+ pin is internally connect to VREFINT output.
  • SYSCFG_VREFBUF_HIGH_IMPEDANCE_ENABLE: VREF+ pin is high impedance.
Return values
None

Definition at line 665 of file stm32l4xx_hal.c.

666 {
667  /* Check the parameters */
668  assert_param(IS_SYSCFG_VREFBUF_HIGH_IMPEDANCE(Mode));
669 
670  MODIFY_REG(VREFBUF->CSR, VREFBUF_CSR_HIZ, Mode);
671 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_SYSCFG_VREFBUF_TrimmingConfig()

void HAL_SYSCFG_VREFBUF_TrimmingConfig ( uint32_t  TrimmingValue)

Tune the Internal Voltage Reference buffer (VREFBUF).

Return values
None

Definition at line 677 of file stm32l4xx_hal.c.

678 {
679  /* Check the parameters */
680  assert_param(IS_SYSCFG_VREFBUF_TRIMMING(TrimmingValue));
681 
682  MODIFY_REG(VREFBUF->CCR, VREFBUF_CCR_TRIM, TrimmingValue);
683 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_SYSCFG_VREFBUF_VoltageScalingConfig()

void HAL_SYSCFG_VREFBUF_VoltageScalingConfig ( uint32_t  VoltageScaling)

Configure the internal voltage reference buffer voltage scale.

Parameters
VoltageScalingspecifies the output voltage to achieve This parameter can be one of the following values:
  • SYSCFG_VREFBUF_VOLTAGE_SCALE0: VREF_OUT1 around 2.048 V. This requires VDDA equal to or higher than 2.4 V.
  • SYSCFG_VREFBUF_VOLTAGE_SCALE1: VREF_OUT2 around 2.5 V. This requires VDDA equal to or higher than 2.8 V.
Return values
None

Definition at line 649 of file stm32l4xx_hal.c.

650 {
651  /* Check the parameters */
652  assert_param(IS_SYSCFG_VREFBUF_VOLTAGE_SCALE(VoltageScaling));
653 
654  MODIFY_REG(VREFBUF->CSR, VREFBUF_CSR_VRS, VoltageScaling);
655 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))