Skip to content
STMicroelectronics Logo
Type to start searching
  • Table Of Contents
  • STM32 HAL/LL Drivers Documentation
  • Drivers Overview
  • STM32U5 HAL/LL Drivers Documentation
    • STM32U5 Drivers Overview
    • HAL Drivers
      • HAL Common Drivers
      • HAL ADC
      • HAL ADF
      • HAL AES
      • HAL COMP
      • HAL CORDIC
      • HAL CORTEX
      • HAL CRC
      • HAL CRS
      • HAL DAC
      • HAL DBGMCU
      • HAL DCACHE
      • HAL DCMI
      • HAL DMA2D
      • HAL DMA
      • HAL DSI
      • HAL EXTI
      • HAL FDCAN
      • HAL FLASH
      • HAL FMAC
      • HAL GFXMMU
      • HAL GFXTIM
      • HAL GPIO
      • HAL GPU2D
      • HAL GTZC
      • HAL HASH
      • HAL HCD
      • HAL I2C
      • HAL ICACHE
      • HAL IWDG
      • HAL JPEG
      • HAL LPTIM
      • HAL LTDC
      • HAL MDF
      • HAL MMC
      • HAL NOR
      • HAL OPAMP
      • HAL PCD
      • HAL PKA
      • HAL PSSI
      • HAL PWR
      • HAL Q
      • HAL RAMCFG
      • HAL RCC
      • HAL RNG
      • HAL RTC
      • HAL SAI
      • HAL SD
      • HAL SDIO
      • HAL SMARTCARD
      • HAL SMBUS
      • HAL SPI
      • HAL SRAM
      • HAL SYSCFG
      • HAL TAMP
      • HAL TIM
      • HAL UART
      • HAL UCPD
      • HAL USART
      • HAL VREFBUF
        • HAL VREFBUF Overview
        • HAL VREFBUF How to Use
        • HAL VREFBUF Use Cases
          • HAL VREFBUF Use Cases
            • Typical Use Case
            • Change Single Parameter During Application Lifetime
            • Configure Trimming Value
        • HAL VREFBUF APIs
      • HAL WWDG
      • HAL XSPI
    • LL Drivers
  • HAL VREFBUF Use Cases
    • Typical Use Case
    • Change Single Parameter During Application Lifetime
    • Configure Trimming Value

HAL VREFBUF Use Cases ¶

Typical Use Case ¶

@startuml

"User Application" -> "Driver System" : HAL_Init()

"Driver System" --> "User Application"



"User Application" -> "Driver RCC" : HAL_RCC_VREFBUF_EnableClock()

"Driver RCC" --> "User Application"



"User Application" -> "Driver VREFBUF" : HAL_VREFBUF_SetConfig()

rnote over "Driver VREFBUF"

**If VREFBUF mode is Internal** 

**Voltage Reference, wait until**

**its output voltage reaches** 

**the expected value.**

endrnote 

... 

"Driver VREFBUF" --> "User Application"

@enduml

Called functions:

  • HAL_VREFBUF_SetConfig()

Change Single Parameter During Application Lifetime ¶

@startuml

"User Application" -> "Driver System" : HAL_Init()

"Driver System" --> "User Application"

"User Application" -> "Driver RCC" : HAL_RCC_VREFBUF_EnableClock()

"Driver RCC" --> "User Application"



"User Application" -> "Driver VREFBUF" : HAL_VREFBUF_SetConfig()

rnote over "Driver VREFBUF"

**If VREFBUF mode is Internal** 

**Voltage Reference, wait until**

**its output voltage reaches** 

**the expected value.**

endrnote 

...

"Driver VREFBUF" --> "User Application"

rnote over "User Application"

**User can choose all options**

**or one of them or nothing**

end rnote



group Option 1  [Voltage scale]

"User Application" ->  "Driver VREFBUF" :  HAL_VREFBUF_SetVoltageScale()

rnote over "Driver VREFBUF"

If VREFBUF mode is Internal

Voltage Reference, wait until

its output voltage reaches

the expected value.

endrnote

...

"Driver VREFBUF" --> "User Application" :

end



group Option 2  [Functional Mode]

"User Application" ->  "Driver VREFBUF" :  HAL_VREFBUF_SetMode()

rnote over "Driver VREFBUF"

If VREFBUF mode is Internal

Voltage Reference, wait until

its output voltage reaches

the expected value.

endrnote

...

"Driver VREFBUF" --> "User Application" :

end



@enduml

Called functions:

  • HAL_VREFBUF_SetConfig()

  • HAL_VREFBUF_SetVoltageScale()

  • HAL_VREFBUF_SetMode()

Configure Trimming Value ¶

@startuml

"User Application" -> "Driver System" : HAL_Init()

"Driver System" --> "User Application"

"User Application" -> "Driver RCC" : HAL_RCC_VREFBUF_EnableClock()

"Driver RCC" --> "User Application"





"User Application" -> "Driver VREFBUF" : HAL_VREFBUF_SetConfig()

rnote over "Driver VREFBUF"

**If VREFBUF mode is Internal** 

**Voltage Reference, wait until**

**its output voltage reaches** 

**the expected value.**

endrnote 

...

"Driver VREFBUF" --> "User Application" :



group Option  [Trimming Value]

"User Application" ->  "Driver VREFBUF" : HAL_VREFBUF_GetTrimming()

"Driver VREFBUF" --> "User Application" :

end 

note right: **To get initial trimming configuration** 

"User Application" ->  "Driver VREFBUF" : HAL_VREFBUF_SetTrimming()

"Driver VREFBUF" --> "User Application" :





@enduml

Called functions:

  • HAL_VREFBUF_SetConfig()

  • HAL_VREFBUF_GetTrimming()

  • HAL_VREFBUF_SetTrimming()

© Copyright 2025, STMicroelectronics.