Skip to main content

Module hdc1080

Module hdc1080 

Source
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§

AcquisitionMode
The MODE field: what one trigger acquires.
HumidityResolution
The HRES field: humidity measurement resolution.
TemperatureResolution
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.