PyDEPP is a Python library that provides a high-level, object-oriented interface for interacting with Digilent FPGA boards over the DEPP (Digilent Asynchronous Parallel Port) protocol. It leverages the Digilent Adept SDK to enable seamless communication with DEPP-compatible devices.
- Register Access: Read and write single or multiple registers with ease.
- Data Streaming: Stream data to and from registers for high-performance applications.
- Timeout Configuration: Set custom communication timeouts for DEPP operations.
- Context Management: Use Python's
with
statement for automatic resource management. - Debugging Tools: Includes a detailed register dump for inspection and debugging.
- Python 3.7 or higher
- Digilent Adept Runtime and SDK installed on your system
- Shared libraries
libdmgr.so
andlibdepp.so
available in your library paths
-
Clone the repository:
git clone https://github.com/0xMax42/pydepp.git cd pydepp
-
Install the library:
pip install .
from pydepp import AdeptDepp
DEVICE_NAME = "Basys3"
with AdeptDepp(DEVICE_NAME) as depp:
# Read a register
value = depp.get_reg(0)
print(f"Register 0 value: {value}")
# Write to a register
depp.set_reg(0, 42)
print("Wrote 42 to register 0")
# Stream data
data = bytes([1, 2, 3, 4, 5])
depp.put_stream(4, data)
print("Streamed data to register 4")
For a more comprehensive example, see the example.py
file in the repository.
- Initialization: Open a connection to a DEPP-compatible device.
- Register Access:
get_reg(reg: int) -> int
: Read a single register.set_reg(reg: int, value: int)
: Write to a single register.get_reg_block(addresses: List[int]) -> List[int]
: Read multiple registers.set_reg_block(addr_data: List[int])
: Write multiple registers.
- Data Streaming:
put_stream(reg: int, data: bytes)
: Stream data to a register.get_stream(reg: int, count: int) -> bytes
: Stream data from a register.
- Timeout:
set_timeout(timeout_ns: int)
: Set communication timeout in nanoseconds.
- Context Management:
- Use
with AdeptDepp(...)
for automatic resource cleanup.
- Use
To build the project, ensure you have setuptools
installed and run:
python setup.py sdist bdist_wheel
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request on the GitHub repository.