supla-device
Toggle main menu visibility
Loading...
Searching...
No Matches
src
supla
control
pin_status_led.h
1
/*
2
Copyright (C) AC SOFTWARE SP. Z O.O.
3
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU General Public License
6
as published by the Free Software Foundation; either version 2
7
of the License, or (at your option) any later version.
8
This program is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15
*/
16
17
#ifndef SRC_SUPLA_CONTROL_PIN_STATUS_LED_H_
18
#define SRC_SUPLA_CONTROL_PIN_STATUS_LED_H_
19
20
#include "../element.h"
21
#include "../io.h"
22
23
namespace
Supla {
24
25
namespace
Io {
26
class
Base
;
27
}
28
29
namespace
Control {
30
class
PinStatusLed :
public
Element {
31
public
:
32
explicit
PinStatusLed(
Supla::Io::IoPin
srcPin,
Supla::Io::IoPin
outPin);
33
explicit
PinStatusLed(
Supla::Io::IoPin
srcPin,
34
Supla::Io::IoPin
outPin,
35
bool
invert);
36
PinStatusLed(
Supla::Io::Base
*ioSrc,
37
Supla::Io::Base
*ioOut,
38
uint8_t srcPin,
39
uint8_t outPin,
40
bool
invert =
false
);
41
PinStatusLed(uint8_t srcPin, uint8_t outPin,
bool
invert =
false
);
42
43
void
onInit
()
override
;
44
void
iterateAlways
()
override
;
45
void
onTimer
()
override
;
46
47
void
setInvertedLogic(
bool
invertedLogic);
48
void
setWorkOnTimer(
bool
workOnTimer);
49
50
protected
:
51
void
updatePin();
52
53
Supla::Io::IoPin
srcPin;
54
Supla::Io::IoPin
outPin;
55
bool
workOnTimer =
false
;
56
};
57
58
}
// namespace Control
59
}
// namespace Supla
60
61
#endif
// SRC_SUPLA_CONTROL_PIN_STATUS_LED_H_
Supla::Control::PinStatusLed::onInit
void onInit() override
Third method called on element in SuplaDevice.begin().
Definition
pin_status_led.cpp:51
Supla::Control::PinStatusLed::onTimer
void onTimer() override
Method called on timer interupt.
Definition
pin_status_led.cpp:62
Supla::Control::PinStatusLed::iterateAlways
void iterateAlways() override
Method called on each SuplaDevice iteration.
Definition
pin_status_led.cpp:56
Supla::Io::Base
Definition
io.h:36
Supla::Io::IoPin
Definition
io_pin.h:28
Generated by
1.17.0