CREAM TEA -- ROOT MCP

stdUSB.h

00001 /*****
00002  
00003 stdUSBL - A libusb implementation of ezusbsys.
00004 
00005 StdUSB libusb implementation used here uses same function interface with native stdUSB Windows WDM driver.
00006  
00007 *****/
00008 
00009 //#include <stdio.h>
00010 #include <usb.h>
00011 #include <stdint.h>
00012 
00013 class stdUSB {
00014 public:
00015     stdUSB(void);
00016     ~stdUSB(void);
00017 
00018     bool createHandles(void);
00019     bool freeHandles(void);;
00020     bool freeHandle(void);
00021     //bool sendData(unsigned short data);
00022     bool sendData(unsigned int data);
00023     bool readData(unsigned short * pData, int l, int* lread);
00024 
00025     static const bool SUCCEED = true;
00026     static const bool FAILED  = false;
00027 private:
00028     struct usb_device* init(void);
00029 
00030     #define INVALID_HANDLE_VALUE NULL
00031     #define USB_TOUT_MS 1000 //200 ms
00032     //#define USB_TOUT_MS 50  // 50 ms
00033     #define USBFX2_EP_WRITE 0x02 //USBFX2 end point address for bulk write
00034     #define USBFX2_EP_READ 0x86 //USBFX2 end point address for bulk read
00035     #define USBFX2_INTFNO 0 //USBFX2 interface number
00036     #define USBFX2_CNFNO 1 //USBFX2 configuration number
00037 
00038     /* USBFX2 device descriptions */
00039     static const uint16_t USBFX2_VENDOR_ID = 0x6672; //0x090c;
00040     static const uint16_t USBFX2_PRODUCT_ID = 0x2920; //0x1000;
00041 protected:
00042     /* The handle to the usb device. Needed by write & read operations. */
00043     struct usb_dev_handle* stdHandle;
00044 };

Generated on Tue Nov 24 19:05:00 2009 for CREAM TEA -- MCP/TARGET Readout by doxygen 1.3.9.1