[PARPORT] header libraries


Karl Tipple (krt@odetics.com)
Thu, 15 Jul 1999 09:08:58 -0700


Can anyone tell me which header files and/or libraries in the LINUX gcc C
compiler that I need to include so that I can use the 'inp' and 'outp'
commands
to access my parallel port? In DOS, those functions are in my 'dos.h'
header file.
I want to port this to LINUX, and I don't think that 'dos.h' will help much
here :-)

Here is a sample of a piece of code I wrote to test out reading the port:

/*This program displays the value present at the input lines of the parallel
printer port */

#include<stdio.h>
#include<dos.h> /*these are the header files needed for the functions
called
                           by this program */

 main(void)

{

char value; /*Declares variable 'value'*/

value=inp(0x379); /*Defines variable 'value', assigns it to inp function
which
                           reads data at parallel input). */

          printf("The value at port 379 is %x\n", value); /*prints to screen HEX
data
                                                          retrieved from port*/
return 0;

}

I've built a hardware interface so that I can read in data from sensors
using the
STATUS lines and output signals through the DATA lines to control relays.

Thanks in advance for any help you can provide.

--Karl

-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --



This archive was generated by hypermail 2.0b3 on Thu 15 Jul 1999 - 12:06:30 EDT