Skip to content

Commit

Permalink
AP_HAL_ChibiOS: add icm45686 detection on CubeRed
Browse files Browse the repository at this point in the history
  • Loading branch information
bugobliterator committed Nov 23, 2023
1 parent 4fd54dc commit 6c4a800
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
18 changes: 14 additions & 4 deletions libraries/AP_HAL_ChibiOS/hwdef/CubeRedPrimary/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
5 changes: 4 additions & 1 deletion libraries/AP_HAL_ChibiOS/hwdef/CubeRedSecondary/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6c4a800

Please sign in to comment.