mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-27 18:27:05 +08:00
drivers/imu/bosch/bmi088: Add BMI090L accel ID
This commit is contained in:
@@ -99,7 +99,13 @@ int BMI088_Accelerometer::probe()
|
|||||||
|
|
||||||
const uint8_t ACC_CHIP_ID = RegisterRead(Register::ACC_CHIP_ID);
|
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);
|
DEVICE_DEBUG("unexpected ACC_CHIP_ID 0x%02x", ACC_CHIP_ID);
|
||||||
return PX4_ERROR;
|
return PX4_ERROR;
|
||||||
}
|
}
|
||||||
@@ -122,7 +128,7 @@ void BMI088_Accelerometer::RunImpl()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case STATE::WAIT_FOR_RESET:
|
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
|
// ACC_PWR_CONF: Power on sensor
|
||||||
RegisterWrite(Register::ACC_PWR_CONF, 0);
|
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 uint32_t SPI_SPEED = 10 * 1000 * 1000; // 10MHz SPI serial interface
|
||||||
static constexpr uint8_t DIR_READ = 0x80;
|
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 {
|
enum class Register : uint8_t {
|
||||||
ACC_CHIP_ID = 0x00,
|
ACC_CHIP_ID = 0x00,
|
||||||
|
|||||||
Reference in New Issue
Block a user