18 lines
336 B
C++
18 lines
336 B
C++
/*
|
||
* DiscreteInput.cpp
|
||
*
|
||
* Created on: 1 дек. 2016 г.
|
||
* Author: titov
|
||
*/
|
||
|
||
#include "DiscreteInput.hh"
|
||
|
||
using driver::detail::DiscreteInput;
|
||
|
||
DiscreteInput::DiscreteInput(const peripheral::IGpio & gpio, bool _level) :
|
||
input(gpio), level(_level) {}
|
||
|
||
DiscreteInput::operator bool() const {
|
||
return input.read() == level;
|
||
}
|