50 lines
1.6 KiB
C++
50 lines
1.6 KiB
C++
/*
|
||
* DiscreteOutputDelayedCompletion.hh
|
||
*
|
||
* Created on: 6 окт. 2020 г.
|
||
* Author: LeonidTitov
|
||
*/
|
||
|
||
#ifndef UMLIBRARY_APPLICATION_DRIVERS_DISCRETEOUTPUTDELAYEDCOMPLETION_HH_
|
||
#define UMLIBRARY_APPLICATION_DRIVERS_DISCRETEOUTPUTDELAYEDCOMPLETION_HH_
|
||
|
||
#include "../ISetupStep.hh"
|
||
|
||
#include "../../peripheral/IGpio.hh"
|
||
#include "../../driver/IDiscreteOutput.hh"
|
||
|
||
#include <exception>
|
||
|
||
namespace application { namespace board {
|
||
|
||
//!Дискретный выход на основе аппаратного вывода, с таймаутов ожидания переключения.
|
||
struct DiscreteOutputDelayedCompletion : public ISetupStep {
|
||
|
||
typedef peripheral::IGpio IGpio;
|
||
typedef driver::IDiscreteOutput IDiscreteOutput;
|
||
|
||
IGpio * pin = nullptr;
|
||
|
||
bool input( Environment & env );
|
||
void build( Environment & env );
|
||
|
||
struct Links {
|
||
Environment::GpioId pin; //!<Вывод в режиме дискретного выхода.
|
||
Environment::Id discrete_output; //!<Дискретный выход.
|
||
};
|
||
|
||
struct Setting {
|
||
float complite_timeout; //!<Таймаут ожидания завершения переключения.
|
||
bool activation_level; //!<Уровень аппаратного вывода, соотвествующий активации дискретного выхода.
|
||
};
|
||
|
||
const Links & links;
|
||
const Setting & config;
|
||
|
||
DiscreteOutputDelayedCompletion( const Links & links, const Setting & config ) : links(links), config(config) {}
|
||
};
|
||
|
||
}}
|
||
|
||
#endif /* UMLIBRARY_APPLICATION_DRIVERS_DISCRETEOUTPUTDELAYEDCOMPLETION_HH_ */
|