45 lines
866 B
C++
45 lines
866 B
C++
/*
|
||
* DiscreteOutputDelayed.h
|
||
*
|
||
* Created on: 12 янв. 2018 г.
|
||
* 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_ */
|