Skip to main content

raw_from_milli_lux

Function raw_from_milli_lux 

Source
pub fn raw_from_milli_lux(milli_lux: u32) -> u16
Expand description

Encodes an illuminance into the result and limit registers’ exponent-and-mantissa word, at the smallest exponent that holds the value.

The inverse of milli_lux. The smallest exponent gives the finest LSB, so the encoded threshold is the closest one the part can compare against; the mantissa is truncated to that LSB. An illuminance above the largest full scale, 83865.60 lux, saturates to HIGH_LIMIT_RESET, the largest encodable word.

§Arguments

  • milli_lux - the illuminance in milli-lux.

§Returns

The 16-bit register word.