mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-28 19:48:31 -04:00
AP_InertialSensor: added support for ICM-20602
treat the same as a 20608
This commit is contained in:
parent
e7024d9203
commit
875274e761
@ -14,7 +14,7 @@
|
|||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
driver for all supported Invensense IMUs, including MPU6000, MPU9250
|
driver for all supported Invensense IMUs, including MPU6000, MPU9250
|
||||||
and ICM-20608
|
ICM-20608 and ICM-20602
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@ -218,6 +218,7 @@ extern const AP_HAL::HAL& hal;
|
|||||||
// WHOAMI values
|
// WHOAMI values
|
||||||
#define MPU_WHOAMI_6000 0x68
|
#define MPU_WHOAMI_6000 0x68
|
||||||
#define MPU_WHOAMI_20608 0xaf
|
#define MPU_WHOAMI_20608 0xaf
|
||||||
|
#define MPU_WHOAMI_20602 0x12
|
||||||
#define MPU_WHOAMI_6500 0x70
|
#define MPU_WHOAMI_6500 0x70
|
||||||
#define MPU_WHOAMI_MPU9250 0x71
|
#define MPU_WHOAMI_MPU9250 0x71
|
||||||
#define MPU_WHOAMI_MPU9255 0x73
|
#define MPU_WHOAMI_MPU9255 0x73
|
||||||
@ -399,6 +400,7 @@ void AP_InertialSensor_Invensense::start()
|
|||||||
case Invensense_MPU6000:
|
case Invensense_MPU6000:
|
||||||
case Invensense_MPU6500:
|
case Invensense_MPU6500:
|
||||||
case Invensense_ICM20608:
|
case Invensense_ICM20608:
|
||||||
|
case Invensense_ICM20602:
|
||||||
default:
|
default:
|
||||||
gdev = DEVTYPE_GYR_MPU6000;
|
gdev = DEVTYPE_GYR_MPU6000;
|
||||||
adev = DEVTYPE_ACC_MPU6000;
|
adev = DEVTYPE_ACC_MPU6000;
|
||||||
@ -438,7 +440,8 @@ void AP_InertialSensor_Invensense::start()
|
|||||||
}
|
}
|
||||||
hal.scheduler->delay(1);
|
hal.scheduler->delay(1);
|
||||||
|
|
||||||
if (_mpu_type == Invensense_ICM20608) {
|
if (_mpu_type == Invensense_ICM20608 ||
|
||||||
|
_mpu_type == Invensense_ICM20602) {
|
||||||
// this avoids a sensor bug, see description above
|
// this avoids a sensor bug, see description above
|
||||||
_register_write(MPUREG_ICM_UNDOC1, MPUREG_ICM_UNDOC1_VALUE, true);
|
_register_write(MPUREG_ICM_UNDOC1, MPUREG_ICM_UNDOC1_VALUE, true);
|
||||||
}
|
}
|
||||||
@ -824,6 +827,9 @@ bool AP_InertialSensor_Invensense::_check_whoami(void)
|
|||||||
case MPU_WHOAMI_20608:
|
case MPU_WHOAMI_20608:
|
||||||
_mpu_type = Invensense_ICM20608;
|
_mpu_type = Invensense_ICM20608;
|
||||||
return true;
|
return true;
|
||||||
|
case MPU_WHOAMI_20602:
|
||||||
|
_mpu_type = Invensense_ICM20602;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
// not a value WHOAMI result
|
// not a value WHOAMI result
|
||||||
return false;
|
return false;
|
||||||
@ -904,7 +910,8 @@ bool AP_InertialSensor_Invensense::_hardware_init(void)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_mpu_type == Invensense_ICM20608) {
|
if (_mpu_type == Invensense_ICM20608 ||
|
||||||
|
_mpu_type == Invensense_ICM20602) {
|
||||||
// this avoids a sensor bug, see description above
|
// this avoids a sensor bug, see description above
|
||||||
_register_write(MPUREG_ICM_UNDOC1, MPUREG_ICM_UNDOC1_VALUE, true);
|
_register_write(MPUREG_ICM_UNDOC1, MPUREG_ICM_UNDOC1_VALUE, true);
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,7 @@ public:
|
|||||||
Invensense_MPU6500,
|
Invensense_MPU6500,
|
||||||
Invensense_MPU9250,
|
Invensense_MPU9250,
|
||||||
Invensense_ICM20608,
|
Invensense_ICM20608,
|
||||||
|
Invensense_ICM20602,
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user