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
This commit is contained in:
Vic Yang
2011-12-21 17:03:43 +08:00
parent 84a286b1f4
commit b228bc14c0
6 changed files with 100 additions and 1 deletions

View File

@@ -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 */

View File

@@ -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 */