summaryrefslogtreecommitdiff
path: root/board/ryu/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/ryu/board.c')
-rw-r--r--board/ryu/board.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/board/ryu/board.c b/board/ryu/board.c
index a361198748..7218a9f8fc 100644
--- a/board/ryu/board.c
+++ b/board/ryu/board.c
@@ -368,7 +368,7 @@ const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
static struct mutex g_mutex;
/* local sensor data (per-sensor) */
-struct motion_data_t g_saved_data[2];
+struct bmi160_drv_data_t g_bmi160_data;
struct motion_sensor_t motion_sensors[] = {
@@ -384,7 +384,7 @@ struct motion_sensor_t motion_sensors[] = {
.location = MOTIONSENSE_LOC_LID,
.drv = &bmi160_drv,
.mutex = &g_mutex,
- .drv_data = &g_saved_data[0],
+ .drv_data = &g_bmi160_data,
.i2c_addr = BMI160_ADDR0,
.rot_standard_ref = NULL,
.default_config = {
@@ -400,7 +400,7 @@ struct motion_sensor_t motion_sensors[] = {
.location = MOTIONSENSE_LOC_LID,
.drv = &bmi160_drv,
.mutex = &g_mutex,
- .drv_data = &g_saved_data[1],
+ .drv_data = &g_bmi160_data,
.i2c_addr = BMI160_ADDR0,
.rot_standard_ref = NULL,
.default_config = {
@@ -408,6 +408,22 @@ struct motion_sensor_t motion_sensors[] = {
.range = 2000
}
},
+
+ {.name = "Mag",
+ .active_mask = SENSOR_ACTIVE_S0_S3,
+ .chip = MOTIONSENSE_CHIP_BMI160,
+ .type = MOTIONSENSE_TYPE_MAG,
+ .location = MOTIONSENSE_LOC_LID,
+ .drv = &bmi160_drv,
+ .mutex = &g_mutex,
+ .drv_data = &g_bmi160_data,
+ .i2c_addr = BMI160_ADDR0,
+ .rot_standard_ref = NULL,
+ .default_config = {
+ .odr = 25000,
+ .range = 1
+ }
+ },
};
const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);