# STM32 temperature sensor configuration options

# Copyright (c) 2021 Eug Krashtan
# SPDX-License-Identifier: Apache-2.0

config STM32_TEMP
	bool "STM32 Temperature Sensor"
	default y
	depends on SOC_FAMILY_STM32
	depends on DT_HAS_ST_STM32_ADC_ENABLED
	depends on DT_HAS_ST_STM32_TEMP_ENABLED || \
		   DT_HAS_ST_STM32_TEMP_CAL_ENABLED || \
		   DT_HAS_ST_STM32C0_TEMP_CAL_ENABLED
	select ADC
	help
	  Enable driver for STM32 temperature sensor.

if STM32_TEMP

config STM32_TEMP_READ_CALIB_VIA_NVMEM
	bool "Read Temperature Sensor 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_TEMP_INJECTED
	bool "STM32 Temperature Sensor through injected channel"
	depends on ADC_STM32_INJECTED_CHANNELS
	help
	  Temperature measurement is done using the injected channel feature.
	  This will permanently enable the ADC temperature sensor (VSENSESEL bit set to 1).

endif # STM32_TEMP
