mirror of https://github.com/ArduPilot/ardupilot
AP_Compass: Add support to AK09915
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
This commit is contained in:
parent
768894fb61
commit
260af200e6
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue