MS5611 Barometer interface.
More...
#include <ms5611.h>
MS5611 Barometer interface.
Provides a simple interface to the MS5611 barometer and temperature sensor. Uses the I2C interface to the sensor.
- Author
- SRLM (srlm@.nosp@m.srlm.nosp@m.produ.nosp@m.ctio.nosp@m.ns.co.nosp@m.m)
Specify the least significant address bit.
Initialize a new MS5611 instance.
void MS5611::Get |
( |
int & |
tPressure, |
|
|
int & |
tTemperature, |
|
|
const bool |
calibrationCalculation = true |
|
) |
| |
|
inline |
Get the most current readings from the MS5611 sensor.
Test results indicate that the Get function takes the following amounts of time, at 80MHz in when calibrationCalculation == true:
- CMM -Os mode: 48448 cycles (~0.62ms)
- LMM -Os mode: 13968 cycles (~0.17ms)
- Warning
- Second order temperature compensation has not been tested! Particularly the very low temperature compensation!
- Parameters
-
tPressure | The pressure, either raw or in units of 0.01 mBar |
tTemperature | The temperature, either raw or in units of 0.01C |
calibrationCalculation | Perform calculations to calibrate (they involve 64 bit integers, so they take a while). |
bool MS5611::GetStatus |
( |
void |
) | |
|
|
inline |
- Returns
- true if device is present and ready, false otherwise
Initialize MS5611 Barometer instance.
This resets and initializes the sensor, reads the PROM, and begins a conversion.
Touch() should be called no sooner than 8.5ms after MS5611 initialization.
- Parameters
-
newbus | The I2C bus to use. |
address | The least significant byte of the I2C address. Use the enum constants. |
bool MS5611::Reset |
( |
void |
) | |
|
|
inline |
Reset the pressure sensor.
- Warning
- untested! (How do I test this?)
- Returns
- true if successfully reset, false otherwise. Takes 2.8ms to reload.
bool MS5611::Touch |
( |
void |
) | |
|
|
inline |
Keep the MS5611 running.
In general, must be called twice for every associated Get().
"Touches" the sensor to make sure that it keeps converting at the maximum pace.
- Warning
- Undefined behavior if called more than every 8.5 ms or less than every 53 seconds.
Test results indicate that the Touch function takes the following amount of time, at 80MHz in:
- CMM -Os mode: 49056 cycles (~0.62ms)
- LMM -Os mode: 22624 cycles (~0.28ms)
- Returns
- true when a new set of data is ready. If result is true, then Get() should be called.
The documentation for this class was generated from the following file: