-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
GitLab-CI
committed
Oct 17, 2023
1 parent
da807e4
commit 04bd252
Showing
66 changed files
with
22,528 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: ea8571ec8a0e73adedfc03c03561c38f | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<!DOCTYPE html> | ||
<html class="writer-html5" lang="en" > | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Overview: module code — sensirion_i2c_sfx6xxx 0.1.0 documentation</title> | ||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> | ||
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> | ||
<link rel="stylesheet" href="../_static/graphviz.css" type="text/css" /> | ||
<link rel="shortcut icon" href="../_static/favicon.ico"/> | ||
<!--[if lt IE 9]> | ||
<script src="../_static/js/html5shiv.min.js"></script> | ||
<![endif]--> | ||
|
||
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> | ||
<script src="../_static/jquery.js"></script> | ||
<script src="../_static/underscore.js"></script> | ||
<script src="../_static/doctools.js"></script> | ||
<script src="../_static/js/theme.js"></script> | ||
<link rel="index" title="Index" href="../genindex.html" /> | ||
<link rel="search" title="Search" href="../search.html" /> | ||
</head> | ||
|
||
<body class="wy-body-for-nav"> | ||
<div class="wy-grid-for-nav"> | ||
<nav data-toggle="wy-nav-shift" class="wy-nav-side"> | ||
<div class="wy-side-scroll"> | ||
<div class="wy-side-nav-search" > | ||
<a href="../index.html" class="icon icon-home"> sensirion_i2c_sfx6xxx | ||
</a> | ||
<div class="version"> | ||
0.1.0 | ||
</div> | ||
<div role="search"> | ||
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> | ||
<input type="text" name="q" placeholder="Search docs" /> | ||
<input type="hidden" name="check_keywords" value="yes" /> | ||
<input type="hidden" name="area" value="default" /> | ||
</form> | ||
</div> | ||
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../quickstart.html">Quick Start</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../development.html">Development</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../api.html">API Documentation</a></li> | ||
</ul> | ||
|
||
</div> | ||
</div> | ||
</nav> | ||
|
||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > | ||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> | ||
<a href="../index.html">sensirion_i2c_sfx6xxx</a> | ||
</nav> | ||
|
||
<div class="wy-nav-content"> | ||
<div class="rst-content"> | ||
<div role="navigation" aria-label="Page navigation"> | ||
<ul class="wy-breadcrumbs"> | ||
<li><a href="../index.html" class="icon icon-home"></a> »</li> | ||
<li>Overview: module code</li> | ||
<li class="wy-breadcrumbs-aside"> | ||
</li> | ||
</ul> | ||
<hr/> | ||
</div> | ||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> | ||
<div itemprop="articleBody"> | ||
|
||
<h1>All modules for which code is available</h1> | ||
<ul><li><a href="sensirion_i2c_sfx6xxx/commands.html">sensirion_i2c_sfx6xxx.commands</a></li> | ||
<li><a href="sensirion_i2c_sfx6xxx/device.html">sensirion_i2c_sfx6xxx.device</a></li> | ||
<li><a href="sensirion_i2c_sfx6xxx/result_types.html">sensirion_i2c_sfx6xxx.result_types</a></li> | ||
</ul> | ||
|
||
</div> | ||
</div> | ||
<footer> | ||
|
||
<hr/> | ||
|
||
<div role="contentinfo"> | ||
<p>© Copyright 2023 Sensirion AG, Switzerland.</p> | ||
</div> | ||
|
||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a | ||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> | ||
provided by <a href="https://readthedocs.org">Read the Docs</a>. | ||
|
||
|
||
</footer> | ||
</div> | ||
</div> | ||
</section> | ||
</div> | ||
<script> | ||
jQuery(function () { | ||
SphinxRtdTheme.Navigation.enable(true); | ||
}); | ||
</script> | ||
|
||
</body> | ||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
<!DOCTYPE html> | ||
<html class="writer-html5" lang="en" > | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>sensirion_i2c_sfx6xxx.result_types — sensirion_i2c_sfx6xxx 0.1.0 documentation</title> | ||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> | ||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> | ||
<link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" /> | ||
<link rel="shortcut icon" href="../../_static/favicon.ico"/> | ||
<!--[if lt IE 9]> | ||
<script src="../../_static/js/html5shiv.min.js"></script> | ||
<![endif]--> | ||
|
||
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script> | ||
<script src="../../_static/jquery.js"></script> | ||
<script src="../../_static/underscore.js"></script> | ||
<script src="../../_static/doctools.js"></script> | ||
<script src="../../_static/js/theme.js"></script> | ||
<link rel="index" title="Index" href="../../genindex.html" /> | ||
<link rel="search" title="Search" href="../../search.html" /> | ||
</head> | ||
|
||
<body class="wy-body-for-nav"> | ||
<div class="wy-grid-for-nav"> | ||
<nav data-toggle="wy-nav-shift" class="wy-nav-side"> | ||
<div class="wy-side-scroll"> | ||
<div class="wy-side-nav-search" > | ||
<a href="../../index.html" class="icon icon-home"> sensirion_i2c_sfx6xxx | ||
</a> | ||
<div class="version"> | ||
0.1.0 | ||
</div> | ||
<div role="search"> | ||
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get"> | ||
<input type="text" name="q" placeholder="Search docs" /> | ||
<input type="hidden" name="check_keywords" value="yes" /> | ||
<input type="hidden" name="area" value="default" /> | ||
</form> | ||
</div> | ||
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../../installation.html">Installation</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../../quickstart.html">Quick Start</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../../development.html">Development</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../../api.html">API Documentation</a></li> | ||
</ul> | ||
|
||
</div> | ||
</div> | ||
</nav> | ||
|
||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > | ||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> | ||
<a href="../../index.html">sensirion_i2c_sfx6xxx</a> | ||
</nav> | ||
|
||
<div class="wy-nav-content"> | ||
<div class="rst-content"> | ||
<div role="navigation" aria-label="Page navigation"> | ||
<ul class="wy-breadcrumbs"> | ||
<li><a href="../../index.html" class="icon icon-home"></a> »</li> | ||
<li><a href="../index.html">Module code</a> »</li> | ||
<li>sensirion_i2c_sfx6xxx.result_types</li> | ||
<li class="wy-breadcrumbs-aside"> | ||
</li> | ||
</ul> | ||
<hr/> | ||
</div> | ||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> | ||
<div itemprop="articleBody"> | ||
|
||
<h1>Source code for sensirion_i2c_sfx6xxx.result_types</h1><div class="highlight"><pre> | ||
<span></span><span class="ch">#!/usr/bin/env python</span> | ||
<span class="c1"># -*- coding: utf-8 -*-</span> | ||
<span class="c1">#</span> | ||
<span class="c1"># (c) Copyright 2023 Sensirion AG, Switzerland</span> | ||
<span class="c1">#</span> | ||
<span class="c1"># THIS FILE IS AUTOMATICALLY GENERATED!</span> | ||
<span class="c1">#</span> | ||
<span class="c1"># Generator: sensirion-driver-generator 0.32.0</span> | ||
<span class="c1"># Product: sfx6xxx</span> | ||
<span class="c1"># Model-Version: 2.2.0</span> | ||
<span class="c1">#</span> | ||
<span class="sd">"""</span> | ||
<span class="sd">The signal classes specify transformations of the raw sensor signals into a meaningful units.</span> | ||
<span class="sd">The generated signal types are used by the driver class and not intended for direct use.</span> | ||
<span class="sd">"""</span> | ||
|
||
<span class="kn">from</span> <span class="nn">sensirion_driver_support_types.signals</span> <span class="kn">import</span> <span class="n">AbstractSignal</span> | ||
|
||
|
||
<div class="viewcode-block" id="SignalTemperature"><a class="viewcode-back" href="../../api.html#sensirion_i2c_sfx6xxx.result_types.SignalTemperature">[docs]</a><span class="k">class</span> <span class="nc">SignalTemperature</span><span class="p">(</span><span class="n">AbstractSignal</span><span class="p">):</span> | ||
<span class="w"> </span><span class="sd">"""Measured temperature in degrees celsius. The raw value is scaled appropriately."""</span> | ||
|
||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">temperature_raw</span><span class="p">):</span> | ||
<span class="bp">self</span><span class="o">.</span><span class="n">_temperature</span> <span class="o">=</span> <span class="n">temperature_raw</span> <span class="o">/</span> <span class="mf">200.0</span> | ||
|
||
<span class="nd">@property</span> | ||
<span class="k">def</span> <span class="nf">value</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> | ||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_temperature</span> | ||
|
||
<span class="k">def</span> <span class="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> | ||
<span class="k">return</span> <span class="s1">'</span><span class="si">{0:.2f}</span><span class="s1">'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">value</span><span class="p">)</span></div> | ||
|
||
|
||
<div class="viewcode-block" id="SignalFlow"><a class="viewcode-back" href="../../api.html#sensirion_i2c_sfx6xxx.result_types.SignalFlow">[docs]</a><span class="k">class</span> <span class="nc">SignalFlow</span><span class="p">(</span><span class="n">AbstractSignal</span><span class="p">):</span> | ||
<span class="w"> </span><span class="sd">"""</span> | ||
<span class="sd"> This signal represents the measured flow. It is scaled with the corresponding scaling factor and</span> | ||
<span class="sd"> offset</span> | ||
<span class="sd"> """</span> | ||
|
||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">flow_raw</span><span class="p">,</span> <span class="n">flow_scale_factor</span><span class="p">,</span> <span class="n">flow_offset</span><span class="p">):</span> | ||
<span class="n">scale_factor</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">flow_scale_factor</span><span class="p">)</span> | ||
<span class="bp">self</span><span class="o">.</span><span class="n">_flow</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">flow_raw</span> <span class="o">-</span> <span class="n">flow_offset</span><span class="p">)</span> <span class="o">/</span> <span class="n">scale_factor</span> | ||
|
||
<span class="nd">@property</span> | ||
<span class="k">def</span> <span class="nf">value</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> | ||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_flow</span> | ||
|
||
<span class="k">def</span> <span class="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> | ||
<span class="k">return</span> <span class="s1">'</span><span class="si">{0:.2f}</span><span class="s1">'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">value</span><span class="p">)</span></div> | ||
|
||
|
||
<div class="viewcode-block" id="SignalRawFlow"><a class="viewcode-back" href="../../api.html#sensirion_i2c_sfx6xxx.result_types.SignalRawFlow">[docs]</a><span class="k">class</span> <span class="nc">SignalRawFlow</span><span class="p">(</span><span class="n">AbstractSignal</span><span class="p">):</span> | ||
<span class="w"> </span><span class="sd">"""This signal converts a user flow input from float into the twos-complement representation"""</span> | ||
|
||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">flow</span><span class="p">,</span> <span class="n">flow_scale_factor</span><span class="p">,</span> <span class="n">flow_offset</span><span class="p">):</span> | ||
<span class="bp">self</span><span class="o">.</span><span class="n">_raw_flow</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">flow</span> <span class="o">*</span> <span class="n">flow_scale_factor</span><span class="p">)</span> <span class="o">+</span> <span class="n">flow_offset</span> | ||
|
||
<span class="nd">@property</span> | ||
<span class="k">def</span> <span class="nf">value</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> | ||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_raw_flow</span> | ||
|
||
<span class="k">def</span> <span class="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> | ||
<span class="k">return</span> <span class="s1">'</span><span class="si">{0}</span><span class="s1">'</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">value</span><span class="p">)</span></div> | ||
|
||
</pre></div> | ||
|
||
</div> | ||
</div> | ||
<footer> | ||
|
||
<hr/> | ||
|
||
<div role="contentinfo"> | ||
<p>© Copyright 2023 Sensirion AG, Switzerland.</p> | ||
</div> | ||
|
||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a | ||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> | ||
provided by <a href="https://readthedocs.org">Read the Docs</a>. | ||
|
||
|
||
</footer> | ||
</div> | ||
</div> | ||
</section> | ||
</div> | ||
<script> | ||
jQuery(function () { | ||
SphinxRtdTheme.Navigation.enable(true); | ||
}); | ||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
API Documentation | ||
================= | ||
|
||
SFX6XXX | ||
------- | ||
|
||
Sfx6xxxDevice | ||
~~~~~~~~~~~~~ | ||
|
||
|
||
.. automodule:: sensirion_i2c_sfx6xxx.device | ||
|
||
Commands | ||
~~~~~~~~ | ||
|
||
.. automodule:: sensirion_i2c_sfx6xxx.commands | ||
:exclude-members: __init__ | ||
|
||
|
||
Result Types | ||
~~~~~~~~~~~~ | ||
|
||
.. automodule:: sensirion_i2c_sfx6xxx.result_types | ||
:exclude-members: __init__ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Build documentation | ||
=================== | ||
|
||
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 | ||
sphinx-build -b html docs docs/_build/html # Build documentation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Development | ||
=========== | ||
|
||
.. toctree:: | ||
|
||
run-tests | ||
build-documentation | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
Execute measurements with SensorBridge | ||
======================================= | ||
|
||
The following steps show how to use this driver on a Windows system using the `Sensirion SEK-SensorBridge`_ to | ||
execute a simple measurement. | ||
|
||
1. Install the SFX6XXX driver and all required packages as described in :ref:`Installation`. | ||
2. Install the driver for the `Sensirion SEK-SensorBridge`_ | ||
|
||
.. sourcecode:: bash | ||
|
||
pip install sensirion-shdlc-sensorbridge | ||
|
||
3. Connect the SEK-SensorBridge to your PC over USB | ||
4. Connect the SFX6XXX sensor to the SEK-SensorBridge | ||
5. Run the example script from the root of the repository. | ||
|
||
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. | ||
|
||
.. sourcecode:: bash | ||
|
||
python examples/example_usage_sensorbridge_sfx6xxx.py --serial-port <your COM port> | ||
|
||
|
||
.. _Sensirion SEK-SensorBridge: https://developer.sensirion.com/sensirion-products/sek-sensorbridge/ | ||
|
||
|
||
Example script | ||
~~~~~~~~~~~~~~ | ||
|
||
.. literalinclude:: ../examples/example_usage_sensorbridge_sfx6xxx.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. | ||
|
||
1. Install the SFX6XXX driver and all required packages as described in :ref:`Installation`. | ||
2. Connect the SFX6XXX 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. | ||
|
||
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. | ||
|
||
.. sourcecode:: bash | ||
|
||
python examples/example_usage_linux_sfx6xxx.py --i2c-port <your I2C port> | ||
|
||
Example script | ||
~~~~~~~~~~~~~~ | ||
|
||
.. literalinclude:: ../examples/example_usage_linux_sfx6xxx.py | ||
:language: python |
Oops, something went wrong.