Expand description
Texas Instruments HDC1080 low-power humidity and temperature sensor.
The HDC1080 returns each measurement as a plain 16-bit fraction of full scale: the temperature register spans -40 to +125 °C and the humidity register 0 to 100 %RH, both linearly over the 16-bit code. There is no per-chip calibration to apply and no checksum on the frame, so the decode is the datasheet’s two equations, done here in integer arithmetic so a node without floating point reads exact millidegrees and milli-percent.
A caller writes a Configuration to the configuration register once, triggers
an acquisition by writing the temperature pointer, waits the resolution’s
conversion time, and reads the four-byte frame into a Measurement.
Modules§
- register
- The HDC1080 register addresses. Every register is 16 bits, sent MSB first.
Structs§
- Configuration
- The configuration register (0x02), field by field.
- Measurement
- One combined temperature and humidity result, as read in a single transaction
after a trigger in
AcquisitionMode::TemperatureThenHumidity.
Enums§
- Acquisition
Mode - The MODE field: what one trigger acquires.
- Humidity
Resolution - The HRES field: humidity measurement resolution.
- Temperature
Resolution - The TRES field: temperature measurement resolution.
Constants§
- CONFIGURATION_
RESET - The power-on value of the configuration register: acquisition mode set to temperature then humidity, 14-bit resolution on both, heater off.
- DEVICE_
ID - The value the device-id register (0xFF) returns for an HDC1080.
- I2C_
ADDRESS - The fixed 7-bit I2C address,
1000000. - MANUFACTURER_
ID - The value the manufacturer-id register (0xFE) returns: Texas Instruments.
Functions§
- celsius
- Decodes the temperature register to degrees Celsius.
- humidity_
register - Builds the humidity register the sensor reports for a relative humidity.
- milli_
celsius - Decodes the temperature register to millidegrees Celsius.
- milli_
percent - Decodes the humidity register to thousandths of a percent relative humidity.
- relative_
humidity - Decodes the humidity register to percent relative humidity.
- serial_
id - Assembles the serial number from its three registers.
- serial_
id_ registers - Splits a serial number into the three registers a sensor reports it in.
- temperature_
register - Builds the temperature register the sensor reports for a temperature.