mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
refactor ms5611: use driver base class
Also: remove device type auto-detection as it will not work with together with the new SPI board config (which specifies a specific device type)
This commit is contained in:
@@ -5,7 +5,10 @@
|
||||
|
||||
aerofc_adc start
|
||||
|
||||
ms5611 -T 0 start
|
||||
if ! ms5611 -T 5607 start
|
||||
then
|
||||
ms5611 start
|
||||
fi
|
||||
mpu9250 -s -R 14 start
|
||||
|
||||
# Possible external compasses
|
||||
@@ -16,4 +19,7 @@ ist8310 -I -R 4 start
|
||||
ll40ls start i2c -a
|
||||
|
||||
# Internal SPI (auto detect ms5611 or ms5607)
|
||||
ms5611 -T 0 -s start
|
||||
if ! ms5611 -T 5607 -s start
|
||||
then
|
||||
ms5611 -s start
|
||||
fi
|
||||
|
||||
@@ -16,11 +16,12 @@ hmc5883 -C -T -I -R 4 start
|
||||
# Internal SPI bus ICM-20608-G
|
||||
mpu6000 -s -T 20608 start
|
||||
|
||||
# External SPI
|
||||
ms5611 -S start
|
||||
|
||||
# Internal SPI (auto detect ms5611 or ms5607)
|
||||
ms5611 -T 0 -s start
|
||||
if ! ms5611 -T 5607 -s start
|
||||
then
|
||||
ms5611 -s start
|
||||
fi
|
||||
|
||||
set BOARD_FMUV3 0
|
||||
|
||||
@@ -67,9 +68,6 @@ then
|
||||
# sensor heating is available, but we disable it for now
|
||||
param set SENS_EN_THERMAL 0
|
||||
|
||||
# External SPI
|
||||
ms5611 -S start
|
||||
|
||||
# external L3GD20H is rotated 180 degrees yaw
|
||||
l3gd20 -X -R 4 start
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
|
||||
initSPIDevice(DRV_GYR_DEVTYPE_L3GD20, SPI::CS{GPIO::PortC, GPIO::Pin13}, SPI::DRDY{GPIO::PortB, GPIO::Pin0}),
|
||||
initSPIDevice(DRV_ACC_DEVTYPE_LSM303D, SPI::CS{GPIO::PortC, GPIO::Pin15}),
|
||||
initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortD, GPIO::Pin7}),
|
||||
initSPIDevice(DRV_BARO_DEVTYPE_MS5607, SPI::CS{GPIO::PortD, GPIO::Pin7}),
|
||||
}, {GPIO::PortE, GPIO::Pin3}),
|
||||
initSPIBus(SPI::Bus::SPI2, {
|
||||
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10})
|
||||
@@ -59,6 +60,7 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
|
||||
initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}),
|
||||
initSPIDevice(DRV_MAG_DEVTYPE_HMC5883, SPI::CS{GPIO::PortC, GPIO::Pin1}), // HMC5983
|
||||
initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortD, GPIO::Pin7}),
|
||||
initSPIDevice(DRV_BARO_DEVTYPE_MS5607, SPI::CS{GPIO::PortD, GPIO::Pin7}),
|
||||
}, {GPIO::PortE, GPIO::Pin3}),
|
||||
initSPIBus(SPI::Bus::SPI2, {
|
||||
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10})
|
||||
|
||||
@@ -17,11 +17,12 @@ hmc5883 -C -T -I -R 4 start
|
||||
# Internal SPI bus ICM-20608-G
|
||||
mpu6000 -s -T 20608 start
|
||||
|
||||
# External SPI
|
||||
ms5611 -S start
|
||||
|
||||
# Internal SPI (auto detect ms5611 or ms5607)
|
||||
ms5611 -T 0 -s start
|
||||
if ! ms5611 -T 5607 -s start
|
||||
then
|
||||
ms5611 -s start
|
||||
fi
|
||||
|
||||
set BOARD_FMUV3 0
|
||||
|
||||
@@ -75,9 +76,6 @@ then
|
||||
ak09916 -X -R 6 start
|
||||
fi
|
||||
|
||||
# External SPI
|
||||
ms5611 -S start
|
||||
|
||||
# external L3GD20H is rotated 180 degrees yaw
|
||||
l3gd20 -X -R 4 start
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
|
||||
initSPIDevice(DRV_GYR_DEVTYPE_L3GD20, SPI::CS{GPIO::PortC, GPIO::Pin13}, SPI::DRDY{GPIO::PortB, GPIO::Pin0}),
|
||||
initSPIDevice(DRV_ACC_DEVTYPE_LSM303D, SPI::CS{GPIO::PortC, GPIO::Pin15}),
|
||||
initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortD, GPIO::Pin7}),
|
||||
initSPIDevice(DRV_BARO_DEVTYPE_MS5607, SPI::CS{GPIO::PortD, GPIO::Pin7}),
|
||||
}, {GPIO::PortE, GPIO::Pin3}),
|
||||
initSPIBus(SPI::Bus::SPI2, {
|
||||
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10})
|
||||
@@ -59,6 +60,7 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
|
||||
initSPIDevice(DRV_IMU_DEVTYPE_MPU9250, SPI::CS{GPIO::PortC, GPIO::Pin2}, SPI::DRDY{GPIO::PortD, GPIO::Pin15}),
|
||||
initSPIDevice(DRV_MAG_DEVTYPE_HMC5883, SPI::CS{GPIO::PortC, GPIO::Pin1}), // HMC5983
|
||||
initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortD, GPIO::Pin7}),
|
||||
initSPIDevice(DRV_BARO_DEVTYPE_MS5607, SPI::CS{GPIO::PortD, GPIO::Pin7}),
|
||||
}, {GPIO::PortE, GPIO::Pin3}),
|
||||
initSPIBus(SPI::Bus::SPI2, {
|
||||
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10})
|
||||
|
||||
@@ -14,5 +14,8 @@ then
|
||||
# It does not start EKF2 in the beginning which is strange behaviour. but 3 seconds hack.
|
||||
# We intentionally put this initialization to here for delayed initialization.
|
||||
sleep 4
|
||||
ms5611 -T 0 -X start
|
||||
if ! ms5611 -T 5607 -X start
|
||||
then
|
||||
ms5611 -X start
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -6,7 +6,10 @@
|
||||
adc start
|
||||
|
||||
# Internal SPI
|
||||
ms5611 -T 0 -s start
|
||||
if ! ms5611 -T 5607 -s start
|
||||
then
|
||||
ms5611 -s start
|
||||
fi
|
||||
|
||||
# Draco-R
|
||||
if param compare SYS_AUTOSTART 6002
|
||||
|
||||
@@ -45,6 +45,7 @@ constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = {
|
||||
initSPIBus(SPI::Bus::SPI2, {
|
||||
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin10}),
|
||||
initSPIDevice(DRV_BARO_DEVTYPE_MS5611, SPI::CS{GPIO::PortD, GPIO::Pin7}),
|
||||
initSPIDevice(DRV_BARO_DEVTYPE_MS5607, SPI::CS{GPIO::PortD, GPIO::Pin7}),
|
||||
}),
|
||||
initSPIBusExternal(SPI::Bus::SPI4, {
|
||||
SPI::CS{GPIO::PortA, GPIO::Pin8},
|
||||
|
||||
Reference in New Issue
Block a user