In article <54**************************@posting.google.com >,
karan <ka***@iitk.ac.in> wrote:
- I simply want some code in C(and this is the C Newsgroup) to
write/read my parallel port.
It might be something like:
fd = open("/dev/parallel", O_RDWR);
followed by ioctl()s and read()s and write()s.
Or, perhaps it might be something like:
volatile unsigned char *pport_data = (volatile unsigned char *)0xf00c3158;
volatile unsigned char *pport_ctl = (volatile unsigned char *)0x14;
followed by direct access to *pport_ctl and *pport_data.
Then again, it might be something like:
#define PPORT_CTL 0771410
#define PPORT_DATA 0771412
...
outb(PPORT_CTL, control_value);
data = inb(PPORT_DATA);
perhaps preceded by some operation to grant access to those ports.
It could be something different from all of these. The correct
answer depends on your platform.
*Because* the answer depends on your platform, you need to ask
elsewhere, such as in a newsgroup dedicated to your platform.
There may not be such a place -- in which case, you may be completely
stuck; or perhaps comp.arch.embedded might be helpful.
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603
email: forget about it
http://web.torek.net/torek/index.html
Reading email is like searching for food in the garbage, thanks to spammers.