libnjb  2.2.7
usb_io.h
00001 #ifndef __NJB__USB__IO__H
00002 #define __NJB__USB__IO__H
00003 
00004 #include "libnjb.h"
00005 
00006 /* Timeout floor, 5 seconds */
00007 #define USBTIMEOUT 5000
00008 
00009 #include <usb.h>
00010 
00011 /*
00012  * Legacy #defines that map native *BSD USB #defines to those used by
00013  * libusb.  Some day we'll get rid of these.
00014  */
00015 
00016 #ifndef UT_WRITE
00017 #define UT_WRITE        USB_ENDPOINT_OUT
00018 #endif
00019 
00020 #ifndef UT_READ
00021 #define UT_READ         USB_ENDPOINT_IN
00022 #endif
00023 
00024 #ifndef UT_CLASS
00025 #define UT_CLASS        USB_TYPE_CLASS
00026 #endif
00027 
00028 #ifndef UT_STANDARD
00029 #define UT_STANDARD     USB_TYPE_STANDARD
00030 #endif
00031 
00032 #ifndef UT_WRITE_VENDOR_OTHER
00033 #define UT_WRITE_VENDOR_OTHER (UT_WRITE | USB_TYPE_VENDOR | USB_RECIP_OTHER )
00034 #endif
00035 
00036 #ifndef UT_READ_VENDOR_OTHER
00037 #define UT_READ_VENDOR_OTHER (UT_READ | USB_TYPE_VENDOR | USB_RECIP_OTHER )
00038 #endif
00039 
00040 ssize_t usb_pipe_read (njb_t *njb, void *buf, size_t nbytes);
00041 ssize_t usb_pipe_write (njb_t *njb, void *buf, size_t nbytes);
00042 int usb_setup (njb_t *njb, int type, int request, int value,
00043         int index, int length, void *data);
00044 
00045 #endif