Initial commit
This commit is contained in:
30
app/include/pwm.h
Normal file
30
app/include/pwm.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef PWM_H_
|
||||
#define PWM_H_
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
typedef struct {
|
||||
std::string control;
|
||||
std::string enable;
|
||||
std::string mode;
|
||||
} PWM_CONTROL;
|
||||
|
||||
typedef enum { FULL_SPEED = 0, MANUAL_CONTROL, AUTOMATIC } PWM_ENABLE;
|
||||
typedef enum { DC = 0, PWM } PWM_MODE;
|
||||
|
||||
class PWM {
|
||||
public:
|
||||
PWM();
|
||||
void dumpValues();
|
||||
|
||||
void setEnable(PWM_CONTROL control, PWM_ENABLE value);
|
||||
void setMode(PWM_CONTROL control, PWM_MODE mode);
|
||||
void setValuePwm(PWM_CONTROL control, int pwm);
|
||||
void setValuePercent(PWM_CONTROL control, int percentage);
|
||||
|
||||
private:
|
||||
std::unordered_map<std::string, PWM_CONTROL> mPwmControls;
|
||||
};
|
||||
|
||||
#endif // PWM_H_
|
||||
Reference in New Issue
Block a user