LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Char driver: what's the best way to do... (https://www.linuxquestions.org/questions/linux-software-2/char-driver-whats-the-best-way-to-do-340179/)

perlMonkey 07-05-2005 07:34 AM

Char driver: what's the best way to do...
 
Hello fellow linux friends!
I am writing a char driver for a stepper motor controller where I need to read an optical encoder and then tell the motor which way to turn. I am using the parallel port and have the basic driver written, but I'm still a little green when it comes to C.
So here's the situation... I need to read the parallel port using interrupts, which I've tested and it works - but the motor will be spinning at 2000 rpm, that means 2000 pulses per second. I've got a 2.4 GHz pentium4 processor so I don't think that'll be an issue. My main question is, since this is a char driver, my main gui application will be accessing the driver as a file using standard file i/o - so whats the best way to read/write to the driver to accomplish this task?

Continuously poll the driver in some kind of loop or is there some better way?

Any help would be greatly appreciated.
Regards,
PerlMonkey


All times are GMT -5. The time now is 11:45 AM.