Rev 61 | Rev 100 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 61 | Rev 82 | ||
---|---|---|---|
Line 7... | Line 7... | ||
7 | #include <ivi.h> |
7 | #include <ivi.h> |
8 | 8 | ||
9 | #include "usb.h" |
9 | #include "usb.h" |
10 | #include "xxusb_dll.h" |
10 | #include "xxusb_dll.h" |
11 | 11 | ||
12 | extern usb_dev_handle *udev; |
- | |
13 | 12 | ||
- | 13 | #define CMD_WRITE 0x000 |
|
- | 14 | #define CMD_READ 0x100 |
|
- | 15 | #define CMD_A24 0x039 |
|
- | 16 | #define CMD_A32 0x009 |
|
14 |
|
17 | #define CMD_HM 0x80000 |
15 |
|
18 | #define CMD_HD 0x20000 |
- | 19 | #define CMD_MRK 0x2000 |
|
16 |
|
20 | #define CMD_DLY 0x8000 |
- | 21 | #define CMD_BLT 0xFF000000 |
|
17 | 22 | ||
- | 23 | #define CMD_D16 1 |
|
- | 24 | #define CMD_D32 0 |
|
- | 25 | ||
- | 26 | ||
- | 27 | #define MAXSTACKSIZE 100000 |
|
- | 28 | ||
- | 29 | int WIENER_VMUSB_StackInit(); |
|
- | 30 | void WIENER_VMUSB_StackClear(); |
|
- | 31 | ||
- | 32 | ||
- | 33 | #define WIENER_VMUSB_StackReadA24D16( ADDR, DATA ) WIENER_VMUSB_StackAppend(CMD_READ | CMD_A24 , CMD_D16 | (ADDR) ) |
|
- | 34 | #define WIENER_VMUSB_StackReadA24D32( ADDR, DATA ) WIENER_VMUSB_StackAppend(CMD_READ | CMD_A24 , CMD_D32 | (ADDR) ) |
|
- | 35 | #define WIENER_VMUSB_StackReadA32D16( ADDR, DATA ) WIENER_VMUSB_StackAppend(CMD_READ | CMD_A32 , CMD_D16 | (ADDR) ) |
|
- | 36 | #define WIENER_VMUSB_StackReadA32D32( ADDR, DATA ) WIENER_VMUSB_StackAppend(CMD_READ | CMD_A32 , CMD_D32 | (ADDR) ) |
|
- | 37 | ||
- | 38 | #define WIENER_VMUSB_StackWriteA24D16( ADDR, DATA) WIENER_VMUSB_StackAppendData(CMD_WRITE | CMD_A24,CMD_D16 | (ADDR), (DATA)) |
|
- | 39 | #define WIENER_VMUSB_StackWriteA24D32( ADDR, DATA) WIENER_VMUSB_StackAppendData(CMD_WRITE | CMD_A24,CMD_D32 | (ADDR), (DATA)) |
|
- | 40 | #define WIENER_VMUSB_StackWriteA32D16( ADDR, DATA) WIENER_VMUSB_StackAppendData(CMD_WRITE | CMD_A32,CMD_D16 | (ADDR), (DATA)) |
|
- | 41 | #define WIENER_VMUSB_StackWriteA32D32( ADDR, DATA) WIENER_VMUSB_StackAppendData(CMD_WRITE | CMD_A32,CMD_D32 | (ADDR), (DATA)) |
|
- | 42 | ||
- | 43 | #define WIENER_VMUSB_StackMarker(MRK) WIENER_VMUSB_StackAppend(CMD_MRK, (MRK)) |
|
- | 44 | ||
- | 45 | int WIENER_VMUSB_StackAppend(int cmd, uint32_t addr); |
|
- | 46 | int WIENER_VMUSB_StackAppendData(int cmd, uint32_t addr, uint32_t data); |
|
- | 47 | ||
- | 48 | void WIENER_VMUSB_StackConditionalRead(int am ,int d16d32,uint32_t addr, uint32_t data); |
|
- | 49 | void WIENER_VMUSB_StackMultiRead(int addr_modifier,int d16d32, uint32_t baseaddr, int n,uint32_t increment); |
|
- | 50 | void WIENER_VMUSB_StackMultiWrite(int addr_modifier,int d16d32,uint32_t baseaddr, int n, uint32_t increment, uint32_t data); |
|
- | 51 | ||
- | 52 | int WIENER_VMUSB_StackGetUint32(int maxn, uint32_t *stack); |
|
- | 53 | int WIENER_VMUSB_StackGetUint16(int maxn, uint16_t *stack); |
|
- | 54 | void WIENER_VMUSB_StackPrint(); |
|
- | 55 | ||
- | 56 | ||
- | 57 | void _VI_FUNC WIENER_VMUSB_load (char *module_path); |
|
- | 58 | void _VI_FUNC WIENER_VMUSB_open (char *serial); |
|
- | 59 | void _VI_FUNC WIENER_VMUSB_close (void); |
|
- | 60 | ||
18 | #define |
61 | #define WIENER_VMUSB_VME_START(NODE) WIENER_VMUSB_load(NULL);WIENER_VMUSB_open((NODE)); |
19 | #define |
62 | #define WIENER_VMUSB_VME_STOP() WIENER_VMUSB_close() |
20 | //#define VME_RESET() WIENVME_reset() |
63 | //#define VME_RESET() WIENVME_reset() |
21 | //#define VME_A24D8_R(VME,DATA) WIENVME_read8(hHandle24, 1, (VME), (DATA)) |
64 | //#define VME_A24D8_R(VME,DATA) WIENVME_read8(hHandle24, 1, (VME), (DATA)) |
22 | #define |
65 | #define WIENER_VMUSB_VME_A24D16_R(VME,DATA) VME_read_16(WUSB_udev, Std_NoPriv_Data, (VME), (DATA)) |
23 | #define |
66 | #define WIENER_VMUSB_VME_A24D32_R(VME,DATA) VME_read_32(WUSB_udev, Std_NoPriv_Data, (VME), (DATA)) |
24 | //#define VME_A24D8_W(VME,DATA) WIENVME_write8(hHandle24, 1, (VME), (DATA)) |
67 | //#define VME_A24D8_W(VME,DATA) WIENVME_write8(hHandle24, 1, (VME), (DATA)) |
25 | #define |
68 | #define WIENER_VMUSB_VME_A24D16_W(VME,DATA) VME_write_16(WUSB_udev, Std_NoPriv_Data, (VME), (DATA)) |
26 | #define |
69 | #define WIENER_VMUSB_VME_A24D32_W(VME,DATA) VME_write_32(WUSB_udev, Std_NoPriv_Data, (VME), (DATA)) |
27 | //#define VME_A32D8_R(VME,DATA) WIENVME_read8(hHandle32, 1, (VME), (DATA)) |
70 | //#define VME_A32D8_R(VME,DATA) WIENVME_read8(hHandle32, 1, (VME), (DATA)) |
28 | #define |
71 | #define WIENER_VMUSB_VME_A32D16_R(VME,DATA) VME_read_16(WUSB_udev, Ext_NoPriv_Data, (VME), (DATA)) |
29 | #define |
72 | #define WIENER_VMUSB_VME_A32D32_R(VME,DATA) VME_read_32(WUSB_udev, Ext_NoPriv_Data, (VME), (DATA)) |
30 | //#define VME_A32D8_W(VME,DATA) WIENVME_write8(hHandle32, 1, (VME), (DATA)) |
73 | //#define VME_A32D8_W(VME,DATA) WIENVME_write8(hHandle32, 1, (VME), (DATA)) |
31 | #define |
74 | #define WIENER_VMUSB_VME_A32D16_W(VME,DATA) VME_write_16(WUSB_udev, Ext_NoPriv_Data, (VME), (DATA)) |
32 | #define |
75 | #define WIENER_VMUSB_VME_A32D32_W(VME,DATA) VME_write_32(WUSB_udev, Ext_NoPriv_Data, (VME), (DATA)) |
- | 76 | ||
- | 77 | ||
- | 78 | short __stdcall WIENER_VMUSB_VME_R( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t *Data); |
|
- | 79 | ||
- | 80 | short __stdcall WIENER_VMUSB_VME_W( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data); |
|
- | 81 | ||
- | 82 | short __stdcall WIENER_VMUSB_VME_MW( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data); |
|
- | 83 | short __stdcall WIENER_VMUSB_VME_MWRST( void ); |
|
- | 84 | short __stdcall WIENER_VMUSB_VME_MWEXEC( void ); |
|
- | 85 | ||
- | 86 | short __stdcall WIENER_VMUSB_VME_MR( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t *Data); |
|
- | 87 | short __stdcall WIENER_VMUSB_VME_MRRST( void ); |
|
- | 88 | short __stdcall WIENER_VMUSB_VME_MREXEC( uint32_t *Data ); |
|
33 | 89 | ||
34 | #endif |
90 | #endif |
35 | 91 |