MIDAS
Loading...
Searching...
No Matches
musbstd.h
Go to the documentation of this file.
1/********************************************************************\
2
3 Name: musbstd.h
4 Created by: Konstantin Olchanski, Stefan Ritt
5
6 Contents: Midas USB access
7
8 $Id$
9
10\********************************************************************/
11
12#ifndef MUSBSTD_H
13#define MUSBSTD_H
14
15#if defined(HAVE_LIBUSB)
16
17#include <usb.h>
18
19typedef struct {
22 int usb_interface;
23 int usb_type;
25
26#elif defined(HAVE_LIBUSB10)
27
28#include <libusb-1.0/libusb.h>
29
30typedef struct {
33 int usb_interface;
34 int usb_type;
36
37#elif defined(_MSC_VER)
38
39#include <windows.h>
40
41typedef struct {
44 int usb_type;
46
47#elif defined(OS_DARWIN)
48
49typedef struct {
50 void *device;
51 void *interface;
53 int usb_interface;
54 int usb_type;
56
57#else
58#error Do not know how to access USB devices
59#endif
60
61/*---- status codes ------------------------------------------------*/
62
63#define MUSB_SUCCESS 1
64#define MUSB_NOT_FOUND 2
65#define MUSB_INVALID_PARAM 3
66#define MUSB_NO_MEM 4
67#define MUSB_ACCESS_ERROR 5
68
69/* make functions callable from a C++ program */
70#ifdef __cplusplus
71extern "C" {
72#endif
73
74/* make functions under WinNT dll exportable */
75#ifndef EXPRT
76#if defined(_MSC_VER) && defined(_USRDLL)
77#define EXPRT __declspec(dllexport)
78#else
79#define EXPRT
80#endif
81#endif
82
90
91#ifdef __cplusplus
92}
93#endif
94
95#endif // MUSBSTD_H
struct usb_device * dev
Definition feccusb.cxx:80
INT index
Definition mana.cxx:271
double count
Definition mdump.cxx:33
int EXPRT musb_reset(MUSB_INTERFACE *musb_interface)
#define EXPRT
Definition musbstd.h:79
int EXPRT musb_set_altinterface(MUSB_INTERFACE *musb_interface, int index)
int EXPRT musb_get_device(MUSB_INTERFACE *musb_interface)
int EXPRT musb_write(MUSB_INTERFACE *musb_interface, int endpoint, const void *buf, int count, int timeout_ms)
int EXPRT musb_read(MUSB_INTERFACE *musb_interface, int endpoint, void *buf, int count, int timeout_ms)
int EXPRT musb_open(MUSB_INTERFACE **musb_interface, int vendor, int product, int instance, int configuration, int usbinterface)
int EXPRT musb_close(MUSB_INTERFACE *musb_interface)
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
Definition rmidas.h:24