#include "vme.h"
short __stdcall VME_R( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t *Data);
short __stdcall VME_W( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data);
short __stdcall VME_MW( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data);
short __stdcall VME_MWRST( void );
short __stdcall VME_MWEXEC( void );
short __stdcall VME_MR( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t *Data);
short __stdcall VME_MRRST( void );
short __stdcall VME_MREXEC( uint32_t *Data );
/*
#ifdef _CVI_
#include "c:\home\CVI\instr\WIENVME_DLL\wienvme_dll.h"
#else
#include "wienvme_dll.h"
#endif
*/
#include "CAENV1718.h"
#include "wusbvme_dll.h"
#include "wienvme_dll.h"
static int VME_interface= -1;
int VME_GetInterface() {
return VME_interface;
}
int VME_CONNECTED() {
return VME_interface;
}
short __stdcall VME_START (int interface) {
VME_interface=interface;
switch (VME_interface) {
case CAEN_V1718:
CAEN_VME_START (NULL);
VME_R_Ptr = CAEN_VME_R;
VME_W_Ptr = CAEN_VME_W;
VME_MW_Ptr = CAEN_VME_MW;
VME_MR_Ptr = CAEN_VME_MR;
VME_MW_Ptr = CAEN_VME_MW;
VME_MR_Ptr = CAEN_VME_MR;
VME_MWEXEC_Ptr = CAEN_VME_MWEXEC;
VME_MREXEC_Ptr = CAEN_VME_MREXEC;
VME_MWRST_Ptr = CAEN_VME_MWRST;
VME_MRRST_Ptr = CAEN_VME_MRRST;
break;
case WIENER_VMEMM:
WIENVME_VME_START(NULL);
VME_R_Ptr = WIENVME_VME_R;
VME_W_Ptr = WIENVME_VME_W;
VME_MW_Ptr = WIENVME_VME_MW;
VME_MR_Ptr = WIENVME_VME_MR;
VME_MW_Ptr = WIENVME_VME_MW;
VME_MR_Ptr = WIENVME_VME_MR;
VME_MWEXEC_Ptr = WIENVME_VME_MWEXEC;
VME_MREXEC_Ptr = WIENVME_VME_MREXEC;
VME_MWRST_Ptr = WIENVME_VME_MWRST;
VME_MRRST_Ptr = WIENVME_VME_MRRST;
break;
case WIENER_VMUSB:
WIENER_VMUSB_VME_START("VM0120");
VME_R_Ptr = WIENER_VMUSB_VME_R;
VME_W_Ptr = WIENER_VMUSB_VME_W;
VME_MW_Ptr = WIENER_VMUSB_VME_MW;
VME_MR_Ptr = WIENER_VMUSB_VME_MR;
VME_MW_Ptr = WIENER_VMUSB_VME_MW;
VME_MR_Ptr = WIENER_VMUSB_VME_MR;
VME_MWEXEC_Ptr = WIENER_VMUSB_VME_MWEXEC;
VME_MREXEC_Ptr = WIENER_VMUSB_VME_MREXEC;
VME_MWRST_Ptr = WIENER_VMUSB_VME_MWRST;
VME_MRRST_Ptr = WIENER_VMUSB_VME_MRRST;
break;
}
return 0;
}
short __stdcall VME_STOP () {
switch (VME_interface) {
case CAEN_V1718:
CAEN_VME_STOP( );
break;
case WIENER_VMEMM:
break;
case WIENER_VMUSB:
WIENER_VMUSB_VME_STOP( );
break;
default:
break;
}
VME_interface = -1;
return 0;
}