73 lines
2.1 KiB
C++
73 lines
2.1 KiB
C++
/*
|
||
* Amc1210ManageableReader.hh
|
||
*
|
||
* Created on: 12 окт. 2020 г.
|
||
* Author: LeonidTitov
|
||
*/
|
||
|
||
#ifndef UMLIBRARY_DRIVER_CHIPSET_AMC1210MANAGEABLEREADER_HH_
|
||
#define UMLIBRARY_DRIVER_CHIPSET_AMC1210MANAGEABLEREADER_HH_
|
||
|
||
#include "../../peripheral/ISerialPort.hh"
|
||
|
||
#include "../../driver/IResolver.hh"
|
||
#include "../../systemic/IProcess.hh"
|
||
|
||
#include "AMC1210.hh"
|
||
|
||
#include "Amc1210SerialPortAdapter.hh"
|
||
|
||
#include "stdint.h"
|
||
#include <cstddef>
|
||
|
||
namespace driver { namespace detail {
|
||
|
||
class Amc1210ManageableReader : public driver::IResolver, public systemic::IProcess {
|
||
public:
|
||
|
||
float getSinChannel() const;
|
||
float getCosChannel() const;
|
||
|
||
Amc1210ManageableReader( peripheral::ISerialPort & con,
|
||
driver::chipset::AMC1210::Packager::Frame request_data,
|
||
std::size_t data_frame_size,
|
||
driver::chipset::AMC1210::Packager::Frame request_info,
|
||
std::size_t info_frame_size,
|
||
unsigned short sin_channel_offset,
|
||
unsigned short cos_channel_offset,
|
||
uint16_t channel_mask );
|
||
|
||
void process();
|
||
|
||
const bool & fault() const;
|
||
|
||
private:
|
||
peripheral::ISerialPort & connection; //!<Последовательный порт подключения к amc1210.
|
||
|
||
bool read_info = false;
|
||
bool read_data = false;
|
||
bool wait_data = false; //!<Признак ожидания данных.
|
||
bool modulator_fault = false;
|
||
|
||
float sin_code = 0.0f;
|
||
float cos_code = 0.0f;
|
||
|
||
const driver::chipset::AMC1210::Packager::Frame request_data;
|
||
const std::size_t data_frame_size;
|
||
|
||
const driver::chipset::AMC1210::Packager::Frame request_info;
|
||
const std::size_t info_frame_size;
|
||
|
||
const unsigned short sin_channel_offset;
|
||
const unsigned short cos_channel_offset;
|
||
|
||
const uint16_t channel_mask;
|
||
|
||
volatile uint16_t modulator_state;
|
||
volatile uint16_t ack_data_state;
|
||
};
|
||
|
||
}}
|
||
|
||
#endif /* UMLIBRARY_DRIVER_CHIPSET_AMC1210MANAGEABLEREADER_HH_ */
|