usbp_xs3sk.h

Go to the documentation of this file.
00001 
00027 #ifndef __USBP_XS3SK_H__
00028 #define __USBP_XS3SK_H__
00029 
00030 #include <string>
00031 #include "usbp_iusb_driver.h"
00032 #include "usbp_iusb_device.h"
00033 #include "usbp_iusb_fpga.h"
00034 
00035 #include "usbp_cyusb.h"
00036 #include "usbp_fx2lp_8051.h"
00037 #include "usbp_xilinx_xs3.h"
00038 
00039 #include "usbp.h"
00040 
00041 using namespace std;
00042 
00046 class USBP_XS3SK : public USBP
00047 {
00048 
00049 public:
00050   USBP_XS3SK(){
00051     UsbD      = new CUsbpCyUSB;
00052     UsbFpga   = new XILINX_XS3;
00053     UsbDevice = new FX2LP_8051;
00054 
00055     UsbFpga->setUSB(UsbD);
00056     UsbDevice->setUSB(UsbD);
00057     
00058     iVid = 0x1443; iPid = 0x0003;
00059     rVid = 0x1443; rPid = 0x0030;
00060   }
00061   
00065   virtual ~USBP_XS3SK(){
00066     if(UsbD)
00067       delete UsbD;
00068     if(UsbFpga)
00069       delete UsbFpga;
00070     if(UsbDevice)
00071       delete UsbDevice;
00072 
00073     UsbD      = NULL;
00074     UsbFpga   = NULL;
00075     UsbDevice = NULL;
00076   }
00077 
00079   int init_usb(void){
00080     return init(iVid, iPid);
00081   }
00083   int loadFxFirmware(string file){
00084     return UsbDevice->downloadFirmware(file, rVid, rPid);
00085   }
00087   int configFPGA(string file){
00088     return UsbFpga->downloadConfigFile(file);
00089   }
00091   int sendData(int addr, int data){
00092     byte wb[2] = {(byte)data,(byte)addr};
00093     return UsbFpga->writeData(wb, 2);
00094   }
00096   string info() { return "USB Protype System"; } 
00097   int deviceInfo(){ UsbD->deviceInfo(); return 0; }
00098   
00099 };
00100 
00101 #endif

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