Subversion Repositories f9daq

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. /********************\
  2.   VMEModule.hh
  3. \********************/
  4.  
  5. #include <stdlib.h>
  6. #include <unistd.h>
  7. #include <fcntl.h>
  8. #include <sys/mman.h>
  9. #include "VMEModule.hh"
  10. #include "wienvme_dll.h"
  11.  
  12.  
  13. VMEModule::VMEModule(int device ,caddr_t vmeaddr, size_t size) {
  14.   m_vmeaddr     =  vmeaddr;
  15.   m_baseaddress = (unsigned long)(vmeaddr) ;
  16. }
  17.  
  18. VMEModule::~VMEModule() {
  19.  
  20. }
  21.  
  22. void VMEModule::write32( unsigned long address, unsigned long value ) {
  23.   VME_write32(address, (void *) &value);
  24. }
  25.  
  26. unsigned long VMEModule::read32( unsigned long address ){
  27.   unsigned long data;
  28.   VME_read32( address, (void *)  &data);
  29.   return data;
  30. }
  31.  
  32. void VMEModule::write16( unsigned long address, unsigned short value ) {
  33.   VME_write16( address, (void *) &value);
  34. }
  35.  
  36. unsigned short VMEModule::read16( unsigned long address ){
  37.   unsigned long data;
  38.   VME_read16( address, (void *) &data);
  39.   return (short) (data& 0xFFFF);
  40. }
  41.  
  42.  
  43.