mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
ff525eb354
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>
47 lines
1.0 KiB
Python
47 lines
1.0 KiB
Python
# Copyright (C) 2018 Kevin Weiss <kevin.weiss@haw-hamburg.de>
|
|
#
|
|
# This file is subject to the terms and conditions of the GNU Lesser
|
|
# General Public License v2.1. See the file LICENSE in the top level
|
|
# directory for more details.
|
|
"""@package PyToAPI
|
|
This module handles generic connection and IO to the serial driver.
|
|
|
|
"""
|
|
|
|
|
|
class RiotDriver:
|
|
"""Contains all reusable functions for connecting, sending and recieveing
|
|
data.
|
|
|
|
"""
|
|
|
|
used_devices = []
|
|
|
|
def __init__(self):
|
|
raise NotImplementedError()
|
|
|
|
def close(self):
|
|
"""Close serial connection."""
|
|
raise NotImplementedError()
|
|
|
|
def read(self):
|
|
"""Read and decode data."""
|
|
raise NotImplementedError()
|
|
|
|
def write(self, data):
|
|
"""Tries write data."""
|
|
raise NotImplementedError()
|
|
|
|
@staticmethod
|
|
def get_configs():
|
|
"""Gets available serial configurations."""
|
|
raise NotImplementedError()
|
|
|
|
|
|
def main():
|
|
"""Tests basic usage of the class"""
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|