| Main index | Section 4 | Options |
In /boot/device.hints: hint.pbio.0.at="isa" hint.pbio.0.port="0x360"
#include <dev/pbio/pbioio.h>
The PPI provides two 8-bit ports (port A and port B) and two 4-bit ports (port C upper, port C lower). Each port can be individually programmed for input and (latched) output, and appears at a different offset of the device's base I/O address.
A separate register allows the configuration of ports for input or output. The device is so simple, that reliably probing for it when input data arrives at its terminals is impossible; therefore the kernel configuration has to specify the device's base address. The device driver provides four character devices that correspond to the peripheral's I/O ports. Opening a device for read or write automatically configures the corresponding hardware port for input or output. At boot time all ports are set configured for input to avoid damaging external circuitry.
A set of ioctl(2) requests allow polled input and paced output to be efficiently performed at the driver level without expensive user/kernel context switching. The driver can perform I/O in three different ways:
| Basic | The read or write operation returns immediately after reading or writing the data to the port at bus speed. |
| Paced | Data is transferred from or to the port at intervals specified by a separate ioctl(2) call. |
| Differential | |
| (Input only.) Only port values that differ from the previous port value are returned. | |
The pacing interval is specified in Hz unit increments. Setting a pace of n seconds will result in no more than one value being read or written every n seconds. Single byte read/write operations will take at least n seconds to complete.
The following ioctl(2) calls are supported:
| PBIO_SETDIFF | accepts a pointer to an integer as the third argument, and sets the driver for differential input if the integer is non-zero. The input pace speed determines the periodic interval the driver will use to examine the port for a changed value. |
| PBIO_GETDIFF | accepts a pointer to an integer as the third argument, and sets the integer to the last set value for differential input. |
| PBIO_SETIPACE | |
| accepts a pointer to an integer as the third argument, and sets the driver's input pacing speed to the value of that integer. | |
| PBIO_GETIPACE | |
| accepts a pointer to an integer as the third argument, and sets the integer to the last set value for the input pace. | |
| PBIO_SETOPACE | |
| accepts a pointer to an integer as the third argument, and sets the driver's output pacing speed to the value of that integer. | |
| PBIO_GETOPACE | |
| accepts a pointer to an integer as the third argument, and sets the integer to the last set value for the output pace. | |
| /dev/pbio0a | Port A (8 bit I/O). |
| /dev/pbio0b | Port B (8 bit I/O). |
| /dev/pbio0ch | |
| Port C upper (4 bit I/O). | |
| /dev/pbio0cl | |
| Port C lower (4 bit I/O). | |
, 1, Personal and Ubiquitous Computing, 53-69, The information furnace: Consolidated home control, 7, 2003.
| PBIO (4) | January 14, 2005 |
| Main index | Section 4 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
| “ | There are two major products of Berkeley, CA -- LSD and UNIX. We don't believe this to be strictly by coincidence. | ” |
| — Jeremy S. Anderson | ||