Skip to content

wsen-hids: Add two-point temperature calibration methods. #105

@nedseb

Description

@nedseb

Context

Part of the temperature calibration harmonization (#103).

The WSEN-HIDS has factory calibration (two-point linear interpolation from calibration registers). The ~6°C discrepancy previously observed was caused by a bug (missing AUTO_INCREMENT bit, fixed in #109). With the fix, the sensor reads correctly (~31°C, matching HTS221).

A two-point software calibration mechanism is needed for per-board fine-tuning, consistent with the harmonized interface defined in #103.

TODO

  • Add self._temp_gain = 1.0 and self._temp_offset = 0.0 in __init__
  • Add set_temp_offset(self, offset_c) method (simple offset, gain=1.0)
  • Add calibrate_temperature(self, ref_low, measured_low, ref_high, measured_high) method
  • Apply calibration in _convert_temperature(): return self._temp_gain * computed + self._temp_offset
  • Update mock test scenario if needed

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    driverConcerne un driver spécifiqueenhancementNew feature or requestreleased

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions