//Clase para acceder a los dispositivos VME con LINCO

#include "VMEDeviceLinco.h"

VMEDeviceLinco::VMEDeviceLinco(
    VMEBus &vmeControl, int VMEBaseAddress):vmeController(vmeControl)
{
  this->VMEBaseAddress = VMEBaseAddress;
//cout<<" VMEBaseADdress 0x"<<hex<<VMEBaseAddress<<endl;
}

VMEDeviceLinco::~VMEDeviceLinco() 
{
//ojo, quiero borrar el bus 
}

//**********************************************************
//*********** M�TODOS P�BLICOS
//**********************************************************
void VMEDeviceLinco::write(int offset, unsigned short valor)
{
	int address;
	address=offset+VMEBaseAddress;
  vmeController.WriteWord(address, (unsigned short)valor);
}

unsigned short VMEDeviceLinco::read(int offset) {

	unsigned short valor=0;
	int address;
	address=offset+VMEBaseAddress;
//cout<<" leo en address 0x"<<hex<<address<<endl;
  valor = vmeController.ReadWord(address);

  return valor;
}

