ahio  1.0.0
I/O Communication Library
ahio Namespace Reference

ahio provides access to various I/O devices. More...

Namespaces

 abstract_driver
 Contains abstract classes that should be implemented by drivers.
 
 drivers
 

Functions

def list_available_drivers ()
 Returns a list of string with the names of available drivers. More...
 
def driver_info (name)
 Returns driver metadata. More...
 
def new_driver (name)
 Instantiates a new object of the named driver. More...
 

Variables

 PortType = Enum('PortType', 'Analog Digital')
 
 Direction = Enum('Direction', 'Output Input')
 
 LogicValue = Enum('LogicValue', 'Low High')
 

Detailed Description

ahio provides access to various I/O devices.

This package provides abstracted access to various digital and analogic I/O devices, such as Arduino, Raspberry PI, MyRIO and PLC. It allows the developer to write and read data from such devices without needing to worry about the specifics of each device, and to easily switch devices without code refactoring.

The functions in this package list and instantiate the drivers. For the driver api, see ahio.abstract_driver.AbstractDriver. Driver metadata format can be found in ahio.abstract_driver.AbstractahioDriverInfo

Author
Álan Crístoffer acris.nosp@m.toff.nosp@m.ers@g.nosp@m.mail.nosp@m..com

Function Documentation

§ driver_info()

def ahio.driver_info (   name)

Returns driver metadata.

Returns a class which static properties contains metadata from the driver, such as name and availability.

Returns
a subclass from ahio.abstract_driver.AbstractahioDriverInfo with metadata from the driver.

Definition at line 80 of file __init__.py.

§ list_available_drivers()

def ahio.list_available_drivers ( )

Returns a list of string with the names of available drivers.

Available means that the driver is installed and can be used. For example, it will not contain "Raspberry" if you're not running on a Raspberry Pi, even if the raspberry.py script is present in the drivers directory.

Returns
a list of strings that can be fed to ahio.new_driver to get an instance of the desired driver.

Definition at line 67 of file __init__.py.

§ new_driver()

def ahio.new_driver (   name)

Instantiates a new object of the named driver.

The API used by the returned object can be seen in ahio.abstract_driver.AbstractDriver

Returns
a Driver object from the required type of None if it's not available

Definition at line 93 of file __init__.py.

Variable Documentation

§ Direction

ahio.Direction = Enum('Direction', 'Output Input')

Definition at line 53 of file __init__.py.

§ LogicValue

ahio.LogicValue = Enum('LogicValue', 'Low High')

Definition at line 54 of file __init__.py.

§ PortType

ahio.PortType = Enum('PortType', 'Analog Digital')

Definition at line 52 of file __init__.py.