mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
Multi instance SHT3x driver support
This commit is contained in:
committed by
Daniel Agar
parent
ed475ca324
commit
2b1229786e
@@ -133,10 +133,8 @@ fi
|
|||||||
# SHT3x temperature and hygrometer sensor, external I2C
|
# SHT3x temperature and hygrometer sensor, external I2C
|
||||||
if param compare -s SENS_EN_SHT3X 1
|
if param compare -s SENS_EN_SHT3X 1
|
||||||
then
|
then
|
||||||
if ! sht3x start -X
|
sht3x start -X
|
||||||
then
|
|
||||||
sht3x start -X -a 0x45
|
sht3x start -X -a 0x45
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# TE MS4525 differential pressure sensor external I2C
|
# TE MS4525 differential pressure sensor external I2C
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
#include <px4_platform_common/module.h>
|
#include <px4_platform_common/module.h>
|
||||||
#include <px4_platform_common/module_params.h>
|
#include <px4_platform_common/module_params.h>
|
||||||
#include <px4_platform_common/i2c_spi_buses.h>
|
#include <px4_platform_common/i2c_spi_buses.h>
|
||||||
#include <uORB/Publication.hpp>
|
#include <uORB/PublicationMulti.hpp>
|
||||||
#include <uORB/topics/sensor_hygrometer.h>
|
#include <uORB/topics/sensor_hygrometer.h>
|
||||||
|
|
||||||
#define SHT3X_CMD_READ_STATUS 0xF32D
|
#define SHT3X_CMD_READ_STATUS 0xF32D
|
||||||
@@ -114,7 +114,7 @@ private:
|
|||||||
int _last_state = sht3x_state::INIT;
|
int _last_state = sht3x_state::INIT;
|
||||||
uint32_t _time_in_state = hrt_absolute_time();
|
uint32_t _time_in_state = hrt_absolute_time();
|
||||||
uint16_t _last_command = 0;
|
uint16_t _last_command = 0;
|
||||||
uORB::Publication<sensor_hygrometer_s> _sensor_hygrometer_pub{ORB_ID(sensor_hygrometer)};
|
uORB::PublicationMulti<sensor_hygrometer_s> _sensor_hygrometer_pub{ORB_ID(sensor_hygrometer)};
|
||||||
|
|
||||||
DEFINE_PARAMETERS(
|
DEFINE_PARAMETERS(
|
||||||
(ParamInt<px4::params::SENS_EN_SHT3X>) _param_sens_en_sht3x
|
(ParamInt<px4::params::SENS_EN_SHT3X>) _param_sens_en_sht3x
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ void LoggedTopics::add_default_topics()
|
|||||||
add_topic("rtl_time_estimate", 1000);
|
add_topic("rtl_time_estimate", 1000);
|
||||||
add_topic("safety");
|
add_topic("safety");
|
||||||
add_topic("sensor_combined");
|
add_topic("sensor_combined");
|
||||||
add_topic("sensor_hygrometer", 500);
|
|
||||||
add_optional_topic("sensor_correction");
|
add_optional_topic("sensor_correction");
|
||||||
add_optional_topic("sensor_gyro_fft", 50);
|
add_optional_topic("sensor_gyro_fft", 50);
|
||||||
add_topic("sensor_selection");
|
add_topic("sensor_selection");
|
||||||
@@ -123,6 +122,7 @@ void LoggedTopics::add_default_topics()
|
|||||||
add_topic_multi("airspeed_wind", 1000, 4);
|
add_topic_multi("airspeed_wind", 1000, 4);
|
||||||
add_topic_multi("control_allocator_status", 200, 2);
|
add_topic_multi("control_allocator_status", 200, 2);
|
||||||
add_optional_topic_multi("rate_ctrl_status", 200, 2);
|
add_optional_topic_multi("rate_ctrl_status", 200, 2);
|
||||||
|
add_topic_multi("sensor_hygrometer", 500, 4);
|
||||||
add_optional_topic_multi("telemetry_status", 1000, 4);
|
add_optional_topic_multi("telemetry_status", 1000, 4);
|
||||||
|
|
||||||
// EKF multi topics (currently max 9 estimators)
|
// EKF multi topics (currently max 9 estimators)
|
||||||
|
|||||||
Reference in New Issue
Block a user