|
def | __init__ (self, serial_port_path, api_level=2) |
| init creates the uC interface object and establishes the connection to the uC on the given port More...
|
|
def | __str__ (self) |
|
def | close_connection (self) |
| close_connection closes the serial connection to the uC and blocks until this is done resets the uC too More...
|
|
def | experiment_state (self) |
| experiment_state returns the state history More...
|
|
def | has_packet (self) |
| has_packet checks if a packet is availible for reading from the buffer More...
|
|
def | read_packet (self) |
| read_packet returns one package from the uC via the "infinte" buffer More...
|
|
def | reset (self) |
| reset uC and hope the serial connection survives More...
|
|
def | send_packet (self, packet_to_send) |
| send_packet send a packet to the uC via the "infinite" buffer needs a package object see package.py More...
|
|
def | start_experiment (self) |
| start_experiment This will reset the uC clock, enable that data is collected and that timed instructions are executed by the uC latest after 72min stop_experiment has to be called, after which a new experiment can be programmed and the function can be called again. More...
|
|
def | stop_experiment (self, time=0) |
| stop_experiment this will stop recording and flush all not jet excecuted timed instructions More...
|
|
def | update_state (self) |
| update_state This method processes all availible messages from the uC and updates the internal representaion in detail it distributes the recorded packages to the coresponding interfaces for processing. More...
|
|
the class uC_api exposes the full interface to the uC as an object, all the interface like i2c, spi, pin and async can be found as exposed variables
Interfaces need to be activated before use, and the activation is ackloaged by the uC you might need to time.sleep(0.01) after the activation for the python object to update register the state change
if you want to record data you need to use function start_experiment() to be abel to see the data send back the maximum time of each experiment is 72min, please call stop experiment before that to start agian
after you are done call close_connection to sever the serial connection to the uC, the recorded data in the python object remains and can be processed after
Definition at line 41 of file uC.py.
def __init__ |
( |
|
self, |
|
|
|
serial_port_path, |
|
|
|
api_level = 2 |
|
) |
| |
init creates the uC interface object and establishes the connection to the uC on the given port
:param serial_port_path: the path of your system to the serial port, eg. on linux it might be /dev/ttyAMC0 or higher, on mac /dev/tty.usbmodem<XXXXX> on windows <COM port>
:type serial_port_path: string
:param api_level: level 1 is that the api only espablishes the connection to the uC and the "infinite" write and read buffers, you need to construct the instruction packages your self,
level 2 it wraps the full representation of the uC interfaces in objects that are made availible as variables on this object, defaults to 2
:type api_level: int, optional
Definition at line 55 of file uC.py.