Skip to content

Commit

Permalink
sensors: mpu6050: Add support for variant mpu6886
Browse files Browse the repository at this point in the history
This commit adds support for mpu6886, which has compatible register
layout.

Signed-off-by: Martin Kiepfer <m.kiepfer@teleschirm.org>
  • Loading branch information
Martin Kiepfer authored and carlescufi committed Oct 25, 2023
1 parent bc5f78d commit aef1611
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/sensor/mpu6050/mpu6050.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ int mpu6050_init(const struct device *dev)
return -EIO;
}

if (id != MPU6050_CHIP_ID && id != MPU9250_CHIP_ID) {
if ((id != MPU6050_CHIP_ID) && (id != MPU9250_CHIP_ID) && (id != MPU6880_CHIP_ID)) {
LOG_ERR("Invalid chip ID.");
return -EINVAL;
}
Expand Down
1 change: 1 addition & 0 deletions drivers/sensor/mpu6050/mpu6050.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#define MPU6050_REG_CHIP_ID 0x75
#define MPU6050_CHIP_ID 0x68
#define MPU9250_CHIP_ID 0x71
#define MPU6880_CHIP_ID 0x19

#define MPU6050_REG_GYRO_CFG 0x1B
#define MPU6050_GYRO_FS_SHIFT 3
Expand Down

0 comments on commit aef1611

Please sign in to comment.