Subversion Repositories f9daq

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
146 f9daq 1
#include <usb.h>
2
 
3
 
4
#define XXUSB_WIENER_VENDOR_ID	0x16DC   /* Wiener, Plein & Baus */
5
#define XXUSB_VMUSB_PRODUCT_ID	0x000B	 /* VM-USB */
6
#define XXUSB_CCUSB_PRODUCT_ID	0x0001	 /* CC-USB */
7
#define XXUSB_ENDPOINT_OUT	2  /* Endpoint 2 Out*/
8
#define XXUSB_ENDPOINT_IN    0x86  /* Endpoint 6 In */
9
#define XXUSB_FIRMWARE_REGISTER 0
10
#define XXUSB_GLOBAL_REGISTER 1
11
#define XXUSB_ACTION_REGISTER 10
12
#define XXUSB_DELAYS_REGISTER 2
13
#define XXUSB_WATCHDOG_REGISTER 3
14
#define XXUSB_SELLEDA_REGISTER 6
15
#define XXUSB_SELNIM_REGISTER 7
16
#define XXUSB_SELLEDB_REGISTER 4
17
#define XXUSB_SERIAL_REGISTER 15
18
#define XXUSB_LAMMASK_REGISTER 8
19
#define XXUSB_LAM_REGISTER 12
20
#define XXUSB_READOUT_STACK 2
21
#define XXUSB_SCALER_STACK 3
22
#define XXUSB_NAF_DIRECT 12
23
 
24
struct XXUSB_STACK
25
{
26
long Data;
27
short Hit;
28
short APatt;
29
short Num;
30
short HitMask;
31
};
32
 
33
struct XXUSB_CC_COMMAND_TYPE
34
{
35
short Crate;
36
short F;
37
short A;
38
short N;
39
long Data;
40
short NoS2;
41
short LongD;
42
short HitPatt;
43
short QStop;
44
short LAMMode;
45
short UseHit;
46
short Repeat;
47
short AddrScan;
48
short FastCam;
49
short NumMod;
50
short AddrPatt;
51
long HitMask[4];
52
long Num;
53
};
54
 
55
struct xxusb_device_typ
56
{
57
  struct usb_device *usbdev;
58
  char SerialString[7];
59
};
60
 
61
typedef struct xxusb_device_typ xxusb_device_type;
62
typedef unsigned char UCHAR;
63
typedef struct usb_bus usb_busx;
64
 
65
 
66
int xxusb_longstack_execute(usb_dev_handle *hDev, void *DataBuffer, int lDataLen, int timeout);
67
int xxusb_bulk_read(usb_dev_handle *hDev, void *DataBuffer, int lDataLen, int timeout);
68
int xxusb_bulk_write(usb_dev_handle *hDev, void *DataBuffer, int lDataLen, int timeout);
69
int xxusb_usbfifo_read(usb_dev_handle *hDev, int *DataBuffer, int lDataLen, int timeout);
70
 
71
short xxusb_register_read(usb_dev_handle *hDev, short RegAddr, long *RegData);
72
short xxusb_stack_read(usb_dev_handle *hDev, short StackAddr, long *StackData);
73
short xxusb_stack_write(usb_dev_handle *hDev, short StackAddr, long *StackData);
74
short xxusb_stack_execute(usb_dev_handle *hDev, long *StackData);
75
short xxusb_register_write(usb_dev_handle *hDev, short RegAddr, long RegData);
76
short xxusb_reset_toggle(usb_dev_handle *hDev);
77
 
78
short xxusb_devices_find(xxusb_device_type *xxusbDev);
79
short xxusb_device_close(usb_dev_handle *hDev);
80
usb_dev_handle* xxusb_device_open(struct usb_device *dev);
81
short xxusb_flash_program(usb_dev_handle *hDev, char *config, short nsect);
82
short xxusb_flashblock_program(usb_dev_handle *hDev, UCHAR *config);
83
usb_dev_handle* xxusb_serial_open(char *SerialString);
84
 
85
short VME_register_write(usb_dev_handle *hdev, long VME_Address, long Data);
86
short VME_register_read(usb_dev_handle *hdev, long VME_Address, long *Data);
87
short VME_LED_settings(usb_dev_handle *hdev, int LED, int code, int invert, int latch);
88
short 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);
89
 
90
short VME_Output_settings(usb_dev_handle *hdev, int Channel, int code, int invert, int latch);
91
 
92
short VME_read_16(usb_dev_handle *hdev,short Address_Modifier, long VME_Address, long *Data);
93
short VME_read_32(usb_dev_handle *hdev, short Address_Modifier, long VME_Address, long *Data);
94
short VME_BLT_read_32(usb_dev_handle *hdev, short Address_Modifier, int count, long VME_Address, long Data[]);
95
short VME_write_16(usb_dev_handle *hdev, short Address_Modifier, long VME_Address, long Data);
96
short VME_write_32(usb_dev_handle *hdev, short Address_Modifier, long VME_Address, long Data);
97
 
98
short CAMAC_DGG(usb_dev_handle *hdev, short channel, short trigger, short output, int delay, int gate, short invert, short latch);
99
short CAMAC_register_read(usb_dev_handle *hdev, int A, long *Data);
100
short CAMAC_register_write(usb_dev_handle *hdev, int A, long Data);
101
short CAMAC_LED_settings(usb_dev_handle *hdev, int LED, int code, int invert, int latch);
102
short CAMAC_Output_settings(usb_dev_handle *hdev, int Channel, int code, int invert, int latch);
103
short CAMAC_read_LAM_mask(usb_dev_handle *hdev, long *Data);
104
short CAMAC_write_LAM_mask(usb_dev_handle *hdev, long Data);
105
 
106
short CAMAC_write(usb_dev_handle *hdev, int N, int A, int F, long Data, int *Q, int *X);
107
short CAMAC_read(usb_dev_handle *hdev, int N, int A, int F, long *Data, int *Q, int *X);
108
short CAMAC_Z(usb_dev_handle *hdev);
109
short CAMAC_C(usb_dev_handle *hdev);
110
short CAMAC_I(usb_dev_handle *hdev, int inhibit); 
111