summaryrefslogtreecommitdiff
path: root/board/waddledee/board.c
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2020-02-07 13:28:33 -0700
committerCommit Bot <commit-bot@chromium.org>2020-02-12 03:15:48 +0000
commitfdec8e3a239cc5c6dd40d9f95640bb8b6cbcf23c (patch)
tree0ee164b15732bee979c9310aa8fff8a3eb99918e /board/waddledee/board.c
parente49c175c63d94d59ee378ce1d97e4df8c25d987f (diff)
downloadchrome-ec-fdec8e3a239cc5c6dd40d9f95640bb8b6cbcf23c.tar.gz
Waddledee: Add thermistors
This change adds the temperature sensors for waddledee, which are hooked up to 2 of the ADCs. BUG=b:146557556 BRANCH=None TEST=builds Change-Id: I3475a586f0992df8cba33939611ce6a632f25119 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2044701 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board/waddledee/board.c')
-rw-r--r--board/waddledee/board.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/board/waddledee/board.c b/board/waddledee/board.c
index 61ca552a9c..6a1a0989cf 100644
--- a/board/waddledee/board.c
+++ b/board/waddledee/board.c
@@ -9,6 +9,7 @@
#include "driver/accel_lis2dh.h"
#include "driver/accelgyro_lsm6dsm.h"
#include "driver/sync.h"
+#include "driver/temp_sensor/thermistor.h"
#include "gpio.h"
#include "intc.h"
#include "keyboard_scan.h"
@@ -21,7 +22,6 @@
#include "tablet_mode.h"
#include "task.h"
#include "temp_sensor.h"
-#include "thermistor.h"
#include "uart.h"
static void filler_interrupt_handler(enum gpio_signal s)
@@ -173,6 +173,21 @@ struct motion_sensor_t motion_sensors[] = {
const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
+/* Thermistors */
+const struct temp_sensor_t temp_sensors[] = {
+ [TEMP_SENSOR_1] = {.name = "Memory",
+ .type = TEMP_SENSOR_TYPE_BOARD,
+ .read = get_temp_3v3_51k1_47k_4050b,
+ .idx = ADC_TEMP_SENSOR_1,
+ .action_delay_sec = 5},
+ [TEMP_SENSOR_2] = {.name = "Ambient",
+ .type = TEMP_SENSOR_TYPE_BOARD,
+ .read = get_temp_3v3_51k1_47k_4050b,
+ .idx = ADC_TEMP_SENSOR_2,
+ .action_delay_sec = 5},
+};
+BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
+
#ifndef TEST_BUILD
/* This callback disables keyboard when convertibles are fully open */
void lid_angle_peripheral_enable(int enable)