libnjb  2.2.6
usb_io.h
1 #ifndef __NJB__USB__IO__H
2 #define __NJB__USB__IO__H
3 
4 #include "libnjb.h"
5 
6 #define USBTIMEOUT 50000
7 
8 #include <usb.h>
9 
10 /*
11  * Legacy #defines that map native *BSD USB #defines to those used by
12  * libusb. Some day we'll get rid of these.
13  */
14 
15 #ifndef UT_WRITE
16 #define UT_WRITE USB_ENDPOINT_OUT
17 #endif
18 
19 #ifndef UT_READ
20 #define UT_READ USB_ENDPOINT_IN
21 #endif
22 
23 #ifndef UT_CLASS
24 #define UT_CLASS USB_TYPE_CLASS
25 #endif
26 
27 #ifndef UT_STANDARD
28 #define UT_STANDARD USB_TYPE_STANDARD
29 #endif
30 
31 #ifndef UT_WRITE_VENDOR_OTHER
32 #define UT_WRITE_VENDOR_OTHER (UT_WRITE | USB_TYPE_VENDOR | USB_RECIP_OTHER )
33 #endif
34 
35 #ifndef UT_READ_VENDOR_OTHER
36 #define UT_READ_VENDOR_OTHER (UT_READ | USB_TYPE_VENDOR | USB_RECIP_OTHER )
37 #endif
38 
39 ssize_t usb_pipe_read (njb_t *njb, void *buf, size_t nbytes);
40 ssize_t usb_pipe_write (njb_t *njb, void *buf, size_t nbytes);
41 int usb_setup (njb_t *njb, int type, int request, int value,
42  int index, int length, void *data);
43 
44 #endif
ssize_t usb_pipe_write(njb_t *njb, void *buf, size_t nbytes)
Definition: usb_io.c:27
ssize_t usb_pipe_read(njb_t *njb, void *buf, size_t nbytes)
Definition: usb_io.c:76
int usb_setup(njb_t *njb, int type, int request, int value, int index, int length, void *data)
Definition: usb_io.c:123
Definition: libnjb.h:182