Browse Source

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

release/1.12
AlexKlimaj 4 years ago committed by GitHub
parent
commit
386b56fbce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      src/drivers/imu/bosch/bmi088/BMI088_Accelerometer.cpp
  2. 3
      src/drivers/imu/bosch/bmi088/Bosch_BMI088_Accelerometer_Registers.hpp

10
src/drivers/imu/bosch/bmi088/BMI088_Accelerometer.cpp

@ -99,7 +99,13 @@ int BMI088_Accelerometer::probe() @@ -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() @@ -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);

3
src/drivers/imu/bosch/bmi088/Bosch_BMI088_Accelerometer_Registers.hpp

@ -49,7 +49,8 @@ static constexpr uint8_t Bit7 = (1 << 7); @@ -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,

Loading…
Cancel
Save