43 #include <px4_platform_common/getopt.h> 44 #include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp> 57 #define INCREMENT(_x, _lim) do { __typeof__(_x) _tmp = _x+1; if (_tmp >= _lim) _tmp = 0; _x = _tmp; } while(0) 60 #define POW2(_x) ((_x) * (_x)) 65 #define ADDR_CMD_CONVERT_D1_OSR256 0x40 66 #define ADDR_CMD_CONVERT_D1_OSR512 0x42 67 #define ADDR_CMD_CONVERT_D1_OSR1024 0x44 68 #define ADDR_CMD_CONVERT_D1_OSR2048 0x46 69 #define ADDR_CMD_CONVERT_D1_OSR4096 0x48 70 #define ADDR_CMD_CONVERT_D2_OSR256 0x50 71 #define ADDR_CMD_CONVERT_D2_OSR512 0x52 72 #define ADDR_CMD_CONVERT_D2_OSR1024 0x54 73 #define ADDR_CMD_CONVERT_D2_OSR2048 0x56 74 #define ADDR_CMD_CONVERT_D2_OSR4096 0x58 82 #define ADDR_CMD_CONVERT_D1 ADDR_CMD_CONVERT_D1_OSR1024 83 #define ADDR_CMD_CONVERT_D2 ADDR_CMD_CONVERT_D2_OSR1024 90 #define MS5611_CONVERSION_INTERVAL 10000 91 #define MS5611_MEASUREMENT_RATIO 3 92 #define MS5611_BARO_DEVICE_PATH_EXT "/dev/ms5611_ext" 93 #define MS5611_BARO_DEVICE_PATH_INT "/dev/ms5611_int"
perf_counter_t _measure_perf
API for the uORB lightweight object broker.
virtual ssize_t read(cdev::file_t *filp, char *buffer, size_t buflen)
Perform a read from the device.
MS5611(device::Device *interface, ms5611::prom_u &prom_buf, const char *path, enum MS56XX_DEVICE_TYPES device_type)
perf_counter_t _sample_perf
perf_counter_t _comms_errors
Calibration PROM as reported by the device.
void start()
Initialize the automatic measurement state machine and start it.
Shared defines for the ms5611 driver.
Abstract class for any character device.
device::Device * _interface
Simple error/warning functions, heavily inspired by the BSD functions of the same names...
virtual int collect()
Collect the result of the most recent measurement.
__BEGIN_DECLS typedef void * orb_advert_t
ORB topic advertiser handle.
void stop()
Stop the automatic measurement state machine.
void Run() override
Perform a poll cycle; collect from the previous measurement and start a new one.
virtual int measure()
Issue a measurement command for the current state.
Fundamental base class for all physical drivers (I2C, SPI).
ringbuffer::RingBuffer * _reports
virtual int ioctl(cdev::file_t *filp, int cmd, unsigned long arg)
Perform an ioctl operation on the device.
enum MS56XX_DEVICE_TYPES _device_type
Barometric pressure sensor driver interface.
void print_info()
Diagnostics - print some basic information about the driver.
unsigned _measure_interval
Performance measuring tools.
Base class for devices connected via I2C.