80 if (g_dev !=
nullptr) {
81 PX4_WARN(
"already started");
88 if (g_dev ==
nullptr) {
93 if (g_dev->
init() != PX4_OK) {
99 if (g_dev ==
nullptr) {
100 PX4_ERR(
"SDP3X was not instantiated (RAM)");
105 if (g_dev->
init() != PX4_OK) {
125 if (g_dev !=
nullptr) {
136 if (g_dev !=
nullptr) {
141 PX4_ERR(
"driver not running");
159 PX4_ERR(
"driver reset failed");
164 PX4_ERR(
"driver poll restart failed");
177 PX4_INFO(
"usage: sdp3x_airspeed command [options]");
178 PX4_INFO(
"options:");
180 PX4_INFO(
"\t-a --all");
181 PX4_INFO(
"command:");
182 PX4_INFO(
"\tstart|stop|reset");
192 const char *myoptarg =
nullptr;
193 bool start_all =
false;
195 while ((ch = px4_getopt(argc, argv,
"ab:", &myoptind, &myoptarg)) != EOF) {
198 i2c_bus = atoi(myoptarg);
211 if (myoptind >= argc) {
220 if (!strcmp(argv[myoptind],
"start")) {
232 if (!strcmp(argv[myoptind],
"stop")) {
239 if (!strcmp(argv[myoptind],
"reset")) {
#define I2C_ADDRESS_2_SDP3X
int start_bus(uint8_t i2c_bus)
Start the driver on a specific bus.
#define SENSOR_POLLRATE_DEFAULT
poll at driver normal rate
#define I2C_ADDRESS_1_SDP3X
int start()
Attempt to start driver on all available I2C busses.
#define SENSORIOCSPOLLRATE
Set the driver polling rate to (arg) Hz, or one of the SENSOR_POLLRATE constants. ...
static constexpr uint8_t PX4_I2C_BUS_DEFAULT
int reset()
Reset the driver.
Driver for Sensirion SDP3X Differential Pressure Sensor.
__EXPORT int sdp3x_airspeed_main(int argc, char *argv[])
static const int i2c_bus_options[]
int stop()
Stop the driver.
#define SENSORIOCRESET
Reset the sensor to its default configuration.
static void sdp3x_airspeed_usage()
#define NUM_I2C_BUS_OPTIONS