48 lines
1.2 KiB
C++
48 lines
1.2 KiB
C++
/*
|
|
* SpiBusSetup.h
|
|
*
|
|
* Created on: 24 èþí. 2019 ã.
|
|
* Author: user
|
|
*/
|
|
|
|
#ifndef SOURCE_APPLICATION__BOARD_SPIBUSSETUP_H_
|
|
#define SOURCE_APPLICATION__BOARD_SPIBUSSETUP_H_
|
|
|
|
#include "../ISetupStep.hh"
|
|
|
|
#include "../../peripheral/ISerialPort.hh"
|
|
#include "../../peripheral/ISerialPortConfigurator.hh"
|
|
|
|
namespace application { namespace virtualization {
|
|
|
|
//!Ìíîãîàáîíåíòíàÿ êîîïåðàòèâíàÿ øèíà SPI.
|
|
struct SpiBus : public ISetupStep {
|
|
|
|
peripheral::ISerialPort * serial_port = nullptr;
|
|
peripheral::ISerialPortConfigurator * serial_port_configurator = nullptr;
|
|
|
|
bool input( Environment & env );
|
|
void build( Environment & env );
|
|
|
|
struct Links {
|
|
Environment::Id spi_port; //!<Èíòåðôåéñ ïîðòà SPI.
|
|
Environment::Id spi_config; //!<Èíòåðôåéñ íàñòðîéêè ïîðòà SPI.
|
|
Environment::Id spi_bus; //!<Øèíà SPI.
|
|
};
|
|
|
|
struct Setting {
|
|
uint32_t abonent_quantity; //!<Ìàêñèìàëüíîå êîëè÷åñòâî àáîíåíòîâ spi øèíû.
|
|
};
|
|
|
|
const Links & links;
|
|
const Setting & config;
|
|
|
|
SpiBus( const Links & links, const Setting & setting );
|
|
|
|
};
|
|
|
|
} /* namespace board */
|
|
} /* namespace application */
|
|
|
|
#endif /* SOURCE_APPLICATION_BOARD_SPIBUSSETUP_H_ */
|