From 6c4a800b8119e5a5fc61f76b5dc57fcbd81cfd0b Mon Sep 17 00:00:00 2001 From: bugobliterator Date: Tue, 4 Jul 2023 17:35:44 +1000 Subject: [PATCH] AP_HAL_ChibiOS: add icm45686 detection on CubeRed --- .../hwdef/CubeRedPrimary/hwdef.dat | 18 ++++++++++++++---- .../hwdef/CubeRedSecondary/hwdef.dat | 5 ++++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CubeRedPrimary/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CubeRedPrimary/hwdef.dat index 625b74edc61f62..f78492d6d89079 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CubeRedPrimary/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CubeRedPrimary/hwdef.dat @@ -105,16 +105,24 @@ PE6 SPI4_MOSI SPI4 # Sensors SPIDEV icm42688_0 SPI1 DEVID1 ICM42688_0_CS MODE3 2*MHZ 8*MHZ +SPIDEV icm45686_0 SPI1 DEVID1 ICM42688_0_CS MODE3 2*MHZ 8*MHZ + SPIDEV ms5611_0 SPI1 DEVID2 BARO_0_CS MODE3 20*MHZ 20*MHZ SPIDEV icm42688_1 SPI2 DEVID1 ICM42688_1_CS MODE3 2*MHZ 8*MHZ +SPIDEV icm45686_1 SPI2 DEVID1 ICM42688_1_CS MODE3 2*MHZ 8*MHZ + SPIDEV rm3100 SPI2 DEVID2 RM3100_CS MODE3 2*MHZ 8*MHZ SPIDEV icm20649 SPI4 DEVID1 ICM20649_CS MODE3 4*MHZ 8*MHZ SPIDEV ms5611_1 SPI4 DEVID2 BARO_1_CS MODE3 20*MHZ 20*MHZ -IMU Invensensev3 SPI:icm42688_1 ROTATION_YAW_90 -IMU Invensensev3 SPI:icm42688_0 ROTATION_PITCH_180_YAW_270 +IMU Invensensev3 SPI:icm42688_1 ROTATION_YAW_90 INSTANCE:0 +IMU Invensensev3 SPI:icm45686_1 ROTATION_YAW_90 INSTANCE:0 + +IMU Invensensev3 SPI:icm42688_0 ROTATION_PITCH_180_YAW_270 INSTANCE:1 +IMU Invensensev3 SPI:icm45686_0 ROTATION_PITCH_180_YAW_270 INSTANCE:1 + IMU Invensensev2 SPI:icm20649 ROTATION_PITCH_180 BARO MS56XX SPI:ms5611_0 @@ -125,16 +133,18 @@ COMPASS RM3100 SPI:rm3100 false ROTATION_YAW_270 CHECK_ICM20649 spi_check_register_inv2("icm20649", INV2REG_WHOAMI, INV2_WHOAMI_ICM20649) CHECK_ICM42688_0 spi_check_register("icm42688_0", INV3REG_WHOAMI, INV3_WHOAMI_ICM42688) +CHECK_ICM45686_0 spi_check_register("icm45686_0", INV3REG_456_WHOAMI, INV3_WHOAMI_ICM45686) CHECK_ICM42688_1 spi_check_register("icm42688_1", INV3REG_WHOAMI, INV3_WHOAMI_ICM42688) +CHECK_ICM45686_1 spi_check_register("icm45686_1", INV3REG_456_WHOAMI, INV3_WHOAMI_ICM45686) CHECK_MS5611_0 check_ms5611("ms5611_0") CHECK_MS5611_1 check_ms5611("ms5611_1") CHECK_IMU0_PRESENT $CHECK_ICM20649 -CHECK_IMU1_PRESENT $CHECK_ICM42688_0 -CHECK_IMU2_PRESENT $CHECK_ICM42688_1 +CHECK_IMU1_PRESENT $CHECK_ICM42688_0 || $CHECK_ICM45686_0 +CHECK_IMU2_PRESENT $CHECK_ICM42688_1 || $CHECK_ICM45686_1 CHECK_BARO0_PRESENT $CHECK_MS5611_0 CHECK_BARO1_PRESENT $CHECK_MS5611_1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CubeRedSecondary/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CubeRedSecondary/hwdef.dat index 10085248376ad4..7e60034d9208c0 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CubeRedSecondary/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CubeRedSecondary/hwdef.dat @@ -61,12 +61,15 @@ PE2 SPI4_SCK SPI4 # Sensors SPIDEV icm42688 SPI2 DEVID1 ICM_CS MODE3 2*MHZ 8*MHZ +SPIDEV icm45686 SPI2 DEVID2 ICM_CS MODE3 2*MHZ 8*MHZ SPIDEV ms5611 SPI4 DEVID2 BARO_CS MODE3 20*MHZ 20*MHZ BARO MS56XX SPI:ms5611 -IMU Invensensev3 SPI:icm42688 ROTATION_PITCH_180_YAW_270 +IMU Invensensev3 SPI:icm42688 ROTATION_PITCH_180_YAW_270 INSTANCE:0 +IMU Invensensev3 SPI:icm45686 ROTATION_PITCH_180_YAW_270 INSTANCE:1 CHECK_ICM42688 spi_check_register("icm42688", INV3REG_WHOAMI, INV3_WHOAMI_ICM42688) +CHECK_ICM45686 spi_check_register("icm45686", INV3REG_456_WHOAMI, INV3_WHOAMI_ICM45686) CHECK_MS5611 check_ms5611("ms5611") CHECK_IMU0_PRESENT $CHECK_ICM42688