Files
OpenCellular/include/motion_lid.h
Alexandru M Stan d0ec94203f motion_sense: Add required header
include/motion_lid.h is generally included by board.c in the various boards.
But include/motion_lid.h actually needs host_command.h defined or else
including it in board.c will cause a confusing error.

This probably doesn't show up on other platforms like samus and glimmer
because they define a few custom commands in board.c, but veyron
doesn't need that. motion_lid ought to just include it directly if it really
needs it.

BUG=None, see next commits in the series, they won't compile without this
TEST=See series
BRANCH=veyron

Change-Id: I42e966d891dbbcca7df484b59c9d1bb35d1357bc
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/256696
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
2015-03-06 08:48:39 +00:00

54 lines
1.4 KiB
C

/* Copyright (c) 2014 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.
*/
/* Header for motion_lid.h */
#ifndef __CROS_EC_MOTION_LID_H
#define __CROS_EC_MOTION_LID_H
#include "host_command.h"
/* Anything outside of lid angle range [-180, 180] should work. */
#define LID_ANGLE_UNRELIABLE 500
/**
* This structure defines all of the data needed to specify the orientation
* of the base and lid accelerometers in order to calculate the lid angle.
*/
struct accel_orientation {
/* Rotation matrix to rotate positive 90 degrees around the hinge. */
matrix_3x3_t rot_hinge_90;
/*
* Rotation matrix to rotate 180 degrees around the hinge. The value
* here should be rot_hinge_90 ^ 2.
*/
matrix_3x3_t rot_hinge_180;
/* Vector pointing along hinge axis. */
vector_3_t hinge_axis;
};
/* Link global structure for orientation. This must be defined in board.c. */
extern const struct accel_orientation acc_orient;
/**
* Get last calculated lid angle. Note, the lid angle calculated by the EC
* is un-calibrated and is an approximate angle.
*
* @return lid angle in degrees in range [0, 360], or LID_ANGLE_UNRELIABLE
* if the lid angle can't be determined.
*/
int motion_lid_get_angle(void);
int host_cmd_motion_lid(struct host_cmd_handler_args *args);
void motion_lid_calc(void);
#endif /* __CROS_EC_MOTION_LID_H */