Add function to convert from linear format
The average and maximum power values are returned from the
power supply in Watts specified in linear format. The values
must be converted from linear format to be useful. The value
will be converted to an integer, keeping the units as Watts.
Linear format is a 16 bit value made up of 5 bits of exponent
followed by 11 bits of mantissa, where the value is:
X = mantissa * 2^exponent
These values are specified as two's complement, and technically
may be negative, though there isn't really a reason for a power
supply to specify negative power values. The code will support
them anyway for completeness, and to be helpful to future code
that may need to for sure.
Change-Id: I2cde529ed4355e173c8a3ecff2865f2c350ad61e
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
2 files changed