summaryrefslogtreecommitdiff
path: root/zephyr/Kconfig.temperature
diff options
context:
space:
mode:
authorDawid Niedzwiecki <dn@semihalf.com>2021-02-05 13:04:18 +0100
committerCommit Bot <commit-bot@chromium.org>2021-02-17 06:49:23 +0000
commitfe93af445598a7d42615ce8a0e7c9d8d0f862ac1 (patch)
tree1bdc7d740b6afaa190dfc2fe8b58f7e7d04d7cd6 /zephyr/Kconfig.temperature
parent2adcac085e240c00d4b32ba11404e98be36f1ee9 (diff)
downloadchrome-ec-fe93af445598a7d42615ce8a0e7c9d8d0f862ac1.tar.gz
zephyr: add shim temperature sensors
Add temperature sensors shim. Use platform/ec the temperature sensors drivers. Generate needed global variables/types: enum temp_sensor_id and temp_sensors from dts. Each temperature sensor type has its own compatible property to assign a correct read function in the temp_sensor_t temp_sensors[] array. Themrmisors has also adc property to point an ADC channel connected to the sensor. Enable "temps" console command and EC_CMD_TEMP_SENSOR_GET_INFO host command. BUG=b:174851465 BRANCH=none TEST=build Zephyr TEST=Run "temps" command, it should return the current temperature measurements Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: Ie680ec0771ea3da598066eb98db80944a93daca5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2687218 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'zephyr/Kconfig.temperature')
-rw-r--r--zephyr/Kconfig.temperature68
1 files changed, 68 insertions, 0 deletions
diff --git a/zephyr/Kconfig.temperature b/zephyr/Kconfig.temperature
new file mode 100644
index 0000000000..d949c60c84
--- /dev/null
+++ b/zephyr/Kconfig.temperature
@@ -0,0 +1,68 @@
+# Copyright 2021 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+menuconfig PLATFORM_EC_TEMP_SENSOR
+ bool "Temperature sensors"
+ help
+ Support for temperature sensors. Once enabled, "temps" console
+ command and EC_CMD_TEMP_SENSOR_GET_INFO host command are available.
+
+if PLATFORM_EC_TEMP_SENSOR
+
+config PLATFORM_EC_THERMISTOR
+ bool "Thermistor support"
+ depends on PLATFORM_EC_ADC
+ help
+ Enables support for thermistors (resistor whose resistance is
+ strongly dependent on temperature) as temperature-sensor type.
+
+config PLATFORM_EC_STEINHART_HART_3V0_22K6_47K_4050B
+ bool "Steinhart-hart 3V0_22K6_47K_4050B"
+ depends on PLATFORM_EC_THERMISTOR
+ help
+ Enables support for measuring temperature using the Steinhart-Hart
+ equation model and the thermistor configured with the following
+ circuit configuration:
+ -3.0V reference voltage
+ -22.6 kilohm fixed resistor, connected to the reference voltage
+ -47 kilohm thermistor reference resistance at 25 C
+ -4050 B-constant (thermistor sensitivity)
+
+config PLATFORM_EC_STEINHART_HART_3V3_13K7_47K_4050B
+ bool "Steinhart-hart 3V3_13K7_47K_4050B"
+ depends on PLATFORM_EC_THERMISTOR
+ help
+ Enables support for measuring temperature using the Steinhart-Hart
+ equation model and the thermistor configured with the following
+ circuit configuration:
+ -3.3V reference voltage
+ -13.7 kilohm fixed resistor, connected to the reference voltage
+ -47 kilohm thermistor reference resistance at 25 C
+ -4050 B-constant (thermistor sensitivity)
+
+config PLATFORM_EC_STEINHART_HART_3V3_30K9_47K_4050B
+ bool "Steinhart-hart 3V3_30K9_47K_4050B"
+ depends on PLATFORM_EC_THERMISTOR
+ help
+ Enables support for measuring temperature using the Steinhart-Hart
+ equation model and the thermistor configured with the following
+ circuit configuration:
+ -3.3V reference voltage
+ -30.9 kilohm fixed resistor, connected to the reference voltage
+ -47 kilohm thermistor reference resistance at 25 C
+ -4050 B-constant (thermistor sensitivity)
+
+config PLATFORM_EC_STEINHART_HART_3V3_51K1_47K_4050B
+ bool "Steinhart-hart 3V3_51K1_47K_4050B"
+ depends on PLATFORM_EC_THERMISTOR
+ default y
+ help
+ Enables support for measuring temperature using the Steinhart-Hart
+ equation model and the thermistor configured with the following
+ circuit configuration:
+ -3.3V reference voltage
+ -51.1 kilohm fixed resistor, connected to the reference voltage
+ -47 kilohm thermistor reference resistance at 25 C
+ -4050 B-constant (thermistor sensitivity)
+endif # PLATFORM_EC_TEMP_SENSOR