• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

abbplugin/roc/ABBdaemon.h (r4864/r2882)

Go to the documentation of this file.
00001 #ifndef ROC_AbbDaemon
00002 #define ROC_AbbDaemon
00003 
00004 /*
00005  * This is the include file for the replacement for ABB daemon client library.
00006  * It has similar interface as original ABBdaemon class, but communicates directly with ABB
00007  *
00008  * @file AbbDaemon.h
00009  * @date 2010-05-28
00010  * @author Sergey Linev
00011  *
00012  */
00013 
00014 #include <exception>
00015 #include <string>
00016 #include <stdint.h>
00017 #include <ostream>
00018 
00019 
00020 namespace mprace {
00021 class ABB;
00022 }
00023 
00024 namespace abbdaemon {
00025 
00026 typedef void* DMABUFFER_HANDLE;
00027 
00028 class ABBexception : public std::exception {
00029    private:
00030    std::string message;
00031    public:
00032    ABBexception(std::string message) {
00033       this->message = message;
00034    }
00035 
00036    ~ABBexception() throw() { };
00037 
00038    virtual const char *what() const throw()
00039             {
00040       return message.c_str();
00041             }
00042 };
00043 
00044 enum { RESET_ALL, RESET_CTL_FIFO, RESET_ABB, RESET_FIFO_TIMEOUT };
00045 
00046 
00047 class ABBdaemonClient {
00048    protected:
00049       mprace::ABB  *board;
00050       std::ostream *debug;
00051 
00052    public:
00053 
00054       ABBdaemonClient(const char* name = "mprace-0", int role = 0);
00055 
00061       virtual ~ABBdaemonClient();
00062 
00065       void setReg(uint32_t reg, uint32_t value);
00066 
00073       void enableDebugMessages(bool enable);
00074 
00082       uint32_t submitReset(uint32_t reset = RESET_ALL);
00083 
00095       uint32_t submitPut(uint32_t rocid, uint32_t retid, uint32_t addr, uint32_t value);
00096 
00114       uint32_t submitNPut(uint32_t rocid, uint32_t retid, int n,
00115             uint32_t *addr, uint32_t *values,
00116             uint32_t *retvals = 0);
00117 
00129       uint32_t submitGet(uint32_t rocid, uint32_t retid, uint32_t addr, uint32_t *value);
00130 
00131 
00139       uint32_t submitNGet(uint32_t rocid, uint32_t retid, int n,
00140             uint32_t *addr, uint32_t *value,
00141             uint32_t *retvals = 0);
00142 
00154       uint32_t submitNOper(uint32_t rocid, uint32_t retid, int n,
00155             uint32_t *addr, uint32_t *value,
00156             uint32_t *retvals = 0);
00157 
00166       uint32_t submitPutDLM(uint32_t value);
00167 
00176       uint32_t submitGetDLM(uint32_t *value);
00177 
00178 
00191       uint32_t readDMAserialized(const unsigned int address,
00192             DMABUFFER_HANDLE buffer_handle, const unsigned int count,
00193             const unsigned int offset = 0, const bool inc = true,
00194             const bool lock = true, const float timeout = 0.0);
00195 
00205       DMABUFFER_HANDLE registerBuffer(unsigned int len, void *address);
00206 
00215       void syncBuffer(DMABUFFER_HANDLE buffer);
00216 
00223       void unregisterBuffer(DMABUFFER_HANDLE buffer);
00224 
00225 
00232       uint32_t getFIFOStatus();
00233 
00239       uint32_t getCTLStatus();
00240 
00251       void getDesignID(uint32_t *version, uint32_t *major,
00252             uint32_t *author, uint32_t *minor);
00253 
00254 };
00255 
00256 }
00257 
00258 #endif

Generated on Tue Dec 10 2013 04:52:16 for ROCsoft by  doxygen 1.7.1