31 #include <mraa/i2c.hpp>
33 #include "upm/iPressureSensor.hpp"
34 #include "upm/iTemperatureSensor.hpp"
36 #define ADDR 0x77 // device address
39 #define BMP085_ULTRALOWPOWER 0
40 #define BMP085_STANDARD 1
41 #define BMP085_HIGHRES 2
42 #define BMP085_ULTRAHIGHRES 3
43 #define BMP085_CAL_AC1 0xAA // R Calibration data (16 bits)
44 #define BMP085_CAL_AC2 0xAC // R Calibration data (16 bits)
45 #define BMP085_CAL_AC3 0xAE // R Calibration data (16 bits)
46 #define BMP085_CAL_AC4 0xB0 // R Calibration data (16 bits)
47 #define BMP085_CAL_AC5 0xB2 // R Calibration data (16 bits)
48 #define BMP085_CAL_AC6 0xB4 // R Calibration data (16 bits)
49 #define BMP085_CAL_B1 0xB6 // R Calibration data (16 bits)
50 #define BMP085_CAL_B2 0xB8 // R Calibration data (16 bits)
51 #define BMP085_CAL_MB 0xBA // R Calibration data (16 bits)
52 #define BMP085_CAL_MC 0xBC // R Calibration data (16 bits)
53 #define BMP085_CAL_MD 0xBE // R Calibration data (16 bits)
55 #define BMP085_CONTROL 0xF4
56 #define BMP085_TEMPDATA 0xF6
57 #define BMP085_PRESSUREDATA 0xF6
58 #define BMP085_READTEMPCMD 0x2E
59 #define BMP085_READPRESSURECMD 0x34
102 BMPX8X (
int bus,
int devAddr=0x77, uint8_t mode=BMP085_ULTRAHIGHRES);
144 float getAltitude (
float sealevelPressure = 101325);
186 mraa::Result
i2cWriteReg (uint8_t reg, uint8_t value);
200 mraa::I2c m_i2ControlCtx;
202 uint8_t oversampling;
203 int16_t ac1, ac2, ac3, b1, b2, mb, mc, md;
204 uint16_t ac4, ac5, ac6;
int32_t computeB5(int32_t UT)
Definition: bmpx8x.cxx:186
uint8_t i2cReadReg_8(int reg)
Definition: bmpx8x.cxx:222
BMPX8X(int bus, int devAddr=0x77, uint8_t mode=BMP085_ULTRAHIGHRES)
Definition: bmpx8x.cxx:35
int32_t getPressureRaw()
Definition: bmpx8x.cxx:111
int getTemperatureCelsius()
Definition: bmpx8x.cxx:175
Interface for Temperature Sensors.
Definition: iTemperatureSensor.hpp:34
int16_t getTemperatureRaw()
Definition: bmpx8x.cxx:136
int32_t getSealevelPressure(float altitudeMeters=0)
Definition: bmpx8x.cxx:157
float getTemperature()
Definition: bmpx8x.cxx:143
int getPressurePa()
Definition: bmpx8x.hpp:156
API for the GY65/BMP085 and BMP180 Atmospheric Pressure Sensors.
Definition: bmpx8x.hpp:93
uint16_t i2cReadReg_16(int reg)
Definition: bmpx8x.cxx:205
mraa::Result i2cWriteReg(uint8_t reg, uint8_t value)
Definition: bmpx8x.cxx:194
const char * getModuleName()
Definition: bmpx8x.cxx:180
Interface for Pressue Sensors.
Definition: iPressureSensor.hpp:38
float getAltitude(float sealevelPressure=101325)
Definition: bmpx8x.cxx:163
int32_t getPressure()
Definition: bmpx8x.cxx:74