reading from a parallel port

Paul Slootman slootman at dri.nl
Tue Apr 9 19:15:21 AEST 1991


djk at ux1.cso.uiuc.edu (Doug Kelly) writes:
>Hello, Im trying to write a program to interface to my Epson ES-300C color
>scanner.  It uses a bi-directional parallel interface, and i cant figure out
>how to 'read' from a parallel port.  Im using borland turbo c, any help would
>be appreciated.  Thanks

Assuming you're on some IBM PC-compatible,
simply do a inportb() (reads a byte from hardware port) from the data latch
corresponding to the parallel interface. For example, to get the byte on a
printer port at 0x378, do

	x=inb(0x378);

This is not, in fact, a C question; I've redirected followups to
comp.os.msdos.programmer.

Paul.
-- 
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
: slootman at dri.nl            :          Don't hit the keys so hard, :
: ...!hp4nl!dri500!slootman  :                             it hurts :
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



More information about the Comp.lang.c mailing list