12.07.2015 Views

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

PPI (9) <strong>NetBSD</strong> <strong>Kernel</strong> Developer’s <strong>Manual</strong> PPI (9)<strong>NAME</strong>ppi —user-space interface to ppbus parallel portSYNOPSIS#include #include #include DESCRIPTIONAll I/O on the ppi interface is performed using ioctl() calls. Each command takes a single uint8_targument, transferring one byte of data. The following commands are available:PPIGDATA, PPISDATAGet and set the contents of the data register.PPIGSTATUS, PPISSTATUSGet and set the contents of the status register.PPIGCTRL, PPISCTRLGet and set the contents of the control register. The following defines correspond to bits in thisregister. Setting a bit in the control register drives the corresponding output low.STROBEAUTOFEEDnINITSELECTINPCDPPIGEPP, PPISEPPGet and set the contents of the EPP control register.PPIGECR, PPISECRGet and set the contents of the ECP control register.PPIGFIFO, PPISFIFORead and write the ECP FIFO (8-bit operations only).EXAMPLESTo present the value 0x5a to the data port, drive STROBE low and then high again, the following code fragmentcan be used:intfd;uint8_t val;val = 0x5a;ioctl(fd, PPISDATA, &val);ioctl(fd, PPIGCTRL, &val);val |= STROBE;ioctl(fd, PPISCTRL, &val);val &= ˜STROBE;ioctl(fd, PPISCTRL, &val);SEE ALSOioctl(2), atppc(4), io(4), ppbus(4), ppi(4)<strong>NetBSD</strong> 3.0 December 29, 2003 1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!