42 #define MS5611_ADDRESS_1 0x76 43 #define MS5611_ADDRESS_2 0x77 55 virtual int read(
unsigned offset,
void *
data,
unsigned count);
56 virtual int ioctl(
unsigned operation,
unsigned &arg);
96 I2C(
"MS5611_I2C", nullptr, bus, 0, 400000),
107 } *cvt = (_cvt *)data;
112 int ret = transfer(&cmd, 1, &buf[0], 3);
168 set_device_address(address);
186 unsigned old_retrycount = _retries;
192 result = transfer(&cmd, 1,
nullptr, 0);
193 _retries = old_retrycount;
208 return transfer(&cmd, 1,
nullptr, 0);
226 uint8_t last_val = 0;
227 bool bits_stuck =
true;
230 for (
int i = 0; i < 8; i++) {
233 if (PX4_OK != transfer(&cmd, 1, &prom_buf[0], 2)) {
240 last_val = prom_buf[0];
243 if (prom_buf[0] != last_val || prom_buf[1] != last_val) {
248 cvt.b[0] = prom_buf[1];
249 cvt.b[1] = prom_buf[0];
int _read_prom()
Read the MS5611 PROM.
int _reset()
Send a reset command to the MS5611.
bool crc4(uint16_t *n_prom)
MS5611 crc4 cribbed from the datasheet.
MS5611_I2C(uint8_t bus, ms5611::prom_u &prom_buf)
virtual int read(unsigned offset, void *data, unsigned count)
virtual ~MS5611_I2C()=default
Shared defines for the ms5611 driver.
int _measure(unsigned addr)
Send a measure command to the MS5611.
virtual int ioctl(unsigned operation, unsigned &arg)
Fundamental base class for all physical drivers (I2C, SPI).
device::Device * MS5611_i2c_interface(ms5611::prom_u &prom_buf)
int _probe_address(uint8_t address)