Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #105 from Sensirion/cleanup-generic-application-note
Browse files Browse the repository at this point in the history
Cleanup the generic setup guide
  • Loading branch information
rnestler authored Sep 1, 2020
2 parents dfbe2e7 + 1387fab commit 440ccdd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
Binary file removed docs/sgp40_voc_index/copy_files.png
Binary file not shown.
38 changes: 30 additions & 8 deletions docs/sgp40_voc_index/genericsetup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ Getting Started On a Custom Platform
Copy files to your project
--------------------------

#. Copy all SGP driver files (.c and .h) into your software project folder.
#. Make sure all files are added to your IDE.

.. note::
Include new image

.. image:: copy_files.png

1. Copy all top level source files (.c and .h) into your software project folder.
2. Copy *hw_i2c/sensirion_hw_i2c_implementation.c* to your project as well.
You'll need to adapt it to your platform.
See :ref:`I2C implementation`.
3. Make sure all files are added to your IDE.

Adapt *sensirion_arch_config.h* for your platform
-------------------------------------------------
Expand All @@ -20,6 +17,8 @@ You may need to adapt *sensirion_arch_config.h* if your compiler doesn't
support C99 and thus does not provide `stdint.h` and `stdlib.h`.


.. _I2C implementation:

Implement *sensirion_hw_i2c_implementation.c*
---------------------------------------------
To use your I2C hardware the file *hw_i2c/sensirion_hw_i2c_implementation.c*
Expand All @@ -39,3 +38,26 @@ I2C functions to implement
.. doxygenfunction:: sensirion_i2c_write
.. doxygenfunction:: sensirion_sleep_usec
.. doxygenfunction:: sensirion_i2c_select_bus

Run *sgp40_voc_index_example_usage.c*
-------------------------------------

If your platform supports the ``printf`` function just run the examples and you
should see the following messages:

::

initialization successful
VOC Index: 0
Temperature: 39.128degC
Relative Humidity: 29.695%RH
VOC Index: 0
Temperature: 39.086degC
Relative Humidity: 29.687%RH
VOC Index: 0
Temperature: 39.106degC
Relative Humidity: 29.647%RH
...

If your platform doesn't support ``printf`` remove the print statements and
observe the measurement values in your debugger.

0 comments on commit 440ccdd

Please sign in to comment.