# STM32 vref sensor configuration options

# Copyright (c) 2023 Kenneth J. Miller <ken@miller.ec>
# SPDX-License-Identifier: Apache-2.0

config STM32_VREF
	bool "STM32 VREF Sensor"
	default y
	depends on DT_HAS_ST_STM32_ADC_ENABLED
	depends on DT_HAS_ST_STM32_VREF_ENABLED
	depends on SOC_FAMILY_STM32 && !SOC_SERIES_STM32F1X
	select ADC
	help
	  Enable driver for STM32 Vref sensor.

if STM32_VREF

config STM32_VREF_READ_CALIB_VIA_NVMEM
	bool "Read VREF calibration data using NVMEM"
	default y
	depends on OTP && NVMEM
	help
	  Read calibration data using the NVMEM subsystem
	  instead of using raw memory accesses.

config STM32_VREF_INJECTED
	bool "STM32 Vref Sensor through injected channel"
	depends on ADC_STM32_INJECTED_CHANNELS
	help
	  Vref measurement is done using the injected channel feature.
	  This will permanently enable the ADC Vref sensor (VREFEN bit set to 1).

endif # STM32_VREF
