27 #include <mraa/i2c.hpp>
29 #define HP20X_I2C_BUS 0
30 #define HP20X_DEFAULT_I2C_ADDR 0x76
116 REG_ALT_OFF_LSB = 0x00,
117 REG_ALT_OFF_MSB = 0x01,
119 REG_PA_H_TH_LSB = 0x02,
120 REG_PA_H_TH_MSB = 0x03,
122 REG_PA_M_TH_LSB = 0x04,
123 REG_PA_M_TH_MSB = 0x05,
125 REG_PA_L_TH_LSB = 0x06,
126 REG_PA_L_TH_MSB = 0x07,
143 INT_EN_T_WIN_EN = 0x01,
144 INT_EN_PA_WIN_EN = 0x02,
146 INT_EN_T_TRAV_EN = 0x04,
147 INT_EN_PA_TRAV_EN = 0x08,
149 INT_EN_T_RDY_EN = 0x10,
150 INT_EN_PA_RDY_EN = 0x20
158 INT_CFG_T_WIN_CFG = 0x01,
159 INT_CFG_PA_WIN_CFG = 0x02,
161 INT_CFG_T_TRAV_CFG = 0x04,
162 INT_CFG_PA_TRAV_CFG = 0x08,
164 INT_CFG_T_RDY_CFG = 0x10,
165 INT_CFG_PA_RDY_CFG = 0x20,
167 INT_CFG_PA_MODE = 0x40
175 INT_SRC_T_WIN = 0x01,
176 INT_SRC_PA_WIN = 0x02,
178 INT_SRC_T_TRAV = 0x04,
179 INT_SRC_PA_TRAV = 0x08,
181 INT_SRC_T_RDY = 0x10,
182 INT_SRC_PA_RDY = 0x20,
184 INT_SRC_DEV_RDY = 0x40,
186 INT_SRC_TH_ERR = 0x80
203 HP20X(
int bus=HP20X_I2C_BUS, uint8_t address=HP20X_DEFAULT_I2C_ADDR);
INT_CFG_BITS_T
Definition: hp20x.h:157
API for the HP20X-based Grove Barometer (High-Accuracy)
Definition: hp20x.h:63
DSR_BITS_T
Definition: hp20x.h:100
HP20X_REG_T
Definition: hp20x.h:115
void compensationEnable(bool enable)
Definition: hp20x.cxx:234
bool setInterruptEnable(uint8_t bits)
Definition: hp20x.cxx:242
INT_SRC_BITS_T
Definition: hp20x.h:174
void setDSR(DSR_BITS_T dsr)
Definition: hp20x.cxx:257
bool writeCmd(uint8_t cmd)
Definition: hp20x.cxx:99
bool setInterruptConfig(uint8_t bits)
Definition: hp20x.cxx:247
CHNL_BITS_T
Definition: hp20x.h:90
void softReset()
Definition: hp20x.cxx:268
float getTemperature()
Definition: hp20x.cxx:156
~HP20X()
Definition: hp20x.cxx:50
uint8_t readReg(HP20X_REG_T reg)
Definition: hp20x.cxx:127
bool waitforDeviceReady()
Definition: hp20x.cxx:78
HP20X(int bus=HP20X_I2C_BUS, uint8_t address=HP20X_DEFAULT_I2C_ADDR)
Definition: hp20x.cxx:36
int readData()
Definition: hp20x.cxx:134
bool writeReg(HP20X_REG_T reg, uint8_t data)
Definition: hp20x.cxx:111
float getAltitude()
Definition: hp20x.cxx:208
HP20X_CMD_T
Definition: hp20x.h:69
uint8_t getInterruptSource()
Definition: hp20x.cxx:252
void setAltitudeOffset(int16_t off)
Definition: hp20x.cxx:275
void recalibrateInternal()
Definition: hp20x.cxx:262
PARA_BITS_T
Definition: hp20x.h:192
void setTemperatureThreshholds(int8_t low, int8_t med, int8_t high)
Definition: hp20x.cxx:296
INT_EN_BITS_T
Definition: hp20x.h:142
bool init(DSR_BITS_T dsr=DSR_4096)
Definition: hp20x.cxx:54
void setPAThreshholds(int16_t low, int16_t med, int16_t high)
Definition: hp20x.cxx:281
float getPressure()
Definition: hp20x.cxx:182
bool isReady()
Definition: hp20x.cxx:68