PropWare
2.1.2
C++ objects and CMake build system for Parallax Propeller
|
Click here for docs on the
develop
branch.
#include <ms5611.h>
Public Types | |
enum | AddressLSB { LSB_0, LSB_1 } |
Public Member Functions | |
MS5611 () | |
bool | Init (libpropeller::I2C *newbus, const AddressLSB address=LSB_0) |
bool | Touch (void) |
void | Get (int &tPressure, int &tTemperature, const bool calibrationCalculation=true) |
bool | GetStatus (void) |
bool | Reset (void) |
Friends | |
class | ::UnityTests |
MS5611 Barometer interface
Provides a simple interface to the MS5611 barometer and temperature sensor. Uses the I2C interface to the sensor.
libpropeller::MS5611::MS5611 | ( | ) |
void libpropeller::MS5611::Get | ( | int & | tPressure, |
int & | tTemperature, | ||
const bool | calibrationCalculation = true |
||
) |
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:
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 libpropeller::MS5611::GetStatus | ( | void | ) |
bool libpropeller::MS5611::Init | ( | libpropeller::I2C * | newbus, |
const AddressLSB | address = LSB_0 |
||
) |
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.
newbus | The I2C bus to use. |
address | The least significant byte of the I2C address. Use the enum constants. |
Definition at line 55 of file ms5611.h.
bool libpropeller::MS5611::Reset | ( | void | ) |
bool libpropeller::MS5611::Touch | ( | void | ) |
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.
Test results indicate that the Touch function takes the following amount of time, at 80MHz in:
Definition at line 116 of file ms5611.h.