Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ Selection of acc hardware. See Wiki Sensor auto detect and hardware failure dete
| ICM45686 | |
| ICM40609D | |
| FAKE | |
| ICM56686 | |

---

Expand Down
2 changes: 2 additions & 0 deletions src/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ main_sources(COMMON_SRC
drivers/accgyro/accgyro_icm42605.h
drivers/accgyro/accgyro_icm45686.c
drivers/accgyro/accgyro_icm45686.h
drivers/accgyro/accgyro_icm56686.c
drivers/accgyro/accgyro_icm56686.h
drivers/accgyro/accgyro_mpu.c
drivers/accgyro/accgyro_mpu.h
drivers/accgyro/accgyro_mpu6000.c
Expand Down
490 changes: 490 additions & 0 deletions src/main/drivers/accgyro/accgyro_icm56686.c

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions src/main/drivers/accgyro/accgyro_icm56686.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* This file is part of INAV.
*
* INAV is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* INAV is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with INAV. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

bool icm56686AccDetect(accDev_t *acc);
bool icm56686GyroDetect(gyroDev_t *gyro);
1 change: 1 addition & 0 deletions src/main/drivers/accgyro/accgyro_mpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#define ICM42688P_WHO_AM_I_CONST (0x47)
#define ICM45686_WHO_AM_I_CONST (0xE9)
#define ICM40609D_WHO_AM_I_CONST (0x3B)
#define ICM56686_WHO_AM_I_CONST (0x08)


// RA = Register Address
Expand Down
1 change: 1 addition & 0 deletions src/main/drivers/bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ typedef enum {
DEVHW_LSM6D,
DEVHW_ICM45686,
DEVHW_ICM40609D,
DEVHW_ICM56686,
/* Combined ACC/GYRO/MAG chips */
DEVHW_MPU9250,

Expand Down
2 changes: 1 addition & 1 deletion src/main/fc/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ static const char *debugModeNames[DEBUG_COUNT] = {
// sync with gyroSensor_e
static const char *const gyroNames[] = {
"NONE", "AUTO", "MPU6000", "MPU6500", "MPU9250", "BMI160",
"ICM20689", "BMI088", "ICM42605", "BMI270", "LSM6DXX", "ICM45686", "ICM40609D", "FAKE"};
"ICM20689", "BMI088", "ICM42605", "BMI270", "LSM6DXX", "ICM45686", "ICM40609D", "FAKE", "ICM56686"};

// sync this with sensors_e
static const char * const sensorTypeNames[] = {
Expand Down
2 changes: 1 addition & 1 deletion src/main/fc/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ tables:
- name: alignment
values: ["DEFAULT", "CW0", "CW90", "CW180", "CW270", "CW0FLIP", "CW90FLIP", "CW180FLIP", "CW270FLIP"]
- name: acc_hardware
values: ["NONE", "AUTO", "MPU6000", "MPU6500", "MPU9250", "BMI160", "ICM20689", "BMI088", "ICM42605", "BMI270","LSM6DXX", "ICM45686", "ICM40609D", "FAKE"]
values: ["NONE", "AUTO", "MPU6000", "MPU6500", "MPU9250", "BMI160", "ICM20689", "BMI088", "ICM42605", "BMI270","LSM6DXX", "ICM45686", "ICM40609D", "FAKE", "ICM56686"]
enum: accelerationSensor_e
- name: rangefinder_hardware
values: ["NONE", "SRF10", "VL53L0X", "MSP", "BENEWAKE", "VL53L1X", "US42", "TOF10120_I2C", "FAKE", "TERARANGER_EVO", "USD1_V0", "NRA"]
Expand Down
13 changes: 13 additions & 0 deletions src/main/sensors/acceleration.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include "drivers/accgyro/accgyro_icm42605.h"
#include "drivers/accgyro/accgyro_icm45686.h"
#include "drivers/accgyro/accgyro_icm40609d.h"
#include "drivers/accgyro/accgyro_icm56686.h"
#include "drivers/accgyro/accgyro_lsm6dxx.h"
#include "drivers/accgyro/accgyro_fake.h"
#include "drivers/sensor.h"
Expand Down Expand Up @@ -273,6 +274,18 @@ static bool accDetect(accDev_t *dev, accelerationSensor_e accHardwareToUse)
}
FALLTHROUGH;
#endif
#ifdef USE_IMU_ICM56686
case ACC_ICM56686:
if (icm56686AccDetect(dev)) {
accHardware = ACC_ICM56686;
break;
}
/* If we are asked for a specific sensor - break out, otherwise - fall through and continue */
if (accHardwareToUse != ACC_AUTODETECT) {
break;
}
FALLTHROUGH;
#endif
#ifdef USE_IMU_FAKE
case ACC_FAKE:
if (fakeAccDetect(dev)) {
Expand Down
5 changes: 4 additions & 1 deletion src/main/sensors/acceleration.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ typedef enum {
ACC_ICM45686,
ACC_ICM40609D,
ACC_FAKE,
ACC_MAX = ACC_FAKE
// New sensors go after ACC_FAKE: acc_hardware is persisted (and AUTO is
// replaced by the detected value), so existing values must not shift.
ACC_ICM56686,
ACC_MAX = ACC_ICM56686
} accelerationSensor_e;

typedef struct {
Expand Down
10 changes: 10 additions & 0 deletions src/main/sensors/gyro.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include "drivers/accgyro/accgyro_icm42605.h"
#include "drivers/accgyro/accgyro_icm45686.h"
#include "drivers/accgyro/accgyro_icm40609d.h"
#include "drivers/accgyro/accgyro_icm56686.h"
#include "drivers/accgyro/accgyro_lsm6dxx.h"
#include "drivers/accgyro/accgyro_fake.h"
#include "drivers/io.h"
Expand Down Expand Up @@ -268,6 +269,15 @@ STATIC_UNIT_TESTED gyroSensor_e gyroDetect(gyroDev_t *dev, gyroSensor_e gyroHard
FALLTHROUGH;
#endif

#ifdef USE_IMU_ICM56686
case GYRO_ICM56686:
if (icm56686GyroDetect(dev)) {
gyroHardware = GYRO_ICM56686;
break;
}
FALLTHROUGH;
#endif

#ifdef USE_IMU_FAKE
case GYRO_FAKE:
if (fakeGyroDetect(dev)) {
Expand Down
5 changes: 4 additions & 1 deletion src/main/sensors/gyro.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ typedef enum {
GYRO_LSM6DXX,
GYRO_ICM45686,
GYRO_ICM40609D,
GYRO_FAKE
GYRO_FAKE,
// New sensors go after GYRO_FAKE to keep existing values (reported over
// MSP/blackbox) stable; keep in sync with accelerationSensor_e.
GYRO_ICM56686
} gyroSensor_e;

typedef enum {
Expand Down
4 changes: 4 additions & 0 deletions src/main/target/common_hardware.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
BUSDEV_REGISTER_SPI(busdev_icm45686, DEVHW_ICM45686, ICM45686_SPI_BUS, ICM45686_CS_PIN, NONE, DEVFLAGS_NONE, IMU_ICM45686_ALIGN);
#endif

#if defined(USE_IMU_ICM56686)
BUSDEV_REGISTER_SPI(busdev_icm56686, DEVHW_ICM56686, ICM56686_SPI_BUS, ICM56686_CS_PIN, NONE, DEVFLAGS_NONE, IMU_ICM56686_ALIGN);
#endif

#endif


Expand Down