Do you have a question? Post it now! No Registration Necessary

Re: Linux Input Driver question

My PC parallel port document at
http://www.epanorama.net/circuits/parallel_output.html
includes information how to directly access PC parallel
port hardware registers in many operating systems, including Linux.
Linux will allow acess to any port using the ioperm syscall.
Here is some code parts for Linux to write 255 to printer port:
#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);
}
For reading use inb() function.
--
Tomi Engdahl (http://www.iki.fi/then /)
Take a look at my electronics web links and documents at
Tomi Engdahl (http://www.iki.fi/then /)
Take a look at my electronics web links and documents at
We've slightly trimmed the long signature. Click to see the full one.
Site Timeline
- » Industry oriented & certified Embedded Training on 8th May 09
- — Next thread in » Embedded Linux
-
- » How to excute shell command and return result string ?
- — Previous thread in » Embedded Linux
-
- » Crosscompiling for ARM: reloc type R_ARM_ABS32 is not supported for PIC - ...
- — Newest thread in » Embedded Linux
-
- » Ten 860v Electric Eels Wire Themselves In Series
- — The site's Newest Thread. Posted in » Hobby Electronics Basics
-