8.5.1. parallel port device
(packages/devices/parport.lsh)


This package allows to read and write data to the parallel port through the "ppdev" driver. The parport driver may not be loaded into the Linux kernel by default. Therefore, you might have to do "/sbin/insmod ppdev" as root before using this class and functions

8.5.1.0. parport
(packages/devices/parport.lsh)


this class allows easy access to the parallel port device.

8.5.1.0.0. (new parport d)
[CLASS] (packages/devices/parport.lsh)


create new parport object on parport device d . example:
 (setq z (new parport "/dev/parport0"))
The parport driver may not be loaded into the Linux kernel by default. Therefore, you might have to do "/sbin/insmod ppdev" as root.

8.5.1.0.1. (==> parport write b)
[MSG] (packages/devices/parport.lsh)


write unsigned byte b to parport

8.5.1.0.2. (==> parport read)
[MSG] (packages/devices/parport.lsh)


read unsigned byte from parport

8.5.1.0.3. (==> parport control b)
[MSG] (packages/devices/parport.lsh)


write unsigned byte b to control lines of parport The control bits are STROBE (0x01, pin 1, inverted), AUTOFEED (0x02, pin 14, inverted), INITIALIZE (0x04, pin 16, not inverted), and SELECT (0x08, pin 17, inverted). The STROBE, AUTOFEED, and SELECT bits are inverted by this function to compensate for the hardware inversion. Return non-zero integer on error.

8.5.1.0.4. (==> parport status)
[MSG] (packages/devices/parport.lsh)


return status of parport

8.5.1.0.5. (==> parport pulse n time p)
[MSG] (packages/devices/parport.lsh)


send byte n to parport, then wait for time seconds (this is a blocking wait), then send byte p and return. This can be used to control R/C servos.

8.5.1.1. low-level parport functions
(packages/devices/parport.lsh)


These functions provide a simple interface to some of the ioctl commands to handle the ppdev parport device. More info on these ioctl commands can be found at: http://www.kernelnewbies.org/documents/kdoc/parportbook/x623.html

8.5.1.1.0. (parport-open s)
(packages/devices/parport.lsh)


open the parallel port device (e.g. "/dev/parport0"), and return an integer handle.

8.5.1.1.1. (parport-close fd)
(packages/devices/parport.lsh)


close parport device fd . d is an integer returned by parport-open .

8.5.1.1.2. (parport-claim fd)
(packages/devices/parport.lsh)


claim parport fd , using ioctl(fd,PPCLAIM) .

8.5.1.1.3. (parport-release fd)
(packages/devices/parport.lsh)


release parport fd , using ioctl(fd,PRELEASE) .

8.5.1.1.4. (parport-datadir fd b)
(packages/devices/parport.lsh)


set the direction of the data pins. b is an int. b =0 for output, b =255 for input. This uses ioctl(fd,PPDATADIR,b) .

8.5.1.1.5. (parport-write fd b)
(packages/devices/parport.lsh)


write unsigned byte b to the parport fd using ioctl(fd,PPWDATA,b) .

8.5.1.1.6. (parport-read fd )
(packages/devices/parport.lsh)


read unsigned byte from the parport fd using ioctl(fd,PPRDATA,b) .

8.5.1.1.7. (parport-control fd b)
(packages/devices/parport.lsh)


write unsigned byte b to the control lines of parport fd using ioctl(fd,PPWCONTROL,b) . The control bits are STROBE (0x01, pin 1, inverted), AUTOFEED (0x02, pin 14, inverted), INITIALIZE (0x04, pin 16, not inverted), and SELECT (0x08, pin 17, inverted). The STROBE, AUTOFEED, and SELECT bits are inverted by this function to compensate for the hardware inversion. Return non-zero integer on error.

8.5.1.1.8. (parport-status fd)
(packages/devices/parport.lsh)


return status lines of parport fd . using ioctl(fd,PPRSTATUS,result) .