mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 03:53:33 +08:00
deprecate df_bmp280_wrapper and replace with in tree bmp280
- deprecate DriverFramework bmp280 driver (df_bmp280_wrapper) - update beaglebone blue and snapdragon flight eagle boards to use in tree bmp280 - update posix (really just linux) and qurt I2C wrappers - tested on beaglebone blue
This commit is contained in:
@@ -44,7 +44,6 @@ px4_add_board(
|
||||
LABEL default
|
||||
#TESTING
|
||||
TOOLCHAIN arm-linux-gnueabihf
|
||||
|
||||
DRIVERS
|
||||
#barometer # all available barometer drivers
|
||||
batt_smbus
|
||||
@@ -53,17 +52,14 @@ px4_add_board(
|
||||
distance_sensor # all available distance sensor drivers
|
||||
gps
|
||||
#imu # all available imu drivers
|
||||
lights/rgbled
|
||||
#lights/rgbled
|
||||
linux_sbus
|
||||
#magnetometer # all available magnetometer drivers
|
||||
pwm_out_sim
|
||||
qshell/posix
|
||||
#telemetry # all available telemetry drivers
|
||||
|
||||
MODULES
|
||||
muorb/krait
|
||||
muorb/test
|
||||
|
||||
airspeed_selector
|
||||
attitude_estimator_q
|
||||
camera_feedback
|
||||
commander
|
||||
@@ -72,7 +68,6 @@ px4_add_board(
|
||||
events
|
||||
fw_att_control
|
||||
fw_pos_control_l1
|
||||
rover_pos_control
|
||||
land_detector
|
||||
landing_target_estimator
|
||||
load_mon
|
||||
@@ -80,17 +75,19 @@ px4_add_board(
|
||||
logger
|
||||
mavlink
|
||||
mc_att_control
|
||||
mc_rate_control
|
||||
mc_pos_control
|
||||
mc_rate_control
|
||||
#micrortps_bridge
|
||||
muorb/krait
|
||||
muorb/test
|
||||
navigator
|
||||
rc_update
|
||||
rover_pos_control
|
||||
sensors
|
||||
#sih
|
||||
simulator
|
||||
vmount
|
||||
vtol_att_control
|
||||
airspeed_selector
|
||||
|
||||
SYSTEMCMDS
|
||||
#bl_update
|
||||
#config
|
||||
@@ -100,6 +97,7 @@ px4_add_board(
|
||||
led_control
|
||||
mixer
|
||||
motor_ramp
|
||||
motor_test
|
||||
#mtd
|
||||
#nshterm
|
||||
param
|
||||
@@ -114,12 +112,14 @@ px4_add_board(
|
||||
tune_control
|
||||
ver
|
||||
work_queue
|
||||
|
||||
EXAMPLES
|
||||
#bottle_drop # OBC challenge
|
||||
#fixedwing_control # Tutorial code from https://px4.io/dev/example_fixedwing_control
|
||||
#hello
|
||||
#hwtest # Hardware test
|
||||
#matlab_csv_serial
|
||||
#px4_mavlink_debug # Tutorial code from http://dev.px4.io/en/debug/debug_values.html
|
||||
#px4_simple_app # Tutorial code from http://dev.px4.io/en/apps/hello_sky.html
|
||||
#rover_steering_control # Rover example app
|
||||
#uuv_example_app
|
||||
)
|
||||
|
||||
@@ -43,46 +43,48 @@ px4_add_board(
|
||||
VENDOR atlflight
|
||||
MODEL eagle
|
||||
LABEL qurt-default
|
||||
|
||||
DRIVERS
|
||||
barometer/bmp280
|
||||
gps
|
||||
imu/mpu9250
|
||||
magnetometer/hmc5883
|
||||
spektrum_rc
|
||||
qshell/qurt
|
||||
snapdragon_pwm_out
|
||||
|
||||
spektrum_rc
|
||||
DF_DRIVERS
|
||||
mpu9250
|
||||
bmp280
|
||||
hmc5883
|
||||
trone
|
||||
isl29501
|
||||
ltc2946
|
||||
|
||||
mpu9250
|
||||
trone
|
||||
MODULES
|
||||
muorb/adsp
|
||||
|
||||
airspeed_selector
|
||||
attitude_estimator_q
|
||||
commander
|
||||
ekf2
|
||||
fw_att_control
|
||||
fw_pos_control_l1
|
||||
rover_pos_control
|
||||
land_detector
|
||||
landing_target_estimator
|
||||
local_position_estimator
|
||||
mc_att_control
|
||||
mc_rate_control
|
||||
mc_pos_control
|
||||
mc_rate_control
|
||||
muorb/adsp
|
||||
rc_update
|
||||
rover_pos_control
|
||||
sensors
|
||||
#sih
|
||||
vmount
|
||||
vtol_att_control
|
||||
airspeed_selector
|
||||
|
||||
SYSTEMCMDS
|
||||
led_control
|
||||
mixer
|
||||
#motor_ramp
|
||||
motor_test
|
||||
param
|
||||
perf
|
||||
#pwm
|
||||
#topic_listener
|
||||
ver
|
||||
work_queue
|
||||
)
|
||||
|
||||
@@ -32,5 +32,6 @@
|
||||
############################################################################
|
||||
|
||||
add_library(drivers_board
|
||||
sitl_led.c
|
||||
board_config.h
|
||||
init.c
|
||||
)
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
/**
|
||||
* @file board_config.h
|
||||
*
|
||||
* SITL internal definitions
|
||||
* EAGLE internal definitions
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
@@ -45,16 +45,16 @@
|
||||
#define BOARD_HAS_NO_RESET
|
||||
#define BOARD_HAS_NO_BOOTLOADER
|
||||
|
||||
#define BOARD_NUMBER_BRICKS 0
|
||||
|
||||
/*
|
||||
* I2C busses
|
||||
*/
|
||||
#define PX4_I2C_BUS_ESC 1
|
||||
#define PX4_SIM_BUS_TEST 2
|
||||
#define PX4_I2C_BUS_EXPANSION 3
|
||||
#define PX4_I2C_BUS_LED 3
|
||||
#define PX4_NUMBER_I2C_BUSES 3
|
||||
#define PX4_I2C_BUS_EXPANSION1 2 // I2C2: J9 / GPS
|
||||
#define PX4_I2C_BUS_EXPANSION 3 // I2C3: J14 / Power
|
||||
#define PX4_I2C_BUS_EXPANSION2 9 // I2C9: J15 / Radio Receiver / Sensors
|
||||
|
||||
#define PX4_NUMBER_I2C_BUSES 3
|
||||
|
||||
#define PX4_I2C_OBDEV_BMP280 0x76
|
||||
|
||||
// SPI
|
||||
#define PX4_SPI_BUS_SENSORS 1
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2013 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
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name PX4 nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* @file sitl_led.c
|
||||
*
|
||||
* sitl LED backend.
|
||||
*/
|
||||
|
||||
#include <px4_platform_common/px4_config.h>
|
||||
#include <px4_platform_common/log.h>
|
||||
#include <stdbool.h>
|
||||
#include <systemlib/px4_macros.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern void led_init(void);
|
||||
extern void led_on(int led);
|
||||
extern void led_off(int led);
|
||||
extern void led_toggle(int led);
|
||||
__END_DECLS
|
||||
|
||||
static bool _led_state[] = { false, false, false, false };
|
||||
|
||||
__EXPORT void led_init()
|
||||
{
|
||||
PX4_DEBUG("LED_INIT");
|
||||
}
|
||||
|
||||
__EXPORT void led_on(int led)
|
||||
{
|
||||
if ((unsigned int)led < arraySize(_led_state)) {
|
||||
PX4_DEBUG("LED%d_ON", led);
|
||||
_led_state[led] = true;
|
||||
}
|
||||
}
|
||||
|
||||
__EXPORT void led_off(int led)
|
||||
{
|
||||
if ((unsigned int)led < arraySize(_led_state)) {
|
||||
PX4_DEBUG("LED%d_OFF", led);
|
||||
_led_state[led] = false;
|
||||
}
|
||||
}
|
||||
|
||||
__EXPORT void led_toggle(int led)
|
||||
{
|
||||
if ((unsigned int)led < arraySize(_led_state)) {
|
||||
_led_state[led] = !_led_state[led];
|
||||
PX4_DEBUG("LED%d_TOGGLE: %s", led, _led_state[led] ? "ON" : "OFF");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -42,9 +42,8 @@ px4_add_board(
|
||||
VENDOR atlflight
|
||||
MODEL excelsior
|
||||
LABEL default
|
||||
TESTING
|
||||
#TESTING
|
||||
TOOLCHAIN arm-oemllib32-linux-gnueabi
|
||||
|
||||
DRIVERS
|
||||
#barometer # all available barometer drivers
|
||||
batt_smbus
|
||||
@@ -53,17 +52,14 @@ px4_add_board(
|
||||
distance_sensor # all available distance sensor drivers
|
||||
gps
|
||||
#imu # all available imu drivers
|
||||
lights/rgbled
|
||||
#lights/rgbled
|
||||
linux_sbus
|
||||
#magnetometer # all available magnetometer drivers
|
||||
pwm_out_sim
|
||||
qshell/posix
|
||||
#telemetry # all available telemetry drivers
|
||||
|
||||
MODULES
|
||||
muorb/krait
|
||||
muorb/test
|
||||
|
||||
airspeed_selector
|
||||
attitude_estimator_q
|
||||
camera_feedback
|
||||
commander
|
||||
@@ -72,7 +68,6 @@ px4_add_board(
|
||||
events
|
||||
fw_att_control
|
||||
fw_pos_control_l1
|
||||
rover_pos_control
|
||||
land_detector
|
||||
landing_target_estimator
|
||||
load_mon
|
||||
@@ -80,17 +75,19 @@ px4_add_board(
|
||||
logger
|
||||
mavlink
|
||||
mc_att_control
|
||||
mc_rate_control
|
||||
mc_pos_control
|
||||
mc_rate_control
|
||||
#micrortps_bridge
|
||||
muorb/krait
|
||||
muorb/test
|
||||
navigator
|
||||
rc_update
|
||||
rover_pos_control
|
||||
sensors
|
||||
sih
|
||||
#sih
|
||||
simulator
|
||||
vmount
|
||||
vtol_att_control
|
||||
airspeed_selector
|
||||
|
||||
SYSTEMCMDS
|
||||
#bl_update
|
||||
#config
|
||||
@@ -100,6 +97,7 @@ px4_add_board(
|
||||
led_control
|
||||
mixer
|
||||
motor_ramp
|
||||
motor_test
|
||||
#mtd
|
||||
#nshterm
|
||||
param
|
||||
@@ -108,19 +106,20 @@ px4_add_board(
|
||||
reboot
|
||||
sd_bench
|
||||
shutdown
|
||||
tests # tests and test runner
|
||||
#tests # tests and test runner
|
||||
top
|
||||
topic_listener
|
||||
tune_control
|
||||
ver
|
||||
work_queue
|
||||
|
||||
EXAMPLES
|
||||
bottle_drop # OBC challenge
|
||||
fixedwing_control # Tutorial code from https://px4.io/dev/example_fixedwing_control
|
||||
hello
|
||||
#bottle_drop # OBC challenge
|
||||
#fixedwing_control # Tutorial code from https://px4.io/dev/example_fixedwing_control
|
||||
#hello
|
||||
#hwtest # Hardware test
|
||||
px4_mavlink_debug # Tutorial code from http://dev.px4.io/en/debug/debug_values.html
|
||||
px4_simple_app # Tutorial code from http://dev.px4.io/en/apps/hello_sky.html
|
||||
rover_steering_control # Rover example app
|
||||
#matlab_csv_serial
|
||||
#px4_mavlink_debug # Tutorial code from http://dev.px4.io/en/debug/debug_values.html
|
||||
#px4_simple_app # Tutorial code from http://dev.px4.io/en/apps/hello_sky.html
|
||||
#rover_steering_control # Rover example app
|
||||
#uuv_example_app
|
||||
)
|
||||
|
||||
@@ -43,45 +43,48 @@ px4_add_board(
|
||||
VENDOR atlflight
|
||||
MODEL excelsior
|
||||
LABEL qurt-default
|
||||
|
||||
DRIVERS
|
||||
barometer/bmp280
|
||||
gps
|
||||
imu/mpu9250
|
||||
spektrum_rc
|
||||
magnetometer/hmc5883
|
||||
qshell/qurt
|
||||
snapdragon_pwm_out
|
||||
|
||||
spektrum_rc
|
||||
DF_DRIVERS
|
||||
mpu9250
|
||||
bmp280
|
||||
hmc5883
|
||||
trone
|
||||
isl29501
|
||||
ltc2946
|
||||
|
||||
mpu9250
|
||||
trone
|
||||
MODULES
|
||||
muorb/adsp
|
||||
|
||||
airspeed_selector
|
||||
attitude_estimator_q
|
||||
commander
|
||||
ekf2
|
||||
fw_att_control
|
||||
fw_pos_control_l1
|
||||
rover_pos_control
|
||||
land_detector
|
||||
landing_target_estimator
|
||||
local_position_estimator
|
||||
mc_att_control
|
||||
mc_rate_control
|
||||
mc_pos_control
|
||||
mc_rate_control
|
||||
muorb/adsp
|
||||
rc_update
|
||||
rover_pos_control
|
||||
sensors
|
||||
sih
|
||||
vmount
|
||||
vtol_att_control
|
||||
airspeed_selector
|
||||
|
||||
SYSTEMCMDS
|
||||
led_control
|
||||
mixer
|
||||
#motor_ramp
|
||||
motor_test
|
||||
param
|
||||
perf
|
||||
#pwm
|
||||
#topic_listener
|
||||
ver
|
||||
work_queue
|
||||
)
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (c) 2015 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
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name PX4 nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
add_library(drivers_board
|
||||
board_config.h
|
||||
init.c
|
||||
)
|
||||
@@ -39,9 +39,26 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#define BOARD_BATTERY1_V_DIV (10.177939394f)
|
||||
#define BOARD_BATTERY1_A_PER_V (15.391030303f)
|
||||
#define BOARD_OVERRIDE_UUID "EAGLEID000000000" // must be of length 16
|
||||
#define PX4_SOC_ARCH_ID PX4_SOC_ARCH_ID_EAGLE
|
||||
|
||||
#define BOARD_HAS_NO_RESET
|
||||
|
||||
#define BOARD_HAS_NO_BOOTLOADER
|
||||
|
||||
/*
|
||||
* I2C busses
|
||||
*/
|
||||
#define PX4_I2C_BUS_EXPANSION1 2 // I2C2: J9 / GPS
|
||||
#define PX4_I2C_BUS_EXPANSION 3 // I2C3: J14 / Power
|
||||
#define PX4_I2C_BUS_EXPANSION2 9 // I2C9: J15 / Radio Receiver / Sensors
|
||||
|
||||
#define PX4_NUMBER_I2C_BUSES 3
|
||||
|
||||
#define PX4_I2C_OBDEV_BMP280 0x76
|
||||
|
||||
// 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 <px4_platform_common/board_common.h>
|
||||
|
||||
@@ -25,7 +25,6 @@ px4_add_board(
|
||||
pwm_out_sim
|
||||
#telemetry # all available telemetry drivers
|
||||
DF_DRIVERS # NOTE: DriverFramework is migrating to intree PX4 drivers
|
||||
bmp280
|
||||
mpu9250
|
||||
MODULES
|
||||
airspeed_selector
|
||||
|
||||
@@ -23,7 +23,6 @@ px4_add_board(
|
||||
pwm_out_sim
|
||||
#telemetry # all available telemetry drivers
|
||||
DF_DRIVERS # NOTE: DriverFramework is migrating to intree PX4 drivers
|
||||
bmp280
|
||||
mpu9250
|
||||
MODULES
|
||||
airspeed_selector
|
||||
|
||||
@@ -60,8 +60,13 @@
|
||||
/*
|
||||
* I2C busses
|
||||
*/
|
||||
#define PX4_I2C_BUS_EXPANSION 1
|
||||
#define PX4_NUMBER_I2C_BUSES 1
|
||||
#define PX4_I2C_BUS_EXPANSION 1 // i2c-1: pins P9 17,18
|
||||
#define PX4_I2C_BUS_ONBOARD 2 // i2c-2: pins P9 19,20 - bmp280, mpu9250
|
||||
|
||||
#define PX4_NUMBER_I2C_BUSES 2
|
||||
|
||||
#define PX4_I2C_OBDEV_MPU9250 0x68
|
||||
#define PX4_I2C_OBDEV_BMP280 0x76
|
||||
|
||||
#include <system_config.h>
|
||||
#include <px4_platform_common/board_common.h>
|
||||
@@ -82,8 +87,6 @@ void rc_cleaning(void);
|
||||
#define rc_i2c_unlock_bus rc_i2c_release_bus
|
||||
#define rc_i2c_get_lock rc_i2c_get_in_use_state
|
||||
|
||||
#define rc_bmp_init rc_initialize_barometer
|
||||
|
||||
#define rc_adc_read_raw rc_adc_raw
|
||||
|
||||
#define rc_servo_send_pulse_us rc_send_servo_pulse_us
|
||||
@@ -94,25 +97,6 @@ void rc_cleaning(void);
|
||||
#define rc_filter_prefill_outputs rc_prefill_filter_outputs
|
||||
#define rc_filter_butterworth_lowpass rc_butterworth_lowpass
|
||||
|
||||
/**
|
||||
* struct to hold the data retreived during one read of the barometer.
|
||||
*/
|
||||
typedef struct rc_bmp_data_t {
|
||||
float temp_c; ///< temperature in degrees celcius
|
||||
float alt_m; ///< altitude in meters
|
||||
float pressure_pa; ///< current pressure in pascals
|
||||
} rc_bmp_data_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int rc_bmp_read(rc_bmp_data_t *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOARD_CONFIG_H
|
||||
|
||||
@@ -138,17 +138,3 @@ void rc_cleaning(void)
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#ifdef __RC_V0_3
|
||||
int rc_bmp_read(rc_bmp_data_t *data)
|
||||
{
|
||||
int rtn = rc_read_barometer();
|
||||
|
||||
data->temp_c = rc_bmp_get_temperature();
|
||||
data->alt_m = rc_bmp_get_altitude_m();
|
||||
data->pressure_pa = rc_bmp_get_pressure_pa();
|
||||
|
||||
return rtn;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user