Parport_Item.pm

Parallel port item

SYNOPSIS

Item which follows digital logic state on standard PC parallel port inputs.

Each item should be defined with a pin number and description.

Example:

 use Parport_Item;
 $input1 = new Parport_Item('10', 'Test device on DB25 pin 10');

 print "Parallel port pin 10 now $state\n" if $state = state_now $input1;

DESCRIPTION

All inputs are pulled high in a typical parallel port (+5 V) when disconnected/open. The item is considered on if the voltage is +5 V (logic high) and off if voltage is 0 V (logic low). Also note that even for those bits that would normally be inverted in the register (ex: pin 11, nBUSY) are are automatically uninverted such that all inputs work the same.

Currently a parallel port item only supports the 5 input pins (DB25 pins 10, 11, 12, 13, and 15).

For a description of the various pins see http://en.wikipedia.org/wiki/Parallel_port

Currently the item tries to automatically determine the correct driver, and will default to the first port. This means it should work cross platform but has not been tested on any platform other than Linux

INHERITS

Generic_Item

METHODS

new()
new()
get_pin_state()

DEPENDENCIES:

This code depends on the Perl modules Device::ParallelPort and may require Device::ParallelPort::drv::parport or Device::ParallelPort::drv::win32 depending on your platform. These modules are available from CPAN.

INI PARAMETERS

NONE

AUTHOR

Jeff Siddall (news@siddall.name)

SEE ALSO

NONE

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

 Parport_Item.pm