diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2015-07-31 13:22:40 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-08-22 09:31:38 +0000 |
commit | 7b102441425af16ba960100c34a415b45917cda9 (patch) | |
tree | 7ca8eea3fc7e5e451be91112add040b48fa43358 /driver/mag_bmm150.h | |
parent | ed0192a9b1c7f4d45f646df9dd463ce7879459f6 (diff) | |
download | chrome-ec-7b102441425af16ba960100c34a415b45917cda9.tar.gz |
bmm150: Add support for calibration
Allow sending calibration information to the magnetometer.
BRANCH=smaug
TEST=Check from user space that calibration is taken into account.
BUG=chrome-os-partner:39900
Change-Id: Ic0f595bde1afdc0b6a79e3516a42b55d1f50c17c
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/291333
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
Diffstat (limited to 'driver/mag_bmm150.h')
-rw-r--r-- | driver/mag_bmm150.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/driver/mag_bmm150.h b/driver/mag_bmm150.h index 6ae8e679b9..7486a77608 100644 --- a/driver/mag_bmm150.h +++ b/driver/mag_bmm150.h @@ -74,6 +74,9 @@ struct bmm150_comp_registers { int8_t dig_xy2; uint16_t dig_xyz1; + + /* Factory or online calibration */ + int16_t offset[3]; }; #define BMM150_COMP_REG(_s) \ @@ -87,5 +90,12 @@ void bmm150_normalize(const struct motion_sensor_t *s, vector_3_t v, uint8_t *data); +int bmm150_set_offset(const struct motion_sensor_t *s, + const int16_t *offset, + int16_t temp); + +int bmm150_get_offset(const struct motion_sensor_t *s, + int16_t *offset, + int16_t *temp); #endif /* __CROS_EC_MAG_BMM150_H */ |