usbp_cyusb.h

Go to the documentation of this file.
00001 
00030 #ifndef _USBP_CYUSB_H_
00031 #define _USBP_CYUSB_H_
00032 
00033 #include "windows.h"
00034 
00035 #include "CyAPI.h"
00036 #include "usbp_iusb_driver.h"
00037 
00038 
00039 class CUsbpCyUSB : public iUSB_Driver
00040 {
00041   
00042 private:
00043   HANDLE m_hWnd;  
00044   CCyBulkEndPoint *BulkOutEpt2;
00045   CCyBulkEndPoint *BulkInEpt6;
00046   CCyBulkEndPoint *BulkOutEpt4;
00047   CCyBulkEndPoint *BulkInEpt8;
00048 
00049 protected:
00050   
00051 public:
00052   CCyUSBDevice   *USBDevice;
00060   CCyUSBEndPoint *OutEndpt;
00061   CCyUSBEndPoint *InEndpt;
00062   
00063   CUsbpCyUSB(){
00064     USBDevice = NULL;
00065     OutEndpt  = NULL;
00066     InEndpt   = NULL;
00067     BulkOutEpt2 = NULL;
00068     BulkInEpt6  = NULL;
00069     BulkOutEpt4 = NULL;
00070     BulkInEpt8  = NULL;
00071   }
00072   
00073   virtual ~CUsbpCyUSB(){
00074     if(USBDevice) 
00075       delete USBDevice;
00076     USBDevice = NULL;
00077     BulkOutEpt2 = NULL;
00078     BulkInEpt6  = NULL;
00079     BulkOutEpt4 = NULL;
00080     BulkInEpt8  = NULL;
00081   }
00082   
00083   int deviceInfo(void);
00084   int deviceInfo(int vid, int pid);
00085   int deviceOpen(int vid, int pid);
00086   int deviceStatus(void);
00087   int deviceCheck(void);
00088   int deviceClose(int vid, int pid);
00089   
00090   int controlWrite(byte reqCode,
00091                    unsigned short value,
00092                    unsigned short index,
00093                    byte *b, int len, int timeout);
00094   
00095   int bulkRead(int ep, int size, byte *b);
00096   int bulkWrite(int ep, int size, byte *b);
00097   int bulkWriteRead(int ep_out, int ep_in, int size, byte *b);
00098 
00099   int assignEpt(void);
00100 };
00101 
00102 #endif

Generated on Mon Mar 5 20:44:19 2007 for usbp by  doxygen 1.5.1-p1