Go to the documentation of this file.
1 /*
2  * Copyright 2009 Freie Universitaet Berlin (FUB)
3  * 2018 Otto-von-Guericke-Universit├Ąt Magdeburg
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
23 #ifndef SHT1X_H
24 #define SHT1X_H
26 #include <stdint.h>
27 #include <periph/gpio.h>
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
38 typedef enum {
47 } sht1x_conf_t;
52 typedef enum {
53  SHT1X_VDD_5_0V = 0,
54  SHT1X_VDD_4_0V = 1,
55  SHT1X_VDD_3_5V = 2,
56  SHT1X_VDD_3_0V = 3,
57  SHT1X_VDD_2_5V = 4,
58 } sht1x_vdd_t;
63 typedef struct {
64  gpio_t clk;
65  gpio_t data;
66  int16_t temp_off;
67  int16_t hum_off;
68  uint8_t conf;
69  uint8_t vdd;
70 } sht1x_dev_t;
75 typedef struct {
76  gpio_t clk;
77  gpio_t data;
91 int sht1x_init(sht1x_dev_t *dev, const sht1x_params_t *params);
103 int16_t sht1x_temperature(const sht1x_dev_t *dev, uint16_t raw);
117 int16_t sht1x_humidity(const sht1x_dev_t *dev, uint16_t raw, int16_t temp);
140 int sht1x_read(const sht1x_dev_t *dev, int16_t *temp, int16_t *hum);
169 int sht1x_read_status(sht1x_dev_t *dev, uint8_t *status);
181 int sht1x_reset(sht1x_dev_t *dev);
183 #ifdef __cplusplus
184 }
185 #endif
187 #endif /* SHT1X_H */
Possible configuration (=status byte) values of the SHT10/11/15.
Definition: sht1x.h:38
int sht1x_reset(sht1x_dev_t *dev)
Reset the sensor&#39;s configuration to default values.
int16_t hum_off
Offset to add to the measured humidity.
Definition: sht1x.h:67
Possible values for Vdd (measured temperature depends on it)
Definition: sht1x.h:52
Low-level GPIO peripheral driver interface definitions.
uint8_t conf
Status byte (containing configuration) of the SHT1X.
Definition: sht1x.h:68
gpio_t data
GPIO connected to the data pin of the SHT1X.
Definition: sht1x.h:65
Waste 8mA at 5V to increase the sensor temperature up to 10┬░C.
Definition: sht1x.h:44
Parameters required to set up the SHT10/11/15 device driver.
Definition: sht1x.h:75
int sht1x_read(const sht1x_dev_t *dev, int16_t *temp, int16_t *hum)
Read the current temperature.
sht1x_vdd_t vdd
The supply voltage of the SHT1X.
Definition: sht1x.h:78
Skip the CRC check (and reading the CRC byte) to safe time.
Definition: sht1x.h:46
SHT10/11/15 temperature humidity sensor.
Definition: sht1x.h:63
gpio_t data
GPIO connected to the data pin of the SHT1X.
Definition: sht1x.h:77
uint8_t vdd
Supply voltage of the SHT1X (as sht1x_vdd_t)
Definition: sht1x.h:69
int16_t sht1x_humidity(const sht1x_dev_t *dev, uint16_t raw, int16_t temp)
Calculate the relative humidity from the raw input.
int sht1x_configure(sht1x_dev_t *dev, sht1x_conf_t conf)
Apply the given configuration (= status byte) to.
Don&#39;t upload calibration data to register to safe 10 millisec.
Definition: sht1x.h:42
gpio_t clk
GPIO connected to the clock pin of the SHT1X.
Definition: sht1x.h:64
Use 8/12 bit resolution instead of 12/14 bit for temp/hum.
Definition: sht1x.h:40
gpio_t clk
GPIO connected to the clock pin of the SHT1X.
Definition: sht1x.h:76
int sht1x_init(sht1x_dev_t *dev, const sht1x_params_t *params)
Initialize the SHT10/11/15 sensor.
int16_t temp_off
Offset to add to the measured temperature.
Definition: sht1x.h:66
int16_t sht1x_temperature(const sht1x_dev_t *dev, uint16_t raw)
Calculate the temperature from the raw input.
int sht1x_read_status(sht1x_dev_t *dev, uint8_t *status)
Read the status byte of an SHT1X sensor.