drivers/imu/bosch/bmi088: Add BMI090L accel ID

This commit is contained in:
AlexKlimaj
2021-01-19 13:49:53 -07:00
committed by GitHub
parent d22eef9396
commit 386b56fbce
2 changed files with 10 additions and 3 deletions
@@ -99,7 +99,13 @@ int BMI088_Accelerometer::probe()
const uint8_t ACC_CHIP_ID = RegisterRead(Register::ACC_CHIP_ID);
if (ACC_CHIP_ID != ID) {
if (ACC_CHIP_ID == ID_088) {
DEVICE_DEBUG("BMI088 Accel");
} else if (ACC_CHIP_ID == ID_090L) {
DEVICE_DEBUG("BMI090L Accel");
} else {
DEVICE_DEBUG("unexpected ACC_CHIP_ID 0x%02x", ACC_CHIP_ID);
return PX4_ERROR;
}
@@ -122,7 +128,7 @@ void BMI088_Accelerometer::RunImpl()
break;
case STATE::WAIT_FOR_RESET:
if (RegisterRead(Register::ACC_CHIP_ID) == ID) {
if ((RegisterRead(Register::ACC_CHIP_ID) == ID_088) || (RegisterRead(Register::ACC_CHIP_ID) == ID_090L)) {
// ACC_PWR_CONF: Power on sensor
RegisterWrite(Register::ACC_PWR_CONF, 0);
@@ -49,7 +49,8 @@ static constexpr uint8_t Bit7 = (1 << 7);
static constexpr uint32_t SPI_SPEED = 10 * 1000 * 1000; // 10MHz SPI serial interface
static constexpr uint8_t DIR_READ = 0x80;
static constexpr uint8_t ID = 0x1E;
static constexpr uint8_t ID_088 = 0x1E;
static constexpr uint8_t ID_090L = 0x1A;
enum class Register : uint8_t {
ACC_CHIP_ID = 0x00,