IEEE1284_OPEN(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

✨ NAME ✨

ieee1284_open β€” open a port πŸ’– (it lives in the Functions corner of the manual, section 3, for the record)


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <ieee1284.h>

int ieee1284_open(struct parport *port, int flags, int *capabilities);

🌸 DESCRIPTION 🌸

okay so bestie, listen: before you can do literally anything with a port, you have to open it first. That's the whole vibe. All the initial set-up of the port happens right here at this stage. And then β€” the way that open ports don't just stay open forever β€” when you're done with it, you close it with ieee1284_close(3). no cap.

The flags you can pass are:

  • F1284_EXCL β€” this device cannot share the port with anybody else, periodt. If that's the situation, you have to declare it at this stage, so the other drivers out there trying to grab the port know not to even bother. Because if you don't? They'll just wait around until this driver releases the port, i.e. never. πŸ’€
lowkey important: the iopl/dev-port access methods don't support this yet, but the ppdev ones do. iykyk.

Now, if capabilities is not NULL, it has to point to storage for an int, and that int gets treated as a set of flags β€” one per bit β€” which the library sets or clears as appropriate. And if a capability is present, it will be used when asked for. Here's the whole lineup:

  • CAP1284_RAW β€” pin-level access is available. If this one's present then these functions are effective: ieee1284_write_data, ieee1284_read_status, ieee1284_wait_status, ieee1284_write_control, ieee1284_read_control, ieee1284_frob_control. slay.
  • CAP1284_NIBBLE β€” there is an implementation of nibble mode for this port.
  • CAP1284_BYTE β€” there is an implementation of byte mode for this port.
  • CAP1284_COMPAT β€” there is an implementation of compatibility mode for this port.
  • CAP1284_ECP β€” there is a hardware implementation of ECP mode for this port.
  • CAP1284_ECPRLE β€” there is an RLE-aware implementation of ECP mode for this port (the F1284_RLE flag is recognised by the ECP transfer functions).
  • CAP1284_ECPSWE β€” there is a software implementation of ECP mode for this port.
  • CAP1284_BECP β€” there is an implementation of bounded ECP mode for this port.
  • CAP1284_EPP β€” there is a hardware implementation of EPP mode for this port.
  • CAP1284_EPPSWE β€” there is a software implementation of EPP mode for this port.
  • CAP1284_IRQ β€” an interrupt line is configured for this port and interrupt notifications can be received using ieee1284_get_irq_fd(3). iconic.
  • CAP1284_DMA β€” a DMA channel is configured for this port.

πŸ’… RETURN VALUE πŸ’…

here's what you might get back, bestie β€” read carefully:

  • E1284_OK β€” the port is now opened. we love to see it. 🫢
  • E1284_INIT β€” there was a problem during port initialization. could be because another driver has opened the port exclusively, or some other reason. 😭
  • E1284_NOMEM β€” there is not enough memory.
  • E1284_NOTAVAIL β€” one or more of the supplied flags is not supported by this type of port.
  • E1284_INVALIDPORT β€” the port parameter is invalid (for instance, the port may already be open).
  • E1284_SYS β€” there was a problem at the operating system level. the global variable errno has been set appropriately.

πŸ‘‘ SEE ALSO πŸ‘‘


🌈 AUTHOR 🌈

Tim Waugh <twaugh@redhat.com>

  • Author.

Copyright Β© 2001-2003 Tim Waugh


and that's the whole page, bestie πŸ’– this was IEEE1284_OPEN(3) from the Functions section, footer stamped 09/18/2007 and IEEE1284_OPEN(3) β€” go forth and open those ports responsibly, mwah πŸ’…βœ¨