41 #include <px4_platform_common/px4_config.h> 60 I2C(
"Airspeed", path, bus, address, 100000),
61 ScheduledWorkItem(MODULE_NAME,
px4::device_bus_to_wq(get_device_id())),
64 _collect_phase(false),
65 _diff_pres_offset(0.0
f),
66 _airspeed_pub(nullptr),
67 _airspeed_orb_class_instance(-1),
69 _conversion_interval(conversion_interval),
111 PX4_WARN(
"uORB started?");
166 unsigned interval = (1000000 / arg);
195 return I2C::ioctl(filp, cmd, arg);
orb_advert_t _airspeed_pub
#define AIRSPEED_BASE_DEVICE_PATH
void stop()
Stop the automatic measurement state machine.
measure the time elapsed performing an event
API for the uORB lightweight object broker.
unsigned _conversion_interval
#define SENSOR_POLLRATE_DEFAULT
poll at driver normal rate
int _airspeed_orb_class_instance
count the number of times an event occurs
High-resolution timer with callouts and timekeeping.
Global flash based parameter store.
#define SENSORIOCSPOLLRATE
Set the driver polling rate to (arg) Hz, or one of the SENSOR_POLLRATE constants. ...
#define ORB_ID(_name)
Generates a pointer to the uORB metadata structure for a given topic.
airspeed scaling factors; out = (in * Vscale) + offset
void perf_free(perf_counter_t handle)
Free a counter.
virtual int ioctl(device::file_t *filp, int cmd, unsigned long arg)
void init()
Activates/configures the hardware registers.
Vector< float, 6 > f(float t, const Matrix< float, 6, 1 > &, const Matrix< float, 3, 1 > &)
perf_counter_t _sample_perf
Simple error/warning functions, heavily inspired by the BSD functions of the same names...
Airspeed(int bus, int address, unsigned conversion_interval, const char *path)
#define AIRSPEEDIOCSSCALE
int orb_unadvertise(orb_advert_t handle)
Airspeed driver interface.
orb_advert_t orb_advertise_multi(const struct orb_metadata *meta, const void *data, int *instance, int priority)
perf_counter_t _comms_errors
void start()
Initialise the automatic measurement state machine and start it.
Performance measuring tools.
Base class for devices connected via I2C.