Create if_lib package containing all the modules and adapt the *.py files to import each other using the intra-package references. The idea behind a package is to invoke test.py either by permanently modifying PYTHONPATH in user profile via adding path to $RIOTBASE/dist/tests or make temporary PYTHONPATH changes during the invocation: PYTHONPATH=$PYTHONPATH:$RIOTBASE/dist/tests python3 test.py Leave periph_i2c_if.py in the same folder as test.py as this file is just a Python wrapper around periph specific main.c. Update BPT memory map. Use definitions generated with the latest code generator. Both routine names and mapping have changed. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Expected result
This test enables you to test all available low-level I2C functions using the shell. Consult the 'help' shell command for available actions.
Background
Test for the low-level I2C driver. Can be run manually or using python script interface.
Glossary
DEV - The I2C device number, this is usually 0. Consult the board header file for more information.
ADDR - The address of the slave I2C device, this is usually the sensor. Information on the slave address should be found in the sensor datasheet.
REG - The register of the slave device/sensor. Not all sensors follow this access method. A I2C_NOSTOP (0x04) may be needed.
LEN - The length to read or write.
FLAG - Flags set for the I2C, more information is available in driver/include/periph/i2c.h