Fill in voltage fault checking code

Fill in the code to check for a voltage fault.  This is where
the power sequencer device detects that one of its child
devices has a bad voltage.  A separate error log will be created
for each voltage rail that has a fault.  Each rail will only have
an error logged against it once for the lifetime of the object.

There will be support documentation that maps the failing rail
name to the hardware that the rail corresponds to.

Change-Id: I13380b9898613bf8e76d66a72e1fbe005f816dad
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/power-sequencer/ucd90160.hpp b/power-sequencer/ucd90160.hpp
index 6457396..8bb152b 100644
--- a/power-sequencer/ucd90160.hpp
+++ b/power-sequencer/ucd90160.hpp
@@ -88,6 +88,54 @@
         void createPowerFaultLog();
 
         /**
+         * Reads the status_word register
+         *
+         * @return uint16_t - the register contents
+         */
+        uint16_t readStatusWord();
+
+        /**
+         * Reads the mfr_status register
+         *
+         * @return uint32_t - the register contents
+         */
+        uint32_t readMFRStatus();
+
+        /**
+         * Says if we've already logged a Vout fault
+         *
+         * The policy is only 1 of the same error will
+         * be logged for the duration of a class instance.
+         *
+         * @param[in] page - the page to check
+         *
+         * @return bool - if we've already logged a fault against
+         *                this page
+         */
+        inline bool isVoutFaultLogged(uint32_t page) const
+        {
+            return std::find(voutErrors.begin(),
+                             voutErrors.end(),
+                             page) != voutErrors.end();
+        }
+
+        /**
+         * Saves that a Vout fault has been logged
+         *
+         * @param[in] page - the page the error was logged against
+         */
+        inline void setVoutFaultLogged(uint32_t page)
+        {
+            voutErrors.push_back(page);
+        }
+
+        /**
+         * List of pages that Vout errors have
+         * already been logged against
+         */
+        std::vector<uint32_t> voutErrors;
+
+        /**
          * The read/write interface to this hardware
          */
         pmbus::PMBus interface;