|
|
 |
Published by Pieter Panman
Click here for more information about this publisher...
|
 |
|
Date Posted: |
March 23rd, 2001
|
|
|
Last Updated: |
March 23rd, 2001
|
|
|
License: |
Freeware |
|
|
Downloads: |
1,305 total; 1 recently |
|
|
Page Views: |
9,944 total |
|
|
User Rating: |
awaiting 10 votes |
 |
|
Jump to the Downloads section |
|
 |
 |
About parallelport driver:
First version of my parallel port driver. Only tested with my computer, currently allows you to set the 8 output bits and read the status bits. Email me suggestions please ;)
This is probably most interesting for developers, or people who like to fiddle with their parallel port!
Someone at Be, inc. told me that there is no supported parallel port driver, so I just wrote a bare bones driver...
Simply drop the parallelport file into /boot/home/config/add-ons/kernel/drivers/bin. Then make a link of that file in /boot/home/config/add-ons/kernel/drivers/dev/misc.
By writing 1 byte to /dev/misc/parallelport you can modify the 8 data bits, and by reading 1 byte you can read info about the inputs.
I'll put more info up later, I just wanted to share it with you.
And this is my first kernel level driver, so it might crash your whole system, although it has not done anything on my system yet.
Enjoy!
==============================================
Here is a sample snippet on how to access it:
int fd;
status_t err;
uchar c;
fd = open("/dev/misc/parallelport", O_RDWR);
if (fd < 0) {
printf("Error opening devicen");
return 1;
}
c = 255;
err = write(fd, &c, 1); // Set all 8 databits to high
if (err < 0)
printf("Error setting 8 bits to onn");
while (true) { // Spit out the byte that contains info about the input bits
snooze(100000);
c++;
err = read(fd, &c, 1);
printf("bits %dn", c);
}
close(fd);
|
 |
|
 |
Latest Version |
 |
|
 |
| |
 |
|
Details about this version:
First version, only write 1 byte to write to the 8 output bits and read 1 byte to check out the status bits.
More to come, please email me with suggestions!
WARNING: I haven't had time to work on it, but I've been informed that my driver is full of bugs. (Thanks Marco)
1) I don't release the memory I allocate
2) I don't use the number of bytes requested
3) I don't release the ISA module
4) makefile sucks :)
So be careful when using this, use it mostly as an inspiration.
|
| |
 |
|
Any Processor - requires R5 (15 KB) |
262 downloads |
|
 |
|
 |
 |
| |
|
|
| Add Additional Location |
 |
|
 |
|
| Source Included |
 |
 |
 |
 |
 |
Like this app? Have questions or comments?
Why not tell the author? Use the "e-mail publisher" link to get in touch with the publisher; they usually love getting feedback.
|
|
|