Niels Leijen / PowerControl
Revision:
2:1e3291e8294d
Parent:
0:f7568c04c1c3
Child:
3:54792b95c570
--- a/PowerControl.h	Wed May 10 18:45:38 2017 +0000
+++ b/PowerControl.h	Fri May 12 20:19:17 2017 +0000
@@ -1,7 +1,12 @@
-#ifndef POWER_H
-#define POWER_H
+#ifndef POWERCONTROL_H
+#define POWERCONTROL_H
 
 #include "mbed.h"
+// include 3rd party library
+#include "PinDetect.h"
+// include own libraries
+#include "pinout.h"
+#include "CanControl.h"
 
 /** Power class
  *  Used to control the buck converters
@@ -10,18 +15,31 @@
 {
     public:
     /** Create PowerControl instance
-    @param greenButton
-    @param redButton
+    @param Button
     */
-    PowerControl(PinName greenButton, PinName redButton);
+    PowerControl(PinName button);
     
     private:
-     /** goSleep
-     sleep
+    /** goSleep
+    Disables all the buck converters and sends a CAN message to deactivate relay
     */
     void goSleep(void);
     
-    InterruptIn _greenButton;
-    InterruptIn _redButton;
+    /** goWakeup
+    Enables all the buck converters and sends a CAN message to activate relay
+    */
+    void goWakeup(void);
+    
+    /** Returns the status of the Canbus
+    1 = enabled, 0 = disabled
+    */
+    bool status(void){return enabled;}
+    
+    PinDetect _button;
+    CanControl _canControl;
+    bool enabled;
 };
-#endif //POWER_H
\ No newline at end of file
+
+
+    
+#endif //POWERCONTROL_H
\ No newline at end of file