1 #ifndef _ots_OtsUDPFirmwareCore_h_
2 #define _ots_OtsUDPFirmwareCore_h_
5 #include "otsdaq-components/DAQHardware/FrontEndFirmwareBase.h"
28 virtual void init(
void);
34 virtual std::string write(
char* address,
char* data);
35 virtual void write(std::string& buffer,
38 bool clearBuffer =
true);
39 virtual void write(std::string& buffer,
42 bool clearBuffer =
true);
43 virtual void write(std::string& buffer,
46 bool clearBuffer =
true);
47 virtual void waitClear(std::string& ,
55 virtual std::string read(
char* address);
56 virtual void read(std::string& buffer,
char* address,
bool clearBuffer =
true);
57 virtual void read(std::string& buffer, uint64_t address,
bool clearBuffer =
true);
58 virtual void read(std::string& buffer, uint32_t address,
bool clearBuffer =
true);
60 virtual void setDataDestination(std::string& buffer,
61 const std::string& ip,
63 bool clearBuffer =
true);
65 virtual uint32_t createRegisterFromValue(std::string& readBuffer,
66 std::string& receivedValue);
69 void writeAdvanced(std::string& buffer,
73 uint8_t commandTypeOptions = 0,
74 bool clearBuffer =
true);
75 void writeAdvanced(std::string& buffer,
76 const uint64_t& address,
79 uint8_t commandTypeOptions = 0,
80 bool clearBuffer =
true);
82 void writeAdvanced(std::string& buffer,
83 const uint64_t& address,
85 uint8_t commandTypeOptions = 0,
86 bool clearBuffer =
true);
87 void writeAdvanced(std::string& buffer,
88 const uint64_t& address,
89 const std::vector<uint64_t>& data,
90 uint8_t commandTypeOptions = 0,
91 bool clearBuffer =
true);
92 void readAdvanced(std::string& buffer,
95 uint8_t commandTypeOptions = 0,
96 bool clearBuffer =
true);
97 void readAdvanced(std::string& buffer,
98 const uint64_t& address,
100 uint8_t commandTypeOptions = 0,
101 bool clearBuffer =
true);
107 void writeDataDestinationIP(std::string& buffer,
108 const uint64_t value,
109 bool clearBuffer =
true);
110 void writeDataDestinationMAC(std::string& buffer,
111 const uint64_t value,
112 bool clearBuffer =
true);
113 void writeDataDestinationPort(std::string& buffer,
114 const uint64_t value,
115 bool clearBuffer =
true);
117 void readDataDestinationIP(std::string& buffer);
118 void readDataDestinationMAC(std::string& buffer);
119 void readDataDestinationPort(std::string& buffer);
121 void setDataDestinationAsSelf(std::string& buffer)
128 virtual void setControlDestination(std::string& buffer,
129 const std::string& ip,
130 const uint16_t port);
132 void writeControlDestinationIP(std::string& buffer,
const uint64_t value);
133 void writeControlDestinationMAC(std::string& buffer,
const uint64_t value);
134 void writeControlDestinationPort(std::string& buffer,
const uint64_t value);
136 void readControlDestinationIP(std::string& buffer);
137 void readControlDestinationMAC(std::string& buffer);
138 void readControlDestinationPort(std::string& buffer);
140 void setControlDestinationAsSelf(std::string& buffer)
148 void UDPFirmwareSpecialPing(std::string& buffer)
153 void UDPFirmwareSpecialNoOp(std::string& buffer)
160 void readUDPFirmwareVersion(std::string& buffer);
161 void softEthernetReset(std::string& buffer);
162 void hardEthernetReset(std::string& buffer);
163 void clearEthernetReset(std::string& buffer);
165 void startBurst(std::string& buffer);
166 void stopBurst(std::string& buffer);
169 static const uint8_t FIFO_ADDRESS_CMD_TYPE;