USBP Basic Python
Some information for the USBP project is available on the USBP wiki. Some of the information has been out dated and is being posted on this blog. The USBP project provides a C/C++ library that wraps generic USB drivers and provides some canned functions (example configuring an FPGA). The USBP project also provides a Python wrapper for the library. The Python class also adds additional functionality.
The USBP Python provides a flexible environment for interfacing with USB FPGA boards. The Python module can also be used interactively. It can be useful to peek and poke wishbone registers interactively.
The following is a very basic Python example to open an interface to an USB FPGA board. Different boards are support.
>>> import usbp
>>> usb = usbp.USBP("ufo400")
# Load the FX2 Firmware
>>> usb.LoadFxFirmware('usbp_v1.hex')
# Configure the FPGA on the Development Board
>>> usb.ConfigFPGA('usbp_top.bit')
Using they Python USBP class is very simple and provides additional functions to send and receive data, read/write to the wishbone bus and read/write to the I2C bus on the USB controller.