Go to the documentation of this file.
79 #define SHT2X_USER_RESOLUTION_MASK 0x81
80 #define SHT2X_USER_EOB_MASK 0x40
81 #define SHT2X_USER_HEATER_MASK 0x04
82 #define SHT2X_USER_RESERVED_MASK 0x38
83 #define SHT2X_USER_OTP_MASK 0x02
@ SHT2X_RES_11_11BIT
RH=11bit, T=11bit.
uint16_t sht2x_read_humidity(const sht2x_t *dev)
Read humidity value from the given SHT2X device, returned in centi RH.
sht2x_res_t
Available resolutions.
bool is_crc_enabled
do CRC or not
Device initialization parameters.
@ SHT2X_OK
everything was fine
@ SHT2X_ERR_TIMEDOUT
timed out
@ SHT2X_RES_8_12BIT
RH= 8bit, T=12bit.
unsigned int i2c_t
Default i2c_t type definition.
int sht2x_init(sht2x_t *dev, const sht2x_params_t *params)
Initialize the given SHT2X device.
int sht2x_read_ident(const sht2x_t *dev, uint8_t *buffer, size_t buflen)
Read identification code from the given SHT2X device.
Device descriptor for the SHT2X sensor.
sht2x_measure_mode_t measure_mode
measurement mode used
@ SHT2X_ERR_OTHER
fatal error
int16_t sht2x_read_temperature(const sht2x_t *dev)
Read temperature value from the given SHT2X device, returned in centi °C.
uint8_t i2c_addr
I2C address
@ SHT2X_RES_10_13BIT
RH=10bit, T=13bit.
@ SHT2X_ERR_I2C
error initializing the I2C bus
@ SHT2X_MEASURE_MODE_NO_HOLD
trigger measurement, no hold master (i.e.
@ SHT2X_ERR_CRC
CRC error.
@ SHT2X_ERR_NODEV
did not detect SHT2x
@ SHT2X_RES_12_14BIT
RH=12bit, T=14bit.
int sht2x_write_userreg(const sht2x_t *dev, uint8_t userreg)
Write User Register to the given SHT2X device.
@ SHT2X_MEASURE_MODE_HOLD
trigger measurement, hold master
sht2x_params_t params
Device Parameters.
int sht2x_reset(sht2x_t *dev)
Reset the SHT2X device.
@ SHT2X_ERR_NOCAL
could not read calibration data
int sht2x_read_userreg(const sht2x_t *dev, uint8_t *userreg)
Read User Register from the given SHT2X device.
sht2x_measure_mode_t
Available Measuring modes.
Low-level I2C peripheral driver interface definition.
@ SHT2X_ERR_I2C_READ
I2C read error.
@ SHT2X_ERR_USERREG
cannot write User Reg
@ SHT2X_ERR_RES
invalid resolution
sht2x_res_t resolution
resolution bits RH/temp