35 lines
580 B
C++
35 lines
580 B
C++
/*
|
||
* DiscreteOutput_OnePin.cpp
|
||
*
|
||
* Created on: 3 дек. 2018 г.
|
||
* Author: titov
|
||
*/
|
||
|
||
|
||
#include "DiscreteOutput_OnePin.hh"
|
||
|
||
driver::detail::DiscreteOutput_OnePin::DiscreteOutput_OnePin(
|
||
peripheral::IGpio & one, bool active_one ) :
|
||
one(one), active_one(active_one) {}
|
||
|
||
void driver::detail::DiscreteOutput_OnePin::on() {
|
||
|
||
one.write( active_one );
|
||
|
||
}
|
||
|
||
void driver::detail::DiscreteOutput_OnePin::off() {
|
||
|
||
one.write( not active_one );
|
||
|
||
}
|
||
|
||
bool driver::detail::DiscreteOutput_OnePin::isCompleted() const {
|
||
|
||
return one.read() == active_one;
|
||
|
||
}
|
||
|
||
|
||
|