lpif.c

Introduction

Raw Parallel Port ppdev Interface

Requirements

Download

lpif.c (v0.02)

Compiling

cc lpif.c -o lpif

Usage

./lpif [OPTIONS]

Informative output:
  -h,  --help         Print help information
  -v,  --version      Print version information

Device configuration:
  -d,  --device       Set ppdev device
                      Default: /dev/parports/0
  -n   --no-inv       Disable inversion compensation
                      Default: Compensate for hardware inversion

Output functions:
  -p,  --print-states Print parallel port pin states in table form
                      Exits with the decimal value of STATUS
  -r,  --raw-reg      Print raw parallel port register values in hex
                      The registers are output in the following order:
                      STATUS CONTROL DATA
                      Exits with the decimal value of STATUS

Input functions:
  -c,  --set-control  Sets the control register to the supplied value
  -s,  --set-data     Sets the data register to the supplied value

When using the --set-xxx options, the value can be specified in hex,
decimal, or octal. For example: 0xFF (hex), 255 (dec), or 0377 (oct)

Keep in mind that the three least significant values of the STATUS port
are almost always reported as high (0x07). The five most significant
bits are the actual hardware pins.

Example:

./lpif -s 0xFF

Known Issues

Last update: 2005-04-29