00001 #ifndef _ots_FrontEndFirmwareBase_h_
00002 #define _ots_FrontEndFirmwareBase_h_
00003
00004 #include <string>
00005 #include <iostream>
00006 #include <vector>
00007 #include "otsdaq-core/MessageFacility/MessageFacility.h"
00008 #include "otsdaq-core/Macros/CoutMacros.h"
00009
00010 namespace ots
00011 {
00012
00013
00014 class FrontEndFirmwareBase
00015 {
00016
00017 public:
00018
00019
00020
00021 FrontEndFirmwareBase (unsigned int version = -1):version_(version){;}
00022 virtual ~FrontEndFirmwareBase (void){;}
00023 virtual void init (void){;}
00024
00025 const unsigned int getVersion () {return version_;}
00026
00027
00028
00029
00030
00031 virtual std::string read (char* address) {__SS__; __THROW__(ss.str() + "Illegal call to undefined base class member function"); return "";};
00032 virtual void read (std::string& buffer, char* address, bool clearBuffer=true) {__SS__; __THROW__(ss.str() + "Illegal call to undefined base class member function"); return;};
00033 virtual void read (std::string& buffer, uint64_t address, bool clearBuffer=true) {__SS__; __THROW__(ss.str() + "Illegal call to undefined base class member function"); return;};
00034 virtual void read (std::string& buffer, uint32_t address, bool clearBuffer=true) {__SS__; __THROW__(ss.str() + "Illegal call to undefined base class member function"); return;};
00035
00036 virtual std::string write (char* address, char* data) {__SS__; __THROW__(ss.str() + "Illegal call to undefined base class member function"); return "";};
00037 virtual void write (std::string& buffer, char* address, char* data, bool clearBuffer=true) {__SS__; __THROW__(ss.str() + "Illegal call to undefined base class member function"); return;};
00038
00039 virtual void setDataDestination (std::string& buffer, const std::string& ip, const uint16_t port, bool clearBuffer=true) {__SS__; __THROW__(ss.str() + "Illegal call to undefined base class member function"); return;};
00040 virtual void write (std::string& buffer, uint64_t address, uint64_t data, bool clearBuffer=true) {__SS__; __THROW__(ss.str() + "Illegal call to undefined base class member function"); return;};
00041 virtual void write (std::string& buffer, uint32_t address, uint32_t data, bool clearBuffer=true) {__SS__; __THROW__(ss.str() + "Illegal call to undefined base class member function"); return;};
00042 virtual void waitSet (std::string& buffer, uint32_t address, uint32_t data, uint32_t timeout = 255, bool clearBuffer=true) {__SS__; __THROW__(ss.str() + "Illegal call to undefined base class member function"); return;};
00043 virtual void waitClear (std::string& buffer, uint32_t address, uint32_t data, uint32_t timeout = 255, bool clearBuffer=true) {__SS__; __THROW__(ss.str() + "Illegal call to undefined base class member function"); return;};
00044 virtual unsigned int getNumberOfBufferedCommands (std::string& buffer) {__SS__; __THROW__(ss.str() + "Illegal call to undefined base class member function"); return 0;};
00045
00046 virtual uint32_t createRegisterFromValue (std::string& readBuffer, std::string& receivedValue) {__SS__; __THROW__(ss.str() + "Illegal call to undefined base class member function"); return 0;};
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082 const unsigned int version_;
00083 };
00084
00085
00086
00087 }
00088
00089 #endif