mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 18:47:21 +08:00
px4_fmu-v4: deprecate boscch pixracer variant and cleanup SPI devs
This commit is contained in:
@@ -26,7 +26,9 @@ px4_add_board(
|
|||||||
dshot
|
dshot
|
||||||
gps
|
gps
|
||||||
heater
|
heater
|
||||||
imu # all available imu drivers
|
#imu # all available imu drivers
|
||||||
|
imu/mpu6000
|
||||||
|
imu/mpu9250
|
||||||
irlock
|
irlock
|
||||||
lights/blinkm
|
lights/blinkm
|
||||||
lights/rgbled
|
lights/rgbled
|
||||||
|
|||||||
@@ -18,11 +18,8 @@ fmu sensor_reset 50
|
|||||||
hmc5883 -C -T -X start
|
hmc5883 -C -T -X start
|
||||||
lis3mdl -X start
|
lis3mdl -X start
|
||||||
ist8310 start
|
ist8310 start
|
||||||
bmp280 -X start
|
|
||||||
qmc5883 -X start
|
qmc5883 -X start
|
||||||
|
rm3100 start
|
||||||
# expansion i2c used for BMM150 rotated by 90deg
|
|
||||||
bmm150 -X -R 2 start
|
|
||||||
|
|
||||||
# Internal SPI
|
# Internal SPI
|
||||||
ms5611 -s start
|
ms5611 -s start
|
||||||
@@ -38,14 +35,10 @@ fi
|
|||||||
if ! hmc5883 -C -T -S -R 2 start
|
if ! hmc5883 -C -T -S -R 2 start
|
||||||
then
|
then
|
||||||
# lis3mdl internal SPI bus is rotated 90 deg yaw
|
# lis3mdl internal SPI bus is rotated 90 deg yaw
|
||||||
if ! lis3mdl start
|
lis3mdl start
|
||||||
then
|
|
||||||
# BMI055 gyro internal SPI bus
|
|
||||||
bmi055 -G start
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Start either ICM2060X or BMI055. They are both connected to the same SPI bus and use the same
|
# Start either ICM2060X. They are both connected to the same SPI bus and use the same
|
||||||
# chip select pin. There are different boards with either one of them and the WHO_AM_I register
|
# chip select pin. There are different boards with either one of them and the WHO_AM_I register
|
||||||
# will prevent the incorrect driver from a successful initialization.
|
# will prevent the incorrect driver from a successful initialization.
|
||||||
|
|
||||||
@@ -53,23 +46,8 @@ fi
|
|||||||
if ! mpu6000 -R 2 -T 20602 start
|
if ! mpu6000 -R 2 -T 20602 start
|
||||||
then
|
then
|
||||||
# ICM20608 internal SPI bus ICM-20602-G is rotated 90 deg yaw
|
# ICM20608 internal SPI bus ICM-20602-G is rotated 90 deg yaw
|
||||||
if ! mpu6000 -R 2 -T 20608 start
|
mpu6000 -R 2 -T 20608 start
|
||||||
then
|
|
||||||
# BMI055 accel internal SPI bus
|
|
||||||
bmi055 -A start
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Start either MPU9250 or BMI160. They are both connected to the same SPI bus and use the same
|
|
||||||
# chip select pin. There are different boards with either one of them and the WHO_AM_I register
|
|
||||||
# will prevent the incorrect driver from a successful initialization.
|
|
||||||
|
|
||||||
# mpu9250 internal SPI bus mpu9250 is rotated 90 deg yaw
|
# mpu9250 internal SPI bus mpu9250 is rotated 90 deg yaw
|
||||||
if ! mpu9250 -R 2 start
|
mpu9250 -R 2 start
|
||||||
then
|
|
||||||
# BMI160 internal SPI bus
|
|
||||||
bmi160 start
|
|
||||||
fi
|
|
||||||
|
|
||||||
# External RM3100 (I2C or SPI)
|
|
||||||
rm3100 start
|
|
||||||
|
|||||||
@@ -23,17 +23,19 @@ px4_add_board(
|
|||||||
camera_trigger
|
camera_trigger
|
||||||
differential_pressure # all available differential pressure drivers
|
differential_pressure # all available differential pressure drivers
|
||||||
distance_sensor # all available distance sensor drivers
|
distance_sensor # all available distance sensor drivers
|
||||||
|
dshot
|
||||||
gps
|
gps
|
||||||
heater
|
heater
|
||||||
imu # all available imu drivers
|
#imu # all available imu drivers
|
||||||
|
imu/mpu6000
|
||||||
|
imu/mpu9250
|
||||||
irlock
|
irlock
|
||||||
lights/blinkm
|
lights/blinkm
|
||||||
lights/rgbled
|
lights/rgbled
|
||||||
lights/rgbled_ncp5623c
|
lights/rgbled_ncp5623c
|
||||||
magnetometer # all available magnetometer drivers
|
magnetometer # all available magnetometer drivers
|
||||||
mkblctrl
|
mkblctrl
|
||||||
#optical_flow # all available optical flow drivers
|
optical_flow # all available optical flow drivers
|
||||||
optical_flow/px4flow
|
|
||||||
pca9685
|
pca9685
|
||||||
protocol_splitter
|
protocol_splitter
|
||||||
pwm_input
|
pwm_input
|
||||||
@@ -48,7 +50,9 @@ px4_add_board(
|
|||||||
uavcan
|
uavcan
|
||||||
|
|
||||||
MODULES
|
MODULES
|
||||||
|
airspeed_selector
|
||||||
attitude_estimator_q
|
attitude_estimator_q
|
||||||
|
battery_status
|
||||||
camera_feedback
|
camera_feedback
|
||||||
commander
|
commander
|
||||||
dataman
|
dataman
|
||||||
@@ -56,7 +60,6 @@ px4_add_board(
|
|||||||
events
|
events
|
||||||
fw_att_control
|
fw_att_control
|
||||||
fw_pos_control_l1
|
fw_pos_control_l1
|
||||||
rover_pos_control
|
|
||||||
land_detector
|
land_detector
|
||||||
landing_target_estimator
|
landing_target_estimator
|
||||||
load_mon
|
load_mon
|
||||||
@@ -67,12 +70,11 @@ px4_add_board(
|
|||||||
mc_pos_control
|
mc_pos_control
|
||||||
micrortps_bridge
|
micrortps_bridge
|
||||||
navigator
|
navigator
|
||||||
battery_status
|
rover_pos_control
|
||||||
sensors
|
sensors
|
||||||
sih
|
sih
|
||||||
vmount
|
vmount
|
||||||
vtol_att_control
|
vtol_att_control
|
||||||
airspeed_selector
|
|
||||||
|
|
||||||
SYSTEMCMDS
|
SYSTEMCMDS
|
||||||
bl_update
|
bl_update
|
||||||
|
|||||||
@@ -71,28 +71,14 @@
|
|||||||
* Define the Chip Selects for SPI1
|
* Define the Chip Selects for SPI1
|
||||||
* CS Devices DRDY
|
* CS Devices DRDY
|
||||||
* ---- ----------------------------------------------- -----
|
* ---- ----------------------------------------------- -----
|
||||||
* PC2 MPU9250 BMI160 PD15
|
* PC2 MPU9250 PD15
|
||||||
* PC15 ICM, ICM_20602, ICM_20608 BMI055_ACCEL PC14
|
* PC15 ICM, ICM_20602, ICM_20608 PC14
|
||||||
* PE15 HMC5983 BMI055_GYRO PE12
|
* PE15 HMC5983 PE12
|
||||||
* ---- ----------------------------------------------- -----
|
* ---- ----------------------------------------------- -----
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* The BMI160 sensor replaces the MPU9250 on some boards. Only one is actually present and connected
|
|
||||||
* to the second GPIO pin on port C. The wrong driver will fail during start because of an incorrect WHO_AM_I register.
|
|
||||||
*/
|
|
||||||
#define GPIO_SPI1_CS_PORTC_PIN2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN2)
|
#define GPIO_SPI1_CS_PORTC_PIN2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN2)
|
||||||
|
|
||||||
/**
|
|
||||||
* The BMI055 acceleration sensor replaces the ICM20608G on some boards. Only one is actually present and connected
|
|
||||||
* to the second GPIO pin on port C. The wrong driver will fail during start because of an incorrect WHO_AM_I register.
|
|
||||||
*/
|
|
||||||
#define GPIO_SPI1_CS_PORTC_PIN15 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN15)
|
#define GPIO_SPI1_CS_PORTC_PIN15 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN15)
|
||||||
|
|
||||||
/**
|
|
||||||
* The BMI055 gyroscope sensor replaces the LIS3MDL, HMC5983 on some boards. Only one is actually present and connected
|
|
||||||
* to the second GPIO pin on port E. The wrong driver will fail during start because of an incorrect WHO_AM_I register.
|
|
||||||
*/
|
|
||||||
#define GPIO_SPI1_CS_PORTE_PIN15 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN15)
|
#define GPIO_SPI1_CS_PORTE_PIN15 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN15)
|
||||||
|
|
||||||
/* Define the Data Ready interrupts On SPI 1. */
|
/* Define the Data Ready interrupts On SPI 1. */
|
||||||
@@ -161,19 +147,12 @@
|
|||||||
#define SPI_BUS_INIT_MASK (PX4_SPI_BUS_RAMTRON | PX4_SPI_BUS_SENSORS)
|
#define SPI_BUS_INIT_MASK (PX4_SPI_BUS_RAMTRON | PX4_SPI_BUS_SENSORS)
|
||||||
|
|
||||||
/* Use these in place of the uint32_t enumeration to select a specific SPI device on SPI1 */
|
/* Use these in place of the uint32_t enumeration to select a specific SPI device on SPI1 */
|
||||||
#define PX4_SPIDEV_GYRO PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 1)
|
#define PX4_SPIDEV_MPU PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 1)
|
||||||
#define PX4_SPIDEV_ACCEL_MAG PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 2)
|
#define PX4_SPIDEV_HMC PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 2)
|
||||||
#define PX4_SPIDEV_MPU PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 4)
|
#define PX4_SPIDEV_LIS PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 3)
|
||||||
#define PX4_SPIDEV_HMC PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 5)
|
#define PX4_SPIDEV_ICM_20608 PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 4)
|
||||||
#define PX4_SPIDEV_ICM PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 6)
|
#define PX4_SPIDEV_ICM_20602 PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 5)
|
||||||
#define PX4_SPIDEV_LIS PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 7)
|
#define PX4_SPIDEV_MPU2 PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 6)
|
||||||
#define PX4_SPIDEV_BMI PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 8)
|
|
||||||
#define PX4_SPIDEV_BMA PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 9)
|
|
||||||
#define PX4_SPIDEV_ICM_20608 PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 10)
|
|
||||||
#define PX4_SPIDEV_ICM_20602 PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 11)
|
|
||||||
#define PX4_SPIDEV_BMI055_ACC PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 12)
|
|
||||||
#define PX4_SPIDEV_BMI055_GYR PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 13)
|
|
||||||
#define PX4_SPIDEV_MPU2 PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 14)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Onboard MS5611 and FRAM are both on bus SPI2.
|
* Onboard MS5611 and FRAM are both on bus SPI2.
|
||||||
@@ -190,12 +169,6 @@
|
|||||||
#define PX4_I2C_BUS_EXPANSION 1
|
#define PX4_I2C_BUS_EXPANSION 1
|
||||||
#define PX4_I2C_BUS_LED PX4_I2C_BUS_EXPANSION
|
#define PX4_I2C_BUS_LED PX4_I2C_BUS_EXPANSION
|
||||||
|
|
||||||
/**
|
|
||||||
* Devices on the external bus.
|
|
||||||
* Note that these are unshifted addresses.
|
|
||||||
*/
|
|
||||||
#define PX4_I2C_OBDEV_BMP280 0x76
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ADC channels:
|
* ADC channels:
|
||||||
* These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 Firmware in the adc driver.
|
* These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 Firmware in the adc driver.
|
||||||
|
|||||||
@@ -324,7 +324,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
SPI_SETFREQUENCY(spi1, 10000000);
|
SPI_SETFREQUENCY(spi1, 10000000);
|
||||||
SPI_SETBITS(spi1, 8);
|
SPI_SETBITS(spi1, 8);
|
||||||
SPI_SETMODE(spi1, SPIDEV_MODE3);
|
SPI_SETMODE(spi1, SPIDEV_MODE3);
|
||||||
SPI_SELECT(spi1, PX4_SPIDEV_GYRO, false);
|
|
||||||
SPI_SELECT(spi1, PX4_SPIDEV_HMC, false);
|
SPI_SELECT(spi1, PX4_SPIDEV_HMC, false);
|
||||||
SPI_SELECT(spi1, PX4_SPIDEV_MPU, false);
|
SPI_SELECT(spi1, PX4_SPIDEV_MPU, false);
|
||||||
up_udelay(20);
|
up_udelay(20);
|
||||||
|
|||||||
@@ -131,7 +131,6 @@ __EXPORT void stm32_spi1select(FAR struct spi_dev_s *dev, uint32_t devid, bool s
|
|||||||
|
|
||||||
/* Shared PC2 CS devices */
|
/* Shared PC2 CS devices */
|
||||||
|
|
||||||
case PX4_SPIDEV_BMI:
|
|
||||||
case PX4_SPIDEV_MPU:
|
case PX4_SPIDEV_MPU:
|
||||||
/* Making sure the other peripherals are not selected */
|
/* Making sure the other peripherals are not selected */
|
||||||
px4_arch_gpiowrite(GPIO_SPI1_CS_PORTC_PIN2, !selected);
|
px4_arch_gpiowrite(GPIO_SPI1_CS_PORTC_PIN2, !selected);
|
||||||
@@ -141,10 +140,8 @@ __EXPORT void stm32_spi1select(FAR struct spi_dev_s *dev, uint32_t devid, bool s
|
|||||||
|
|
||||||
/* Shared PC15 CS devices */
|
/* Shared PC15 CS devices */
|
||||||
|
|
||||||
case PX4_SPIDEV_ICM:
|
|
||||||
case PX4_SPIDEV_ICM_20602:
|
case PX4_SPIDEV_ICM_20602:
|
||||||
case PX4_SPIDEV_ICM_20608:
|
case PX4_SPIDEV_ICM_20608:
|
||||||
case PX4_SPIDEV_BMI055_ACC:
|
|
||||||
case PX4_SPIDEV_MPU2:
|
case PX4_SPIDEV_MPU2:
|
||||||
/* Making sure the other peripherals are not selected */
|
/* Making sure the other peripherals are not selected */
|
||||||
px4_arch_gpiowrite(GPIO_SPI1_CS_PORTC_PIN2, 1);
|
px4_arch_gpiowrite(GPIO_SPI1_CS_PORTC_PIN2, 1);
|
||||||
@@ -156,7 +153,6 @@ __EXPORT void stm32_spi1select(FAR struct spi_dev_s *dev, uint32_t devid, bool s
|
|||||||
|
|
||||||
case PX4_SPIDEV_HMC:
|
case PX4_SPIDEV_HMC:
|
||||||
case PX4_SPIDEV_LIS:
|
case PX4_SPIDEV_LIS:
|
||||||
case PX4_SPIDEV_BMI055_GYR:
|
|
||||||
/* Making sure the other peripherals are not selected */
|
/* Making sure the other peripherals are not selected */
|
||||||
px4_arch_gpiowrite(GPIO_SPI1_CS_PORTC_PIN2, 1);
|
px4_arch_gpiowrite(GPIO_SPI1_CS_PORTC_PIN2, 1);
|
||||||
px4_arch_gpiowrite(GPIO_SPI1_CS_PORTC_PIN15, 1);
|
px4_arch_gpiowrite(GPIO_SPI1_CS_PORTC_PIN15, 1);
|
||||||
|
|||||||
@@ -23,9 +23,12 @@ px4_add_board(
|
|||||||
camera_trigger
|
camera_trigger
|
||||||
differential_pressure # all available differential pressure drivers
|
differential_pressure # all available differential pressure drivers
|
||||||
distance_sensor # all available distance sensor drivers
|
distance_sensor # all available distance sensor drivers
|
||||||
|
dshot
|
||||||
gps
|
gps
|
||||||
heater
|
heater
|
||||||
imu # all available imu drivers
|
#imu # all available imu drivers
|
||||||
|
imu/mpu6000
|
||||||
|
imu/mpu9250
|
||||||
irlock
|
irlock
|
||||||
lights/blinkm
|
lights/blinkm
|
||||||
lights/rgbled
|
lights/rgbled
|
||||||
@@ -46,7 +49,9 @@ px4_add_board(
|
|||||||
#uavcan
|
#uavcan
|
||||||
|
|
||||||
MODULES
|
MODULES
|
||||||
|
airspeed_selector
|
||||||
attitude_estimator_q
|
attitude_estimator_q
|
||||||
|
battery_status
|
||||||
camera_feedback
|
camera_feedback
|
||||||
commander
|
commander
|
||||||
dataman
|
dataman
|
||||||
@@ -54,7 +59,6 @@ px4_add_board(
|
|||||||
events
|
events
|
||||||
fw_att_control
|
fw_att_control
|
||||||
fw_pos_control_l1
|
fw_pos_control_l1
|
||||||
rover_pos_control
|
|
||||||
land_detector
|
land_detector
|
||||||
landing_target_estimator
|
landing_target_estimator
|
||||||
load_mon
|
load_mon
|
||||||
@@ -64,12 +68,11 @@ px4_add_board(
|
|||||||
mc_att_control
|
mc_att_control
|
||||||
mc_pos_control
|
mc_pos_control
|
||||||
navigator
|
navigator
|
||||||
battery_status
|
rover_pos_control
|
||||||
sensors
|
sensors
|
||||||
sih
|
sih
|
||||||
vmount
|
vmount
|
||||||
vtol_att_control
|
vtol_att_control
|
||||||
airspeed_selector
|
|
||||||
|
|
||||||
SYSTEMCMDS
|
SYSTEMCMDS
|
||||||
bl_update
|
bl_update
|
||||||
|
|||||||
@@ -158,9 +158,7 @@ MPU6000_SPI_interface(int bus, int device_type, bool external_bus)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MPU_DEVICE_TYPE_ICM20608:
|
case MPU_DEVICE_TYPE_ICM20608:
|
||||||
#if defined(PX4_SPIDEV_ICM)
|
#if defined(PX4_SPIDEV_ICM_20608)
|
||||||
cs = PX4_SPIDEV_ICM;
|
|
||||||
#elif defined(PX4_SPIDEV_ICM_20608)
|
|
||||||
cs = PX4_SPIDEV_ICM_20608;
|
cs = PX4_SPIDEV_ICM_20608;
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user