10#ifndef SEMF_OUTPUT_SOFTPWM_H_
11#define SEMF_OUTPUT_SOFTPWM_H_
44 unsigned int maxValue()
const override;
45 void set(
unsigned int value,
bool inverted =
false)
override;
46 unsigned int value()
const override;
47 void start()
override;
66 bool checkForConstantSetting();
73 SEMF_SLOT(m_startOnTimeSlot,
SoftPwm, *
this, startOnTime);
75 SEMF_SLOT(m_startOffTimeSlot,
SoftPwm, *
this, startOffTime);
77 unsigned int m_pwmValue = 0;
79 unsigned int m_maxValue = std::numeric_limits<unsigned int>::max();
Class for handling a digital output.
Interface class for using a GPIO pin of the microcontroller.
Class to interface pwm's hardware module of the microcontroller.
The SoftPwm class outputs a PWM signal on the given GPIO.
SoftPwm(const SoftPwm &other)=delete
virtual ~SoftPwm()=default
unsigned int value() const override
Returns the current PWM value.
unsigned int maxValue() const override
Returns the maximum possible PWM value.
void setMaxValue(unsigned int maxValue) override
Set the maximum possible PWM value.
void set(unsigned int value, bool inverted=false) override
Set a PWM value. Duty cycle is value / maxValue.
bool isEnabled() const override
Returns the current status of PWM module.
SoftPwm(Gpio &output, app::TimeBase &timebase, bool inverted=false)
Constructor.
Software SoftwareTimer which can be added to a TimeBase or used singular.
A TimeBase is the bridge between e.g. a hardware timer (interrupt service routine) and TickReceiver o...