semf
pwm.h
Go to the documentation of this file.
1
10#ifndef SEMF_OUTPUT_PWM_H_
11#define SEMF_OUTPUT_PWM_H_
12
15#include <cstdint>
16
17namespace semf
18{
22class Pwm
23{
24public:
25 virtual ~Pwm() = default;
26
31 virtual void setMaxValue(unsigned int maxValue) = 0;
36 virtual unsigned int maxValue() const = 0;
42 virtual void set(unsigned int value, bool inverted = false) = 0;
47 virtual unsigned int value() const = 0;
49 virtual void start() = 0;
51 virtual void stop() = 0;
57 virtual bool isEnabled() const = 0;
58
61};
62} /* namespace semf */
63#endif /* SEMF_OUTPUT_PWM_H_*/
Class to interface pwm's hardware module of the microcontroller.
Definition: pwm.h:23
virtual void start()=0
virtual unsigned int value() const =0
Returns the current PWM value.
virtual void set(unsigned int value, bool inverted=false)=0
Set a PWM value. Duty cycle is value / maxValue.
virtual bool isEnabled() const =0
Returns the current status of PWM module.
virtual void stop()=0
virtual void setMaxValue(unsigned int maxValue)=0
Set the maximum possible PWM value.
Signal< Error > error
Definition: pwm.h:60
virtual ~Pwm()=default
virtual unsigned int maxValue() const =0
Returns the maximum possible PWM value.
Signal for lightweight signal/slot implementation. One signal can be connected to multiple slots and ...
Definition: signal.h:41