Rev 87 | Rev 123 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 76 | f9daq | 1 | #include "vme.h" |
| 2 | |||
| 100 | f9daq | 3 | |
| 4 | short __stdcall VME_R( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t *Data); |
||
| 5 | |||
| 6 | short __stdcall VME_W( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data); |
||
| 7 | |||
| 8 | short __stdcall VME_MW( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data); |
||
| 9 | short __stdcall VME_MWRST( void ); |
||
| 10 | short __stdcall VME_MWEXEC( void ); |
||
| 11 | |||
| 12 | short __stdcall VME_MR( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t *Data); |
||
| 13 | short __stdcall VME_MRRST( void ); |
||
| 14 | short __stdcall VME_MREXEC( uint32_t *Data ); |
||
| 15 | |||
| 76 | f9daq | 16 | /* |
| 17 | #ifdef _CVI_ |
||
| 18 | #include "c:\home\CVI\instr\WIENVME_DLL\wienvme_dll.h" |
||
| 19 | #else |
||
| 20 | #include "wienvme_dll.h" |
||
| 21 | #endif |
||
| 22 | */ |
||
| 23 | |||
| 24 | #include "CAENV1718.h" |
||
| 25 | #include "wusbvme_dll.h" |
||
| 26 | #include "wienvme_dll.h" |
||
| 27 | |||
| 28 | static int VME_interface= -1; |
||
| 87 | f9daq | 29 | int VME_GetInterface() { return VME_interface;} |
| 76 | f9daq | 30 | int VME_CONNECTED(){ |
| 31 | |||
| 32 | return VME_interface; |
||
| 33 | } |
||
| 34 | |||
| 100 | f9daq | 35 | short __stdcall VME_START (int interface) |
| 76 | f9daq | 36 | { |
| 37 | |||
| 38 | |||
| 39 | VME_interface=interface; |
||
| 40 | switch (VME_interface){ |
||
| 41 | case CAEN_V1718: |
||
| 42 | CAEN_VME_START (NULL); |
||
| 43 | VME_R_Ptr = CAEN_VME_R; |
||
| 44 | VME_W_Ptr = CAEN_VME_W; |
||
| 45 | |||
| 46 | VME_MW_Ptr = CAEN_VME_MW; |
||
| 47 | VME_MR_Ptr = CAEN_VME_MR; |
||
| 48 | |||
| 49 | VME_MW_Ptr = CAEN_VME_MW; |
||
| 50 | VME_MR_Ptr = CAEN_VME_MR; |
||
| 51 | |||
| 52 | VME_MWEXEC_Ptr = CAEN_VME_MWEXEC; |
||
| 53 | VME_MREXEC_Ptr = CAEN_VME_MREXEC; |
||
| 54 | |||
| 55 | VME_MWRST_Ptr = CAEN_VME_MWRST; |
||
| 56 | VME_MRRST_Ptr = CAEN_VME_MRRST; |
||
| 57 | |||
| 58 | |||
| 59 | break; |
||
| 60 | |||
| 61 | case WIENER_VMEMM: |
||
| 62 | WIENVME_VME_START(NULL); |
||
| 63 | VME_R_Ptr = WIENVME_VME_R; |
||
| 64 | VME_W_Ptr = WIENVME_VME_W; |
||
| 65 | |||
| 66 | VME_MW_Ptr = WIENVME_VME_MW; |
||
| 67 | VME_MR_Ptr = WIENVME_VME_MR; |
||
| 68 | |||
| 69 | VME_MW_Ptr = WIENVME_VME_MW; |
||
| 70 | VME_MR_Ptr = WIENVME_VME_MR; |
||
| 71 | |||
| 72 | VME_MWEXEC_Ptr = WIENVME_VME_MWEXEC; |
||
| 73 | VME_MREXEC_Ptr = WIENVME_VME_MREXEC; |
||
| 74 | |||
| 75 | VME_MWRST_Ptr = WIENVME_VME_MWRST; |
||
| 76 | VME_MRRST_Ptr = WIENVME_VME_MRRST; |
||
| 77 | break; |
||
| 78 | case WIENER_VMUSB: |
||
| 79 | WIENER_VMUSB_VME_START("VM0120"); |
||
| 80 | VME_R_Ptr = WIENER_VMUSB_VME_R; |
||
| 81 | VME_W_Ptr = WIENER_VMUSB_VME_W; |
||
| 82 | |||
| 83 | VME_MW_Ptr = WIENER_VMUSB_VME_MW; |
||
| 84 | VME_MR_Ptr = WIENER_VMUSB_VME_MR; |
||
| 85 | |||
| 86 | VME_MW_Ptr = WIENER_VMUSB_VME_MW; |
||
| 87 | VME_MR_Ptr = WIENER_VMUSB_VME_MR; |
||
| 88 | |||
| 89 | VME_MWEXEC_Ptr = WIENER_VMUSB_VME_MWEXEC; |
||
| 90 | VME_MREXEC_Ptr = WIENER_VMUSB_VME_MREXEC; |
||
| 91 | |||
| 92 | VME_MWRST_Ptr = WIENER_VMUSB_VME_MWRST; |
||
| 93 | VME_MRRST_Ptr = WIENER_VMUSB_VME_MRRST; |
||
| 94 | break; |
||
| 95 | |||
| 96 | } |
||
| 97 | |||
| 98 | return 0; |
||
| 99 | } |
||
| 100 | |||
| 100 | f9daq | 101 | short __stdcall VME_STOP () |
| 76 | f9daq | 102 | { |
| 103 | switch (VME_interface){ |
||
| 104 | case CAEN_V1718: |
||
| 105 | |||
| 106 | CAEN_VME_STOP( ); |
||
| 107 | break; |
||
| 108 | |||
| 109 | case WIENER_VMEMM: |
||
| 110 | |||
| 111 | break; |
||
| 112 | case WIENER_VMUSB: |
||
| 113 | WIENER_VMUSB_VME_STOP( ); |
||
| 114 | break; |
||
| 115 | default: |
||
| 116 | |||
| 117 | break; |
||
| 118 | |||
| 119 | } |
||
| 120 | |||
| 121 | VME_interface = -1; |
||
| 122 | return 0; |
||
| 123 | } |