IEEE1284_TRANSFER(3)
π IEEE1284_TRANSFER π
okay bestie, welcome to IEEE1284_TRANSFER(3) β that's section 3 of the manual, aka the functions zone. this is the one about actually moving bytes around on your parallel port. sit down, grab a strawberry π, we're doing this.
β¨ NAME β¨
ieee1284_nibble_read, ieee1284_compat_write, ieee1284_byte_read, ieee1284_epp_read_data, ieee1284_epp_write_data, ieee1284_epp_read_addr, ieee1284_epp_write_addr, ieee1284_ecp_read_data, ieee1284_ecp_write_data, ieee1284_ecp_read_addr, ieee1284_ecp_write_addr β the data transfer functions π
π¦ SYNOPSIS π¦
first things first, you gotta include the header, no cap:
#include <ieee1284.h>
and here's the whole girl squad of signatures, all of them, every single one:
ssize_t ieee1284_nibble_read(struct parport *port, int flags,
char *buffer, size_t len);
ssize_t ieee1284_compat_write(struct parport *port, int flags,
const char *buffer, size_t len);
ssize_t ieee1284_byte_read(struct parport *port, int flags,
char *buffer, size_t len);
ssize_t ieee1284_epp_read_data(struct parport *port, int flags,
char *buffer, size_t len);
ssize_t ieee1284_epp_write_data(struct parport *port, int flags,
const char *buffer, size_t len);
ssize_t ieee1284_epp_read_addr(struct parport *port, int flags,
char *buffer, size_t len);
ssize_t ieee1284_epp_write_addr(struct parport *port, int flags,
char *buffer, size_t len);
ssize_t ieee1284_ecp_read_data(struct parport *port, int flags,
char *buffer, size_t len);
ssize_t ieee1284_ecp_write_data(struct parport *port, int flags,
const char *buffer, size_t len);
ssize_t ieee1284_ecp_read_addr(struct parport *port, int flags,
char *buffer, size_t len);
ssize_t ieee1284_ecp_write_addr(struct parport *port, int flags,
char *buffer, size_t len);
look at them. so organized. so iconic. π
πΈ DESCRIPTION πΈ
okay so this whole set of functions is for transferring bytes in whatever transfer mode is relevant at the time. for ECP and EPP modes you've got two flavors of transfer available: data and address β and in ECP, address is usually called channel, iykyk.
the port you pass in must be a claimed port. not a random port you found on the street. a claimed one. β
the buffer you supply has to be at least len bytes long. when you're reading, the transferred data gets stored into the buffer. when you're writing, the data to be transferred gets taken from the buffer. simple as that π
now the timeout tea β:
- for reads (peripheral β host): if there's no data available and
F1284_NONBLOCKis not in effect, the inactivity timer starts. if data shows up before the inactivity time-out runs out, it gets read. otherwise the return value will beE1284_TIMEDOUT. π - for writes (host β peripheral): if the peripheral is not willing to accept data and
F1284_NONBLOCKis not in effect, the inactivity timer starts. if the peripheral says "yeah I'll take it" before the inactivity time-out elapses, it gets sent. otherwise the return value will beE1284_TIMEDOUT.
and the flags can change the vibe slightly, so let's go through them one by one:
F1284_NONBLOCKβ for reads (peripheral β host): if no data is available, return immediately (withE1284_TIMEDOUT). for writes (host β peripheral): if the peripheral is not willing to accept data, return immediately (withE1284_TIMEDOUT). basically "don't wait around bestie, I have places to be." πF1284_SWEβ don't use hardware assistance for the transfer. instead, set the parallel port pins according to the wire protocol. doing it by hand, the old-fashioned way. πF1284_RLE(for ECP only) β use run length encoding. if the peripheral is in ECP mode with RLE, calls toieee1284_ecp_read_datamust set this flag so the RLE coming from the peripheral gets interpreted correctly, and calls toieee1284_ecp_write_datamay set this flag in order to take advantage of RLE. so: reads = mandatory, writes = optional flex. β¨F1284_FASTEPP(for EPP only) β use multi-byte transfers. several bytes at a time get transferred using hardware assistance, if supporting hardware is present. the price of this increased speed is that the return value will be less reliable when this flag is used. fast and sloppy, we love a risky queen but read that again: less reliable. π₯
for ECP mode, a given direction is in force at any particular time, and it's up to the application to make sure it's only writing when in forward mode, and reading when in reverse mode. do NOT mix them up. the mode will not forgive you.
π RETURN VALUE π
the return value is the number of bytes successfully transferred or, if it's negative, one of these lil guys:
E1284_NOTIMPLβ this transfer mode and flags combination is not yet implemented in libieee1284. sorry, not built yet. πE1284_TIMEDOUTβ timed out waiting for peripheral to handshake. the peripheral ghosted you. πE1284_NOMEMβ not enough memory is available. πE1284_SYSβ there was a problem at the operating system level. the global variableerrnohas been set appropriately.E1284_INVALIDPORTβ theportparameter is invalid (for instance, perhaps the port is not claimed). wrong port, bestie.
if any bytes are successfully transferred, that number is returned. an error is only returned if no bytes are transferred. periodt.
also, for host-to-peripheral transfers, all data is at the peripheral by the time the call returns. all of it. delivered. π«Ά
π SEE ALSO π
π AUTHOR π
Tim Waugh <twaugh@redhat.com> β Author. π
π COPYRIGHT π
Copyright Β© 2001-2003 Tim Waugh
and that's the whole page, bestie! π this was IEEE1284_TRANSFER(3), dated 09/18/2007, and it lives right there in the same manual as its friends. go forth and transfer those bytes responsibly β and remember, only write in forward mode. mwah πβ¨π
π¦ where this page comes from
- alpine 3.24: libieee1284-doc 0.2.11-r4 Β· GPL-2.0-or-later
- debian bookworm: libieee1284-3-dev 0.2.11-14
- debian trixie: libieee1284-3-dev 0.2.11-14.1+b1
- opensuse-leap 16.0: libieee1284-devel 0.2.11-bp160.1.13 Β· GPL-2.0-or-later AND MIT
- opensuse-leap 16.0: libieee1284-devel 0.2.11-bp160.1.13 Β· GPL-2.0-or-later AND MIT
- opensuse-leap 16.0: libieee1284-devel 0.2.11-bp160.1.13 Β· GPL-2.0-or-later AND MIT
- opensuse-leap 16.0: libieee1284-devel 0.2.11-bp160.1.13 Β· GPL-2.0-or-later AND MIT
- ubuntu jammy: libieee1284-3-dev 0.2.11-14build2
- ubuntu noble: libieee1284-3-dev 0.2.11-14.1build1
- ubuntu questing: libieee1284-3-dev 0.2.11-14.1build1
- ubuntu resolute: libieee1284-3-dev 0.2.11-14.1build2
- ubuntu stonking: libieee1284-3-dev 0.2.11-15 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms