Skip to main content

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)

Release files for pyfbsdi2c-tspspi 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyfbsdi2c-tspspi 1.0.0
File Size Uploaded
pyfbsdi2c-tspspi-1.0.0.tar.gz 2.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyfbsdi2c-tspspi 1.0.0
File Interpreter ABI Platform
pyfbsdi2c_tspspi-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 5.4 kB

Release files / pyfbsdi2c-tspspi-1.0.0.tar.gz

Download URL pyfbsdi2c-tspspi-1.0.0.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f5c1b311d648c551ac33a95f3c155875400fee014befca9c9c521f9dc39192b5
BLAKE2b-256 checksum
How to use checksums
678f7bc414bacf55dceeb3f08483c29524e790b2211d96f16b58e5088c91b006
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.13

Release files / pyfbsdi2c_tspspi-1.0.0-py3-none-any.whl

Download URL pyfbsdi2c_tspspi-1.0.0-py3-none-any.whl
Size 2.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
185d763d54a1e9eb9e631e3d46f1606958dc7a85e69431bb4bb6d2f39c04c659
BLAKE2b-256 checksum
How to use checksums
58e6573fabc02c309cfcb69634970069a92fc455045bbecaa0535a195923f8a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.13

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page