Rev 134 | 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" |
||
| 123 | f9daq | 26 | #include "wienvme_dll.h" |
| 170 | f9daq | 27 | #include "sis3153.h" |
| 76 | f9daq | 28 | |
| 29 | static int VME_interface= -1; |
||
| 123 | f9daq | 30 | int VME_GetInterface() { |
| 31 | return VME_interface; |
||
| 32 | } |
||
| 33 | int VME_CONNECTED() { |
||
| 34 | return VME_interface; |
||
| 76 | f9daq | 35 | } |
| 36 | |||
| 134 | f9daq | 37 | short VME_START (int interface) { |
| 38 | //short __stdcall VME_START (int interface) { |
||
| 123 | f9daq | 39 | |
| 40 | VME_interface=interface; |
||
| 41 | switch (VME_interface) { |
||
| 42 | case CAEN_V1718: |
||
| 43 | CAEN_VME_START (NULL); |
||
| 44 | VME_R_Ptr = CAEN_VME_R; |
||
| 45 | VME_W_Ptr = CAEN_VME_W; |
||
| 46 | |||
| 47 | VME_MW_Ptr = CAEN_VME_MW; |
||
| 48 | VME_MR_Ptr = CAEN_VME_MR; |
||
| 49 | |||
| 50 | VME_MW_Ptr = CAEN_VME_MW; |
||
| 51 | VME_MR_Ptr = CAEN_VME_MR; |
||
| 52 | |||
| 53 | VME_MWEXEC_Ptr = CAEN_VME_MWEXEC; |
||
| 54 | VME_MREXEC_Ptr = CAEN_VME_MREXEC; |
||
| 55 | |||
| 56 | VME_MWRST_Ptr = CAEN_VME_MWRST; |
||
| 57 | VME_MRRST_Ptr = CAEN_VME_MRRST; |
||
| 58 | |||
| 59 | |||
| 60 | break; |
||
| 61 | |||
| 62 | case WIENER_VMEMM: |
||
| 63 | WIENVME_VME_START(NULL); |
||
| 64 | VME_R_Ptr = WIENVME_VME_R; |
||
| 65 | VME_W_Ptr = WIENVME_VME_W; |
||
| 66 | |||
| 67 | VME_MW_Ptr = WIENVME_VME_MW; |
||
| 68 | VME_MR_Ptr = WIENVME_VME_MR; |
||
| 69 | |||
| 70 | VME_MW_Ptr = WIENVME_VME_MW; |
||
| 71 | VME_MR_Ptr = WIENVME_VME_MR; |
||
| 72 | |||
| 73 | VME_MWEXEC_Ptr = WIENVME_VME_MWEXEC; |
||
| 74 | VME_MREXEC_Ptr = WIENVME_VME_MREXEC; |
||
| 75 | |||
| 76 | VME_MWRST_Ptr = WIENVME_VME_MWRST; |
||
| 77 | VME_MRRST_Ptr = WIENVME_VME_MRRST; |
||
| 78 | break; |
||
| 170 | f9daq | 79 | |
| 123 | f9daq | 80 | case WIENER_VMUSB: |
| 81 | WIENER_VMUSB_VME_START("VM0120"); |
||
| 82 | VME_R_Ptr = WIENER_VMUSB_VME_R; |
||
| 83 | VME_W_Ptr = WIENER_VMUSB_VME_W; |
||
| 84 | |||
| 85 | VME_MW_Ptr = WIENER_VMUSB_VME_MW; |
||
| 86 | VME_MR_Ptr = WIENER_VMUSB_VME_MR; |
||
| 87 | |||
| 88 | VME_MW_Ptr = WIENER_VMUSB_VME_MW; |
||
| 89 | VME_MR_Ptr = WIENER_VMUSB_VME_MR; |
||
| 90 | |||
| 91 | VME_MWEXEC_Ptr = WIENER_VMUSB_VME_MWEXEC; |
||
| 92 | VME_MREXEC_Ptr = WIENER_VMUSB_VME_MREXEC; |
||
| 93 | |||
| 94 | VME_MWRST_Ptr = WIENER_VMUSB_VME_MWRST; |
||
| 95 | VME_MRRST_Ptr = WIENER_VMUSB_VME_MRRST; |
||
| 96 | break; |
||
| 97 | |||
| 170 | f9daq | 98 | case SIS3153_USB: |
| 99 | SIS3153_USB_VME_START(NULL); |
||
| 100 | VME_R_Ptr = SIS3153_USB_VME_R; |
||
| 101 | VME_W_Ptr = SIS3153_USB_VME_W; |
||
| 102 | |||
| 103 | VME_MWRST_Ptr = SIS3153_USB_VME_MWRST; |
||
| 104 | VME_MW_Ptr = SIS3153_USB_VME_MW; |
||
| 105 | VME_MWEXEC_Ptr = SIS3153_USB_VME_MWEXEC; |
||
| 106 | |||
| 107 | VME_MRRST_Ptr = SIS3153_USB_VME_MRRST; |
||
| 108 | VME_MR_Ptr = SIS3153_USB_VME_MR; |
||
| 109 | VME_MREXEC_Ptr = SIS3153_USB_VME_MREXEC; |
||
| 110 | break; |
||
| 111 | default: |
||
| 112 | break; |
||
| 123 | f9daq | 113 | } |
| 114 | return 0; |
||
| 76 | f9daq | 115 | } |
| 170 | f9daq | 116 | |
| 134 | f9daq | 117 | short VME_STOP () { |
| 118 | //short __stdcall VME_STOP () { |
||
| 123 | f9daq | 119 | switch (VME_interface) { |
| 120 | case CAEN_V1718: |
||
| 170 | f9daq | 121 | CAEN_VME_STOP(); |
| 123 | f9daq | 122 | break; |
| 123 | case WIENER_VMEMM: |
||
| 124 | break; |
||
| 125 | case WIENER_VMUSB: |
||
| 170 | f9daq | 126 | WIENER_VMUSB_VME_STOP(); |
| 123 | f9daq | 127 | break; |
| 170 | f9daq | 128 | case SIS3153_USB: |
| 129 | SIS3153_USB_VME_STOP(); |
||
| 130 | break; |
||
| 123 | f9daq | 131 | default: |
| 132 | break; |
||
| 133 | } |
||
| 134 | VME_interface = -1; |
||
| 135 | return 0; |
||
| 76 | f9daq | 136 | } |