Skip to main content

PyRPIIC

./icon.png

A [Py]thon 3 addon for [R]aspberry [Pi] that enables [i]nterfacing w/ a variety of low-level board [IC]s.

PyPI

Compatibility

  • Raspberry Pi Models: A, B (revisions 1.0 and 2.0), A+, B+, 2, 3, 3+, 3 A+, 4, Compute Module 3, Zero.
  • Python 3.7+

Install

Install the latest from PyPi:

pip install pyrpiic

Modules

Clocks

  • LMK612
  • SI570

EEPROMs

  • Generic
  • M24C02

I2C-GPIO Expanders

  • TCA6416A

Sensors

  • LDC1412
  • LDC1414
  • LDC1612
  • LDC1614

Examples

Clocks (Programmable Oscillators)

from pyrpio.i2c import I2C
from pyrpiic.clock.lmk61e2 import LMK61E2

# Create and open I2C-3 bus
i2c3 = I2C('/dev/i2c-3')
i2c3.open()

# Create clock
clock = LMK61E2(i2c3, 0x5A)

# Perform various clock operations
clock.set_frequency(156_250_000)
freq, regs = clock.get_frequency()
clock.regs2freq(regs)
clock.set_registers(regs)

# Close I2C-3 bus
i2c3.close()

I2C-GPIO Expander Example

from pyrpio.i2c import I2C
from pyrpiic.ioexpander.tca6416a import TCA6416A

# Create and open I2C-3 bus
i2c3 = I2C('/dev/i2c-3')
i2c3.open()

# Create gpio expander
gpio_exp = TCA6416A(i2c3, 0x21)

# Set GPIO P00 as output pulled high
gpio_exp.set_gpio_direction('P00', 'OUT')
gpio_exp.set_gpio_output('P00', high=True)

# Set GPIO P01 as input w/ flipped polarity and read value
gpio_exp.set_gpio_direction('P01', 'IN')
gpio_exp.set_gpio_polarity('P01', flipped=True)
gpio_exp.get_gpio_input('P01')

# Close I2C-3 bus
i2c3.close()

Release files for PyRPIIC 1.4.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 PyRPIIC 1.4.0
File Size Uploaded
PyRPIIC-1.4.0.tar.gz 20.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PyRPIIC 1.4.0
File Interpreter ABI Platform
PyRPIIC-1.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 46.4 kB

Release files / PyRPIIC-1.4.0.tar.gz

Download URL PyRPIIC-1.4.0.tar.gz
Size 20.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e4760abf159e4cc37e6a000d9cbc2a722df2c47d87dc66e19bd732d4a6dffe76
BLAKE2b-256 checksum
How to use checksums
4f07b824ddcb39e2d4f1015a9045c68259588e47abb91f3e4984db1f75adfb6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.7 CPython/3.8.11 Linux/5.4.92-flatcar

Release files / PyRPIIC-1.4.0-py3-none-any.whl

Download URL PyRPIIC-1.4.0-py3-none-any.whl
Size 26.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
610e3626226dd44014e36761f40573a08c872fa96ae5dee88440ad738bbd06d2
BLAKE2b-256 checksum
How to use checksums
949dd4513024331a373d1b3ab6b08dff25c776c44ba1c11c3624f1662df31784
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.7 CPython/3.8.11 Linux/5.4.92-flatcar

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

1 release file

0.0.4

1 release file

0.0.3

1 release file

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