semf
digitalout.h
Go to the documentation of this file.
1
10#ifndef SEMF_APP_OUTPUT_DIGITALOUT_H_
11#define SEMF_APP_OUTPUT_DIGITALOUT_H_
12
13#include <semf/system/gpio.h>
14#include <cstddef>
15
16namespace semf
17{
18namespace app
19{
24{
25public:
27 enum State : bool
28 {
29 Low = false,
30 High = true
31 };
32
33 virtual ~DigitalOut() = default;
34
39 virtual void setInverted(bool inverted) = 0;
45 virtual void set(State state = High) = 0;
47 virtual void reset() = 0;
49 virtual void toggle() = 0;
54 virtual State state() const = 0;
55};
56} /* namespace app */
57} /* namespace semf */
58#endif /* SEMF_APP_OUTPUT_DIGITALOUT_H_ */
Class for handling a digital output.
Definition: digitalout.h:24
virtual State state() const =0
Gets the present/current state of a GPIO pin.
virtual void setInverted(bool inverted)=0
Configures the inversion of the output.
virtual ~DigitalOut()=default
virtual void reset()=0
virtual void set(State state=High)=0
Sets the output level of a GPIO pin.
virtual void toggle()=0