diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2015-05-15 13:07:26 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-05-16 04:17:15 +0000 |
commit | 628bf151769308e99f6019ce0bbd143461b57046 (patch) | |
tree | 585fb1459ea1674cc5fe16e9de0a2c3dd272fbd2 /driver/mag_bmm150.h | |
parent | 0a71b4418da9d2c2b26f38e2f30c012bfc13bcd4 (diff) | |
download | chrome-ec-628bf151769308e99f6019ce0bbd143461b57046.tar.gz |
driver: Add BMM150 behind BMI160 support.
Add support for Bosh Sensortec BMM160 compass.
We access it through BMI150.
BRANCH=none
BUG=chrome-os-partner:39900
TEST=Test on a nucleo board and smaug.
Change-Id: I5b959cab4f9341ba0fcd3ed9bad815fa92f80a37
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/271525
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'driver/mag_bmm150.h')
-rw-r--r-- | driver/mag_bmm150.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/driver/mag_bmm150.h b/driver/mag_bmm150.h new file mode 100644 index 0000000000..27ca5aebb6 --- /dev/null +++ b/driver/mag_bmm150.h @@ -0,0 +1,37 @@ +/* Copyright 2015 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. + */ + +/* BMM150 magnetometer definition */ + +#ifndef __CROS_EC_MAG_BMM150_H +#define __CROS_EC_MAG_BMM150_H + +#include "accelgyro.h" + +#define BMM150_ADDR0 0x20 +#define BMM150_ADDR1 0x22 +#define BMM150_ADDR2 0x24 +#define BMM150_ADDR3 0x26 + +#define BMM150_CHIP_ID 0x40 +#define BMM150_CHIP_ID_MAJOR 0x32 + +#define BMM150_BASE_DATA 0x42 + +#define BMM150_INT_STATUS 0x4a +#define BMM150_PWR_CTRL 0x4b +#define BMM150_SRST ((1 << 7) | (1 << 1)) +#define BMM150_PWR_ON (1 << 0) + +#define BMM150_OP_CTRL 0x4c +#define BMM150_OP_MODE_OFFSET 1 +#define BMM150_OP_MODE_MASK 3 +#define BMM150_OP_MODE_NORMAL 0x00 +#define BMM150_OP_MODE_FORCED 0x01 +#define BMM150_OP_MODE_SLEEP 0x03 + +#define BMM150_INT_CTRL 0x4d + +#endif /* __CROS_EC_MAG_BMM150_H */ |