boards: px4/fmu-v6c add BMI088 support

This commit is contained in:
jamming 2023-12-16 00:45:37 +08:00 committed by GitHub
parent fe4333f4a0
commit b7306f3773
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 36 additions and 5 deletions

View File

@ -16,6 +16,7 @@ CONFIG_DRIVERS_DSHOT=y
CONFIG_DRIVERS_GPS=y
CONFIG_DRIVERS_HEATER=y
CONFIG_DRIVERS_IMU_BOSCH_BMI055=y
CONFIG_DRIVERS_IMU_BOSCH_BMI088=y
CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y
CONFIG_COMMON_INS=y
CONFIG_COMMON_LIGHT=y

View File

@ -4,9 +4,16 @@
#------------------------------------------------------------------------------
board_adc start
# Internal SPI bus BMI055 accel/gyro
bmi055 -A -R 4 -s start
bmi055 -G -R 4 -s start
if ver hwtypecmp V6C000002 V6C002002
then
# Internal SPI BMI088 accel/gyro
bmi088 -A -R 4 -s start
bmi088 -G -R 4 -s start
else
# Internal SPI bus BMI055 accel/gyro
bmi055 -A -R 4 -s start
bmi055 -G -R 4 -s start
fi
# Internal SPI bus ICM42688p
icm42688p -R 6 -s start

View File

@ -141,14 +141,15 @@
#define GPIO_HW_VER_SENSE /* PC1 */ GPIO_ADC123_INP11
#define HW_INFO_INIT_PREFIX "V6C"
#define BOARD_NUM_SPI_CFG_HW_VERSIONS 3 // Rev 0, 10 and Mini Sensor sets
#define BOARD_NUM_SPI_CFG_HW_VERSIONS 5 // Rev 0, 10 and Mini Sensor sets
// Base/FMUM
#define V6C00 HW_VER_REV(0x0,0x0) // FMUV6C, Rev 0 I2C4 External but with Internal devices
#define V6C01 HW_VER_REV(0x0,0x1) // FMUV6C, Rev 1 I2C4 Internal I2C2 External
#define V6C02 HW_VER_REV(0x0,0x2) // FMUV6C, Rev 2 I2C4 Internal I2C2 External,BMI088+ICM-42688P
#define V6C10 HW_VER_REV(0x1,0x0) // NO PX4IO, Rev 0 I2C4 External but with Internal devices
#define V6C11 HW_VER_REV(0x1,0x1) // NO PX4IO, Rev 1 I2C4 Internal I2C2 External
#define V6C21 HW_VER_REV(0x2,0x1) // FMUV6CMini, Rev 1 I2C4 Internal I2C2 External
#define V6C22 HW_VER_REV(0x2,0x2) // FMUV6CMini, Rev 2 I2C4 Internal I2C2 External,BMI088+ICM-42688P
/* HEATER
* PWM in future

View File

@ -104,9 +104,11 @@ static px4_hw_mft_list_entry_t mft_lists[] = {
// ver_rev
{V6C00, hw_mft_list_v0600, arraySize(hw_mft_list_v0600)}, // Rev 0
{V6C01, hw_mft_list_v0600, arraySize(hw_mft_list_v0600)}, // Rev 1
{V6C02, hw_mft_list_v0600, arraySize(hw_mft_list_v0600)}, // Rev 2
{V6C10, hw_mft_list_v0610, arraySize(hw_mft_list_v0610)}, // Rev 0 No PX4IO
{V6C11, hw_mft_list_v0610, arraySize(hw_mft_list_v0610)}, // Rev 1 No PX4IO
{V6C21, hw_mft_list_v0600, arraySize(hw_mft_list_v0600)}, // Rev 1 MINI
{V6C22, hw_mft_list_v0600, arraySize(hw_mft_list_v0600)}, // Rev 2 MINI
};
/************************************************************************************

View File

@ -56,6 +56,16 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin4})
}),
}),
initSPIHWVersion(V6C02, {
initSPIBus(SPI::Bus::SPI1, {
initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortC, GPIO::Pin14}, SPI::DRDY{GPIO::PortE, GPIO::Pin5}),
initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortE, GPIO::Pin4}),
initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortC, GPIO::Pin13}, SPI::DRDY{GPIO::PortE, GPIO::Pin6}),
}, {GPIO::PortB, GPIO::Pin2}),
initSPIBus(SPI::Bus::SPI2, {
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin4})
}),
}),
initSPIHWVersion(V6C21, {
initSPIBus(SPI::Bus::SPI1, {
initSPIDevice(DRV_GYR_DEVTYPE_BMI055, SPI::CS{GPIO::PortC, GPIO::Pin14}, SPI::DRDY{GPIO::PortE, GPIO::Pin5}),
@ -66,6 +76,16 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin4})
}),
}),
initSPIHWVersion(V6C22, {
initSPIBus(SPI::Bus::SPI1, {
initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortC, GPIO::Pin14}, SPI::DRDY{GPIO::PortE, GPIO::Pin5}),
initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortC, GPIO::Pin15}, SPI::DRDY{GPIO::PortE, GPIO::Pin4}),
initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortC, GPIO::Pin13}, SPI::DRDY{GPIO::PortE, GPIO::Pin6}),
}, {GPIO::PortB, GPIO::Pin2}),
initSPIBus(SPI::Bus::SPI2, {
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin4})
}),
}),
};
static constexpr bool unused = validateSPIConfig(px4_spi_buses_all_hw);