MotorControlModuleSDFM_TMS3.../Projects/EFC_Application/UMLibrary/driver/DiscreteOutputDelayed.hh

45 lines
862 B
C++
Raw Permalink Normal View History

/*
* DiscreteOutputDelayed.h
*
* Created on: 12 <EFBFBD><EFBFBD><EFBFBD>. 2018 <EFBFBD>.
* Author: titov
*/
#ifndef SOURCE_DRIVER_DISCRETEOUTPUTDELAYED_H_
#define SOURCE_DRIVER_DISCRETEOUTPUTDELAYED_H_
#include "IDiscreteOutput.hh"
#include "../peripheral/IGpio.hh"
#include "../systemic/Timer.hh"
namespace driver { namespace detail {
/*! \brief
* \details
*
*/
class DiscreteOutputDelayed : public IDiscreteOutput {
private:
const bool active_level;
peripheral::IGpio & gpio_pin;
systemic::Timer timer_completed;
const unsigned int timeout;
bool prev_state_on;
public:
void on();
void off();
bool isCompleted() const;
DiscreteOutputDelayed(peripheral::IGpio & gpio_pin, bool active_level, unsigned int timeout_in_ms );
virtual ~DiscreteOutputDelayed() noexcept;
};
} }
#endif /* SOURCE_DRIVER_DISCRETEOUTPUTDELAYED_H_ */