semf
leddimming.h
Go to the documentation of this file.
1
10#ifndef SEMF_APP_OUTPUT_LEDDIMMING_H_
11#define SEMF_APP_OUTPUT_LEDDIMMING_H_
12
13#include <semf/app/output/led.h>
14
15namespace semf
16{
17namespace app
18{
34class LedDimming : public Led
35{
36public:
38 enum class Mode : uint8_t
39 {
40 Off = 0, //<! Led is off.
41 On, //<! Led is on.
42 Blinking, //<! Led is blinking.
43 Sine, //<! Led is visualizing a sine function.
44 Triangule //<! Led is visualizing a triangle function.
45 };
46
47 virtual ~LedDimming() = default;
48
56 virtual void setBrightness(uint16_t maxBrightness) = 0;
66 virtual void setBrightness(uint16_t minBrightness, uint16_t maxBrightness) = 0;
77 virtual void setBlinking(unsigned int onOffTime) = 0;
89 virtual void setBlinking(unsigned int onTime, unsigned int offTime) = 0;
105 virtual void setSine(unsigned int periodInTimeBaseTicks, unsigned int startIndexInTimeBaseTicks) = 0;
113 virtual void setSine(unsigned int periodInTimeBaseTicks) = 0;
128 virtual void setTriangle(unsigned int periodInTimeBaseTicks, unsigned int startIndexInTimeBaseTicks) = 0;
136 virtual void setTriangle(unsigned int periodInTimeBaseTicks) = 0;
141 virtual Mode mode() const = 0;
142};
143} /* namespace app */
144} /* namespace semf */
145#endif /* SEMF_APP_OUTPUT_LEDDIMMING_H_ */
This class uses PwmOut and a SoftwareTimer in order to generate different waveforms....
Definition: leddimming.h:35
virtual void setBrightness(uint16_t minBrightness, uint16_t maxBrightness)=0
Sets the minimum and maximum brightness of the LED.
virtual void setBrightness(uint16_t maxBrightness)=0
Sets the maximum brightness of the LED.
virtual void setSine(unsigned int periodInTimeBaseTicks)=0
Starts showing a sine waveform on the led.
virtual void setTriangle(unsigned int periodInTimeBaseTicks)=0
Starts showing a triangle waveform on the led. Maximal brightness can be set by setBrightness functio...
virtual void setBlinking(unsigned int onOffTime)=0
Start blinking the led with the same on-off time.
virtual Mode mode() const =0
Returns the active mode of the led.
virtual void setTriangle(unsigned int periodInTimeBaseTicks, unsigned int startIndexInTimeBaseTicks)=0
Starts showing a triangle waveform on the led.
virtual void setBlinking(unsigned int onTime, unsigned int offTime)=0
Starts blinking the led with different on and off time.
virtual void setSine(unsigned int periodInTimeBaseTicks, unsigned int startIndexInTimeBaseTicks)=0
Starts showing a sine waveform on the led.
virtual ~LedDimming()=default
Interface for all Led classes.
Definition: led.h:23