/* * DiscreteOutput_DoublePin.cpp * * Created on: 3 δεκ. 2018 γ. * Author: titov */ #include "DiscreteOutput_DoublePin.hh" driver::detail::DiscreteOutput_DoublePin::DiscreteOutput_DoublePin( peripheral::IGpio & one, bool active_one, peripheral::IGpio & two, bool active_two ) : one(one), two(two), active_one(active_one), active_two(active_two) {} void driver::detail::DiscreteOutput_DoublePin::on() { one.write( active_one ); two.write( active_two ); } void driver::detail::DiscreteOutput_DoublePin::off() { two.write( not active_two ); one.write( not active_one ); } bool driver::detail::DiscreteOutput_DoublePin::isCompleted() const { return one.read() == active_one and two.read() == active_two; }