March 2002
Intermediate to advanced
432 pages
9h
English
Using inb and outb isn't the only way to query and control the PC parallel port's data, control, and status registers. The Linux parallel port device driver, ppdev, also allows for this control, by using ioctl.2 This approach is similar to the approach used in Chapter 6, “Asynchronous Serial Communication Interfacing,” to control the serial port. A file (/dev/parport0) is opened, and a file descriptor is returned. With this descriptor, calls to ioctl can set individual control bits, query the port status, and read and write to the port's data bus. The program in Listing 7.3, snowmakingcontrolppdev.c, uses ppdev to control the parallel port registers that control the interface circuit in Figure 7.3. (“The ...
Read now
Unlock full access