summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVic Yang <victoryang@google.com>2011-12-21 17:03:43 +0800
committerVic Yang <victoryang@google.com>2011-12-22 13:51:07 +0800
commitb228bc14c01f54bc70b82ea85bcb82dd402006a1 (patch)
tree79842c8aa2894a11abe75954e4e99da7edd61744 /include
parent84a286b1f49c25df1d44bbf87d748b20421f5521 (diff)
downloadchrome-ec-b228bc14c01f54bc70b82ea85bcb82dd402006a1.tar.gz
Add host command to read temperature sensor value
Add a LPC host command to read temperature sensor value with given sensor id. Add ectool command to read temperature sensor value through LPC. BUG=chrome-os-partner:7329 TEST=Manual check the reading received is the same as value printed by console command. Change-Id: Id3386774435be6c3ae010a143f4fa894568efdb8
Diffstat (limited to 'include')
-rw-r--r--include/lpc_commands.h12
-rw-r--r--include/temp_sensor_commands.h19
2 files changed, 31 insertions, 0 deletions
diff --git a/include/lpc_commands.h b/include/lpc_commands.h
index 08b4d9c1d8..a7ba4818c9 100644
--- a/include/lpc_commands.h
+++ b/include/lpc_commands.h
@@ -205,4 +205,16 @@ struct lpc_response_flash_checksum {
#endif /* SUPPORT_CHECKSUM */
+/*****************************************************************************/
+/* Temperature sensor commands */
+
+/* Get temperature readings */
+#define EC_LPC_COMMAND_TEMP_SENSOR_GET_READINGS 0x30
+struct lpc_params_temp_sensor_get_readings {
+ uint8_t temp_sensor_id;
+} __attribute__ ((packed));
+struct lpc_response_temp_sensor_get_readings {
+ uint32_t value;
+} __attribute__ ((packed));
+
#endif /* __CROS_EC_LPC_COMMANDS_H */
diff --git a/include/temp_sensor_commands.h b/include/temp_sensor_commands.h
new file mode 100644
index 0000000000..6971804895
--- /dev/null
+++ b/include/temp_sensor_commands.h
@@ -0,0 +1,19 @@
+/* Copyright (c) 2011 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.
+ */
+
+/* Temperature sensor commands for Chrome EC */
+
+#ifndef __CROS_EC_TEMP_SENSOR_COMMANDS_H
+#define __CROS_EC_TEMP_SENSOR_COMMANDS_H
+
+#include "common.h"
+
+/* Initializes the module. */
+int temp_sensor_commands_init(void);
+
+/* Host command handlers. */
+enum lpc_status temp_sensor_command_get_readings(uint8_t *data);
+
+#endif /* __CROS_EC_TEMP_SENSOR_COMMANDS_H */