usbp_boost.cpp

Go to the documentation of this file.
00001 
00034 #include <boost/python.hpp>
00035 #include <boost/python/list.hpp>
00036 #include <boost/python/extract.hpp>
00037 #include "usbp_boost.h"
00038 #include "usbp_pbrd_v01.h"
00039 #include "usbp_pbrd_blank.h"
00040 #include "usbp_xs3sk.h"
00041 #include "usbp_cyusb.h"
00042 //#include "num_util.h"
00043 
00044 
00045 using namespace boost::python;
00046 
00047 
00048 namespace usbp {
00049 namespace Python {
00056 BOOST_PYTHON_MODULE(USBP)
00057 {
00061   class_<USBP_PBRD_BLANK>("BLANK", init<>())
00062     .def("initUSB",        &USBP_PBRD_BLANK::init_usb,        "Init the USB Bus")               
00063     .def("loadFxFirmware", &USBP_PBRD_BLANK::loadFxFirmware,  "Load the FX2 Firmware")          
00064     .def("info",           &USBP_PBRD_BLANK::info,            "Get info about the USB bus")     
00065     .def("deviceInfo",     &USBP_PBRD_BLANK::deviceInfo,      "Get info about the USB device")  
00066     .def("writeVID_PID",   &USBP_PBRD_BLANK::writeVID_PID,    "Set VID and PID")                
00067     ;
00068   
00072   class_<USBP_PBRD_V01>("PBRD01", init<>())
00073     .def("initUSB",         &USBP_PBRD_V01::init_usb,           "Init USB Bus")
00074     .def("loadFxFirmware",  &USBP_PBRD_V01::loadFxFirmware,     "Load FX2 Firmware")
00075     .def("configFPGA",      &USBP_PBRD_V01::configFPGA,         "Configure the FPGA")
00076     .def("info",            &USBP_PBRD_V01::info,               "Get USB Bus Info")
00077     .def("deviceInfo",      &USBP_PBRD_V01::deviceInfo,         "Get USB Device Info")
00078     .def("ReadData",        &USBP_PBRD_V01::PyReadData,         "Read Data")
00079     .def("WriteData",       &USBP_PBRD_V01::PyWriteData,        "Write Data")
00080     .def("ReadReg",         &USBP_PBRD_V01::ReadReg,            "Read a Register")
00081     .def("WriteReg",        &USBP_PBRD_V01::WriteReg,           "Write a Register")
00082         .def("xferFPGA",        &USBP_PBRD_V01::testFPGAXfer,       "TEST Data Xfer")
00083     .def("xferTest",        &USBP_PBRD_V01::testXferLoopback,   "TEST LoopBack")
00084     .def("speedTest",       &USBP_PBRD_V01::testFPGAXferSpeed,  "TEST Speed")
00085     ;
00086 
00090   class_<USBP_XS3SK>("XS3SK", init<>())
00091     .def("initUSB",             &USBP_XS3SK::init_usb)
00092     .def("loadFxFirmware",      &USBP_XS3SK::loadFxFirmware)
00093     .def("configFPGA",          &USBP_XS3SK::configFPGA)
00094     .def("info",                &USBP_XS3SK::info)
00095     .def("deviceInfo",          &USBP_XS3SK::deviceInfo)
00096     .def("xfer",                &USBP_XS3SK::sendData)
00097     ;
00098 }
00099 
00100 //BOOST_PYTHON_MODULE(XS3SK)
00101 //{
00102 //  class_<USBP_XS3SK>("USBP_XS3SK", init<>())
00103 //    .def("initUSB",             &USBP_XS3SK::init_usb)
00104 //    .def("loadFxFirmware",      &USBP_XS3SK::loadFxFirmware)
00105 //    .def("configFPGA",          &USBP_XS3SK::configFPGA)
00106 //    .def("info",                &USBP_XS3SK::info)
00107 //    .def("deviceInfo",          &USBP_XS3SK::deviceInfo)
00108 //    .def("xfer",                &USBP_XS3SK::sendData)
00109 //    ;
00110 //}
00111 
00112 
00121 //BOOST_PYTHON_MODULE(CyUSB)
00122 //{
00123 //  class_<CUsbpCyUSB >("CUsbpCyUSB", init<>())
00124 //    .def("Info",                &CUsbpCyUSB::deviceInfo)
00125 //    .def("Open",                &CUsbpCyUSB::deviceOpen)
00126 //    .def("Status",              &CUsbpCyUSB::deviceStatus)
00127 //    .def("Check",               &CUsbpCyUSB::deviceCheck)
00128 //    .def("Close",               &CUsbpCyUSB::deviceClose)
00129 //    .def("controlWrite",        &CUsbpCyUSB::controlWrite)
00130 //    .def("bulkRead",            &CUsbpCyUSB::bulkRead)
00131 //    .def("bulkWrite",           &CUsbpCyUSB::bulkWrite)
00132 //    .def("assignEpt",           &CUsbpCyUSB::assignEpt)
00133 //}
00134 
00135 }}
00136 // End usbp_boost.cpp

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