semf
semf::LedBlinking Class Reference

Interface for a blinking led class. More...

#include <ledblinking.h>

Inheritance diagram for semf::LedBlinking:
Inheritance graph
Collaboration diagram for semf::LedBlinking:
Collaboration graph

Public Member Functions

 LedBlinking (Gpio &ledPin, app::TimeBase &timebase, bool inverted=false)
 Constructor. More...
 
 LedBlinking (const LedBlinking &other)=delete
 
void setOn () override
 
void setOff () override
 
void toggle () override
 
void setBlinking (unsigned int onOffTime) override
 Starts blinking the led with the same on and off time. More...
 
void setBlinking (unsigned int onTime, unsigned int offTime) override
 Starts blinking the led with different on and off time. More...
 
Mode mode () const override
 Returns the active mode of the led. More...
 
- Public Member Functions inherited from semf::app::LedBlinking
virtual ~LedBlinking ()=default
 
virtual void setBlinking (unsigned int onOffTime)=0
 Starts blinking the led with the same on and off time. More...
 
virtual void setBlinking (unsigned int onTime, unsigned int offTime)=0
 Starts blinking the led with different on and off time. More...
 
virtual Mode mode () const =0
 Returns the active mode of the led. More...
 
- Public Member Functions inherited from semf::app::Led
virtual ~Led ()=default
 
virtual void setOn ()=0
 
virtual void setOff ()=0
 
virtual void toggle ()=0
 

Additional Inherited Members

- Public Types inherited from semf::app::LedBlinking
enum class  Mode : uint8_t { Off = 0 , On = 1 , Blinking = 2 }
 

Detailed Description

Interface for a blinking led class.

Definition at line 21 of file ledblinking.h.

Constructor & Destructor Documentation

◆ LedBlinking() [1/2]

semf::LedBlinking::LedBlinking ( Gpio ledPin,
app::TimeBase timebase,
bool  inverted = false 
)

Constructor.

Parameters
ledPinLed GPIO.
timebaseTimeBase used for internal SoftwareTimer.
invertedtrue for inverted on / off status of the led.

Definition at line 16 of file ledblinking.cpp.

◆ LedBlinking() [2/2]

semf::LedBlinking::LedBlinking ( const LedBlinking other)
explicitdelete

Member Function Documentation

◆ mode()

LedBlinking::Mode semf::LedBlinking::mode ( ) const
overridevirtual

Returns the active mode of the led.

Returns
Active led mode setting.

Implements semf::app::LedBlinking.

Definition at line 67 of file ledblinking.cpp.

◆ setBlinking() [1/2]

void semf::LedBlinking::setBlinking ( unsigned int  onOffTime)
overridevirtual

Starts blinking the led with the same on and off time.

Parameters
onOffTimeOn and off time.

Implements semf::app::LedBlinking.

Definition at line 49 of file ledblinking.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setBlinking() [2/2]

void semf::LedBlinking::setBlinking ( unsigned int  onTime,
unsigned int  offTime 
)
overridevirtual

Starts blinking the led with different on and off time.

Parameters
onTimeOn time.
offTimeOff time.

Implements semf::app::LedBlinking.

Definition at line 54 of file ledblinking.cpp.

Here is the call graph for this function:

◆ setOff()

void semf::LedBlinking::setOff ( )
overridevirtual

Switch the LED off.

Implements semf::app::Led.

Definition at line 31 of file ledblinking.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setOn()

void semf::LedBlinking::setOn ( )
overridevirtual

Switch the LED on.

Implements semf::app::Led.

Definition at line 22 of file ledblinking.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toggle()

void semf::LedBlinking::toggle ( )
overridevirtual

Toggle the led state.

Implements semf::app::Led.

Definition at line 39 of file ledblinking.cpp.

Here is the call graph for this function: