MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/driver/DiscreteOutput_OnePin.cpp
2024-06-07 11:12:56 +03:00

35 lines
580 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* 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;
}