26#ifndef DETERMINISTICESPASYNCWEBSERVER_SHT3X_H
27#define DETERMINISTICESPASYNCWEBSERVER_SHT3X_H
33#define SHT3X_CMD_SINGLE_HIGH 0x2400
34#define SHT3X_CMD_SINGLE_MED 0x240B
35#define SHT3X_CMD_SINGLE_LOW 0x2416
36#define SHT3X_CMD_SOFT_RESET 0x30A2
37#define SHT3X_CMD_READ_STATUS 0xF32D
38#define SHT3X_CMD_HEATER_ON 0x306D
39#define SHT3X_CMD_HEATER_OFF 0x3066
55bool sht3x_parse(
const uint8_t resp[6], int32_t *temp_mc, int32_t *rh_mpct);
int32_t sht3x_rh_mpct(uint16_t raw)
Convert a raw 16-bit humidity tick to milli-percent relative humidity (0..100000).
bool sht3x_parse(const uint8_t resp[6], int32_t *temp_mc, int32_t *rh_mpct)
Decode a six-byte single-shot response (T msb/lsb/crc, RH msb/lsb/crc). Verifies both CRC-8 words,...
int32_t sht3x_temp_mc(uint16_t raw)
Convert a raw 16-bit temperature tick to milli-degrees Celsius.
bool sht3x_begin(uint8_t addr)
Soft-reset the SHT3x at addr over I2C.
bool sht3x_read(int32_t *temp_mc, int32_t *rh_mpct)
Trigger a single-shot high-repeatability measurement, read + verify the six bytes,...
uint8_t sht3x_crc8(const uint8_t *data, size_t len)
Sensirion CRC-8 (poly 0x31, init 0xFF) over len bytes.