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

45 lines
866 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.

/*
* 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_ */