power: bcl_peripheral: Update ibat and vbat formula
Update the formula to calculate ibat and vbat. This
was required since the threshold was trigger by an
offset of 200 mV to 300 mV. Basically improve the
accuracy by 200-300mV. Below is the new calculation.
vbat = (vbat_raw * 39000) * (100 + v_gain * 32 / 128) / 100
vbat_raw = (vbat * 100 / ( 100 + v_gain * 32 / 128 )) / 39000
ibat = (ibat_raw * 39000 + i_offset * 1200) *
(100 + i_gain * 32 / 128) / 100
ibat_raw = (ibat * 100 / ( 100 + i_gain * 32 / 128 ) -
i_offset * 1200) / 39000
Change-Id: I7af772e20de09b9a0767d217c0424be9a75d89c4
Signed-off-by:
Shiju Mathew <shijum@codeaurora.org>
Loading
Please register or sign in to comment