Skip to main content

Python solution for communicating with peripheral ICs

Project description

Documentation Status

pyripherals is a Python package for communicating with peripheral electronic devices. It has a Register class to keep track of internal registers, but is most useful when used with a FrontPanel compatible Opal Kelly FPGA. With that, pyripherals makes use of the FrontPanel API for Python and Verilog to communicate more easily on common interfaces such as I2C and SPI.

Quick Start

  1. Install with pip

Note that not all of pyripherals will work with Python 3.10

pip install pyripherals

To use an FPGA and peripherals:

  1. Download FrontPanel from OpalKelly

  2. Download Registers.xlsx from the GitHub

  3. Create config.yaml with create_yaml and edit fields as needed

>>> from interfaces.utils import create_yaml
>>> create_yaml()
YAML created at C:/Users/username/.pyripherals

See Installation Guide for more information.

Documentation

Documentation is hosted on Read the Docs.

Acknowledgements

The FPGA code is dervied from many open-source contributions.

  • The Verilog I2C controller is from OpalKelly OpalKelly I2CController (MIT License).

  • The Verilog AD7961 controller is from Analog Devices and is free to use / redistribute as long as its used with Analog Devices parts (which must be the case since it does not work if connected to other parts). The Verilog is available within the EVAL-AD7960 evaluation kit software

  • The Verilog SPI Controller is from OpenCores.org and is authored by Simon Srot (GPL 2.1 or later license).

  • The Verilog wishbone master is written by Dan Gisselquist, Gisselquist Technology LLC. (LGPL, v3)

  • The DDR user interface (ddr_test.v) started with the OpalKelly DDR example provided in the FrontPanel example RAMTester and was significantly modified to support two ports.

The Python code relies on wonderful open source packages such as:

  • numpy
  • numfi
  • matplotlib
  • pandas
  • openpyxl
  • h5py
  • pyyaml
  • scipy

OpalKelly Module Compatibility.

We have targeted and tested with the XEM7310-A75 module (Xilinx Artix-7). We have not tested but anticipate reasonable portability to other USB 3 OpalKelly modules:

  • XEM7310MT
  • XEM7320
  • XEM7305
  • XEM7360

(Approximate) FPGA Block Diagram

This is the block diagram of the top_level_module.bit bitfile

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyripherals-0.0.3.tar.gz (60.6 kB view hashes)

Uploaded Source

Built Distribution

pyripherals-0.0.3-py3-none-any.whl (68.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page