18 #define _DPB_DATA_LEN 4
19 #define _DPB_VAL_MAX 0x7FFF
23 uint8_t temp[_DPB_DATA_LEN];
28 if ((temp[0] & 0x80) || (temp[2] & 0x80)) {
33 t = (temp[0] << 8) | temp[1];
36 t = (temp[2] << 8) | temp[3];
#define DPB_MAN_HUMID_RH
Max value in DpbData.humid, in percent RH.
#define DPB_MAX_TEMP_C
Max value in DpbData.temp, in tenth of degrees.
Structure defines data from the DigiPicco sensor.
Structure defines OpenCores I2C Device.
int16_t temp
temperature in degrees celcuis times 10.
This driver is to read the DigiPicco I2C sensor.
uint8_t i2cAddr
I2C address type.
bool dpbRead(I2C_Device *dev, i2cAddr addr, DpbData *data)
Read the DigiPicco I2C Basic temperature and humidity control device.
int8_t humid
humidity in percent (0-100).
bool i2cRead(I2C_Device *dev, i2cAddr addr, uint8_t *bytes, int len)
Reads from the I2C device.
static bool errRebase(const char *name)
Rebases the cause of the error message.
#define DPB_MIN_TEMP_C
Min value in DpbData.temp, in tenth of degrees.
bool errSet(uint32_t code, const char *error, const char *name)
Sets an error.
#define ERROR(CODE,...)
Expands an error code to an error code with a description (if ERROR_W_DESCR is declared).