sensors: mpu6050: Add support for variant mpu6886

This commit adds support for mpu6886, which has compatible register
layout.

Signed-off-by: Martin Kiepfer <m.kiepfer@teleschirm.org>
This commit is contained in:
Martin Kiepfer 2023-09-09 15:45:26 +02:00 committed by Carles Cufí
parent bc5f78d9ba
commit aef1611e1f
2 changed files with 2 additions and 1 deletions

View file

@ -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;
}

View file

@ -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