HIH6130 humidity and temperature sensor

Device driver for Honeywell HumidIcon Digital Humidity/Temperature Sensors: HIH-6130/6131 Series.

void hih6130_init(hih6130_t * dev, i2c.h::i2c_t i2c, uint8_t address)

Initialize a sensor.

Parameters

dev:device descriptor of sensor to initialize
i2c:I2C bus the sensor is connected to
address:I2C slave address of the sensor

int hih6130_get_humidity_temperature_float(const hih6130_t * dev, float * relative_humidity_percent, float * temperature_celsius)

Read humidity and temperature from sensor and convert to floating-point.

Parameters

dev:Sensor device descriptor
relative_humidity_percent:
 Measured relative humidity in percent
temperature_celsius:
 Measured temperature in degrees Celsius

Return values

  • 0 on success
  • -1 on error
  • 1 if data is stale
struct hih6130_t

Device descriptor for HIH6130/HIH6131 sensors.

i2c.h::i2c_t i2c

I2C device the sensor is connected to.

uint8_t addr

the slave address of the sensor on the I2C bus