semf
semf::DigitalOut Class Reference

Class for handling a digital output. More...

#include <digitalout.h>

Inheritance diagram for semf::DigitalOut:
Inheritance graph
Collaboration diagram for semf::DigitalOut:
Collaboration graph

Public Member Functions

 DigitalOut (Gpio &gpio, bool inverted=false)
 Constructor. More...
 
 DigitalOut (const DigitalOut &other)=delete
 
void setInverted (bool inverted) override
 Configures the inversion of the output. More...
 
void set (State state=High) override
 Sets the output level of a GPIO pin. More...
 
void reset () override
 
void toggle () override
 
State state () const override
 Gets the present/current state of a GPIO pin. More...
 
- Public Member Functions inherited from semf::app::DigitalOut
virtual ~DigitalOut ()=default
 
virtual void setInverted (bool inverted)=0
 Configures the inversion of the output. More...
 
virtual void set (State state=High)=0
 Sets the output level of a GPIO pin. More...
 
virtual void reset ()=0
 
virtual void toggle ()=0
 
virtual State state () const =0
 Gets the present/current state of a GPIO pin. More...
 

Additional Inherited Members

- Public Types inherited from semf::app::DigitalOut
enum  State : bool { Low = false , High = true }
 

Detailed Description

Class for handling a digital output.

Definition at line 21 of file digitalout.h.

Constructor & Destructor Documentation

◆ DigitalOut() [1/2]

semf::DigitalOut::DigitalOut ( Gpio gpio,
bool  inverted = false 
)
explicit

Constructor.

Parameters
gpioGPIO interface object for hardware access.
invertedtrue sets high level of a pin as low and low level of a pin as high.

Definition at line 15 of file digitalout.cpp.

◆ DigitalOut() [2/2]

semf::DigitalOut::DigitalOut ( const DigitalOut other)
explicitdelete

Member Function Documentation

◆ reset()

void semf::DigitalOut::reset ( )
overridevirtual

Sets low level of a GPIO pin.

Implements semf::app::DigitalOut.

Definition at line 57 of file digitalout.cpp.

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

◆ set()

void semf::DigitalOut::set ( State  state = High)
overridevirtual

Sets the output level of a GPIO pin.

Parameters
stateThe new output level of a GPIO pin.
Note
Default is High.

Implements semf::app::DigitalOut.

Definition at line 27 of file digitalout.cpp.

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

◆ setInverted()

void semf::DigitalOut::setInverted ( bool  inverted)
overridevirtual

Configures the inversion of the output.

Parameters
invertedtrue sets high level of a pin as low and a low level of a pin as high.

Implements semf::app::DigitalOut.

Definition at line 21 of file digitalout.cpp.

Here is the caller graph for this function:

◆ state()

app::DigitalOut::State semf::DigitalOut::state ( ) const
overridevirtual

Gets the present/current state of a GPIO pin.

Returns
Present/current state of a GPIO pin.

Implements semf::app::DigitalOut.

Definition at line 68 of file digitalout.cpp.

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

◆ toggle()

void semf::DigitalOut::toggle ( )
overridevirtual

Toggles the output of a GPIO pin.

Implements semf::app::DigitalOut.

Definition at line 62 of file digitalout.cpp.

Here is the call graph for this function: