30 #define PWM_PATH "/sys/devices/ocp.3/"
31 #define PWM_PERIOD "period"
32 #define PWM_DUTY "duty"
33 #define PWM_POLARITY "polarity"
49 float analogFrequency;
55 virtual int setPeriod(
unsigned int period_ns);
78 float period_nsToFrequency(
unsigned int);
79 unsigned int frequencyToPeriod_ns(
float);
virtual void invertPolarity()
Definition: PWM.cpp:90
virtual float getFrequency()
Definition: PWM.cpp:60
virtual ~PWM()
Definition: PWM.cpp:127
virtual PWM::POLARITY getPolarity()
Definition: PWM.cpp:95
A class to control a basic PWM output – you must know the exact sysfs filename for the PWM output...
Definition: PWM.h:43
virtual int stop()
Definition: PWM.cpp:123
virtual void setAnalogFrequency(float frequency_hz)
Definition: PWM.h:68
virtual int setDutyCycle(unsigned int duration_ns)
Definition: PWM.cpp:64
virtual int setFrequency(float frequency_hz)
Definition: PWM.cpp:56
virtual unsigned int getPeriod()
Definition: PWM.cpp:42
virtual int setPeriod(unsigned int period_ns)
Definition: PWM.cpp:38
virtual unsigned int getDutyCycle()
Definition: PWM.cpp:76
Definition: BusDevice.cpp:27
virtual int analogWrite(float voltage)
Definition: PWM.cpp:106
virtual int run()
Definition: PWM.cpp:114
virtual float getDutyCyclePercent()
Definition: PWM.cpp:80
virtual int setPolarity(PWM::POLARITY)
Definition: PWM.cpp:86
PWM(string pinName)
Definition: PWM.cpp:31
virtual int calibrateAnalogMax(float analogMax)
Definition: PWM.cpp:100
virtual bool isRunning()
Definition: PWM.cpp:118
POLARITY
Definition: PWM.h:45