si70xx.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Bas Stottelaar <basstottelaar@gmail.com>
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 
21 #ifndef SI70XX_H
22 #define SI70XX_H
23 
24 #include "periph/i2c.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
33 enum {
37 };
38 
42 typedef struct {
44  uint8_t address;
46 
50 typedef struct {
52 } si70xx_t;
53 
65 int si70xx_init(si70xx_t *dev, const si70xx_params_t *params);
66 
73 uint16_t si70xx_get_relative_humidity(const si70xx_t *dev);
74 
82 int16_t si70xx_get_temperature(const si70xx_t *dev);
83 
92 void si70xx_get_both(const si70xx_t *dev, uint16_t *humidity, int16_t *temperature);
93 
100 uint64_t si70xx_get_serial(const si70xx_t *dev);
101 
108 uint8_t si70xx_get_id(const si70xx_t *dev);
109 
116 uint8_t si70xx_get_revision(const si70xx_t *dev);
117 
118 #ifdef __cplusplus
119 }
120 #endif
121 
122 #endif /* SI70XX_H */
123 
si70xx_params_t params
Device parameters.
Definition: si70xx.h:51
int16_t si70xx_get_temperature(const si70xx_t *dev)
Read the current temperature from the sensor.
uint64_t si70xx_get_serial(const si70xx_t *dev)
Read the sensor serial number.
All OK.
Definition: si70xx.h:34
uint8_t si70xx_get_id(const si70xx_t *dev)
Read the sensor id, to identifier the sensor variant.
unsigned int i2c_t
Default i2c_t type definition.
Definition: i2c.h:157
No valid device found on I2C bus.
Definition: si70xx.h:35
Si70xx device descriptor.
Definition: si70xx.h:50
An error occured when reading/writing on I2C bus.
Definition: si70xx.h:36
void si70xx_get_both(const si70xx_t *dev, uint16_t *humidity, int16_t *temperature)
Read the relative humidity and temperature from the sensor.
uint8_t si70xx_get_revision(const si70xx_t *dev)
Read the firmware revision of the sensor.
int si70xx_init(si70xx_t *dev, const si70xx_params_t *params)
Initialize and reset the sensor.
i2c_t i2c_dev
I2C bus the sensor is connected to.
Definition: si70xx.h:43
uint8_t address
sensor address
Definition: si70xx.h:44
Device initialization parameters.
Definition: si70xx.h:42
uint16_t si70xx_get_relative_humidity(const si70xx_t *dev)
Read the relative humidity from the sensor.
Low-level I2C peripheral driver interface definition.