io.h help with parallel port.

Questions about applications and software
Forum rules
Before you post please read this

io.h help with parallel port.

Postby jkltech on Mon Oct 06, 2008 4:00 pm

I've been trying to write something for c++ that will let me control the individual pins on my computer's parallel port, and found that asm/io.h is what I need, but it isn't there!
Code: Select all
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <asm/io.h>

#define base 0x378           /* printer port base address */
#define value 255            /* numeric value to send to printer port */

main(int argc, char **argv)
   if (ioperm(base,1,1))
    fprintf(stderr, "Couldn't get the port at %x\n", base), exit(1);

   outb(value, base);

Linux Mint is funded by ads and donations.

Re: io.h help with parallel port.

Postby Husse on Mon Oct 06, 2008 4:25 pm

Something like this?
Don't fix it if it ain't broken, don't break it if you can't fix it
Level 21
Level 21
Posts: 19703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Return to Software & Applications

Who is online

Users browsing this forum: Google Adsense [Bot], wojto6p and 33 guests