Crate sensor_temp_humidity_sht40

Source

Structs§

HumPcmOffset
Humidity PCM offset to be applied to sensor measurement after conversion from raw value. This can be used to apply external calibration, beyond what is automatically done on-sensor.
Measurement
A sensor measurement result
RawMeasurement
The raw, integer measurement data from the sensor. In order to get actual temperature/humidity values this needs to be transformed. Normally, the transformations are done using the equations (1), (2) and (3) from the sensor’s datasheet. This is what the usual measurement API does, but accessing raw measurements is provided as a convenience if you want to do your own calibration.
SHT40Driver
SHT40Driver is the main structure with which a user of this driver interracts. It is generic over two parameters implementing embedded_hal traits for the specific platform you’re using: I2c which must implement embedded_hal::blocking::i2c::{Read, Write, WriteRead} and Delay which must implement embedded_hal::blocking::delay::DelayMs.
TempOffset
Temperature offset to be applied to sensor measurement after conversion from raw value. This can be used to apply external calibration, beyond what is automatically done on-sensor.

Enums§

Error
Driver error type parameterised to support hal-specific communication error subtypes
HeaterDuration
Define the duration for which the built-in heater should be turned on. After that time, the heater automatically turns off, without the need for any additional I2C commands.
HeaterPower
Define the power at which the built-in heater should be operated.
I2CAddr
I2C addresses for SHT40 are fixed, and depending on the product number the sensor uses either 0x44 or 0x45. Product numbers SHT4x-Axxx get address 0x44, and SHT4x-Bxxx get 0x45. For example, SHT40-AD1B has address 0x44 and SHT40-BD1B has address 0x45.
Precision
The accuracy of SHT40 is typically +/- 0.2C and at worst +/- 0.4C in the interval [0..60]C. The worst case outside this interval is +/- 1C (for the ends of the interval [-40..120]C.
SHT40Error
Driver error type independent of hal-specific types.
TempUnit
Measurement unit for Temperature.

Constants§

MAX_MILLICELSIUS_OFFSET
MAX_MILLIFAHRENHEIT_OFFSET
MAX_PCMHUM_OFFSET

Functions§

convert_raw_to_units
The SHT40 sensor uses a 16-bit ADC for converting the analog measurements into data, which is then calibrated on-sensor and then sent via I2C. In the raw measurement, temp_ticks and rel_hum_ticks are direct outputs after the calibration process and take values in the [0 .. 2^16 - 1] interval.