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

68 lines
2.3 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.

/*!\file
* \brief \todo Описание файла.
*/
/*
* SlipCommunicationSetup.h
*
* Created on: 13 июн. 2019 г.
* Author: titov
*/
#ifndef SOURCE_APPLICATION_SERVICE_SLIPCOMMUNICATIONSETUP_H_
#define SOURCE_APPLICATION_SERVICE_SLIPCOMMUNICATIONSETUP_H_
#include "../ISetupStep.hh"
#include "../../peripheral/IUartPort.hh"
#include "../../peripheral/IGpio.hh"
#include "../../systemic/ISignal.hh"
#include "../../systemic/IStatus.hh"
#include <exception>
namespace application { namespace board {
struct SlipCommunicationSetup : public ISetupStep {
typedef systemic::ISignal ISignal;
typedef systemic::IStatus IStatus;
peripheral::IGpio * re = nullptr;
peripheral::IGpio * de = nullptr;
peripheral::IUartPort * port = nullptr;
ISignal* mpSigAddrBus = NULL;//
IStatus* mpStsAddrValid = NULL;//
bool input( Environment & env );
void build( Environment & env );
struct Links {
uint16_t uart_id; //!<Интерфейс Uart.
Environment::GpioId gpio_de_id; //!<Вывод управление приемо-передатчиком: DE.
Environment::GpioId gpio_re_id; //!<Вывод управление приемо-передатчиком: RE.
Environment::SignalId address_bus_id;//!< Cистемный идентификатор cигнала содержащий значение(дип-переключатели) адреса на шине
Environment::StatusId address_valid_id;//!< Cистемный идентификатор статуса готовности значения с дип-переключателей
uint16_t slip_com_id; //!<Протокол SlipCommuncation.
};
const Links & links;
struct Setting {
unsigned short address;//!< Адрес на шине (если == 0 то адрес определяется links.sigAddr)
bool active_de; //!<Активный уровень вывода управления DE.
bool active_re; //!<Активный уровень вывода управления RE.
};
const Setting & cfg;
const configuration::ProcessConfig & params;
SlipCommunicationSetup( const Links & links, const Setting & hardware, const configuration::ProcessConfig & proc );
};
}}
#endif /* SOURCE_APPLICATION_SERVICE_SLIPCOMMUNICATIONSETUP_H_ */