Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: deprecate DriverFramework mpu9250 driver #12136

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions boards/aerotenna/ocpoc/src/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,9 @@
#define ADC_BATTERY_CURRENT_CHANNEL ((uint8_t)(-1))
#define ADC_AIRSPEED_VOLTAGE_CHANNEL 11

// SPI
#define PX4_SPI_BUS_SENSORS 1
#define PX4_SPIDEV_MPU PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 1)

#include <system_config.h>
#include <drivers/boards/common/board_common.h>
2 changes: 1 addition & 1 deletion boards/aerotenna/ocpoc/ubuntu.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ px4_add_board(
distance_sensor # all available distance sensor drivers
gps
#imu # all available imu drivers
imu/mpu9250
lights/rgbled
linux_pwm_out
linux_sbus
Expand All @@ -24,7 +25,6 @@ px4_add_board(
#telemetry # all available telemetry drivers

DF_DRIVERS # NOTE: DriverFramework is migrating to intree PX4 drivers
mpu9250
ms5611
hmc5883

Expand Down
2 changes: 1 addition & 1 deletion boards/atlflight/eagle/qurt-default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ px4_add_board(

DRIVERS
gps
imu/mpu9250
spektrum_rc
qshell/qurt
snapdragon_pwm_out

DF_DRIVERS
mpu9250
bmp280
hmc5883
trone
Expand Down
4 changes: 4 additions & 0 deletions boards/atlflight/eagle/src/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,9 @@
#define PX4_I2C_BUS_LED 3
#define PX4_NUMBER_I2C_BUSES 3

// SPI
#define PX4_SPI_BUS_SENSORS 1
#define PX4_SPIDEV_MPU PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 1)

#include <system_config.h>
#include <drivers/boards/common/board_common.h>
2 changes: 1 addition & 1 deletion boards/atlflight/excelsior/qurt-default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ px4_add_board(

DRIVERS
gps
imu/mpu9250
spektrum_rc
qshell/qurt
snapdragon_pwm_out

DF_DRIVERS
mpu9250
bmp280
hmc5883
trone
Expand Down
2 changes: 1 addition & 1 deletion boards/beaglebone/blue/cross.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ px4_add_board(
distance_sensor # all available distance sensor drivers
gps
#imu # all available imu drivers
imu/mpu9250
#magnetometer # all available magnetometer drivers
pwm_out_sim
#telemetry # all available telemetry drivers
Expand All @@ -24,7 +25,6 @@ px4_add_board(
linux_sbus

DF_DRIVERS # NOTE: DriverFramework is migrating to intree PX4 drivers
mpu9250
bmp280

MODULES
Expand Down
2 changes: 1 addition & 1 deletion boards/beaglebone/blue/native.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ px4_add_board(
distance_sensor # all available distance sensor drivers
gps
#imu # all available imu drivers
imu/mpu9250
#magnetometer # all available magnetometer drivers
pwm_out_sim
#telemetry # all available telemetry drivers
Expand All @@ -22,7 +23,6 @@ px4_add_board(
linux_sbus

DF_DRIVERS # NOTE: DriverFramework is migrating to intree PX4 drivers
mpu9250
bmp280

MODULES
Expand Down
2 changes: 1 addition & 1 deletion boards/emlid/navio2/cross.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ px4_add_board(
distance_sensor # all available distance sensor drivers
gps
#imu # all available imu drivers
imu/mpu9250
#magnetometer # all available magnetometer drivers
pwm_out_sim
#telemetry # all available telemetry drivers
Expand All @@ -27,7 +28,6 @@ px4_add_board(
hmc5883
isl29501
lsm9ds1
mpu9250
ms5611
trone

Expand Down
2 changes: 1 addition & 1 deletion boards/emlid/navio2/native.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ px4_add_board(
distance_sensor # all available distance sensor drivers
gps
#imu # all available imu drivers
imu/mpu9250
#magnetometer # all available magnetometer drivers
pwm_out_sim
#telemetry # all available telemetry drivers
Expand All @@ -25,7 +26,6 @@ px4_add_board(
hmc5883
isl29501
lsm9ds1
mpu9250
ms5611
trone

Expand Down
8 changes: 6 additions & 2 deletions boards/emlid/navio2/src/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,12 @@
/*
* I2C busses
*/
#define PX4_I2C_BUS_EXPANSION 1
#define PX4_NUMBER_I2C_BUSES 1
#define PX4_I2C_BUS_EXPANSION 1
#define PX4_NUMBER_I2C_BUSES 1

// SPI
#define PX4_SPI_BUS_SENSORS 0
#define PX4_SPIDEV_MPU PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 1)

#include <system_config.h>
#include <drivers/boards/common/board_common.h>
8 changes: 4 additions & 4 deletions posix-configs/bbblue/px4.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ param set SYS_AUTOSTART 4011
# Note that the setting here applies to all PWM channels.
# param set PWM_MIN 1120
# param set PWM_MAX 1920
# Not using DJI 430 LITE ESC anymore due to its hiccups:
# Not using DJI 430 LITE ESC anymore due to its hiccups:
# each random motor stop would cause a scary flip in the fly
# Replacing with 4 BLHeli32 (Wraith32 V2) ESCs solved the main problem in BBBlue porting

# Broadcast heartbeats on local network. This allows a ground control station
# to automatically find the drone on the local network.
param set MAV_BROADCAST 1
Expand Down Expand Up @@ -53,7 +53,7 @@ dataman start

df_bmp280_wrapper start -D /dev/i2c-2

df_mpu9250_wrapper start
mpu9250 start
# options: -R rotation

gps start -d /dev/ttyS2 -s -p ubx
Expand All @@ -73,7 +73,7 @@ mc_att_control start
#fw_att_control start
#fw_pos_control_l1 start

mavlink start -n SoftAp -x -u 14556 -r 1000000
mavlink start -n SoftAp -x -u 14556 -r 1000000
# -n name of wifi interface: SoftAp, wlan or your custom interface,
# e.g., -n SoftAp . The default is wlan

Expand Down
10 changes: 5 additions & 5 deletions posix-configs/bbblue/px4_fw.config
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ param set SYS_AUTOSTART 4011
# Not using DJI 430 LITE ESC anymore due to its hiccups:
# each random motor stop would cause a scary flip in the fly
# Replacing with 4 BLHeli32 (Wraith32 V2) ESCs solved the main problem in BBBlue porting

# Broadcast heartbeats on local network. This allows a ground control station
# to automatically find the drone on the local network.
param set MAV_BROADCAST 1
Expand All @@ -36,7 +36,7 @@ param set MAV_TYPE 2
# Three possible main power battery sources for BBBlue:
# 1. onboard 2S LiPo battery connector, which is connect to ADC channel 6
# 2. onboard 9-18V DC Jack, which is connect to ADC channel 5. This is the board default.
# 3. other power source (e.g., LiPo battery more than 4S/18V).
# 3. other power source (e.g., LiPo battery more than 4S/18V).
# Scale the voltage to below 1.8V and connect it to ADC channel # 0, 1, 2 or 3.
param set BAT_ADC_CHANNEL 5

Expand All @@ -53,7 +53,7 @@ dataman start

df_bmp280_wrapper start -D /dev/i2c-2

df_mpu9250_wrapper start
mpu9250 start
# options: -R rotation

gps start -d /dev/ttyS2 -s -p ubx
Expand All @@ -73,8 +73,8 @@ ekf2 start
fw_att_control start
fw_pos_control_l1 start

mavlink start -n SoftAp -x -u 14556 -r 1000000
# -n name of wifi interface: SoftAp, wlan or your custom interface,
mavlink start -n SoftAp -x -u 14556 -r 1000000
# -n name of wifi interface: SoftAp, wlan or your custom interface,
# e.g., -n wlan . The default on BBBlue is SoftAp

sleep 1
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/eagle/200qx/px4.config
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ param set UART_ESC_MOTOR2 2
param set UART_ESC_MOTOR3 1
param set UART_ESC_MOTOR4 3
sleep 1
df_mpu9250_wrapper start
mpu9250 start
df_bmp280_wrapper start
gps start -d /dev/tty-4
sensors start
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/eagle/210qc/px4.config
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ param set UART_ESC_MOTOR2 2
param set UART_ESC_MOTOR3 1
param set UART_ESC_MOTOR4 3
sleep 1
df_mpu9250_wrapper start
mpu9250 start
df_bmp280_wrapper start
gps start -d /dev/tty-4
sensors start
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/eagle/flight/px4.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ gps start -d /dev/tty-4
param set MAV_TYPE 2
sleep 1
df_hmc5883_wrapper start
df_mpu9250_wrapper start_without_mag
mpu9250 start
df_bmp280_wrapper start
df_trone_wrapper start
#df_ltc2946_wrapper start # (currently not working on all boards...)
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/eagle/init/rcS
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ else
fi


qshell df_mpu9250_wrapper start
qshell mpu9250 start
qshell df_bmp280_wrapper start
qshell sensors start

Expand Down
2 changes: 1 addition & 1 deletion posix-configs/excelsior/px4.config
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ param set UART_ESC_MOTOR2 2
param set UART_ESC_MOTOR3 1
param set UART_ESC_MOTOR4 3
sleep 1
df_mpu9250_wrapper start
mpu9250 start
df_bmp280_wrapper start
sensors start
commander start
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/ocpoc/px4.config
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ param set MAV_BROADCAST 1
param set MAV_TYPE 2
param set MAV_SYS_ID 1

df_mpu9250_wrapper start_without_mag -R 10
mpu9250 start -R 10
df_hmc5883_wrapper start -D /dev/i2c-4
df_ms5611_wrapper start
rgbled start -b 1
Expand Down
4 changes: 2 additions & 2 deletions posix-configs/rpi/px4.config
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ param set BAT_V_DIV 10.9176300578
param set BAT_CNT_V_CURR 0.001
param set BAT_A_PER_V 15.391030303
dataman start
df_lsm9ds1_wrapper start -R 4
#df_mpu9250_wrapper start -R 10
#df_lsm9ds1_wrapper start -R 4
mpu9250 start -R 10
#df_hmc5883_wrapper start
df_ms5611_wrapper start
navio_rgbled start
Expand Down
2 changes: 1 addition & 1 deletion posix-configs/rpi/px4_no_shield.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ param set SYS_AUTOSTART 4001
param set MAV_BROADCAST 1
sleep 1
param set MAV_TYPE 2
df_mpu9250_wrapper start -R 10
mpu9250 start -R 10
df_ms5611_wrapper start
gps start -d /dev/ttyACM0 -i uart -p ubx
sensors start
Expand Down
12 changes: 4 additions & 8 deletions src/drivers/imu/mpu9250/AK8963_I2C.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/****************************************************************************
*
* Copyright (c) 2016 PX4 Development Team. All rights reserved.
* Copyright (c) 2016-2019 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -44,9 +44,7 @@
#include "mpu9250.h"
#include "MPU9250_mag.h"

#ifdef USE_I2C

device::Device *AK8963_I2C_interface(int bus, bool external_bus);
device::Device *AK8963_I2C_interface(int bus);

class AK8963_I2C : public device::I2C
{
Expand All @@ -63,7 +61,7 @@ class AK8963_I2C : public device::I2C
};

device::Device *
AK8963_I2C_interface(int bus, bool external_bus)
AK8963_I2C_interface(int bus)
{
return new AK8963_I2C(bus);
}
Expand All @@ -76,7 +74,7 @@ AK8963_I2C::AK8963_I2C(int bus) : I2C("AK8963_I2C", nullptr, bus, AK8963_I2C_ADD
int
AK8963_I2C::write(unsigned reg_speed, void *data, unsigned count)
{
uint8_t cmd[MPU_MAX_WRITE_BUFFER_SIZE];
uint8_t cmd[2];

if (sizeof(cmd) < (count + 1)) {
return -EIO;
Expand Down Expand Up @@ -110,5 +108,3 @@ AK8963_I2C::probe()

return OK;
}

#endif
2 changes: 1 addition & 1 deletion src/drivers/imu/mpu9250/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
############################################################################
#
# Copyright (c) 2016 PX4 Development Team. All rights reserved.
# Copyright (c) 2016-2019 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down
Loading