Skip to main content

Python utilities for RedPitaya

Project description

pyrp3

Python 3 port (using 2to3) of PyRedPitaya library in the pyrp3 namespace.

Note: The following is a copy of the Readme from the original repo and might not work with this version of the library.

Overview

This package provides a library to access the Red Pitaya registers. This library consist of a C library (libmonitor.c) and a ctypes interface on the Python side.

An object-oriented interface to the different application (scope, generator, PID, AMS, ...) is provided. This interface is implemented using Python properties (see usage below) and can quickly be extended to your own application.

A rpyc server is used in order to communicate with your computer. The interface is the same on the computer as the one on the board.

Installation

To install `pyrp3`` on any machine, run the command:

  pip3 install pyrp3

Usage

You need to have Python installed on you Red Pitaya.

Interactive Python

Logging onto the redpitaya using ssh, one can start the ipython shell and run :

    from pyrp3.board import RedPitaya

    redpitaya = RedPitaya()

    print(redpitaya.ams.temp) # Read property
    redpitaya.hk.led = 0b10101010 # Write property

Remote access

You need to install the pyrp3 package on your PC as well as rpyc:

    rpyc_server

On the computer (replace REDPITAYA_IP by the string containing the IP address) :

    from rpyc import connect
    from pyrp3.pc import RedPitaya

    conn = connect(REDPITAYA_IP, port=18861)
    redpitaya = RedPitaya(conn)

    print(redpitaya.read(0x40000000)) # Direct access

    print(redpitaya.ams.temp) # Read property
    redpitaya.hk.led = 0b10101010 # Write property

    from time import sleep
    from pylab import *

    redpitaya.scope.setup(frequency = 100, trigger_source=1)
    sleep(100E-3)
    plot(redpitaya.scope.times, redpitaya.scope.data_ch1)
    show()

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

pyrp3-2.0.2rc1.tar.gz (14.0 kB view details)

Uploaded Source

File details

Details for the file pyrp3-2.0.2rc1.tar.gz.

File metadata

  • Download URL: pyrp3-2.0.2rc1.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for pyrp3-2.0.2rc1.tar.gz
Algorithm Hash digest
SHA256 8f91fcdd7c8a89aaf43df8714258786b49fbbe7d100d98357c9b0503f268c706
MD5 9b1eba9cc41185d5b78ecf2b5c8d107c
BLAKE2b-256 da1d807184205c51befa0662be916f655f90556432c56b7a798545d7bb516e9f

See more details on using hashes here.

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