io.h help with parallel port.

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
jkltech

io.h help with parallel port.

Post by jkltech »

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);
}
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Husse

Re: io.h help with parallel port.

Post by Husse »

Something like this?
/usr/src/linux-headers-2.6.24-16-generic/include/asm-x86/io.h
Locked

Return to “Software & Applications”