HAL VREFBUF Functions

Configuration functions

group VREFBUF_Exported_Functions_Group1

This subsection provides a set of functions allowing to configure and start the VREFBUF peripheral:

Functions

hal_status_t HAL_VREFBUF_SetConfig ( hal_vrefbuf_t instance , const hal_vrefbuf_config_t * p_config )

Configure the VREFBUF (mode and voltage scale).

Parameters :
  • instance – VREFBUF instance.

  • p_config – Pointer to a hal_vrefbuf_config_t structure that contains the VREFBUF configuration.

Return values :
  • HAL_OK – VREFBUF instance has been correctly configured.

  • HAL_INVALID_PARAM – When the p_config pointer is NULL.

  • HAL_ERROR – HAL operation completed with error.

void HAL_VREFBUF_GetConfig ( hal_vrefbuf_t instance , hal_vrefbuf_config_t * p_config )

Get the configuration of VREFBUF (functional mode and voltage scale).

Parameters :
  • instance – VREFBUF instance.

  • p_config – Pointer to a hal_vrefbuf_config_t structure that contains the VREFBUF configuration.

hal_status_t HAL_VREFBUF_SetMode ( hal_vrefbuf_t instance , hal_vrefbuf_mode_t mode )

Set the functional mode of VREFBUF.

Parameters :
  • instance – VREFBUF instance.

  • mode – This parameter indicates the mode of VREFBUF hal_vrefbuf_mode_t enumeration.

Return values :
  • HAL_OK – VREFBUF mode has been correctly configured.

  • HAL_ERROR – HAL operation completed with error.

hal_vrefbuf_mode_t HAL_VREFBUF_GetMode ( hal_vrefbuf_t instance )

Get the functional mode of VREFBUF.

Parameters :

instance – VREFBUF instance.

Return values :

Value – of type hal_vrefbuf_mode_t .

hal_status_t HAL_VREFBUF_SetVoltageScale ( hal_vrefbuf_t instance , hal_vrefbuf_voltage_scale_t voltage_scale )

Set the voltage scale of VREFBUF.

Parameters :
  • instance – VREFBUF instance.

  • voltage_scale – This parameter indicates the voltage scale of VREFBUF hal_vrefbuf_voltage_scale_t enumeration.

Return values :
  • HAL_OK – VREFBUF voltage scale has been correctly configured.

  • HAL_ERROR – HAL operation completed with error.

hal_vrefbuf_voltage_scale_t HAL_VREFBUF_GetVoltageScale ( hal_vrefbuf_t instance )

Get the voltage scale of VREFBUF.

Parameters :

instance – VREFBUF instance.

Return values :

Value – of type hal_vrefbuf_voltage_scale_t .

Advanced configuration functions

group VREFBUF_Exported_Functions_Group2

This subsection provides a set of functions that allow the user to configure advanced functions in VREFBUF, giving the user greater control over the operation of the driver.

Functions

hal_status_t HAL_VREFBUF_SetTrimming ( hal_vrefbuf_t instance , uint32_t trimming_value )

Set the trimming value of VREFBUF.

Note

The trimming value is automatically initialized with the trimming value (according to the voltage scale selected) stored in the flash memory during the production test (factory trimming).

Note

The user can modify the trimming value with an arbitrary value for fine-tuning of VREFBUF output voltage (factory trimming value can be set back by device reset or data backup implemented at application level). In this case, any change of voltage scale is discarded.

Parameters :
  • instance – VREFBUF instance.

  • trimming_value – Trimming value (between 0 and 63).

Return values :

HAL_OK – trimming_value has been correctly configured.

uint32_t HAL_VREFBUF_GetTrimming ( hal_vrefbuf_t instance )

Get the trimming value of VREFBUF.

Parameters :

instance – VREFBUF instance.

Return values :

uint32_t – Trimming value (between 0 and 63).