Skip to main content

iic (I2C) ioctl wrapper for FreeBSD

Project description

FreeBSD I2C wrapper for Python

The pyfbsdi2c-tspspi project contains a very thin wrapper for the ioctl requests for the iic device on FreeBSD to test various hardware devices from Python. It allows direct access to the I2C bus on devices like the RaspberryPi when running under FreeBSD.

Installation

pip install pyfbsdi2c-tspspi

Usage

The bus can be instantiated using context management of it's constructor. One can select the bus via it's first constructor argument:

from fbsdi2c import FbsdI2C

To instantiate via context management one can use:

with FbsdI2C() as i2c:
    # Use i2c.

To instantiate using the constructor:

i2c = FbsdI2C()
# Use i2c.

To use multiple busses:

i2c0 = FbsdI2C("/dev/iic0")
i2c1 = FbsdI2C("/dev/iic1")

Supported methods

This module exposes the pylabdevs I2CBus interface:

Scanning for bus devices

To print a list with all device addresses that respond:

with FbsdI2C() as i2c:
    print(i2c.scan())

Reading and writing from a buffer

with FbsdI2C() as i2c:
    i2c.write(0x33, bytearray(1,2,3))
    data = i2c.read(0x33, 5)

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

pyfbsdi2c_tspspi-0.0.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyfbsdi2c_tspspi-0.0.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file pyfbsdi2c_tspspi-0.0.1.tar.gz.

File metadata

  • Download URL: pyfbsdi2c_tspspi-0.0.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.13

File hashes

Hashes for pyfbsdi2c_tspspi-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0e3fdfe33a0e0b3c83314b368f09ab2ec279b46f70a75226d287847fd40896ff
MD5 a4cbc5aed1a86a6a3e0468e116c501f2
BLAKE2b-256 6961d70cf0380acfdc3030ce3a46a550a097cedf64a893ca7e12c00aa1a2a68f

See more details on using hashes here.

File details

Details for the file pyfbsdi2c_tspspi-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pyfbsdi2c_tspspi-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9fbd74c3408e3d2bcb6a872fd4d850675467eae22dfaaaa29b0ca0e6782694f7
MD5 51de3bb75241ab014e0f63a317e6070d
BLAKE2b-256 4da4e9ac258eed47269d602acb82a3d6685fe94393365cdc1b19f6c5f1964e2a

See more details on using hashes here.

Supported by

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