ethoscope.hardware.interfaces package¶
Submodules¶
ethoscope.hardware.interfaces.interfaces module¶
-
class
ethoscope.hardware.interfaces.interfaces.
BaseInterface
(do_warm_up=True)[source]¶ Bases:
object
Template class which is an abstract representation of an hardware interface. It must define, in
__init__()
, how the interface is connected, and insend()
, how information are communicated to the hardware. In addition, derived classes must implement a_warm_up()
, method, which defines optionnal instructions passed to the hardware upon first connection (that is useful to experimenters that want to manually check their settings).Parameters: do_warm_up –
-
class
ethoscope.hardware.interfaces.interfaces.
DefaultInterface
(do_warm_up=True)[source]¶ Bases:
ethoscope.hardware.interfaces.interfaces.BaseInterface
Class that implements a dummy interface that does nothing. This can be used to keep software consistency when no hardware is to be used.
Template class which is an abstract representation of an hardware interface. It must define, in
__init__()
, how the interface is connected, and insend()
, how information are communicated to the hardware. In addition, derived classes must implement a_warm_up()
, method, which defines optionnal instructions passed to the hardware upon first connection (that is useful to experimenters that want to manually check their settings).Parameters: do_warm_up –
-
class
ethoscope.hardware.interfaces.interfaces.
HardwareConnection
(interface_class, *args, **kwargs)[source]¶ Bases:
threading.Thread
A class to build a connection to arbitrary hardware. It implements an instance of a
BaseInterface
which it uses to send instructions, asynchronously and on demand.Parameters: - interface_class (class) – the class to use a an interface to hardware (derives from
BaseInterface
) - args – list of arguments passed the the hardware interface
- kwargs – list of keyword arguments passed the the hardware interface
-
run
()[source]¶ Infinite loop that send instructions to the hardware interface Do not call directly, used the
start()
method instead.
-
send_instruction
(instruction=None)[source]¶ Stage an instruction to be sent to the hardware interface. Instructions will be parsed sequentially, but asynchronously from the main thread execution. :param instruction: a dictionary of keyword arguments ,matching those of
interface_class.send()
. :type instruction: dict()
- interface_class (class) – the class to use a an interface to hardware (derives from
ethoscope.hardware.interfaces.sleep_depriver_interface module¶
-
class
ethoscope.hardware.interfaces.sleep_depriver_interface.
SleepDepriverInterface
(port=None, *args, **kwargs)[source]¶ Bases:
ethoscope.hardware.interfaces.lynx_motion.SimpleLynxMotionInterface
Class to connect and abstract the SSC-32U Lynx Motion servo controller. It assumes a BAUD of 115200, which can be configured on the board as described in the user manual (page 34).
Parameters: - port (str.) – the serial port to use. Automatic detection if
None
. - args – additional arguments
- kwargs – additional keyword arguments
- port (str.) – the serial port to use. Automatic detection if
-
class
ethoscope.hardware.interfaces.sleep_depriver_interface.
SleepDepriverInterfaceCR
(port=None, *args, **kwargs)[source]¶ Bases:
ethoscope.hardware.interfaces.lynx_motion.SimpleLynxMotionInterface
Class to connect and abstract the SSC-32U Lynx Motion servo controller. It assumes a BAUD of 115200, which can be configured on the board as described in the user manual (page 34).
Parameters: - port (str.) – the serial port to use. Automatic detection if
None
. - args – additional arguments
- kwargs – additional keyword arguments
- port (str.) – the serial port to use. Automatic detection if