Python API to access a USB attached PFx Brick.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
examples
pfxbrick
.gitignore
.travis.yml
CHANGELOG.rst
LICENSE.md
MANIFEST.in
Makefile
README.rst
builddocs.sh
buildwheels.sh
requirements.txt
setup.py

README.rst

PFx Brick Python API

https://travis-ci.org/fx-bricks/pfx-brick-py.svg?branch=master

This repository contains the API for developing python scripts and applications which communicate with the PFx Brick.

Getting Started

Requirements

  • Python 3.6+
  • hidapi
  • sphinx (for documentation)

Installation

The pfxbrick package can be installed with pip:

$ pip install pfxbrick

or directly from the source code:

$ git clone https://github.com/fx-bricks/pfx-brick-py.git
$ cd pfx-brick-py
$ python setup.py install

Basic Usage

After installation, the package can imported:

$ python
>>> import pfxbrick
>>> pfxbrick.__version__

An example of the package can be seen below

from pfxbrick import PFxBrick

# Open a PFx Brick session instance
brick = PFxBrick()
brick.open()

# Get the status and identity of the PFx Brick
print('PFx Brick ICD version : %s' %(brick.get_icd_rev()))
brick.get_status()
brick.print_status()

# Get the PFx Brick configuration settings
brick.get_config()
brick.print_config()

# Get the user defined name of the PFx Brick
brick.get_name()
print(brick.name)

# Change the user defined name
brick.set_name('My Cool Brick')

# End the session
brick.close()

Documentation

If you want to learn more about PFx Brick, check out our website.