hih6130.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Eistec AB
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
23 #ifndef HIH6130_H
24 #define HIH6130_H
25 
26 #include <stdint.h>
27 
28 #include "periph/i2c.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
37 typedef struct {
39  uint8_t addr;
40 } hih6130_t;
41 
49 void hih6130_init(hih6130_t *dev, i2c_t i2c, uint8_t address);
50 
63  float *relative_humidity_percent, float *temperature_celsius);
64 
65 #ifdef __cplusplus
66 }
67 #endif
68 
69 #endif /* HIH6130_H */
70 
i2c_t
unsigned int i2c_t
Default i2c_t type definition.
Definition: i2c.h:151
hih6130_get_humidity_temperature_float
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.
hih6130_t
Device descriptor for HIH6130/HIH6131 sensors.
Definition: hih6130.h:37
hih6130_t::i2c
i2c_t i2c
I2C device the sensor is connected to.
Definition: hih6130.h:38
hih6130_t::addr
uint8_t addr
the slave address of the sensor on the I2C bus
Definition: hih6130.h:39
i2c.h
Low-level I2C peripheral driver interface definition.
hih6130_init
void hih6130_init(hih6130_t *dev, i2c_t i2c, uint8_t address)
Initialize a sensor.