Skip to main content

temperature_from_micro_celsius

Function temperature_from_micro_celsius 

Source
pub fn temperature_from_micro_celsius(
    micro_celsius: i32,
    resolution: Resolution,
) -> i16
Expand description

Converts micro-degrees Celsius to a raw temperature register value.

The result is truncated to the step resolution resolves, since the datasheet specifies that the bits below a selected resolution read as zero.

§Arguments

  • micro_celsius - the temperature in millionths of a degree Celsius.
  • resolution - the resolution the part is configured for.

§Returns

The 16-bit two’s-complement temperature register, as a signed value.