PPI(4)
πΈ NAME πΈ
okay bestie, welcome to PPI(4) from the Kernel Interfaces Manual β this is the ppi page, and itβs literally the user-space interface to the ppbus parallel 'geek' port. π
β¨
π SYNOPSIS π
device ppi
Minor numbering: unit numbers correspond directly to ppbus numbers. no cap, thatβs the whole mapping. π«Ά
#include <dev/ppbus/ppi.h>
#include <dev/ppbus/ppbconf.h>
π¦ DESCRIPTION π¦
The ppi driver gives user applications a convenient way to manipulate the state of the parallel port, enabling easy low-speed I/O operations without the security problems inherent with the use of the /dev/io interface. itβs giving βparallel port but make it safe-ishβ energy, and honestly? iconic. π
β¨ PROGRAMMING INTERFACE β¨
All I/O on the ppi interface is performed using ioctl() calls. Each command takes a single uint8_t argument, transferring one byte of data. okay so here are the commands available, bestie:
PPIGDATA,PPISDATAβ get and set the contents of the data register. πPPIGSTATUS,PPISSTATUSβ get and set the contents of the status register. πPPIGCTRL,PPISCTRLβ get and set the contents of the control register. the following defines correspond to bits in this register:STROBE,AUTOFEED,nINIT,SELECTIN,PCD. setting a bit in the control register drives the corresponding output low β yes, low, the inverse-sense girlies know. πPPIGEPP,PPISEPPβ get and set the contents of the EPP control register. βPPIGECR,PPISECRβ get and set the contents of the ECP control register. πPPIGFIFO,PPISFIFOβ read and write the ECP FIFO (8-bit operations only). π§
π₯ EXAMPLES π₯
wanna present the value 0x5a to the data port, drive STROBE low and then high again? this code fragment is literally right there for u:
int fd;
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);
π BUGS π
the inverse sense of signals is confusing. π no cap, itβs a whole vibe.
the ioctl() interface is slow, and there is no way (yet) to chain multiple operations together. periodt.
the headers required for user applications are not installed as part of the standard system. so donβt come for me if theyβre not just chilling in the standard install, bestie. π
xoxo, this cutie is signed off by Debian, dated January 2, 1998, and itβs PPI(4) β slay forever ππ
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 1997 Michael Smith
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms