HAL VREFBUF Overview

Introducing VREFBUF

group VREFBUF_Introduction

  • The VREFBUF (voltage reference buffer) hardware abstraction layer provides a set of APIs to interface with the STM32 voltage reference buffer peripheral.

  • It simplifies the configuration, initialization, and management of the internal reference voltage.

  • This abstraction layer ensures portability and ease of use across different STM32 series.

The HAL VREFBUF driver includes the following features:

  • Selectable output voltage levels

  • Provides a stable voltage reference for on-chip peripherals (ADC, DAC) and can be used as an external reference via the VREF+ pin

Module and files

The following diagram illustrates the VREFBUF module and its associated files.

Module and files diagram

Component diagram

The following diagram illustrates the software components involved in the VREFBUF module. It shows the interactions between the user application, HAL drivers, low-level drivers, and the hardware components.

@startuml
<style>
componentDiagram {
   arrow {
      FontSize 8
   }
}
</style>

title VREFBUF Software Component Diagram

package "HAL" {
    [HAL_VREFBUF]

}

package "Low Layer" {
    [LL_VREFBUF]
    [CMSIS device]
}

package "HW" {
    [STM32_HW]
}

[Appli] --> [HAL_VREFBUF] : HAL VREFBUF API
[HAL_VREFBUF] --> [LL_VREFBUF] : LL VREFBUF API
[LL_VREFBUF] --> [CMSIS device]:VREFBUF register def
[LL_VREFBUF] --> [STM32_HW]: VREFBUF registers R/W
@enduml

Configuration table

The following table lists the configuration defines for the HAL VREFBUF module, specifying their locations, default values, and descriptions:

group VREFBUF_Configuration_Table

Configuration inside the VREFBUF:

Config defines

Description

Default value

Note

USE_HAL_VREFBUF_MODULE

from hal_conf.h

1

When set, HAL VREFBUF module is enabled

USE_HAL_CHECK_PARAM

from hal_conf.h

0

Parameters (pointers or sizes) are checked in runtime

USE_ASSERT_DBG_PARAM

from PreProcessor env

None

When defined, enable the params assert