mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-22 22:50:49 +08:00
feat(boards/px4_fmu-v6x): add LSM6DSV fallback support (#29697)
Probe ICM45686 and IIM42653 first on V6X008 and start LSM6DSV only when neither is detected, preserving existing IMU priority. Assisted-by: Codex Signed-off-by: Brown <zebulon-86@outlook.com> Co-authored-by: Farhang <46557204+farhangnaderi@users.noreply.github.com>
This commit is contained in:
1 parent
aad332ac93
commit
100d257c91
3 files changed
+20
-7
No files matched your search
@@ -30,6 +30,7 @@ CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_ICM45686=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_IIM42652=y
|
||||
CONFIG_DRIVERS_IMU_INVENSENSE_IIM42653=y
|
||||
CONFIG_DRIVERS_IMU_ST_LSM6DSV=y
|
||||
CONFIG_COMMON_LIGHT=y
|
||||
CONFIG_COMMON_MAGNETOMETER=y
|
||||
CONFIG_DRIVERS_OSD_MSP_OSD=y
|
||||
|
||||
@@ -75,18 +75,27 @@ then
|
||||
iim42652 -s -R 6 start
|
||||
icm45686 -s -R 10 start
|
||||
else
|
||||
# Internal SPI bus 3x ICM45686 or 3x IIM42653
|
||||
if ! icm45686 -b 3 -s -R 0 start
|
||||
# Internal SPI bus 3x ICM45686, IIM42653, or LSM6DSV
|
||||
if ! icm45686 -b 3 -s -R 0 -q start
|
||||
then
|
||||
iim42653 -b 3 -s -R 0 start
|
||||
if ! iim42653 -b 3 -s -R 0 -q start
|
||||
then
|
||||
lsm6dsv -b 3 -s -R 0 start
|
||||
fi
|
||||
fi
|
||||
if ! icm45686 -b 2 -s -R 0 start
|
||||
if ! icm45686 -b 2 -s -R 0 -q start
|
||||
then
|
||||
iim42653 -b 2 -s -R 0 start
|
||||
if ! iim42653 -b 2 -s -R 0 -q start
|
||||
then
|
||||
lsm6dsv -b 2 -s -R 0 start
|
||||
fi
|
||||
fi
|
||||
if ! icm45686 -b 1 -s -R 10 start
|
||||
if ! icm45686 -b 1 -s -R 10 -q start
|
||||
then
|
||||
iim42653 -b 1 -s -R 10 start
|
||||
if ! iim42653 -b 1 -s -R 10 -q start
|
||||
then
|
||||
lsm6dsv -b 1 -s -R 10 start
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
else
|
||||
|
||||
@@ -158,14 +158,17 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
|
||||
initSPIBus(SPI::Bus::SPI1, {
|
||||
initSPIDevice(DRV_IMU_DEVTYPE_ICM45686, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}),
|
||||
initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}),
|
||||
initSPIDevice(DRV_IMU_DEVTYPE_ST_LSM6DSV, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}),
|
||||
}, {GPIO::PortI, GPIO::Pin11}),
|
||||
initSPIBus(SPI::Bus::SPI2, {
|
||||
initSPIDevice(DRV_IMU_DEVTYPE_ICM45686, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortA, GPIO::Pin10}),
|
||||
initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortA, GPIO::Pin10}),
|
||||
initSPIDevice(DRV_IMU_DEVTYPE_ST_LSM6DSV, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortA, GPIO::Pin10}),
|
||||
}, {GPIO::PortF, GPIO::Pin4}),
|
||||
initSPIBus(SPI::Bus::SPI3, {
|
||||
initSPIDevice(DRV_IMU_DEVTYPE_ICM45686, SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortI, GPIO::Pin7}),
|
||||
initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortI, GPIO::Pin7}),
|
||||
initSPIDevice(DRV_IMU_DEVTYPE_ST_LSM6DSV, SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortI, GPIO::Pin7}),
|
||||
}, {GPIO::PortE, GPIO::Pin7}),
|
||||
// initSPIBus(SPI::Bus::SPI4, {
|
||||
// // no devices
|
||||
|
||||
Reference in new issue
Block a user