/cvi/instr/vme/vme.c |
---|
0,0 → 1,110 |
#include "vme.h" |
/* |
#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_CONNECTED(){ |
return VME_interface; |
} |
short 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 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; |
} |
/cvi/instr/vme/vme.fp |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
## -0,0 +1 ## |
+application/octet-stream |
\ No newline at end of property |
Index: instr/vme/vme.h |
=================================================================== |
--- instr/vme/vme.h (nonexistent) |
+++ instr/vme/vme.h (revision 76) |
@@ -0,0 +1,72 @@ |
+#ifndef _VME_H_ |
+#define _VME_H_ |
+ |
+#include <stdint.h> |
+ |
+#define CAEN_V1718 0 |
+#define WIENER_VMEMM 1 |
+#define WIENER_VMUSB 2 |
+ |
+ |
+short VME_START( int interface ); |
+short VME_STOP(); |
+int VME_CONNECTED(); |
+ |
+#define VME_A16 0x29 |
+#define VME_A24 0x39 |
+#define VME_A32 0x9 |
+ |
+#define VME_D8 0x1 |
+#define VME_D16 0x2 |
+#define VME_D32 0x4 |
+ |
+#define VME_A16D8_R(VME,DATA) VME_R( VME_A16, VME_D8 , (VME), (DATA) ) |
+#define VME_A16D16_R(VME,DATA) VME_R( VME_A16, VME_D16 , (VME), (DATA) ) |
+#define VME_A16D32_R(VME,DATA) VME_R( VME_A16, VME_D32 , (VME), (DATA) ) |
+ |
+#define VME_A24D8_R(VME,DATA) VME_R( VME_A24, VME_D8 , (VME), (DATA) ) |
+#define VME_A24D16_R(VME,DATA) VME_R( VME_A24, VME_D16 , (VME), (DATA) ) |
+#define VME_A24D32_R(VME,DATA) VME_R( VME_A24, VME_D32 , (VME), (DATA) ) |
+ |
+#define VME_A32D8_R(VME,DATA) VME_R( VME_A32, VME_D8 , (VME), (DATA) ) |
+#define VME_A32D16_R(VME,DATA) VME_R( VME_A32, VME_D16 , (VME), (DATA) ) |
+#define VME_A32D32_R(VME,DATA) VME_R( VME_A32, VME_D32 , (VME), (DATA) ) |
+ |
+#define VME_A16D8_W(VME,DATA) VME_W( VME_A16, VME_D8 , (VME), (DATA) ) |
+#define VME_A16D16_W(VME,DATA) VME_W( VME_A16, VME_D16 , (VME), (DATA) ) |
+#define VME_A16D32_W(VME,DATA) VME_W( VME_A16, VME_D32 , (VME), (DATA) ) |
+ |
+#define VME_A24D8_W(VME,DATA) VME_W( VME_A24, VME_D8 , (VME), (DATA) ) |
+#define VME_A24D16_W(VME,DATA) VME_W( VME_A24, VME_D16 , (VME), (DATA) ) |
+#define VME_A24D32_W(VME,DATA) VME_W( VME_A24, VME_D32 , (VME), (DATA) ) |
+ |
+#define VME_A32D8_W(VME,DATA) VME_W( VME_A32, VME_D8 , (VME), (DATA) ) |
+#define VME_A32D16_W(VME,DATA) VME_W( VME_A32, VME_D16 , (VME), (DATA) ) |
+#define VME_A32D32_W(VME,DATA) VME_W( VME_A32, VME_D32 , (VME), (DATA) ) |
+ |
+ |
+#define VME_R (*VME_R_Ptr) |
+#define VME_W (*VME_W_Ptr) |
+#define VME_MW (*VME_MW_Ptr) |
+#define VME_MWRST (*VME_MWRST_Ptr) |
+#define VME_MWEXEC (*VME_MWEXEC_Ptr) |
+ |
+#define VME_MR (*VME_MR_Ptr) |
+#define VME_MRRST (*VME_MRRST_Ptr) |
+#define VME_MREXEC (*VME_MREXEC_Ptr) |
+ |
+ |
+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 ); |
+ |
+#endif |
+ |