I posted this before, but I didn't see any responses, so I thought I'd
repost and update my progress.
First, I would like to use the parallel port as an interface to some
circuits. This means I will need to control and read the pins on the
parallel port individually.
Using the LPG and the IO mini-FAQ, I came up with the following:
if(ioperm(LP_B(1)+1,1,1)<0) { printf("error opening /dev/lp1\n"); return 1; }
status=inb(LP_B(1)+1);
printf("%x\n",status);
ioperm(LP_B(1)+1,1,0);
This prints some interesting things based on the status of the
printer, but I have no idea what they mean (I could look them up in
<linux/lp.h>, but that wouldn't do any good, because I don't know
which pins' being high the literal meaning corresponds to).
Does anyone know how to address the individual pins with inb and outb?
Feel free to correct anything in the above code, too.
Thanks.
--
http://ajshrom.student.princeton.edu | Linux ...