MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/application/drivers/DiscreteOutputDelayedCompletion.hh
2024-06-07 11:12:56 +03:00

50 lines
1.6 KiB
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.

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