mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-10 20:11:35 +08:00
[DO NOT MERGE] boards: mro_pixracerpro remap GPS1 to 4xPWM/DSHOT
This commit is contained in:
@@ -37,6 +37,8 @@
|
||||
* I2C interface for DPS310
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_I2C)
|
||||
|
||||
#include <lib/drivers/device/i2c.h>
|
||||
|
||||
namespace dps310
|
||||
@@ -89,3 +91,5 @@ DPS310_I2C::write(unsigned address, void *data, unsigned count)
|
||||
}
|
||||
|
||||
} // namespace dps310
|
||||
|
||||
#endif // CONFIG_I2C
|
||||
|
||||
@@ -36,7 +36,9 @@
|
||||
namespace dps310
|
||||
{
|
||||
extern device::Device *DPS310_SPI_interface(uint8_t bus, uint32_t device, int bus_frequency, spi_mode_e spi_mode);
|
||||
#if defined(CONFIG_I2C)
|
||||
extern device::Device *DPS310_I2C_interface(uint8_t bus, uint32_t device, int bus_frequency);
|
||||
#endif // CONFIG_I2C
|
||||
}
|
||||
|
||||
#include <px4_platform_common/getopt.h>
|
||||
@@ -59,12 +61,16 @@ I2CSPIDriverBase *DPS310::instantiate(const I2CSPIDriverConfig &config, int runt
|
||||
{
|
||||
device::Device *interface = nullptr;
|
||||
|
||||
#if defined(CONFIG_I2C)
|
||||
|
||||
if (config.bus_type == BOARD_I2C_BUS) {
|
||||
interface = DPS310_I2C_interface(config.bus, config.i2c_address, config.bus_frequency);
|
||||
|
||||
} else if (config.bus_type == BOARD_SPI_BUS) {
|
||||
interface = DPS310_SPI_interface(config.bus, config.spi_devid, config.bus_frequency, config.spi_mode);
|
||||
}
|
||||
} else
|
||||
#endif // CONFIG_I2C
|
||||
if (config.bus_type == BOARD_SPI_BUS) {
|
||||
interface = DPS310_SPI_interface(config.bus, config.spi_devid, config.bus_frequency, config.spi_mode);
|
||||
}
|
||||
|
||||
if (interface == nullptr) {
|
||||
PX4_ERR("failed creating interface for bus %i (devid 0x%" PRIx32 ")", config.bus, config.spi_devid);
|
||||
@@ -95,9 +101,15 @@ I2CSPIDriverBase *DPS310::instantiate(const I2CSPIDriverConfig &config, int runt
|
||||
extern "C" int dps310_main(int argc, char *argv[])
|
||||
{
|
||||
using ThisDriver = DPS310;
|
||||
BusCLIArguments cli{true, true};
|
||||
|
||||
#if defined(CONFIG_I2C)
|
||||
BusCLIArguments cli {true, true};
|
||||
cli.i2c_address = 0x77;
|
||||
cli.default_i2c_frequency = 400000;
|
||||
#else
|
||||
BusCLIArguments cli {false, true};
|
||||
#endif // CONFIG_I2C
|
||||
|
||||
cli.default_spi_frequency = 10 * 1000 * 1000;
|
||||
|
||||
const char *verb = cli.parseDefaultArguments(argc, argv);
|
||||
|
||||
@@ -49,15 +49,17 @@ px4_add_module(
|
||||
drivers_magnetometer
|
||||
)
|
||||
|
||||
px4_add_module(
|
||||
MODULE drivers__imu__invensense__icm20948_i2c_passthrough
|
||||
MAIN icm20948_i2c_passthrough
|
||||
COMPILE_FLAGS
|
||||
SRCS
|
||||
ICM20948_I2C_Passthrough.cpp
|
||||
ICM20948_I2C_Passthrough.hpp
|
||||
icm20948_i2c_passthrough_main.cpp
|
||||
InvenSense_ICM20948_registers.hpp
|
||||
DEPENDS
|
||||
px4_work_queue
|
||||
)
|
||||
if(CONFIG_I2C)
|
||||
px4_add_module(
|
||||
MODULE drivers__imu__invensense__icm20948_i2c_passthrough
|
||||
MAIN icm20948_i2c_passthrough
|
||||
COMPILE_FLAGS
|
||||
SRCS
|
||||
ICM20948_I2C_Passthrough.cpp
|
||||
ICM20948_I2C_Passthrough.hpp
|
||||
icm20948_i2c_passthrough_main.cpp
|
||||
InvenSense_ICM20948_registers.hpp
|
||||
DEPENDS
|
||||
px4_work_queue
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
#include "AKM_AK09916_registers.hpp"
|
||||
|
||||
#include <drivers/drv_hrt.h>
|
||||
#include <lib/drivers/device/i2c.h>
|
||||
#include <lib/drivers/magnetometer/PX4Magnetometer.hpp>
|
||||
#include <lib/perf/perf_counter.h>
|
||||
#include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp>
|
||||
|
||||
Reference in New Issue
Block a user