zephyr/drivers/sensor/st/stm32_temp/Kconfig
Mathieu Choplain 8d40279644 drivers: sensor: stm32_temp: handle disabled ADCs more gracefully
This commit modifies the STM32 internal temperature sensor driver
to handle erroneous usage more gracefully. More precisely:
 - driver no longer builds if no ADC node is enabled
 - fail builds with an explicit error message when the sensor
   is enabled but the corresponding ADC is not. This can only
   happen on STM32 series with more than one ADC (e.g., H7).

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-08-01 16:43:51 +02:00

17 lines
448 B
Plaintext

# 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.