32 #ifndef BSP430_SENSORS_SHT21_H
33 #define BSP430_SENSORS_SHT21_H
75 #define BSP430_SENSORS_SHT21_I2C_ADDRESS 0x40
79 #define BSP430_SENSORS_SHT21_RESET_DELAY_MS 15
84 #define BSP430_SENSORS_SHT21_CONFIG_H12T14 0x00
89 #define BSP430_SENSORS_SHT21_CONFIG_H8T12 0x01
94 #define BSP430_SENSORS_SHT21_CONFIG_H10T13 0x80
99 #define BSP430_SENSORS_SHT21_CONFIG_H11T11 0x81
103 #define BSP430_SENSORS_SHT21_CONFIG_RESOLUTION_MASK 0x81
107 #define BSP430_SENSORS_SHT21_CONFIG_EOB_MASK 0x40
111 #define BSP430_SENSORS_SHT21_CONFIG_HEATER_MASK 0x04
114 #define BSP430_SENSORS_SHT21_EIC_LENGTH 8
117 #define BSP430_SENSORS_SHT21_EIC_IS_SHT21(eic_) ((0x00 == (eic_)[0]) && (0x80 == (eic_)[1]))
120 #define BSP430_SENSORS_SHT21_EIC_IS_HTU21D(eic_) ((0x48 == (eic_)[0]) && (0x54 == (eic_)[1]))
125 #define BSP430_SENSORS_SHT21_HUMIDITY_RAW_TO_ppth(raw_) (unsigned int)(((1250UL * (raw_)) >> 16) - 60)
133 #define BSP430_SENSORS_SHT21_TEMPERATURE_RAW_TO_cK(raw_) (22630U + (unsigned int)((17572UL * (raw_)) >> 16))
137 #define BSP430_SENSORS_SHT21_TEMPERATURE_RAW_TO_dK(raw_) ((unsigned int)((5 + BSP430_SENSORS_SHT21_TEMPERATURE_RAW_TO_cK(raw_)) / 10))
139 #ifndef BSP430_SENSORS_SHT21_IS_HTU21D
152 #define BSP430_SENSORS_SHT21_IS_HTU21D 1
int iBSP430sensorsSHT21getMeasurement(hBSP430halSERIAL i2c, int hold_master, uint16_t *rawp)
struct sBSP430sensorsSHT21sample sBSP430sensorsSHT21sample
eBSP430sensorsSHT21measurement
Definition: sht21.h:264
int iBSP430sensorsSHT21configuration(hBSP430halSERIAL i2c, int resolution, int heater)
int iBSP430sensorsSHT21eic(hBSP430halSERIAL i2c, uint8_t *eic)
int iBSP430sensorsSHT21getSample(hBSP430halSERIAL i2c, hBSP430sensorsSHT21sample sample)
Definition: serial_.h:193
Hardware presentation/abstraction for generic timers (Timer_A/Timer_B)
Declarations for abstracted serial interface.
int iBSP430sensorsSHT21initiateMeasurement(hBSP430halSERIAL i2c, int hold_master, eBSP430sensorsSHT21measurement type)
sBSP430sensorsSHT21sample * hBSP430sensorsSHT21sample
Definition: sht21.h:175
int iBSP430sensorsSHT21reset(hBSP430halSERIAL i2c)
int iBSP430sensorsSHT21crc(const uint8_t *data, int len)