Start implementation of sensors wrapper, rename files and classes, sort usings

This commit is contained in:
2022-08-02 23:11:01 +02:00
parent 1da0844ae8
commit f7bd651121
8 changed files with 63 additions and 8 deletions

39
app/include/Pwm.h Normal file
View File

@@ -0,0 +1,39 @@
#ifndef PWM_H_
#define PWM_H_
#include <string>
#include <unordered_map>
#include <vector>
enum class PWM_CONTROL_PROPERTY { CONTROL, ENABLE, MODE };
struct PWM_CONTROL {
std::string control;
std::string enable;
std::string mode;
std::string initialEnable;
std::string initialMode;
};
enum class PWM_ENABLE { FULL_SPEED = 0, MANUAL_CONTROL };
enum class PWM_MODE { DC = 0, PWM };
class PWM {
public:
PWM();
void dumpValues();
std::vector<PWM_CONTROL> getControls();
int readValue(PWM_CONTROL control, PWM_CONTROL_PROPERTY property);
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_