AP_Compass: Add support to AK09915

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
This commit is contained in:
Patrick José Pereira 2021-10-20 00:03:43 -03:00 committed by Willian Galvani
parent 768894fb61
commit 260af200e6
2 changed files with 5 additions and 0 deletions

View File

@ -49,6 +49,7 @@ extern const AP_HAL::HAL &hal;
#define ICM_WHOAMI_VAL 0xEA
#define AK09915_Device_ID 0x10
#define AK09916_Device_ID 0x09
#define AK09918_Device_ID 0x0c
#define AK09916_MILLIGAUSS_SCALE 10.0f
@ -314,6 +315,9 @@ bool AP_Compass_AK09916::_check_id()
/* Read AK09916's id */
if (_bus->register_read(REG_DEVICE_ID, &deviceid)) {
switch (deviceid) {
case AK09915_Device_ID:
_devtype = DEVTYPE_AK09915;
return true;
case AK09916_Device_ID:
_devtype = DEVTYPE_AK09916;
return true;

View File

@ -66,6 +66,7 @@ public:
DEVTYPE_RM3100_2 = 0x12, // unused, past mistake
DEVTYPE_MMC5983 = 0x13,
DEVTYPE_AK09918 = 0x14,
DEVTYPE_AK09915 = 0x15,
};
#if HAL_MSP_COMPASS_ENABLED