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
tree: 24acba297b970d7128201b4bfcd5bee39f2ea08e
  1. org/
  2. power-sequencer/
  3. power-supply/
  4. test/
  5. .gitignore
  6. argument.hpp
  7. bootstrap.sh
  8. configure.ac
  9. device.hpp
  10. device_monitor.hpp
  11. elog-errors.hpp
  12. event.hpp
  13. file.hpp
  14. gpio.cpp
  15. gpio.hpp
  16. LICENSE
  17. Makefile.am
  18. names_values.hpp
  19. pmbus.cpp
  20. pmbus.hpp
  21. README.md
  22. timer.cpp
  23. timer.hpp
  24. utility.cpp
  25. utility.hpp
README.md

Code for detecting and analyzing power faults on Witherspoon.

To Build

To build this package, do the following steps:

    1. ./bootstrap.sh
    2. ./configure ${CONFIGURE_FLAGS}
    3. make

To full clean the repository again run `./bootstrap.sh clean`.