27 #include <mraa/common.hpp>
28 #include <mraa/i2c.hpp>
30 #define HP20X_I2C_BUS 0
31 #define HP20X_DEFAULT_I2C_ADDR 0x76
117 REG_ALT_OFF_LSB = 0x00,
118 REG_ALT_OFF_MSB = 0x01,
120 REG_PA_H_TH_LSB = 0x02,
121 REG_PA_H_TH_MSB = 0x03,
123 REG_PA_M_TH_LSB = 0x04,
124 REG_PA_M_TH_MSB = 0x05,
126 REG_PA_L_TH_LSB = 0x06,
127 REG_PA_L_TH_MSB = 0x07,
144 INT_EN_T_WIN_EN = 0x01,
145 INT_EN_PA_WIN_EN = 0x02,
147 INT_EN_T_TRAV_EN = 0x04,
148 INT_EN_PA_TRAV_EN = 0x08,
150 INT_EN_T_RDY_EN = 0x10,
151 INT_EN_PA_RDY_EN = 0x20
159 INT_CFG_T_WIN_CFG = 0x01,
160 INT_CFG_PA_WIN_CFG = 0x02,
162 INT_CFG_T_TRAV_CFG = 0x04,
163 INT_CFG_PA_TRAV_CFG = 0x08,
165 INT_CFG_T_RDY_CFG = 0x10,
166 INT_CFG_PA_RDY_CFG = 0x20,
168 INT_CFG_PA_MODE = 0x40
176 INT_SRC_T_WIN = 0x01,
177 INT_SRC_PA_WIN = 0x02,
179 INT_SRC_T_TRAV = 0x04,
180 INT_SRC_PA_TRAV = 0x08,
182 INT_SRC_T_RDY = 0x10,
183 INT_SRC_PA_RDY = 0x20,
185 INT_SRC_DEV_RDY = 0x40,
187 INT_SRC_TH_ERR = 0x80
204 HP20X(
int bus=HP20X_I2C_BUS, uint8_t address=HP20X_DEFAULT_I2C_ADDR);
API for the HP20X-based Grove Barometer (High-Accuracy)
Definition: hp20x.h:64
CHNL_BITS_T
Definition: hp20x.h:91
void compensationEnable(bool enable)
Definition: hp20x.cxx:214
PARA_BITS_T
Definition: hp20x.h:193
bool setInterruptEnable(uint8_t bits)
Definition: hp20x.cxx:222
INT_EN_BITS_T
Definition: hp20x.h:143
void setDSR(DSR_BITS_T dsr)
Definition: hp20x.cxx:237
HP20X_REG_T
Definition: hp20x.h:116
bool writeCmd(uint8_t cmd)
Definition: hp20x.cxx:100
bool setInterruptConfig(uint8_t bits)
Definition: hp20x.cxx:227
void softReset()
Definition: hp20x.cxx:248
float getTemperature()
Definition: hp20x.cxx:160
~HP20X()
Definition: hp20x.cxx:51
INT_SRC_BITS_T
Definition: hp20x.h:175
uint8_t readReg(HP20X_REG_T reg)
Definition: hp20x.cxx:130
INT_CFG_BITS_T
Definition: hp20x.h:158
bool waitforDeviceReady()
Definition: hp20x.cxx:79
HP20X(int bus=HP20X_I2C_BUS, uint8_t address=HP20X_DEFAULT_I2C_ADDR)
Definition: hp20x.cxx:37
int readData()
Definition: hp20x.cxx:137
HP20X_CMD_T
Definition: hp20x.h:70
DSR_BITS_T
Definition: hp20x.h:101
bool writeReg(HP20X_REG_T reg, uint8_t data)
Definition: hp20x.cxx:113
float getAltitude()
Definition: hp20x.cxx:196
uint8_t getInterruptSource()
Definition: hp20x.cxx:232
void setAltitudeOffset(int16_t off)
Definition: hp20x.cxx:255
void recalibrateInternal()
Definition: hp20x.cxx:242
void setTemperatureThreshholds(int8_t low, int8_t med, int8_t high)
Definition: hp20x.cxx:276
bool init(DSR_BITS_T dsr=DSR_4096)
Definition: hp20x.cxx:55
void setPAThreshholds(int16_t low, int16_t med, int16_t high)
Definition: hp20x.cxx:261
float getPressure()
Definition: hp20x.cxx:178
bool isReady()
Definition: hp20x.cxx:69