Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,12 @@ For special setups you find the sensor pinout in the section below.
## Documentation & Quickstart

See the [documentation page](https://sensirion.github.io/python-i2c-stcc4) for an API description and a
[quickstart](https://sensirion.github.io/python-i2c-stcc4/execute-measurements.html) example.
[quickstart](https://sensirion.github.io/python-i2c-stcc4/quickstart.html) example.


## Contributing

### Check coding style

The coding style can be checked with [`flake8`](http://flake8.pycqa.org/):

```bash
pip install -e .[test] # Install requirements
flake8 # Run style check
```

In addition, we check the formatting of files with
[`editorconfig-checker`](https://editorconfig-checker.github.io/):

```bash
pip install editorconfig-checker==2.0.3 # Install requirements
editorconfig-checker # Run check
```
In case you want to contribute to this project, please read the [contribution guidelines]((https://sensirion.github.io/python-i2c-stcc4/contributing.html)).

## License

Expand Down
26 changes: 0 additions & 26 deletions ci/checkin_doc.sh

This file was deleted.

16 changes: 0 additions & 16 deletions ci/set_git_config.sh

This file was deleted.

3 changes: 1 addition & 2 deletions docs/build-documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ The documentation is built with `Sphinx <http://www.sphinx-doc.org>`_:

.. code-block:: bash

python setup.py install # Install package
pip install -r docs/requirements.txt # Install requirements
python -m pip install .[docs] # Install doc requirements
sphinx-build -b html docs docs/_build/html # Build documentation
3 changes: 3 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
from datetime import datetime

import importlib.metadata as metadata
import sphinx_tabs.tabs

import sphinx.ext.autodoc

import sensirion_i2c_stcc4
Expand Down Expand Up @@ -37,6 +39,7 @@
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'sphinx_tabs.tabs',
'sphinx.ext.inheritance_diagram',
'sphinx.ext.githubpages',
'sphinx.ext.intersphinx',
Expand Down
25 changes: 25 additions & 0 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Contributing
------------

Contributions are welcome. To keep this driver lean and focused, contributions
should be limited to bug fixes, maintenance, and improvements that make the
driver API more convenient to use.

The driver is intended to provide a minimal interface to the sensor. Application-
specific functionality and higher-level features should be implemented in an
application layer rather than added to the driver.

.. note::

This driver is generated from a model. Contributions may therefore be
incorporated into the underlying model and regenerated. Changes made only
to the generated code may be overwritten by a future driver generation.

Before submitting a contribution, make sure that:

- All CI pipeline checks pass.
- The code passes the `flake8` checks.
- The code complies with the repository's `.editorconfig` configuration.

Pull requests that introduce new functionality should preserve the scope and
purpose of the driver described above.
45 changes: 45 additions & 0 deletions docs/dev-setup.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
To prepare your development environment, check out the repository,
create a Python virtual environment, and activate it.
Then install the driver in editable mode using `pip`.

Check out the Git repository to your local machine:

.. code-block:: console

git clone <url-of-driver-repository>
cd <checkout-folder>

Create a Python virtual environment:

.. code-block:: console

python -m venv .venv

Activate the virtual environment:

.. tabs::

.. group-tab:: Bash

.. code-block:: console

source .venv/bin/activate

.. group-tab:: PowerShell

.. code-block:: console

.venv\Scripts\Activate.ps1

.. group-tab:: Command Prompt

.. code-block:: console

.venv\Scripts\activate.bat

Install the driver in editable mode together with the development dependencies:

.. code-block:: console

python -m pip install -e .

4 changes: 4 additions & 0 deletions docs/development.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Development
===========

For development, you first need to prepare your setup.

.. include:: dev-setup.rst

.. toctree::

run-tests
Expand Down
37 changes: 37 additions & 0 deletions docs/driver-installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
The driver installation consists of creating a Python virtual environment,
activating it, and installing the driver using `pip`.

Create a Python virtual environment:

.. code-block:: console

python -m venv .venv

Activate the virtual environment:

.. tabs::

.. group-tab:: Bash


.. code-block:: console

source .venv/bin/activate

.. group-tab:: PowerShell

.. code-block:: console

.venv\Scripts\Activate.ps1

.. group-tab:: Command Prompt

.. code-block:: console

.venv\Scripts\activate.bat

Install the driver:

.. code-block:: console

python -m pip install sensirion_i2c_stcc4
58 changes: 33 additions & 25 deletions docs/execute-measurements.rst
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
Execute measurements with SensorBridge
=======================================
Install the STCC4 Driver
------------------------

The following steps show how to use this driver on a Windows system using the `Sensirion SEK-SensorBridge`_ to
execute a simple measurement.
.. include:: driver-installation.rst

1. Install the STCC4 driver and all required packages as described in :ref:`Installation`.
2. Install the driver for the `Sensirion SEK-SensorBridge`_

.. sourcecode:: bash
Use the SensorBridge on Windows
-------------------------------

pip install sensirion-shdlc-sensorbridge
1. Install the driver for the `Sensirion SEK-SensorBridge`_:

3. Connect the SEK-SensorBridge to your PC over USB
.. code-block:: console

a. If the SEK-SensorBridge is not detected by your system, follow the `SensorBridge FTDI Driver Installation`_
python -m pip install sensirion-shdlc-sensorbridge

4. Connect the STCC4 sensor to the SEK-SensorBridge
5. Run the example script from the root of the repository.
2. Connect the SEK-SensorBridge to your PC over USB.

By default the script assumes the SensorBridge is connected to :code:`COM1` serial port. If this is different on your system,
pass the port in use with the :code:`--serial-port` parameter as outlined below.
If the SEK-SensorBridge is not detected by your system, follow the
`SensorBridge FTDI Driver Installation`_.

.. sourcecode:: bash
3. Connect the STCC4 sensor to the SEK-SensorBridge.

4. Run the example script from the root of the repository.

By default, the script assumes that the SensorBridge is connected to the
``COM1`` serial port. If a different port is used, specify it with the
``--serial-port`` parameter:

.. code-block:: console

python examples/example_usage_sensorbridge_stcc4.py --serial-port <your COM port>

Expand All @@ -35,20 +40,23 @@ Example script
.. literalinclude:: ../examples/example_usage_sensorbridge_stcc4.py
:language: python

Execute measurements using internal Linux I²C driver
====================================================

On Linux systems it is furthermore possible to use the Linux user space I²C driver directly.
How this can be done is shown in the following.
Use the Linux I²C Driver
------------------------

On Linux systems, the sensor can alternatively be accessed directly through
the Linux user-space I²C driver.

1. Connect the STCC4 sensor to an I²C port of your system, for example I²C
port 1 of a Raspberry Pi.

1. Install the STCC4 driver and all required packages as described in :ref:`Installation`.
2. Connect the STCC4 sensor to the I²C port of your system (for example to the I²C port 1 of a Raspberry Pi).
3. Run the example script from the root of the repository.
2. Run the example script from the root of the repository.

By default the script assumes you have the sensor connected to :code:`/dev/i2c-1`.
If this is different on your system, pass the port in use with the :code:`--i2c-port` parameter as outlined below.
By default, the script assumes that the sensor is connected to
``/dev/i2c-1``. If a different port is used, specify it with the
``--i2c-port`` parameter:

.. sourcecode:: bash
.. code-block:: console

python examples/example_usage_linux_stcc4.py --i2c-port <your I2C port>

Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ Contents
installation
quickstart
development
contributing
api
9 changes: 3 additions & 6 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
Installation
============

The package can be installed with pip:
It is assumed that you have a working Python installation on your system.
If not, please install Python first including `pip <https://pip.pypa.io/en/stable/installation/>`_.

.. sourcecode:: bash

pip install sensirion_i2c_stcc4

Recommended usage is within a virtualenv.
.. include:: driver-installation.rst
4 changes: 4 additions & 0 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Quick Start
===========

Learn how to quickly get started with the STCC4 and perform your first measurements using
the provided usage examples.


.. toctree::

execute-measurements
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
click==8.0.4
jinja2~=3.1.0
sphinx~=7.1.0
sphinx-tabs~=3.5.0
sphinx_rtd_theme~=1.3.0
5 changes: 1 addition & 4 deletions docs/run-tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Unit tests can be run with `pytest <https://pytest.org>`_:

.. code-block:: bash

pip install -e .[test] # Install requirements
pip install -e .[test] # Install test requirements


We provide a mock implementation that allows you to execute the tests for STCC4 without hardware.
Expand All @@ -26,6 +26,3 @@ attached to COM1 you can start the tests with the following command:
.. note::
The SensorBridge must have default settings (baudrate 460800, address 0)




14 changes: 7 additions & 7 deletions metadata.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# driver generation metadata
generator_version: 1.6.1
model_version: 3.5.1
dg_status: released
is_manually_modified: false
first_generated: '2025-02-24 11:47'
last_generated: '2026-04-30 12:17'
# driver generation metadata
generator_version: 1.9.1
model_version: 3.5.1
dg_status: released
is_manually_modified: false
first_generated: '2025-02-24 11:47'
last_generated: '2026-09-15 17:23'
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ description = "I2C driver for the Sensirion STCC4 sensor family"

readme = "README.md"
version = "1.1.0"
requires-python = ">=3.8,<4.0"

requires-python = ">=3.8.4,<4.0"

authors = [
{ name = "Sensirion", email = "info@sensirion.com" },
Expand Down Expand Up @@ -45,8 +46,10 @@ dependencies = [
docs=[
"jinja2~=3.1.6",
"sphinx-rtd-theme==3.0.2",
"sphinx==8.2.3",
"sphinx>=7.0,<8.0;python_version < '3.11'",
"sphinx==8.2.3;python_version >= '3.11'",
"lazy-object-proxy ~=1.7.1",
"sphinx-tabs~=3.5.0",
"sphinx-autoapi~=3.0.0",
]

Expand Down
Loading