Skip to content

Commit 3a91e8c

Browse files
committed
v2024-04-15
1 parent 2aa5f20 commit 3a91e8c

21 files changed

+4168
-2
lines changed

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,27 @@
1-
# tmf8806_driver_python
2-
TMF8806 Python driver
1+
# Python
2+
This folder contains libraries, tools, and tests to interact with the ams OSRAM TMF8806 devices over I2C and GPIO.
3+
4+
## Setup Python Environment
5+
This framework requires to use python 3.6 or newer for Window 10/11.
6+
To install the required packages, run `python -m pip install -r requirements.txt`.
7+
8+
## Adding your own sub-directory
9+
When you add a new sub-directory and want to execute python files there you need to
10+
`import __init__` before any other local import. Also you need to copy the file `__init__.py` into this subdirectory
11+
and make sure the python root path points to the directory where this readme.md file is located.
12+
`TOF_PYTHON_ROOT_DIR = os.path.normpath(os.path.dirname(__file__) + "/..")`
13+
14+
This is a summary of the files and sub-folders:
15+
16+
## ./tmf8x0x
17+
All python classes, files and functions, specific to the TMF8806.
18+
There is a python class to control the device hardware and the bootloader that also allows to download intel hex files to the device.
19+
There is a second class that implements measurement application specific commands and controls and data readout, as well as histogram configuration and readout.
20+
21+
### ./tmf8x0x/examples
22+
Several examples that show the usage:
23+
- how to perform measurements and read them out
24+
- how to configure for histogram dumping and how to read them out
25+
26+
### ./tmf8x0x/tests
27+
Python tests to verify functonality of device and/or scripts.
173 KB
Binary file not shown.

requirements.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
intelhex
2+
pytest
3+
matplotlib
4+
numpy
5+
pyzmq
6+
avrdude_windows
7+
setuptools
8+
./packages/aos_com-1.0.10-py3-none-any.whl
9+
./packages/aos_lab-1.0.10-py3-none-any.whl

tmf8x0x/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Version Changelog
2+
1.0 first released version

tmf8x0x/__init__.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# *****************************************************************************
2+
# * Copyright by ams OSRAM AG *
3+
# * All rights are reserved. *
4+
# * *
5+
# * IMPORTANT - PLEASE READ CAREFULLY BEFORE COPYING, INSTALLING OR USING *
6+
# * THE SOFTWARE. *
7+
# * *
8+
# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
9+
# * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
10+
# * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
11+
# * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT *
12+
# * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
13+
# * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
14+
# * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES LOSS OF USE, *
15+
# * DATA, OR PROFITS OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
16+
# * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
17+
# * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
18+
# * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
19+
# *****************************************************************************
20+
21+
22+
""" Import this script to set up the python path.
23+
"""
24+
25+
import os
26+
import sys
27+
28+
TOF_PYTHON_ROOT_DIR = os.path.normpath(os.path.dirname(__file__) + "/..")
29+
"""Change this path depending on the relative path between this file and the TOF python root dir."""
30+
31+
if TOF_PYTHON_ROOT_DIR not in sys.path:
32+
sys.path.append(TOF_PYTHON_ROOT_DIR)

0 commit comments

Comments
 (0)