Rev 136 | Rev 139 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 136 | Rev 138 | ||
---|---|---|---|
Line 29... | Line 29... | ||
29 | 29 | ||
30 | short __stdcall WIENER_VMUSB_VME_MR( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t *Data); |
30 | short __stdcall WIENER_VMUSB_VME_MR( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t *Data); |
31 | short __stdcall WIENER_VMUSB_VME_MRRST( void ); |
31 | short __stdcall WIENER_VMUSB_VME_MRRST( void ); |
32 | short __stdcall WIENER_VMUSB_VME_MREXEC( uint32_t *Data ); |
32 | short __stdcall WIENER_VMUSB_VME_MREXEC( uint32_t *Data ); |
33 | 33 | ||
- | 34 | ||
- | 35 | #ifdef XXDLL |
|
34 | 36 | ||
35 | short __stdcall xxusb_register_read(usb_dev_handle *hDev, short RegAddr, long *RegData); |
37 | short __stdcall xxusb_register_read(usb_dev_handle *hDev, short RegAddr, long *RegData); |
36 | short __stdcall xxusb_stack_read(usb_dev_handle *hDev, short StackAddr, long *StackData); |
38 | short __stdcall xxusb_stack_read(usb_dev_handle *hDev, short StackAddr, long *StackData); |
37 | short __stdcall xxusb_stack_write(usb_dev_handle *hDev, short StackAddr, long *StackData); |
39 | short __stdcall xxusb_stack_write(usb_dev_handle *hDev, short StackAddr, long *StackData); |
38 | short __stdcall xxusb_stack_execute(usb_dev_handle *hDev, long *StackData); |
40 | short __stdcall xxusb_stack_execute(usb_dev_handle *hDev, long *StackData); |
Line 47... | Line 49... | ||
47 | short __stdcall xxusb_device_close(usb_dev_handle *hDev); |
49 | short __stdcall xxusb_device_close(usb_dev_handle *hDev); |
48 | usb_dev_handle* __stdcall xxusb_device_open(struct usb_device *dev); |
50 | usb_dev_handle* __stdcall xxusb_device_open(struct usb_device *dev); |
49 | short __stdcall xxusb_flash_program(usb_dev_handle *hDev, char *config, short nsect); |
51 | short __stdcall xxusb_flash_program(usb_dev_handle *hDev, char *config, short nsect); |
50 | short __stdcall xxusb_flashblock_program(usb_dev_handle *hDev, UCHAR *config); |
52 | short __stdcall xxusb_flashblock_program(usb_dev_handle *hDev, UCHAR *config); |
51 | usb_dev_handle* __stdcall xxusb_serial_open(char *SerialString); |
53 | usb_dev_handle* __stdcall xxusb_serial_open(char *SerialString); |
52 | 54 | ||
53 | short __stdcall VME_register_write(usb_dev_handle *hdev, long VME_Address, long Data); |
55 | short __stdcall VME_register_write(usb_dev_handle *hdev, long VME_Address, long Data); |
54 | short __stdcall VME_register_read(usb_dev_handle *hdev, long VME_Address, long *Data); |
56 | short __stdcall VME_register_read(usb_dev_handle *hdev, long VME_Address, long *Data); |
55 | short __stdcall VME_LED_settings(usb_dev_handle *hdev, int LED, int code, int invert, int latch); |
57 | short __stdcall VME_LED_settings(usb_dev_handle *hdev, int LED, int code, int invert, int latch); |
56 | 58 | ||
57 | short __stdcall VME_DGG(usb_dev_handle *hdev, unsigned short channel, unsigned short trigger,unsigned short output, long delay, unsigned short gate, unsigned short invert, unsigned short latch); |
59 | short __stdcall VME_DGG(usb_dev_handle *hdev, unsigned short channel, unsigned short trigger,unsigned short output, long delay, unsigned short gate, unsigned short invert, unsigned short latch); |
Line 65... | Line 67... | ||
65 | short __stdcall VME_write_32(usb_dev_handle *hdev, short Address_Modifier, long VME_Address, long Data); |
67 | short __stdcall VME_write_32(usb_dev_handle *hdev, short Address_Modifier, long VME_Address, long Data); |
66 | 68 | ||
67 | 69 | ||
68 | void _VI_FUNC WIENER_VMUSB_load (const char* module_path) { |
70 | void _VI_FUNC WIENER_VMUSB_load (const char* module_path) { |
69 | if (module_path == NULL) { |
71 | if (module_path == NULL) { |
70 | DLLHandle = LoadLibrary("libxxusb.dll"); |
72 | DLLHandle = LoadLibrary("c:\\Windows\\system32\\libxxusb.dll"); |
71 | } else { |
73 | } else { |
72 | DLLHandle = LoadLibrary(module_path); |
74 | DLLHandle = LoadLibrary(module_path); |
73 | } |
75 | } |
74 | if (!DLLHandle) { |
76 | if (!DLLHandle) { |
75 | printf ("\n\nFailed to Open libxxusb.dll \n"); |
77 | printf ("\n\nFailed to Open libxxusb.dll \n"); |
- | 78 | printf("LastError 0x%x\n",GetLastError() ); |
|
76 | return; |
79 | return; |
77 | } |
80 | } |
78 | if (!(xxusb_register_read_Ptr = (void *) GetProcAddress(DLLHandle,"xxusb_register_read"))) exit(1); |
81 | if (!(xxusb_register_read_Ptr = (void *) GetProcAddress(DLLHandle,"xxusb_register_read"))) exit(1); |
79 | if (!(xxusb_stack_read_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_stack_read"))) exit(1); |
82 | if (!(xxusb_stack_read_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_stack_read"))) exit(1); |
80 | if (!(xxusb_stack_write_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_stack_write"))) exit(1); |
83 | if (!(xxusb_stack_write_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_stack_write"))) exit(1); |
Line 83... | Line 86... | ||
83 | if (!(xxusb_register_write_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_register_write"))) exit(1); |
86 | if (!(xxusb_register_write_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_register_write"))) exit(1); |
84 | if (!(xxusb_usbfifo_read_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_usbfifo_read"))) exit(1); |
87 | if (!(xxusb_usbfifo_read_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_usbfifo_read"))) exit(1); |
85 | if (!(xxusb_bulk_read_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_bulk_read"))) exit(1); |
88 | if (!(xxusb_bulk_read_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_bulk_read"))) exit(1); |
86 | if (!(xxusb_bulk_write_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_bulk_write"))) exit(1); |
89 | if (!(xxusb_bulk_write_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_bulk_write"))) exit(1); |
87 | if (!(xxusb_reset_toggle_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_reset_toggle"))) exit(1); |
90 | if (!(xxusb_reset_toggle_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_reset_toggle"))) exit(1); |
88 | 91 | ||
89 | if (!(xxusb_devices_find_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_devices_find"))) exit(1); |
92 | if (!(xxusb_devices_find_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_devices_find"))) exit(1); |
90 | if (!(xxusb_device_close_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_device_close"))) exit(1); |
93 | if (!(xxusb_device_close_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_device_close"))) exit(1); |
91 | if (!(xxusb_device_open_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_device_open"))) exit(1); |
94 | if (!(xxusb_device_open_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_device_open"))) exit(1); |
92 | if (!(xxusb_flash_program_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_flash_program"))) exit(1); |
95 | if (!(xxusb_flash_program_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_flash_program"))) exit(1); |
93 | if (!(xxusb_flashblock_program_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_flashblock_program"))) exit(1); |
96 | if (!(xxusb_flashblock_program_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_flashblock_program"))) exit(1); |
Line 101... | Line 104... | ||
101 | if (!(VME_read_32_Ptr = (void*) GetProcAddress(DLLHandle,"VME_read_32"))) exit(1); |
104 | if (!(VME_read_32_Ptr = (void*) GetProcAddress(DLLHandle,"VME_read_32"))) exit(1); |
102 | if (!(VME_BLT_read_32_Ptr = (void*) GetProcAddress(DLLHandle,"VME_BLT_read_32"))) exit(1); |
105 | if (!(VME_BLT_read_32_Ptr = (void*) GetProcAddress(DLLHandle,"VME_BLT_read_32"))) exit(1); |
103 | if (!(VME_write_16_Ptr = (void*) GetProcAddress(DLLHandle,"VME_write_16"))) exit(1); |
106 | if (!(VME_write_16_Ptr = (void*) GetProcAddress(DLLHandle,"VME_write_16"))) exit(1); |
104 | if (!(VME_write_32_Ptr = (void*) GetProcAddress(DLLHandle,"VME_write_32"))) exit(1); |
107 | if (!(VME_write_32_Ptr = (void*) GetProcAddress(DLLHandle,"VME_write_32"))) exit(1); |
105 | } |
108 | } |
- | 109 | ||
- | 110 | #else |
|
- | 111 | ||
- | 112 | void _VI_FUNC WIENER_VMUSB_load (const char* module_path) { |
|
- | 113 | ||
- | 114 | } |
|
- | 115 | #endif |
|
106 | 116 | ||
107 | void _VI_FUNC WIENER_VMUSB_open (const char *serial) { |
117 | void _VI_FUNC WIENER_VMUSB_open (const char *serial) { |
108 | 118 | ||
109 | xxusb_device_type devices[100]; |
119 | xxusb_device_type devices[100]; |
110 | struct usb_device *dev; |
120 | struct usb_device *dev; |