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
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
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135 }}
00136