fdhwlib  2.0.25
/home/kopmann/git-mirror/fdhwlib/fdhwlib/Hw/FltMemory.h
Go to the documentation of this file.
00001 /***************************************************************************
00002     FltMemory.h  -  description
00003 
00004     begin                : Mon Jul 3 2000
00005     copyright            : (C) 2000 by Andreas Kopmann
00006     email                : kopmann@hpe.fzk.de
00007  ***************************************************************************/
00008 
00009 
00010 #if defined (_MSC_VER) && (_MSC_VER >= 1000)
00011 #pragma once
00012 #endif
00013 #ifndef _INC_FLTMEMORY_39196B0E02E4_INCLUDED
00014 #define _INC_FLTMEMORY_39196B0E02E4_INCLUDED
00015 
00016 #include <Pbus/Pbus.h>
00017 
00018 #include <Hw/FltDef.h>
00019 
00020 
00074 //##ModelId=399121FB021E
00075 class FltMemory : public Pbus {
00076 public:
00083   FltMemory(const char * name, int slotID, int regID, int len);
00084 
00085   virtual ~FltMemory();
00086   
00088   virtual unsigned long read(unsigned long addr);
00089 
00091   virtual void read(unsigned long *data, int len = 0);
00092   
00096   int read(int ch, int page, unsigned long * data);
00097 
00098 
00100   unsigned short read(int ch, int page, int addr);
00101 
00106   int read(int ch, int page, unsigned short * data);
00107 
00114   int read(int ch, int page, int start, unsigned short * data, int n);
00115 
00116 #if defined (FLT_VER) && (FLT_VER >= 200)
00117   // There is no use for these functions in version 2
00118 #else
00119 
00121   void read(int ch, int page, int start,
00122               unsigned short *even, unsigned short *odd);
00123 
00129   void read(int ch, int page, int start,
00130                unsigned short *even, unsigned short *odd, int n);
00131 
00132 #endif
00133 
00144   void write(int ch, int page, unsigned long * data);
00145 
00146 
00155   void write(int ch, int page, int addr, unsigned short data);
00156 
00165   void write(int ch, int page, unsigned short * data);
00166 
00175   void clear(int ch, int page, unsigned short data);
00176 
00178   void broadcast(int page, unsigned short data);
00179 
00181   void broadcast(int page, unsigned short * data);
00182 
00183 #if defined (FLT_VER) && (FLT_VER >= 200)
00184   // There is no use for these functions in version 2
00185 #else
00186 
00196   void convertToPixelFormat(unsigned long *rawdata, unsigned short *even, unsigned short *odd,
00197              int start, int n);
00198 
00208   void convertToRawFormat(unsigned long *rawdata, unsigned short *pixeldata,
00209              int start, int n);
00210 #endif
00211 
00212   int getLength();
00213 
00214         char * getName();
00215 
00216   int getBlockLen();
00217 
00218   int getPageAddrLen();
00219 
00220   int getPixelAddrLen();
00221   
00223   unsigned long getAddr();
00224   
00225 protected:  
00226   unsigned long addr;
00227 
00228   int len;
00229 
00231   int blockLen;
00232 
00234   int pageAddrLen;
00235 
00237   int pixelAddrLen;
00238 
00239   
00240 private:
00241 
00242   const char *name;
00243 
00244   bool readable;
00245 
00246   bool writeable;
00247 
00248 
00249 #if defined (FLT_VER) && (FLT_VER >= 200)
00250   // There is no use for these members in version 2
00251 #else
00252 
00258   unsigned long buffer[FLT_PAGE_SIZE];
00259 
00260   unsigned short nextpixel[FLT_PAGE_SIZE];
00261 #endif
00262 
00263 };
00264 
00265 #endif /* _INC_FLTMEMORY_39196B0E02E4_INCLUDED */
00266