27 #include <mraa/i2c.hpp> 30 #define MPL3115A2_NAME "mpl3115a2" 32 #define MPL3115A2_I2C_ADDRESS 0x60 33 #define MPL3115A2_DEVICE_ID 0xc4 35 #define MPL3115A2_STATUS 0x00 36 #define MPL3115A2_OUT_PRESS 0x01 37 #define MPL3115A2_OUT_TEMP 0x04 38 #define MPL3115A2_WHO_AM_I 0x0c 39 #define MPL3115A2_PT_DATA_CFG 0x13 40 #define MPL3115A2_P_MIN 0x1C 41 #define MPL3115A2_T_MIN 0x1F 42 #define MPL3115A2_P_MAX 0x21 43 #define MPL3115A2_T_MAX 0x24 44 #define MPL3115A2_CTRL_REG1 0x26 47 #define MPL3115A2_CTRL_SBYB 0x01 48 #define MPL3115A2_CTRL_OST 0x02 49 #define MPL3115A2_CTRL_RESET 0x04 50 #define MPL3115A2_CTRL_ALT_MODE 0x80 52 #define MPL3115A2_SETOVERSAMPLE(a) ((a & 7) << 3) 53 #define MPL3115A2_GETOVERSAMPLE(a) ((a >> 3) & 7) 54 #define MPL3115A2_MAXOVERSAMPLE 7 91 MPL3115A2(
int bus,
int devAddr=MPL3115A2_I2C_ADDRESS, uint8_t mode=6);
169 float getAltitude (
float sealevelPressure = 101325.0);
227 mraa::Result
i2cWriteReg (uint8_t reg, uint8_t value);
248 mraa::I2c m_i2ControlCtx;
250 uint8_t m_oversampling;
252 int32_t m_iTemperature;
float getPressureMax(void)
Definition: mpl3115a2.cpp:266
int sampleData(void)
Definition: mpl3115a2.cpp:146
void setOversampling(uint8_t oversampling)
Definition: mpl3115a2.cpp:240
int32_t getTempReg(int reg)
Definition: mpl3115a2.cpp:189
float convertTempCtoF(float fTemp)
Definition: mpl3115a2.cpp:278
float getTemperatureMax(void)
Definition: mpl3115a2.cpp:254
API for the MPL3115A2 Atmospheric Pressure Sensor.
Definition: mpl3115a2.hpp:82
float getAltitude(float sealevelPressure=101325.0)
Definition: mpl3115a2.cpp:234
float getTemperature(int bSampleData=true)
Definition: mpl3115a2.cpp:211
C++ API wrapper for the bh1749 driver.
Definition: a110x.hpp:29
int32_t getPressureReg(int reg)
Definition: mpl3115a2.cpp:184
uint8_t i2cReadReg_8(int reg)
Definition: mpl3115a2.cpp:320
float convertPaToinHg(float fPressure)
Definition: mpl3115a2.cpp:287
MPL3115A2(int bus, int devAddr=MPL3115A2_I2C_ADDRESS, uint8_t mode=6)
Definition: mpl3115a2.cpp:39
float getPressureMin(void)
Definition: mpl3115a2.cpp:272
int resetSensor(void)
Definition: mpl3115a2.cpp:134
mraa::Result i2cWriteReg(uint8_t reg, uint8_t value)
Definition: mpl3115a2.cpp:297
uint8_t getOversampling(void)
Definition: mpl3115a2.cpp:248
float getSealevelPressure(float altitudeMeters=0.0)
Definition: mpl3115a2.cpp:228
float getTemperatureMin(void)
Definition: mpl3115a2.cpp:260
int testSensor(void)
Definition: mpl3115a2.cpp:73
uint16_t i2cReadReg_16(int reg)
Definition: mpl3115a2.cpp:310
void dumpSensor(void)
Definition: mpl3115a2.cpp:113
float getPressure(int bSampleData=true)
Definition: mpl3115a2.cpp:194