Files
fantasize/app/include/pwm/PWMControl.h

41 lines
795 B
C++

#ifndef PWMCONTROL_H_
#define PWMCONTROL_H_
#include <boost/json/object.hpp>
#include <string>
#include <Printable.h>
#include <Serializable.h>
enum class PWM_CONTROL_PROPERTY { CONTROL, ENABLE, MODE };
enum class PWM_ENABLE { FULL_SPEED = 0, MANUAL_CONTROL };
enum class PWM_MODE { DC = 0, PWM };
class PWMControl : public Printable, public Serializable {
public:
PWMControl(std::string controlPath);
~PWMControl();
void Power(int percent);
int Power();
void EnableManualControl();
void Reset();
const std::string toString() const override;
json toJson() const override;
private:
int mCurrentValue;
std::string mControlPath;
std::string mEnablePath;
std::string mModePath;
std::string mInitialEnable;
std::string mInitialMode;
};
#endif // PWMCONTROL_H_