mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 08:23:33 +08:00
I2C/SPI require device type in constructor
This commit is contained in:
@@ -39,18 +39,13 @@
|
||||
|
||||
ADIS16448::ADIS16448(I2CSPIBusOption bus_option, int bus, int32_t device, enum Rotation rotation, int bus_frequency,
|
||||
spi_mode_e spi_mode) :
|
||||
SPI("ADIS16448", nullptr, bus, device, spi_mode, bus_frequency),
|
||||
SPI(DRV_IMU_DEVTYPE_ADIS16448, MODULE_NAME, bus, device, spi_mode, bus_frequency),
|
||||
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
|
||||
_px4_accel(get_device_id(), ORB_PRIO_MAX, rotation),
|
||||
_px4_baro(get_device_id(), ORB_PRIO_MAX),
|
||||
_px4_gyro(get_device_id(), ORB_PRIO_MAX, rotation),
|
||||
_px4_mag(get_device_id(), ORB_PRIO_MAX, rotation)
|
||||
{
|
||||
_px4_accel.set_device_type(DRV_IMU_DEVTYPE_ADIS16448);
|
||||
_px4_baro.set_device_type(DRV_IMU_DEVTYPE_ADIS16448);
|
||||
_px4_gyro.set_device_type(DRV_IMU_DEVTYPE_ADIS16448);
|
||||
_px4_mag.set_device_type(DRV_IMU_DEVTYPE_ADIS16448);
|
||||
|
||||
_px4_accel.set_scale(ADIS16448_ACCEL_SENSITIVITY);
|
||||
_px4_gyro.set_scale(ADIS16448_GYRO_INITIAL_SENSITIVITY);
|
||||
_px4_mag.set_scale(ADIS16448_MAG_SENSITIVITY);
|
||||
|
||||
@@ -55,12 +55,12 @@ using namespace time_literals;
|
||||
|
||||
ADIS16477::ADIS16477(I2CSPIBusOption bus_option, int bus, int32_t device, enum Rotation rotation, int bus_frequency,
|
||||
spi_mode_e spi_mode, spi_drdy_gpio_t drdy_gpio) :
|
||||
SPI("ADIS16477", nullptr, bus, device, spi_mode, bus_frequency),
|
||||
SPI(DRV_IMU_DEVTYPE_ADIS16477, MODULE_NAME, bus, device, spi_mode, bus_frequency),
|
||||
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
|
||||
_px4_accel(get_device_id(), ORB_PRIO_MAX, rotation),
|
||||
_px4_gyro(get_device_id(), ORB_PRIO_MAX, rotation),
|
||||
_sample_perf(perf_alloc(PC_ELAPSED, "adis16477: read")),
|
||||
_bad_transfers(perf_alloc(PC_COUNT, "adis16477: bad transfers")),
|
||||
_sample_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": read")),
|
||||
_bad_transfers(perf_alloc(PC_COUNT, MODULE_NAME": bad transfers")),
|
||||
_drdy_gpio(drdy_gpio)
|
||||
{
|
||||
#ifdef GPIO_SPI1_RESET_ADIS16477
|
||||
@@ -68,10 +68,8 @@ ADIS16477::ADIS16477(I2CSPIBusOption bus_option, int bus, int32_t device, enum R
|
||||
px4_arch_configgpio(GPIO_SPI1_RESET_ADIS16477);
|
||||
#endif // GPIO_SPI1_RESET_ADIS16477
|
||||
|
||||
_px4_accel.set_device_type(DRV_IMU_DEVTYPE_ADIS16477);
|
||||
_px4_accel.set_scale(1.25f * CONSTANTS_ONE_G / 1000.0f); // accel 1.25 mg/LSB
|
||||
|
||||
_px4_gyro.set_device_type(DRV_IMU_DEVTYPE_ADIS16477);
|
||||
_px4_gyro.set_scale(math::radians(0.025f)); // gyro 0.025 °/sec/LSB
|
||||
}
|
||||
|
||||
|
||||
@@ -72,21 +72,18 @@ using namespace time_literals;
|
||||
|
||||
ADIS16497::ADIS16497(I2CSPIBusOption bus_option, int bus, int32_t device, enum Rotation rotation, int bus_frequency,
|
||||
spi_mode_e spi_mode, spi_drdy_gpio_t drdy_gpio) :
|
||||
SPI("ADIS16497", nullptr, bus, device, spi_mode, bus_frequency),
|
||||
SPI(DRV_IMU_DEVTYPE_ADIS16497, MODULE_NAME, bus, device, spi_mode, bus_frequency),
|
||||
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
|
||||
_px4_accel(get_device_id(), ORB_PRIO_MAX, rotation),
|
||||
_px4_gyro(get_device_id(), ORB_PRIO_MAX, rotation),
|
||||
_sample_perf(perf_alloc(PC_ELAPSED, "adis16497: read")),
|
||||
_bad_transfers(perf_alloc(PC_COUNT, "adis16497: bad transfers")),
|
||||
_sample_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": read")),
|
||||
_bad_transfers(perf_alloc(PC_COUNT, MODULE_NAME": bad transfers")),
|
||||
_drdy_gpio(drdy_gpio)
|
||||
{
|
||||
#ifdef GPIO_SPI1_RESET_ADIS16497
|
||||
// Configure hardware reset line
|
||||
px4_arch_configgpio(GPIO_SPI1_RESET_ADIS16497);
|
||||
#endif // GPIO_SPI1_RESET_ADIS16497
|
||||
|
||||
_px4_accel.set_device_type(DRV_IMU_DEVTYPE_ADIS16497);
|
||||
_px4_gyro.set_device_type(DRV_IMU_DEVTYPE_ADIS16497);
|
||||
}
|
||||
|
||||
ADIS16497::~ADIS16497()
|
||||
|
||||
@@ -220,7 +220,7 @@ private:
|
||||
|
||||
BMA180::BMA180(I2CSPIBusOption bus_option, int bus, int32_t device, enum Rotation rotation, int bus_frequency,
|
||||
spi_mode_e spi_mode) :
|
||||
SPI("BMA180", ACCEL_DEVICE_PATH, bus, device, spi_mode, bus_frequency),
|
||||
SPI(DRV_ACC_DEVTYPE_BMA180, MODULE_NAME, bus, device, spi_mode, bus_frequency),
|
||||
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
|
||||
_call_interval(0),
|
||||
_reports(nullptr),
|
||||
@@ -232,8 +232,6 @@ BMA180::BMA180(I2CSPIBusOption bus_option, int bus, int32_t device, enum Rotatio
|
||||
_current_range(0),
|
||||
_sample_perf(perf_alloc(PC_ELAPSED, "bma180_read"))
|
||||
{
|
||||
_device_id.devid_s.devtype = DRV_ACC_DEVTYPE_BMA180;
|
||||
|
||||
// default scale factors
|
||||
_accel_scale.x_offset = 0;
|
||||
_accel_scale.x_scale = 1.0f;
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
class BMI055 : public device::SPI, public I2CSPIDriver<BMI055>
|
||||
{
|
||||
public:
|
||||
BMI055(const char *name, const char *devname, I2CSPIBusOption bus_option, int bus, int type, uint32_t device,
|
||||
BMI055(uint8_t devtype, const char *name, const char *devname, I2CSPIBusOption bus_option, int bus, uint32_t device,
|
||||
enum spi_mode_e mode, uint32_t frequency, enum Rotation rotation);
|
||||
virtual ~BMI055() = default;
|
||||
|
||||
|
||||
@@ -46,8 +46,7 @@ const uint8_t BMI055_accel::_checked_registers[BMI055_ACCEL_NUM_CHECKED_REGISTER
|
||||
|
||||
BMI055_accel::BMI055_accel(I2CSPIBusOption bus_option, int bus, const char *path_accel, uint32_t device,
|
||||
enum Rotation rotation, int bus_frequency, spi_mode_e spi_mode) :
|
||||
BMI055("bmi055_accel", path_accel, bus_option, bus, DRV_ACC_DEVTYPE_BMI055, device, spi_mode, bus_frequency,
|
||||
rotation),
|
||||
BMI055(DRV_ACC_DEVTYPE_BMI055, "bmi055_accel", path_accel, bus_option, bus, device, spi_mode, bus_frequency, rotation),
|
||||
_px4_accel(get_device_id(), (external() ? ORB_PRIO_MAX - 1 : ORB_PRIO_HIGH - 1), rotation),
|
||||
_sample_perf(perf_alloc(PC_ELAPSED, "bmi055_accel_read")),
|
||||
_bad_transfers(perf_alloc(PC_COUNT, "bmi055_accel_bad_transfers")),
|
||||
@@ -55,7 +54,6 @@ BMI055_accel::BMI055_accel(I2CSPIBusOption bus_option, int bus, const char *path
|
||||
_duplicates(perf_alloc(PC_COUNT, "bmi055_accel_duplicates")),
|
||||
_got_duplicate(false)
|
||||
{
|
||||
_px4_accel.set_device_type(DRV_ACC_DEVTYPE_BMI055);
|
||||
}
|
||||
|
||||
BMI055_accel::~BMI055_accel()
|
||||
|
||||
@@ -51,14 +51,12 @@ const uint8_t BMI055_gyro::_checked_registers[BMI055_GYRO_NUM_CHECKED_REGISTERS]
|
||||
|
||||
BMI055_gyro::BMI055_gyro(I2CSPIBusOption bus_option, int bus, const char *path_gyro, uint32_t device,
|
||||
enum Rotation rotation, int bus_frequency, spi_mode_e spi_mode) :
|
||||
BMI055("bmi055_gyro", path_gyro, bus_option, bus, DRV_GYR_DEVTYPE_BMI055, device, spi_mode, bus_frequency,
|
||||
rotation),
|
||||
BMI055(DRV_GYR_DEVTYPE_BMI055, "bmi055_gyro", path_gyro, bus_option, bus, device, spi_mode, bus_frequency, rotation),
|
||||
_px4_gyro(get_device_id(), (external() ? ORB_PRIO_MAX - 1 : ORB_PRIO_HIGH - 1), rotation),
|
||||
_sample_perf(perf_alloc(PC_ELAPSED, "bmi055_gyro_read")),
|
||||
_bad_transfers(perf_alloc(PC_COUNT, "bmi055_gyro_bad_transfers")),
|
||||
_bad_registers(perf_alloc(PC_COUNT, "bmi055_gyro_bad_registers"))
|
||||
{
|
||||
_px4_gyro.set_device_type(DRV_GYR_DEVTYPE_BMI055);
|
||||
}
|
||||
|
||||
BMI055_gyro::~BMI055_gyro()
|
||||
|
||||
@@ -97,11 +97,10 @@ BMI055::custom_method(const BusCLIArguments &cli)
|
||||
}
|
||||
}
|
||||
|
||||
BMI055::BMI055(const char *name, const char *devname, I2CSPIBusOption bus_option, int bus, int type, uint32_t device,
|
||||
enum spi_mode_e mode,
|
||||
uint32_t frequency, enum Rotation rotation):
|
||||
SPI(name, devname, bus, device, mode, frequency),
|
||||
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus, type),
|
||||
BMI055::BMI055(uint8_t devtype, const char *name, const char *devname, I2CSPIBusOption bus_option, int bus,
|
||||
uint32_t device, enum spi_mode_e mode, uint32_t frequency, enum Rotation rotation):
|
||||
SPI(devtype, name, bus, device, mode, frequency),
|
||||
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus, devtype),
|
||||
_whoami(0),
|
||||
_register_wait(0),
|
||||
_reset_wait(0),
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
class BMI088 : public device::SPI, public I2CSPIDriver<BMI088>
|
||||
{
|
||||
public:
|
||||
BMI088(const char *name, const char *devname, I2CSPIBusOption bus_option, int bus, int type, uint32_t device,
|
||||
BMI088(const char *name, const char *devname, I2CSPIBusOption bus_option, int bus, uint8_t type, uint32_t device,
|
||||
enum spi_mode_e mode, uint32_t frequency, enum Rotation rotation);
|
||||
virtual ~BMI088() = default;
|
||||
|
||||
|
||||
@@ -63,7 +63,6 @@ BMI088_accel::BMI088_accel(I2CSPIBusOption bus_option, int bus, const char *path
|
||||
_duplicates(perf_alloc(PC_COUNT, "bmi088_accel_duplicates")),
|
||||
_got_duplicate(false)
|
||||
{
|
||||
_px4_accel.set_device_type(DRV_ACC_DEVTYPE_BMI088);
|
||||
}
|
||||
|
||||
BMI088_accel::~BMI088_accel()
|
||||
|
||||
@@ -65,7 +65,6 @@ BMI088_gyro::BMI088_gyro(I2CSPIBusOption bus_option, int bus, const char *path_g
|
||||
_bad_transfers(perf_alloc(PC_COUNT, "bmi088_gyro_bad_transfers")),
|
||||
_bad_registers(perf_alloc(PC_COUNT, "bmi088_gyro_bad_registers"))
|
||||
{
|
||||
_px4_gyro.set_device_type(DRV_GYR_DEVTYPE_BMI088);
|
||||
}
|
||||
|
||||
BMI088_gyro::~BMI088_gyro()
|
||||
|
||||
@@ -96,10 +96,11 @@ BMI088::custom_method(const BusCLIArguments &cli)
|
||||
}
|
||||
}
|
||||
|
||||
BMI088::BMI088(const char *name, const char *devname, I2CSPIBusOption bus_option, int bus, int type, uint32_t device,
|
||||
BMI088::BMI088(const char *name, const char *devname, I2CSPIBusOption bus_option, int bus, uint8_t type,
|
||||
uint32_t device,
|
||||
enum spi_mode_e mode,
|
||||
uint32_t frequency, enum Rotation rotation):
|
||||
SPI(name, devname, bus, device, mode, frequency),
|
||||
SPI(type, MODULE_NAME, bus, device, mode, frequency),
|
||||
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus, type),
|
||||
_whoami(0),
|
||||
_register_wait(0),
|
||||
|
||||
@@ -51,7 +51,7 @@ const uint8_t BMI160::_checked_registers[BMI160_NUM_CHECKED_REGISTERS] = { BM
|
||||
|
||||
BMI160::BMI160(I2CSPIBusOption bus_option, int bus, int32_t device, enum Rotation rotation, int bus_frequency,
|
||||
spi_mode_e spi_mode) :
|
||||
SPI("BMI160", nullptr, bus, device, spi_mode, bus_frequency),
|
||||
SPI(DRV_IMU_DEVTYPE_BMI160, MODULE_NAME, bus, device, spi_mode, bus_frequency),
|
||||
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
|
||||
_px4_accel(get_device_id(), (external() ? ORB_PRIO_MAX - 1 : ORB_PRIO_HIGH - 1), rotation),
|
||||
_px4_gyro(get_device_id(), (external() ? ORB_PRIO_MAX - 1 : ORB_PRIO_HIGH - 1), rotation),
|
||||
@@ -64,8 +64,6 @@ BMI160::BMI160(I2CSPIBusOption bus_option, int bus, int32_t device, enum Rotatio
|
||||
_reset_retries(perf_alloc(PC_COUNT, "bmi160_reset_retries")),
|
||||
_duplicates(perf_alloc(PC_COUNT, "bmi160_duplicates"))
|
||||
{
|
||||
_px4_accel.set_device_type(DRV_IMU_DEVTYPE_BMI160);
|
||||
_px4_gyro.set_device_type(DRV_IMU_DEVTYPE_BMI160);
|
||||
}
|
||||
|
||||
BMI160::~BMI160()
|
||||
|
||||
@@ -188,7 +188,7 @@ using namespace time_literals;
|
||||
|
||||
FXAS21002C::FXAS21002C(I2CSPIBusOption bus_option, int bus, uint32_t device, enum Rotation rotation, int bus_frequency,
|
||||
spi_mode_e spi_mode) :
|
||||
SPI("FXAS21002C", nullptr, bus, device, spi_mode, bus_frequency),
|
||||
SPI(DRV_GYR_DEVTYPE_FXAS2100C, MODULE_NAME, bus, device, spi_mode, bus_frequency),
|
||||
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
|
||||
_px4_gyro(get_device_id(), (external() ? ORB_PRIO_VERY_HIGH : ORB_PRIO_DEFAULT), rotation),
|
||||
_sample_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": read")),
|
||||
@@ -196,7 +196,6 @@ FXAS21002C::FXAS21002C(I2CSPIBusOption bus_option, int bus, uint32_t device, enu
|
||||
_bad_registers(perf_alloc(PC_COUNT, MODULE_NAME": bad register")),
|
||||
_duplicates(perf_alloc(PC_COUNT, MODULE_NAME": duplicate reading"))
|
||||
{
|
||||
_px4_gyro.set_device_type(DRV_GYR_DEVTYPE_FXAS2100C);
|
||||
}
|
||||
|
||||
FXAS21002C::~FXAS21002C()
|
||||
|
||||
@@ -55,7 +55,7 @@ const uint8_t FXOS8701CQ::_checked_registers[FXOS8701C_NUM_CHECKED_REGISTERS] =
|
||||
|
||||
FXOS8701CQ::FXOS8701CQ(I2CSPIBusOption bus_option, int bus, uint32_t device, enum Rotation rotation, int bus_frequency,
|
||||
spi_mode_e spi_mode) :
|
||||
SPI("FXOS8701CQ", nullptr, bus, device, spi_mode, bus_frequency),
|
||||
SPI(DRV_ACC_DEVTYPE_FXOS8701C, MODULE_NAME, bus, device, spi_mode, bus_frequency),
|
||||
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
|
||||
_px4_accel(get_device_id(), ORB_PRIO_LOW, rotation),
|
||||
#if !defined(BOARD_HAS_NOISY_FXOS8700_MAG)
|
||||
@@ -66,12 +66,7 @@ FXOS8701CQ::FXOS8701CQ(I2CSPIBusOption bus_option, int bus, uint32_t device, enu
|
||||
_bad_registers(perf_alloc(PC_COUNT, MODULE_NAME": bad reg")),
|
||||
_accel_duplicates(perf_alloc(PC_COUNT, MODULE_NAME": acc dupe"))
|
||||
{
|
||||
set_device_type(DRV_ACC_DEVTYPE_FXOS8701C);
|
||||
|
||||
_px4_accel.set_device_type(DRV_ACC_DEVTYPE_FXOS8701C);
|
||||
|
||||
#if !defined(BOARD_HAS_NOISY_FXOS8700_MAG)
|
||||
_px4_mag.set_device_type(DRV_ACC_DEVTYPE_FXOS8701C);
|
||||
_px4_mag.set_scale(0.001f);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -56,11 +56,12 @@ ICM20948_mag::ICM20948_mag(ICM20948 *parent, device::Device *interface, enum Rot
|
||||
_px4_mag(parent->_interface->get_device_id(), (parent->_interface->external() ? ORB_PRIO_MAX : ORB_PRIO_HIGH),
|
||||
rotation),
|
||||
_parent(parent),
|
||||
_mag_overruns(perf_alloc(PC_COUNT, MODULE_NAME": mag_overruns")),
|
||||
_mag_overflows(perf_alloc(PC_COUNT, MODULE_NAME": mag_overflows")),
|
||||
_mag_errors(perf_alloc(PC_COUNT, MODULE_NAME": mag_errors"))
|
||||
_mag_overruns(perf_alloc(PC_COUNT, MODULE_NAME": mag overruns")),
|
||||
_mag_overflows(perf_alloc(PC_COUNT, MODULE_NAME": mag overflows")),
|
||||
_mag_errors(perf_alloc(PC_COUNT, MODULE_NAME": mag errors"))
|
||||
{
|
||||
_px4_mag.set_device_type(DRV_MAG_DEVTYPE_AK09916);
|
||||
_px4_mag.set_external(_parent->is_external());
|
||||
_px4_mag.set_scale(ICM20948_MAG_RANGE_GA);
|
||||
}
|
||||
|
||||
|
||||
@@ -102,8 +102,6 @@ ICM20948::ICM20948(device::Device *interface, device::Device *mag_interface, enu
|
||||
_good_transfers(perf_alloc(PC_COUNT, MODULE_NAME": good_trans")),
|
||||
_duplicates(perf_alloc(PC_COUNT, MODULE_NAME": dupe"))
|
||||
{
|
||||
_px4_accel.set_device_type(DRV_IMU_DEVTYPE_ICM20948);
|
||||
_px4_gyro.set_device_type(DRV_IMU_DEVTYPE_ICM20948);
|
||||
}
|
||||
|
||||
ICM20948::~ICM20948()
|
||||
|
||||
@@ -68,9 +68,8 @@ ICM20948_I2C_interface(int bus, uint32_t address, int bus_frequency)
|
||||
}
|
||||
|
||||
ICM20948_I2C::ICM20948_I2C(int bus, uint32_t address, int bus_frequency) :
|
||||
I2C("ICM20948_I2C", nullptr, bus, address, bus_frequency)
|
||||
I2C(DRV_IMU_DEVTYPE_ICM20948, MODULE_NAME, bus, address, bus_frequency)
|
||||
{
|
||||
_device_id.devid_s.devtype = DRV_IMU_DEVTYPE_ICM20948;
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -86,9 +86,8 @@ ICM20948_SPI_interface(int bus, uint32_t devid, int bus_frequency, spi_mode_e sp
|
||||
}
|
||||
|
||||
ICM20948_SPI::ICM20948_SPI(int bus, uint32_t device, int bus_frequency, spi_mode_e spi_mode) :
|
||||
SPI("ICM20948", nullptr, bus, device, spi_mode, bus_frequency)
|
||||
SPI(DRV_IMU_DEVTYPE_ICM20948, MODULE_NAME, bus, device, spi_mode, bus_frequency)
|
||||
{
|
||||
_device_id.devid_s.devtype = DRV_IMU_DEVTYPE_ICM20948;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -65,9 +65,8 @@ AK09916_I2C_interface(int bus, int bus_frequency)
|
||||
}
|
||||
|
||||
AK09916_I2C::AK09916_I2C(int bus, int bus_frequency) :
|
||||
I2C("AK09916_I2C", nullptr, bus, AK09916_I2C_ADDR, bus_frequency)
|
||||
I2C(DRV_IMU_DEVTYPE_ICM20948, "AK09916_I2C", bus, AK09916_I2C_ADDR, bus_frequency)
|
||||
{
|
||||
_device_id.devid_s.devtype = DRV_IMU_DEVTYPE_ICM20948;
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -42,17 +42,12 @@ static constexpr int16_t combine(uint8_t msb, uint8_t lsb)
|
||||
|
||||
ICM20602::ICM20602(I2CSPIBusOption bus_option, int bus, uint32_t device, enum Rotation rotation, int bus_frequency,
|
||||
spi_mode_e spi_mode, spi_drdy_gpio_t drdy_gpio) :
|
||||
SPI(MODULE_NAME, nullptr, bus, device, spi_mode, bus_frequency),
|
||||
SPI(DRV_IMU_DEVTYPE_ICM20602, MODULE_NAME, bus, device, spi_mode, bus_frequency),
|
||||
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
|
||||
_drdy_gpio(drdy_gpio),
|
||||
_px4_accel(get_device_id(), ORB_PRIO_HIGH, rotation),
|
||||
_px4_gyro(get_device_id(), ORB_PRIO_HIGH, rotation)
|
||||
{
|
||||
set_device_type(DRV_IMU_DEVTYPE_ICM20602);
|
||||
|
||||
_px4_accel.set_device_type(DRV_IMU_DEVTYPE_ICM20602);
|
||||
_px4_gyro.set_device_type(DRV_IMU_DEVTYPE_ICM20602);
|
||||
|
||||
ConfigureSampleRate(_px4_gyro.get_max_rate_hz());
|
||||
}
|
||||
|
||||
|
||||
@@ -42,17 +42,12 @@ static constexpr int16_t combine(uint8_t msb, uint8_t lsb)
|
||||
|
||||
ICM20608G::ICM20608G(I2CSPIBusOption bus_option, int bus, uint32_t device, enum Rotation rotation, int bus_frequency,
|
||||
spi_mode_e spi_mode, spi_drdy_gpio_t drdy_gpio) :
|
||||
SPI(MODULE_NAME, nullptr, bus, device, spi_mode, bus_frequency),
|
||||
SPI(DRV_IMU_DEVTYPE_ICM20608G, MODULE_NAME, bus, device, spi_mode, bus_frequency),
|
||||
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
|
||||
_drdy_gpio(drdy_gpio),
|
||||
_px4_accel(get_device_id(), ORB_PRIO_HIGH, rotation),
|
||||
_px4_gyro(get_device_id(), ORB_PRIO_HIGH, rotation)
|
||||
{
|
||||
set_device_type(DRV_IMU_DEVTYPE_ICM20608G);
|
||||
|
||||
_px4_accel.set_device_type(DRV_IMU_DEVTYPE_ICM20608G);
|
||||
_px4_gyro.set_device_type(DRV_IMU_DEVTYPE_ICM20608G);
|
||||
|
||||
ConfigureSampleRate(_px4_gyro.get_max_rate_hz());
|
||||
}
|
||||
|
||||
|
||||
@@ -42,17 +42,12 @@ static constexpr int16_t combine(uint8_t msb, uint8_t lsb)
|
||||
|
||||
ICM20689::ICM20689(I2CSPIBusOption bus_option, int bus, uint32_t device, enum Rotation rotation, int bus_frequency,
|
||||
spi_mode_e spi_mode, spi_drdy_gpio_t drdy_gpio) :
|
||||
SPI(MODULE_NAME, nullptr, bus, device, spi_mode, bus_frequency),
|
||||
SPI(DRV_IMU_DEVTYPE_ICM20689, MODULE_NAME, bus, device, spi_mode, bus_frequency),
|
||||
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
|
||||
_drdy_gpio(drdy_gpio),
|
||||
_px4_accel(get_device_id(), ORB_PRIO_HIGH, rotation),
|
||||
_px4_gyro(get_device_id(), ORB_PRIO_HIGH, rotation)
|
||||
{
|
||||
set_device_type(DRV_IMU_DEVTYPE_ICM20689);
|
||||
|
||||
_px4_accel.set_device_type(DRV_IMU_DEVTYPE_ICM20689);
|
||||
_px4_gyro.set_device_type(DRV_IMU_DEVTYPE_ICM20689);
|
||||
|
||||
ConfigureSampleRate(_px4_gyro.get_max_rate_hz());
|
||||
}
|
||||
|
||||
|
||||
@@ -42,17 +42,12 @@ static constexpr int16_t combine(uint8_t msb, uint8_t lsb)
|
||||
|
||||
ICM40609D::ICM40609D(I2CSPIBusOption bus_option, int bus, uint32_t device, enum Rotation rotation, int bus_frequency,
|
||||
spi_mode_e spi_mode, spi_drdy_gpio_t drdy_gpio) :
|
||||
SPI(MODULE_NAME, nullptr, bus, device, spi_mode, bus_frequency),
|
||||
SPI(DRV_IMU_DEVTYPE_ICM40609D, MODULE_NAME, bus, device, spi_mode, bus_frequency),
|
||||
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
|
||||
_drdy_gpio(drdy_gpio),
|
||||
_px4_accel(get_device_id(), ORB_PRIO_HIGH, rotation),
|
||||
_px4_gyro(get_device_id(), ORB_PRIO_HIGH, rotation)
|
||||
{
|
||||
set_device_type(DRV_IMU_DEVTYPE_ICM40609D);
|
||||
|
||||
_px4_accel.set_device_type(DRV_IMU_DEVTYPE_ICM40609D);
|
||||
_px4_gyro.set_device_type(DRV_IMU_DEVTYPE_ICM40609D);
|
||||
|
||||
ConfigureSampleRate(_px4_gyro.get_max_rate_hz());
|
||||
}
|
||||
|
||||
|
||||
@@ -42,17 +42,12 @@ static constexpr int16_t combine(uint8_t msb, uint8_t lsb)
|
||||
|
||||
ICM42688P::ICM42688P(I2CSPIBusOption bus_option, int bus, uint32_t device, enum Rotation rotation, int bus_frequency,
|
||||
spi_mode_e spi_mode, spi_drdy_gpio_t drdy_gpio) :
|
||||
SPI(MODULE_NAME, nullptr, bus, device, spi_mode, bus_frequency),
|
||||
SPI(DRV_IMU_DEVTYPE_ICM42688P, MODULE_NAME, bus, device, spi_mode, bus_frequency),
|
||||
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
|
||||
_drdy_gpio(drdy_gpio),
|
||||
_px4_accel(get_device_id(), ORB_PRIO_HIGH, rotation),
|
||||
_px4_gyro(get_device_id(), ORB_PRIO_HIGH, rotation)
|
||||
{
|
||||
set_device_type(DRV_IMU_DEVTYPE_ICM42688P);
|
||||
|
||||
_px4_accel.set_device_type(DRV_IMU_DEVTYPE_ICM42688P);
|
||||
_px4_gyro.set_device_type(DRV_IMU_DEVTYPE_ICM42688P);
|
||||
|
||||
ConfigureSampleRate(_px4_gyro.get_max_rate_hz());
|
||||
}
|
||||
|
||||
|
||||
@@ -42,17 +42,12 @@ static constexpr int16_t combine(uint8_t msb, uint8_t lsb)
|
||||
|
||||
MPU6000::MPU6000(I2CSPIBusOption bus_option, int bus, uint32_t device, enum Rotation rotation, int bus_frequency,
|
||||
spi_mode_e spi_mode, spi_drdy_gpio_t drdy_gpio) :
|
||||
SPI(MODULE_NAME, nullptr, bus, device, spi_mode, bus_frequency),
|
||||
SPI(DRV_IMU_DEVTYPE_MPU6000, MODULE_NAME, bus, device, spi_mode, bus_frequency),
|
||||
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
|
||||
_drdy_gpio(drdy_gpio),
|
||||
_px4_accel(get_device_id(), ORB_PRIO_HIGH, rotation),
|
||||
_px4_gyro(get_device_id(), ORB_PRIO_HIGH, rotation)
|
||||
{
|
||||
set_device_type(DRV_IMU_DEVTYPE_MPU6000);
|
||||
|
||||
_px4_accel.set_device_type(DRV_IMU_DEVTYPE_MPU6000);
|
||||
_px4_gyro.set_device_type(DRV_IMU_DEVTYPE_MPU6000);
|
||||
|
||||
ConfigureSampleRate(_px4_gyro.get_max_rate_hz());
|
||||
}
|
||||
|
||||
|
||||
@@ -42,17 +42,12 @@ static constexpr int16_t combine(uint8_t msb, uint8_t lsb)
|
||||
|
||||
MPU6500::MPU6500(I2CSPIBusOption bus_option, int bus, uint32_t device, enum Rotation rotation, int bus_frequency,
|
||||
spi_mode_e spi_mode, spi_drdy_gpio_t drdy_gpio) :
|
||||
SPI(MODULE_NAME, nullptr, bus, device, spi_mode, bus_frequency),
|
||||
SPI(DRV_IMU_DEVTYPE_MPU6500, MODULE_NAME, bus, device, spi_mode, bus_frequency),
|
||||
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
|
||||
_drdy_gpio(drdy_gpio),
|
||||
_px4_accel(get_device_id(), ORB_PRIO_HIGH, rotation),
|
||||
_px4_gyro(get_device_id(), ORB_PRIO_HIGH, rotation)
|
||||
{
|
||||
set_device_type(DRV_IMU_DEVTYPE_MPU6500);
|
||||
|
||||
_px4_accel.set_device_type(DRV_IMU_DEVTYPE_MPU6500);
|
||||
_px4_gyro.set_device_type(DRV_IMU_DEVTYPE_MPU6500);
|
||||
|
||||
ConfigureSampleRate(_px4_gyro.get_max_rate_hz());
|
||||
}
|
||||
|
||||
|
||||
@@ -44,17 +44,12 @@ static constexpr int16_t combine(uint8_t msb, uint8_t lsb)
|
||||
|
||||
MPU9250::MPU9250(I2CSPIBusOption bus_option, int bus, uint32_t device, enum Rotation rotation, int bus_frequency,
|
||||
spi_mode_e spi_mode, spi_drdy_gpio_t drdy_gpio, bool enable_magnetometer) :
|
||||
SPI(MODULE_NAME, nullptr, bus, device, spi_mode, bus_frequency),
|
||||
SPI(DRV_IMU_DEVTYPE_MPU9250, MODULE_NAME, bus, device, spi_mode, bus_frequency),
|
||||
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
|
||||
_drdy_gpio(drdy_gpio),
|
||||
_px4_accel(get_device_id(), ORB_PRIO_HIGH, rotation),
|
||||
_px4_gyro(get_device_id(), ORB_PRIO_HIGH, rotation)
|
||||
{
|
||||
set_device_type(DRV_IMU_DEVTYPE_MPU9250);
|
||||
|
||||
_px4_accel.set_device_type(DRV_IMU_DEVTYPE_MPU9250);
|
||||
_px4_gyro.set_device_type(DRV_IMU_DEVTYPE_MPU9250);
|
||||
|
||||
ConfigureSampleRate(_px4_gyro.get_max_rate_hz());
|
||||
|
||||
if (enable_magnetometer) {
|
||||
|
||||
@@ -37,7 +37,7 @@ constexpr uint8_t L3GD20::_checked_registers[];
|
||||
|
||||
L3GD20::L3GD20(I2CSPIBusOption bus_option, int bus, uint32_t device, enum Rotation rotation, int bus_frequency,
|
||||
spi_mode_e spi_mode) :
|
||||
SPI("L3GD20", nullptr, bus, device, spi_mode, bus_frequency),
|
||||
SPI(DRV_GYR_DEVTYPE_L3GD20, MODULE_NAME, bus, device, spi_mode, bus_frequency),
|
||||
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
|
||||
_px4_gyro(get_device_id(), ORB_PRIO_DEFAULT, rotation),
|
||||
_sample_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": read")),
|
||||
@@ -45,7 +45,6 @@ L3GD20::L3GD20(I2CSPIBusOption bus_option, int bus, uint32_t device, enum Rotati
|
||||
_bad_registers(perf_alloc(PC_COUNT, MODULE_NAME": bad_reg")),
|
||||
_duplicates(perf_alloc(PC_COUNT, MODULE_NAME": dupe"))
|
||||
{
|
||||
_px4_gyro.set_device_type(DRV_GYR_DEVTYPE_L3GD20);
|
||||
}
|
||||
|
||||
L3GD20::~L3GD20()
|
||||
|
||||
@@ -55,7 +55,7 @@ static constexpr uint8_t _checked_registers[] = {
|
||||
|
||||
LSM303D::LSM303D(I2CSPIBusOption bus_option, int bus, uint32_t device, enum Rotation rotation, int bus_frequency,
|
||||
spi_mode_e spi_mode) :
|
||||
SPI("LSM303D", nullptr, bus, device, spi_mode, bus_frequency),
|
||||
SPI(DRV_IMU_DEVTYPE_LSM303D, MODULE_NAME, bus, device, spi_mode, bus_frequency),
|
||||
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
|
||||
_px4_accel(get_device_id(), ORB_PRIO_DEFAULT, rotation),
|
||||
_px4_mag(get_device_id(), ORB_PRIO_LOW, rotation),
|
||||
@@ -65,8 +65,6 @@ LSM303D::LSM303D(I2CSPIBusOption bus_option, int bus, uint32_t device, enum Rota
|
||||
_bad_values(perf_alloc(PC_COUNT, "lsm303d: bad_val")),
|
||||
_accel_duplicates(perf_alloc(PC_COUNT, "lsm303d: acc_dupe"))
|
||||
{
|
||||
_px4_accel.set_device_type(DRV_ACC_DEVTYPE_LSM303D);
|
||||
_px4_mag.set_device_type(DRV_MAG_DEVTYPE_LSM303D);
|
||||
_px4_mag.set_external(external());
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ extern "C" int lsm303d_main(int argc, char *argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
BusInstanceIterator iterator(MODULE_NAME, cli, DRV_ACC_DEVTYPE_LSM303D);
|
||||
BusInstanceIterator iterator(MODULE_NAME, cli, DRV_IMU_DEVTYPE_LSM303D);
|
||||
|
||||
if (!strcmp(verb, "start")) {
|
||||
return ThisDriver::module_start(cli, iterator);
|
||||
|
||||
@@ -55,21 +55,25 @@ MPU6000::MPU6000(device::Device *interface, enum Rotation rotation, int device_t
|
||||
switch (_device_type) {
|
||||
default:
|
||||
case MPU_DEVICE_TYPE_MPU6000:
|
||||
_interface->set_device_type(DRV_IMU_DEVTYPE_MPU6000);
|
||||
_px4_accel.set_device_type(DRV_IMU_DEVTYPE_MPU6000);
|
||||
_px4_gyro.set_device_type(DRV_IMU_DEVTYPE_MPU6000);
|
||||
break;
|
||||
|
||||
case MPU_DEVICE_TYPE_ICM20602:
|
||||
_interface->set_device_type(DRV_IMU_DEVTYPE_ICM20602);
|
||||
_px4_accel.set_device_type(DRV_IMU_DEVTYPE_ICM20602);
|
||||
_px4_gyro.set_device_type(DRV_IMU_DEVTYPE_ICM20602);
|
||||
break;
|
||||
|
||||
case MPU_DEVICE_TYPE_ICM20608:
|
||||
_interface->set_device_type(DRV_IMU_DEVTYPE_ICM20608G);
|
||||
_px4_accel.set_device_type(DRV_IMU_DEVTYPE_ICM20608G);
|
||||
_px4_gyro.set_device_type(DRV_IMU_DEVTYPE_ICM20608G);
|
||||
break;
|
||||
|
||||
case MPU_DEVICE_TYPE_ICM20689:
|
||||
_interface->set_device_type(DRV_IMU_DEVTYPE_ICM20689);
|
||||
_px4_accel.set_device_type(DRV_IMU_DEVTYPE_ICM20689);
|
||||
_px4_gyro.set_device_type(DRV_IMU_DEVTYPE_ICM20689);
|
||||
break;
|
||||
|
||||
@@ -70,7 +70,7 @@ MPU6000_I2C_interface(int bus, uint32_t devid, int device_type, bool external_bu
|
||||
}
|
||||
|
||||
MPU6000_I2C::MPU6000_I2C(int bus, int device_type, int bus_frequency) :
|
||||
I2C("MPU6000_I2C", nullptr, bus, PX4_I2C_MPU6050_ADDR, bus_frequency),
|
||||
I2C(DRV_IMU_DEVTYPE_MPU6000, MODULE_NAME, bus, PX4_I2C_MPU6050_ADDR, bus_frequency)
|
||||
_device_type(device_type)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ MPU6000_SPI_interface(int bus, uint32_t devid, int device_type, bool external_bu
|
||||
}
|
||||
|
||||
MPU6000_SPI::MPU6000_SPI(int bus, uint32_t device, int device_type, int bus_frequency, spi_mode_e spi_mode) :
|
||||
SPI("MPU6000", nullptr, bus, device, spi_mode, bus_frequency),
|
||||
SPI(DRV_IMU_DEVTYPE_MPU6000, MODULE_NAME, bus, device, spi_mode, bus_frequency),
|
||||
_device_type(device_type)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -68,9 +68,9 @@ AK8963_I2C_interface(int bus, int bus_frequency)
|
||||
return new AK8963_I2C(bus, bus_frequency);
|
||||
}
|
||||
|
||||
AK8963_I2C::AK8963_I2C(int bus, int bus_frequency) : I2C("AK8963_I2C", nullptr, bus, AK8963_I2C_ADDR, bus_frequency)
|
||||
AK8963_I2C::AK8963_I2C(int bus, int bus_frequency) :
|
||||
I2C(DRV_MAG_DEVTYPE_AK8963, "AK8963_I2C", bus, AK8963_I2C_ADDR, bus_frequency)
|
||||
{
|
||||
_device_id.devid_s.devtype = DRV_MAG_DEVTYPE_AK8963;
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -56,11 +56,12 @@ MPU9250_mag::MPU9250_mag(MPU9250 *parent, device::Device *interface, enum Rotati
|
||||
_px4_mag(parent->_interface->get_device_id(), (parent->_interface->external() ? ORB_PRIO_MAX : ORB_PRIO_HIGH),
|
||||
rotation),
|
||||
_parent(parent),
|
||||
_mag_overruns(perf_alloc(PC_COUNT, MODULE_NAME": mag_overruns")),
|
||||
_mag_overflows(perf_alloc(PC_COUNT, MODULE_NAME": mag_overflows")),
|
||||
_mag_errors(perf_alloc(PC_COUNT, MODULE_NAME": mag_errors"))
|
||||
_mag_overruns(perf_alloc(PC_COUNT, MODULE_NAME": mag overruns")),
|
||||
_mag_overflows(perf_alloc(PC_COUNT, MODULE_NAME": mag overflows")),
|
||||
_mag_errors(perf_alloc(PC_COUNT, MODULE_NAME": mag errors"))
|
||||
{
|
||||
_px4_mag.set_device_type(DRV_MAG_DEVTYPE_AK8963);
|
||||
_px4_mag.set_external(_parent->is_external());
|
||||
_px4_mag.set_scale(MPU9250_MAG_RANGE_GA);
|
||||
}
|
||||
|
||||
@@ -138,7 +139,6 @@ bool MPU9250_mag::_measure(const hrt_abstime ×tamp_sample, const ak8963_reg
|
||||
return false;
|
||||
}
|
||||
|
||||
_px4_mag.set_external(_parent->is_external());
|
||||
_px4_mag.set_temperature(_parent->_last_temperature);
|
||||
|
||||
/*
|
||||
|
||||
@@ -82,8 +82,6 @@ MPU9250::MPU9250(device::Device *interface, device::Device *mag_interface, enum
|
||||
_bad_registers(perf_alloc(PC_COUNT, MODULE_NAME": bad_reg")),
|
||||
_duplicates(perf_alloc(PC_COUNT, MODULE_NAME": dupe"))
|
||||
{
|
||||
_px4_accel.set_device_type(DRV_IMU_DEVTYPE_MPU9250);
|
||||
_px4_gyro.set_device_type(DRV_IMU_DEVTYPE_MPU9250);
|
||||
}
|
||||
|
||||
MPU9250::~MPU9250()
|
||||
|
||||
@@ -68,9 +68,8 @@ MPU9250_I2C_interface(int bus, uint32_t address, int bus_frequency)
|
||||
}
|
||||
|
||||
MPU9250_I2C::MPU9250_I2C(int bus, uint32_t address, int bus_frequency) :
|
||||
I2C("MPU9250_I2C", nullptr, bus, address, bus_frequency)
|
||||
I2C(DRV_IMU_DEVTYPE_MPU9250, MODULE_NAME, bus, address, bus_frequency)
|
||||
{
|
||||
set_device_type(DRV_IMU_DEVTYPE_MPU9250);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -86,9 +86,8 @@ MPU9250_SPI_interface(int bus, uint32_t cs, int bus_frequency, spi_mode_e spi_mo
|
||||
}
|
||||
|
||||
MPU9250_SPI::MPU9250_SPI(int bus, uint32_t device, int bus_frequency, spi_mode_e spi_mode) :
|
||||
SPI("MPU9250", nullptr, bus, device, spi_mode, bus_frequency)
|
||||
SPI(DRV_IMU_DEVTYPE_MPU9250, MODULE_NAME, bus, device, spi_mode, bus_frequency)
|
||||
{
|
||||
set_device_type(DRV_IMU_DEVTYPE_MPU9250);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -41,16 +41,12 @@ static constexpr uint32_t FIFO_INTERVAL{1000}; // 1000 us / 1000 Hz interval
|
||||
|
||||
ISM330DLC::ISM330DLC(I2CSPIBusOption bus_option, int bus, uint32_t device, enum Rotation rotation, int bus_frequency,
|
||||
spi_mode_e spi_mode, spi_drdy_gpio_t drdy_gpio) :
|
||||
SPI(MODULE_NAME, nullptr, bus, device, spi_mode, bus_frequency),
|
||||
SPI(DRV_IMU_DEVTYPE_ST_ISM330DLC, MODULE_NAME, bus, device, spi_mode, bus_frequency),
|
||||
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
|
||||
_drdy_gpio(drdy_gpio),
|
||||
_px4_accel(get_device_id(), ORB_PRIO_DEFAULT, rotation),
|
||||
_px4_gyro(get_device_id(), ORB_PRIO_DEFAULT, rotation)
|
||||
{
|
||||
set_device_type(DRV_IMU_DEVTYPE_ST_ISM330DLC);
|
||||
_px4_accel.set_device_type(DRV_IMU_DEVTYPE_ST_ISM330DLC);
|
||||
_px4_gyro.set_device_type(DRV_IMU_DEVTYPE_ST_ISM330DLC);
|
||||
|
||||
_px4_accel.set_update_rate(1000000 / FIFO_INTERVAL);
|
||||
_px4_gyro.set_update_rate(1000000 / FIFO_INTERVAL);
|
||||
}
|
||||
|
||||
@@ -40,15 +40,11 @@ static constexpr int16_t combine(uint8_t lsb, uint8_t msb) { return (msb << 8u)
|
||||
|
||||
LSM9DS1::LSM9DS1(I2CSPIBusOption bus_option, int bus, uint32_t device, enum Rotation rotation, int bus_frequency,
|
||||
spi_mode_e spi_mode) :
|
||||
SPI(MODULE_NAME, nullptr, bus, device, spi_mode, bus_frequency),
|
||||
SPI(DRV_IMU_DEVTYPE_ST_LSM9DS1_AG, MODULE_NAME, bus, device, spi_mode, bus_frequency),
|
||||
I2CSPIDriver(MODULE_NAME, px4::device_bus_to_wq(get_device_id()), bus_option, bus),
|
||||
_px4_accel(get_device_id(), ORB_PRIO_DEFAULT, rotation),
|
||||
_px4_gyro(get_device_id(), ORB_PRIO_DEFAULT, rotation)
|
||||
{
|
||||
set_device_type(DRV_IMU_DEVTYPE_ST_LSM9DS1_AG);
|
||||
_px4_accel.set_device_type(DRV_IMU_DEVTYPE_ST_LSM9DS1_AG);
|
||||
_px4_gyro.set_device_type(DRV_IMU_DEVTYPE_ST_LSM9DS1_AG);
|
||||
|
||||
_px4_accel.set_update_rate(1000000 / _fifo_interval);
|
||||
_px4_gyro.set_update_rate(1000000 / _fifo_interval);
|
||||
}
|
||||
|
||||
@@ -88,8 +88,7 @@ extern "C" __EXPORT int lsm9ds1_main(int argc, char *argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
BusInstanceIterator iterator(MODULE_NAME, cli,
|
||||
DRV_IMU_DEVTYPE_ST_LSM9DS1_AG);
|
||||
BusInstanceIterator iterator(MODULE_NAME, cli, DRV_IMU_DEVTYPE_ST_LSM9DS1_AG);
|
||||
|
||||
if (!strcmp(verb, "start")) {
|
||||
return ThisDriver::module_start(cli, iterator);
|
||||
|
||||
Reference in New Issue
Block a user