Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: PowerControl.h
- 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