Skip to content

Commit a0cb593

Browse files
committed
Fix docs and attribution
1 parent 8454b24 commit a0cb593

File tree

6 files changed

+33
-3
lines changed

6 files changed

+33
-3
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ sensor drivers. For details, please read the package description in
55
[README.rst](README.rst).
66

77

8+
## Attribution ** FORK **
9+
10+
This library is a fork of the official python library from Sensirion, to
11+
add support for CircuitPython on embedded devices and linux SBCs.
12+
813
## Usage
914

1015
See package description in [README.rst](README.rst) and user manual at

README.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,10 @@ Installation and Usage
1919
----------------------
2020

2121
The user manual is available at https://sensirion.github.io/python-i2c-driver/.
22+
23+
24+
Attribution
25+
-----------
26+
27+
This library is a fork of the official python library from Sensirion, to
28+
add support for CircuitPython on embedded devices and linux SBCs.

docs/index.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ This package contains the base driver for Sensirion I²C devices. It provides
55
a hardware-independent interface to allow writing device drivers which work
66
with various I²C transceivers.
77

8+
Attribution
9+
-----------
10+
11+
This library is a fork of the official python library from Sensirion, to
12+
add support for CircuitPython on embedded devices and linux SBCs.
813

914
Contents
1015
--------

docs/logging_debugging.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ Logging / Debugging
22
===================
33

44
Every module of this package uses the `Python Logging Facility`_ to log debug
5-
messages, warnings etc. This page gives a quick overview how it works.
5+
messages, warnings etc when run on a Single Board Computer (SBC).
6+
It uses the `adafruit_logging` library for CircuitPython when run on embedded
7+
hardware, which is a CPython compatible alternative.
8+
This page gives a quick overview how the logging works.
69

710
Usage
811
-----
@@ -69,6 +72,8 @@ only critical messages will be logged):
6972
# Make connection less verbose
7073
sensirion_i2c_driver.connection.log.setLevel(level=logging.CRITICAL)
7174

75+
# or, assuming import board
76+
# with CircuitPythonI2cTransceiver(board.I2C()) as transceiver:
7277
with LinuxI2cTransceiver('/dev/i2c-1') as transceiver:
7378
device = I2cDevice(I2cConnection(transceiver), slave_address=0x69)
7479
response = device.execute(I2cCommand(tx_data=b"\x80\x04", rx_length=6,

docs/quickstart.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Following example code shows how the driver is intended to use:
1313
.. sourcecode:: python
1414

1515
from struct import pack
16-
from sensirion_i2c_driver import LinuxI2cTransceiver, I2cConnection, \
16+
from sensirion_i2c_driver import I2cTransceiver, I2cConnection, \
1717
I2cDevice, SensirionI2cCommand, CrcCalculator
1818

1919

@@ -44,6 +44,7 @@ Following example code shows how the driver is intended to use:
4444

4545

4646
# Usage
47-
with LinuxI2cTransceiver('/dev/i2c-1') as transceiver:
47+
# I2cTransceiver import is Automatically switched between Linux/CircuitPython
48+
with I2cTransceiver('/dev/i2c-1') as transceiver:
4849
device = MyI2cDevice(I2cConnection(transceiver))
4950
print("Serial Number: {}".format(device.read_serial_number()))

docs/transceivers.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ transceivers, i.e. the low level code which controls the I²C hardware:
1313
to use an I²C device file provided by the Linux Kernel (e.g. "/dev/i2c-1").
1414
This transceiver allows to use for example the I²C pins of a Raspberry Pi.
1515

16+
- :py:class:`~sensirion_i2c_driver.circuitpython_i2c_transceiver.CircuitPythonI2cTransceiver`
17+
to use an I²C bus provided by adafruit_bus_device (e.g. board.I2C()).
18+
This transceiver allows to use for example the I²C pins of an ESP32.
19+
20+
- :py:class:`~sensirion_i2c_driver.I2cTransceiver`
21+
An alias to Linux/CircuitPython I2cTransceiver, based on if embedded device.
22+
1623
Other implementations are provided in separate Python packages (for
1724
architecture reasons). But to avoid having dependencies from those Packages
1825
to this one just to implement the transceiver interface, we define a backward

0 commit comments

Comments
 (0)