ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
From what I've tried and read I can't use outb() or inb() to control a parallel port (which connects via usb).
Any body know how to control a parallel port for systems without a physical parallel port connector (and hence have to buy and use a parallel port to usb converter).
USB to Parallel Port adapters are supported by the usblp.c kernel driver, which provides a /dev/usb/lp* or /dev/usblp* device for each attached USB->PPT converter. You can read/write to these device files to communicate with devices that comply with IEEE 1284. outb() and inb() only work with devices that support direct port-based IO, which USB->PPT devices do not. (In fact, no USB devices that I'm aware of do, largely, I suspect, due to the ability to have up to 256 USB devices)
USB to Parallel Port adapters are supported by the usblp.c kernel driver, which provides a /dev/usb/lp* or /dev/usblp* device for each attached USB->PPT converter. You can read/write to these device files to communicate with devices that comply with IEEE 1284. outb() and inb() only work with devices that support direct port-based IO, which USB->PPT devices do not. (In fact, no USB devices that I'm aware of do, largely, I suspect, due to the ability to have up to 256 USB devices)
So how do I set/read pin values for difference BASE's?
Code:
int fd = fopen("/dev/usblp0", "w");
write(fd, X, 1);
Will that set all pins X (e.g. if X = 20, will set the BASE pins to 0b10100)?
i use also simple portcontrol software for linux console to drive my GSM modem. A thought came yo my mind that should you try telling that usb<>centronics - device that there is printer after it with ready-pin etc and then send byte-stuff to it ? You can set "pin" with boolean algebra, bit set etc...
Try something like that if you have such converter, i'd like to know also results.
There are some USB parallel port adapters that can do what is required, Linux has a driver for those based on the Lucent Technologies USS-720. However the latency introduced by USB can result in poor performance.
You should use the Parport API to do any bit fiddling.
Alternatively consider using a micro-controller that has USB support.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.