50 lines
1.4 KiB
C++
50 lines
1.4 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_ */
|