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 
24 #ifndef SI70XX_H
25 #define SI70XX_H
26 
27 #include "periph/i2c.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
36 enum {
40 };
41 
45 typedef struct {
47  uint8_t address;
49 
53 typedef struct {
55 } si70xx_t;
56 
68 int si70xx_init(si70xx_t *dev, const si70xx_params_t *params);
69 
76 uint16_t si70xx_get_relative_humidity(const si70xx_t *dev);
77 
85 int16_t si70xx_get_temperature(const si70xx_t *dev);
86 
95 void si70xx_get_both(const si70xx_t *dev, uint16_t *humidity, int16_t *temperature);
96 
103 uint64_t si70xx_get_serial(const si70xx_t *dev);
104 
111 uint8_t si70xx_get_id(const si70xx_t *dev);
112 
119 uint8_t si70xx_get_revision(const si70xx_t *dev);
120 
121 #ifdef __cplusplus
122 }
123 #endif
124 
125 #endif /* SI70XX_H */
126 
si70xx_params_t params
Device parameters.
Definition: si70xx.h:54
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:37
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
Si70xx device descriptor.
Definition: si70xx.h:53
No valid device found on I2C bus.
Definition: si70xx.h:38
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:46
uint8_t address
sensor address
Definition: si70xx.h:47
An error occured when reading/writing on I2C bus.
Definition: si70xx.h:39
Device initialization parameters.
Definition: si70xx.h:45
uint16_t si70xx_get_relative_humidity(const si70xx_t *dev)
Read the relative humidity from the sensor.
Low-level I2C peripheral driver interface definition.