Loading...
Searching...
No Matches
sht3x.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018 Gunar Schorcht
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
17#ifndef SHT3X_H
18#define SHT3X_H
19
20#include <stdint.h>
21#include <stdbool.h>
22
23#include "periph/i2c.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
30#define SHT3X_I2C_ADDR_1 (0x44)
31#define SHT3X_I2C_ADDR_2 (0x45)
43
55
79
89
106
124int sht3x_init (sht3x_dev_t *dev, const sht3x_params_t *params);
125
160int sht3x_read (sht3x_dev_t* dev, int16_t* temp, int16_t* hum);
161
162#ifdef __cplusplus
163}
164#endif
165
166#endif /* SHT3X_H */
uint_fast8_t i2c_t
Default i2c_t type definition.
Definition i2c.h:151
Low-level I2C peripheral driver interface definition.
int sht3x_read(sht3x_dev_t *dev, int16_t *temp, int16_t *hum)
Read SHT3x measurement results (temperature and humidity)
sht3x_mode_t
SHT3x measurement modes.
Definition sht3x.h:47
@ SHT3X_PERIODIC_2_MPS
periodic with 2 measurements per second (mps)
Definition sht3x.h:51
@ SHT3X_PERIODIC_4_MPS
periodic with 4 measurements per second (mps)
Definition sht3x.h:52
@ SHT3X_SINGLE_SHOT
single shot measurement
Definition sht3x.h:48
@ SHT3X_PERIODIC_1_MPS
periodic with 1 measurements per second (mps)
Definition sht3x.h:50
@ SHT3X_PERIODIC_10_MPS
periodic with 10 measurements per second (mps)
Definition sht3x.h:53
@ SHT3X_PERIODIC_0_5_MPS
periodic with 0.5 measurements per second (mps)
Definition sht3x.h:49
sht3x_error_codes
Driver error codes (returned as negative values)
Definition sht3x.h:36
@ SHT3X_ERROR_STATUS
sensor has wrong status
Definition sht3x.h:40
@ SHT3X_ERROR_I2C
I2C communication failure.
Definition sht3x.h:38
@ SHT3X_ERROR_MEASURE_CMD_INV
measurement command not executed
Definition sht3x.h:41
@ SHT3X_ERROR_CRC
CRC check failed.
Definition sht3x.h:39
@ SHT3X_OK
no error
Definition sht3x.h:37
sht3x_repeat_t
SHT3x repeatability levels.
Definition sht3x.h:74
@ SHT3X_LOW
low repeatability
Definition sht3x.h:77
@ SHT3X_HIGH
high repeatability
Definition sht3x.h:75
@ SHT3X_MEDIUM
medium repeatability
Definition sht3x.h:76
int sht3x_init(sht3x_dev_t *dev, const sht3x_params_t *params)
Initialize the SHT3x sensor device.
SHT3x sensor device data structure.
Definition sht3x.h:93
uint8_t i2c_addr
I2C address.
Definition sht3x.h:96
i2c_t i2c_dev
I2C device
Definition sht3x.h:95
uint32_t meas_duration
time in us until the results of the current measurement become available
Definition sht3x.h:103
sht3x_repeat_t repeat
repeatability level used
Definition sht3x.h:99
bool meas_started
indicates whether measurement is started
Definition sht3x.h:101
uint32_t meas_start_time
start time of current measurement in us
Definition sht3x.h:102
sht3x_mode_t mode
measurement mode used
Definition sht3x.h:98
SHT3x device initialization parameters.
Definition sht3x.h:83
i2c_t i2c_dev
I2C device
Definition sht3x.h:84
uint8_t i2c_addr
I2C address
Definition sht3x.h:85
sht3x_repeat_t repeat
repeatability level used
Definition sht3x.h:87
sht3x_mode_t mode
measurement mode used
Definition sht3x.h:86