Skip to content

Commit

Permalink
px4_fmu-v6x:Add Sensor set 8
Browse files Browse the repository at this point in the history
  • Loading branch information
davids5 committed Jan 31, 2024
1 parent 103ddb5 commit d1f718a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 7 deletions.
21 changes: 15 additions & 6 deletions boards/px4/fmu-v6x/init/rc.board_sensors
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,21 @@ else
fi
fi

if ver hwtypecmp V6X006
# Keep nesting shallow
if ver hwtypecmp V6X006 V6X008
then
# Internal SPI bus ICM45686
icm45686 -s -R 10 start
iim42652 -s -R 6 start
adis16470 -s -R 0 start
if ver hwtypecmp V6X006
then
# Internal SPI bus ICM45686
icm45686 -s -R 10 start
iim42652 -s -R 6 start
adis16470 -s -R 0 start
else
# Internal SPI bus 3x ICM45686
icm45686 -b 3 -s -R 0 start
icm45686 -b 2 -s -R 0 start
icm45686 -b 1 -s -R 10 start
fi
else
if ver hwtypecmp V6X004
then
Expand Down Expand Up @@ -142,7 +151,7 @@ ist8310 -X -b 1 -R 10 start
# Possible internal Baro
if param compare SENS_INT_BARO_EN 1
then
if ver hwtypecmp V6X001 V6X006
if ver hwtypecmp V6X001 V6X006 V6X008
then
icp201xx -I -a 0x64 start
else
Expand Down
2 changes: 1 addition & 1 deletion boards/px4/fmu-v6x/src/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
#define GPIO_HW_VER_SENSE /* PH3 */ GPIO_ADC3_INP14
#define HW_INFO_INIT_PREFIX "V6X"

#define BOARD_NUM_SPI_CFG_HW_VERSIONS 6
#define BOARD_NUM_SPI_CFG_HW_VERSIONS 7
// Base/FMUM
#define V6X_0 HW_FMUM_ID(0x0) // FMUV6X, Auterion,HB Sensor Set Rev 0
#define V6X_1 HW_FMUM_ID(0x1) // FMUV6X, CUAV Sensor Set Rev 1
Expand Down
23 changes: 23 additions & 0 deletions boards/px4/fmu-v6x/src/spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,29 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
}),
}),

initSPIFmumID(V6X_8, {
initSPIBus(SPI::Bus::SPI1, {
initSPIDevice(DRV_IMU_DEVTYPE_ICM45686, 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}),
}, {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}),
}, {GPIO::PortE, GPIO::Pin7}),
// initSPIBus(SPI::Bus::SPI4, {
// // no devices
// TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
// }, {GPIO::PortG, GPIO::Pin8}),
initSPIBus(SPI::Bus::SPI5, {
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
}),
initSPIBusExternal(SPI::Bus::SPI6, {
initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}),
initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}),
}),
}),


initSPIFmumID(V6X_16, {
initSPIBus(SPI::Bus::SPI1, {
Expand Down

0 comments on commit d1f718a

Please sign in to comment.