Skip to main content

power_register_from_current

Function power_register_from_current 

Source
pub fn power_register_from_current(current: i16, bus: u16) -> u16
Expand description

Reproduces the chip’s power calculation from the current and bus registers.

This is the datasheet’s Power = Current * BusVoltage / 20000. The power register is unsigned, so the magnitude of the current is used.

§Arguments

  • current - the signed current register.
  • bus - the bus voltage register.

§Returns

The power register the chip would hold.