Subversion Repositories f9daq

Rev

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

/********************\
  VMEModule.hh
\********************/


#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
#include "VMEModule.hh"
#include "wienvme_dll.h"


VMEModule::VMEModule(int device ,caddr_t vmeaddr, size_t size) {
  m_vmeaddr     =  vmeaddr;
  m_baseaddress = (unsigned long)(vmeaddr) ;
}

VMEModule::~VMEModule() {
 
}

void VMEModule::write32( unsigned long address, unsigned long value ) {
  VME_write32(address, (void *) &value);
}

unsigned long VMEModule::read32( unsigned long address ){
  unsigned long data;
  VME_read32( address, (void *)  &data);
  return data;
}

void VMEModule::write16( unsigned long address, unsigned short value ) {
  VME_write16( address, (void *) &value);
}

unsigned short VMEModule::read16( unsigned long address ){
  unsigned long data;
  VME_read16( address, (void *) &data);
  return (short) (data& 0xFFFF);
}