semf
pwmout.h
Go to the documentation of this file.
1
10#ifndef SEMF_APP_OUTPUT_PWMOUT_H_
11#define SEMF_APP_OUTPUT_PWMOUT_H_
12
13#include <semf/output/pwm.h>
14#include <cstdint>
15#include <cstddef>
16
17namespace semf
18{
19namespace app
20{
24class PwmOut
25{
26public:
27 virtual ~PwmOut() = default;
28
33 virtual void enable(bool enable = true) = 0;
38 virtual void disable(bool disable = true) = 0;
43 virtual bool isEnabled() const = 0;
48 virtual void start() = 0;
53 virtual void stop() = 0;
58 virtual void setValue(uint32_t pwm) = 0;
63 virtual uint32_t value() const = 0;
70 virtual void setPermille(uint16_t pwm) = 0;
77 virtual uint16_t permille() const = 0;
82 virtual void setMaxValue(uint32_t pwm) = 0;
88 virtual uint32_t maxValue() const = 0;
96 virtual void setInverted(bool inverted) = 0;
97};
98} /* namespace app */
99} /* namespace semf */
100#endif /* SEMF_APP_OUTPUT_PWMOUT_H_ */
Class for using a PWM as an output with permille value handling.
Definition: pwmout.h:25
virtual void enable(bool enable=true)=0
Enables / disable the PWM output.
virtual ~PwmOut()=default
virtual void stop()=0
Disable the PWM.
virtual uint32_t value() const =0
Returns the current PWM value.
virtual uint16_t permille() const =0
Returns the current PWM value in permille. The PWM value is calculated based on the set maximum value...
virtual void setPermille(uint16_t pwm)=0
Set the PWM value in permille. The pwm value is calculated based on the set maximum value.
virtual void disable(bool disable=true)=0
Enables / disable the PWM output.
virtual void setMaxValue(uint32_t pwm)=0
Set the maximum value for the PWM.
virtual bool isEnabled() const =0
Current status of the PWM module.
virtual uint32_t maxValue() const =0
Returns the maximum possible PWM value.
virtual void setInverted(bool inverted)=0
To configure whether the PWM should be inverted. This configuration does not become active until the ...
virtual void setValue(uint32_t pwm)=0
Change the PWM value.
virtual void start()=0
Enables the PWM.