35 lines
576 B
C++
35 lines
576 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;
|
|
|
|
}
|
|
|
|
|
|
|