IEEE1284_DATA(3)

πŸ“¦
version 0.2.11 Β· 7 versions
, in alpine 3.24, debian bookworm, debian trixie, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ IEEE1284_DATA πŸ’…

okay bestie, welcome to the Functions section of the manual (yes that's the manual name, we're fancy here) β€” today we're controlling the data lines of a parallel port and honestly? iconic behavior. πŸŽ€


🌸 NAME 🌸

ieee1284_read_data</p>, ieee1284_write_data</p>, ieee1284_data_dir</p>, ieee1284_wait_data</p> β€” they run the data lines, periodt. πŸ’…


✨ SYNOPSIS ✨

#include <ieee1284.h>

int ieee1284_read_data(struct parport *port);

void ieee1284_write_data(struct parport *port, unsigned char dt);

int ieee1284_data_dir(struct parport *port, int reverse);

int ieee1284_wait_data(struct parport *port, unsigned char mask,
                       unsigned char val, struct timeval *timeout);

πŸ¦‹ DESCRIPTION πŸ¦‹

so like. these functions manipulate the data lines of the parallel port that's associated with port β€” and heads up, that port must have been claimed using ieee1284_claim(3) first. no claiming, no playing. πŸ’€

The lines are represented by an 8-bit number (one line per bit, cute right) plus a direction. And here's the vibe: the data lines are driven as a group. They're either all host-driven (forward direction) or not (reverse direction). When the peripheral is driving them, the host must not. fr fr, that's the rule. πŸ™ˆ

For ieee1284_data_dir, the reverse parameter should be zero to turn the data line drivers on, and non-zero to turn them off. lowkey important: some port types may be unable to switch off the data line drivers. it's giving "sorry, not available on this hardware". 😭

Also, setting the data lines may have side effects on some port types β€” for example, some Amiga ports pulse nStrobe. so yeah, watch out for that. ⚠️

ieee1284_wait_data waits, up until the timeout, for the data bits specified in mask to have the corresponding values in val. it's just sitting there, waiting, main character energy. ⏳


πŸ‘‘ RETURN VALUE πŸ‘‘

ieee1284_read_data returns the 8-bit number representing the data lines β€” unless it's just not possible to return such a value with this port type, in which case it returns an error code instead. the possible error codes, bestie:

  • E1284_NOTAVAIL β€” Bi-directional data lines are not available on this system. 🚫
  • E1284_INVALIDPORT β€” The port parameter is invalid (perhaps it has not been claimed, for instance). πŸ‘€
  • E1284_SYS β€” There was an error at the operating system level, and errno has been set accordingly. πŸ’€
  • E1284_TIMEDOUT β€” The timeout has elapsed. ⏰

And now the plot twist: whereas ieee1284_read_data may return E1284_NOTAVAIL on its first invocation on the port, if it does not do so, then it cannot β€” not until ieee1284_close is called for that port. so basically: first impression is everything, and it doesn't change its mind later. πŸ™ˆ


πŸŽ€ AUTHOR πŸŽ€

Tim Waugh <twaugh@redhat.com>

  • Author. (yes that's literally the whole credit, and honestly? respect. 🫢)

Copyright Β© 2001-2003 Tim Waugh


and that's the whole page, bestie!! thanks for reading, mwah 🫢 this was IEEE1284_DATA(3) from 09/18/2007 β€” yeah it's an oldie but it ate and left no crumbs. go claim your port. slay. βœ¨πŸŒˆπŸ’–