rtapi_outb(3rtapi)

πŸ“¦
version 2.9.4 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ rtapi_outb(3rtapi) ✨

okay bestie, so this is a page from the RTAPI section of the LinuxCNC manuals and it's literally all about poking bytes at hardware I/O ports πŸ’… it's giving low-level, it's giving realtime, it's giving "yes we're talking directly to the hardware, no cap".


🌸 NAME 🌸

rtapi_outb, rtapi_inb β€” do a little hardware I/O, as a treat πŸŽ€


πŸ¦‹ SYNTAX πŸ¦‹

void rtapi_outb(unsigned char byte, unsigned int port)

unsigned char rtapi_inb(unsigned int port)

πŸ’– ARGUMENTS πŸ’–

  • port β€” the address of the I/O port. like, where the port lives. that's the whole vibe.
  • byte β€” the byte you're writing to the port. one (1) single byte. iconic.

✨ DESCRIPTION ✨

rtapi_outb writes a byte to a hardware I/O port. rtapi_inb reads a byte from a hardware I/O port. that's it, that's the whole thing. out goes the byte, in comes the byte. πŸ”₯


πŸ‘‘ REALTIME CONSIDERATIONS πŸ‘‘

so this is the part where you pay attention, bestie:

  • you may call these from init/cleanup code, and also from within realtime tasks 🫢
  • these are not available in non-realtime components. sorry to the non-realtime girlies, this is not your moment πŸ’€

πŸ’œ RETURN VALUE πŸ’œ

rtapi_inb returns the byte that was read from the given I/O port. like it literally hands you the byte. slay.


🌈 NOTES 🌈

the I/O address should be inside a region that was previously allocated by rtapi_request_region. if it's not, another real-time module or the Linux kernel itself might try to access that same I/O region at the same time 😭 and that is not the kind of chaos we're manifesting, fr fr.

πŸ“ SEE ALSO πŸ“


that's the whole page, bestie πŸ’… go forth and byte responsibly.

~ from the LinuxCNC Documentation girlies, dated 2006-10-12 β€” yes she's vintage, yes she still ate πŸ’– ✨ πŸŽ€ πŸ¦‹