summaryrefslogtreecommitdiff
path: root/include/ec_commands.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ec_commands.h')
-rw-r--r--include/ec_commands.h49
1 files changed, 43 insertions, 6 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h
index d51c9b7efe..980dfa2b1e 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -1300,6 +1300,18 @@ enum motionsense_command {
*/
MOTIONSENSE_CMD_KB_WAKE_ANGLE = 5,
+ /*
+ * Sensor subsytem status.
+ * Same format as EC_MEMMAP_ACC_STATUS
+ * - for system without LPC -
+ */
+ MOTIONSENSE_CMD_GET_STATUS = 6,
+
+ /*
+ * Retrieve data and flags from all accel/gyro sensors.
+ */
+ MOTIONSENSE_CMD_GET_DATA = 7,
+
/* Number of motionsense sub-commands. */
MOTIONSENSE_NUM_CMDS
};
@@ -1350,10 +1362,10 @@ enum motionsensor_chip {
struct ec_params_motion_sense {
uint8_t cmd;
union {
- /* Used for MOTIONSENSE_CMD_DUMP. */
+ /* Used for MOTIONSENSE_CMD_DUMP, GET_STATUS, GET_DATA. */
struct {
/* no args */
- } dump;
+ } data, dump, status;
/*
* Used for MOTIONSENSE_CMD_EC_RATE and
@@ -1366,7 +1378,6 @@ struct ec_params_motion_sense {
/* Used for MOTIONSENSE_CMD_INFO. */
struct {
- /* Should be element of enum motionsensor_id. */
uint8_t sensor_num;
} info;
@@ -1375,7 +1386,6 @@ struct ec_params_motion_sense {
* MOTIONSENSE_CMD_SENSOR_RANGE.
*/
struct {
- /* Should be element of enum motionsensor_id. */
uint8_t sensor_num;
/* Rounding flag, true for round-up, false for down. */
@@ -1391,18 +1401,40 @@ struct ec_params_motion_sense {
struct ec_response_motion_sense {
union {
- /* Used for MOTIONSENSE_CMD_DUMP. */
+ /* Used for MOTIONSENSE_CMD_DUMP */
struct {
/* Flags representing the motion sensor module. */
uint8_t module_flags;
- /* Flags for each sensor in enum motionsensor_id. */
+ /* Flags for each sensor. */
uint8_t sensor_flags[EC_MOTION_SENSOR_COUNT];
/* Array of all sensor data. Each sensor is 3-axis. */
int16_t data[3*EC_MOTION_SENSOR_COUNT];
} dump;
+ /* Used for MOTIONSENSE_CMD_GET_DATA */
+ struct {
+ /* Flags representing the motion sensor module. */
+ uint8_t module_flags;
+
+ /* Number of sensors managed directly by the EC */
+ uint8_t sensor_number;
+
+ /*
+ * sensor data is truncated if response_max is too small
+ * for holding all the data.
+ */
+ struct sensor_data {
+ /* Flags for each sensor. */
+ uint8_t flags;
+ uint8_t padding;
+
+ /* Each sensor is up to 3-axis. */
+ int16_t data[3];
+ } sensor[0];
+ } data;
+
/* Used for MOTIONSENSE_CMD_INFO. */
struct {
/* Should be element of enum motionsensor_type. */
@@ -1415,6 +1447,11 @@ struct ec_response_motion_sense {
uint8_t chip;
} info;
+ /* Used for MOTIONSENSE_CMD_GET_STATUS */
+ struct {
+ uint8_t value;
+ } status;
+
/*
* Used for MOTIONSENSE_CMD_EC_RATE, MOTIONSENSE_CMD_SENSOR_ODR,
* MOTIONSENSE_CMD_SENSOR_RANGE, and