ftdi_stream.c(3)

πŸ“¦
version 1.5.42+git.de9f01e Β· 2 versions
, in opensuse-leap 16.0

πŸ’… ftdi_stream.c(3) πŸ’…

okay so bestie, welcome to the ftdi_stream.c page from libftdi1 β€” yes that's the manual name, and yes you're gonna understand it, i promise 🫢 this one's all about streaming data off your FTDI device at high speed, no cap.


✨ SYNOPSIS ✨

like literally just include these, in this order, bestie:

#include <stdlib.h>
#include <stdio.h>
#include <sys/time.h>
#include <libusb.h>
#include 'ftdi.h'

(yes 'ftdi.h' has single quotes in the original, don't come for me πŸ’€ that's how it's written)

πŸŽ€ Classes

  • struct FTDIStreamState β€” the state struct, she's iconic, she holds everything together πŸ‘‘

πŸ¦‹ Functions

  • int ftdi_readstream (struct ftdi_context *ftdi, FTDIStreamCallback *callback, void *userdata, int packetsPerTransfer, int numTransfers)

🌸 Function Documentation 🌸

πŸ’– int ftdi_readstream (struct ftdi_context * ftdi, FTDIStreamCallback * callback, void * userdata, int packetsPerTransfer, int numTransfers)

streaming reading of data from the device ✨

so the vibe here is: this uses asynchronous transfers in libusb-1.0 to get high-performance streaming of data from a device interface back to the PC. like, maximum slay throughput πŸ”₯ This function continuously transfers data until either an error occurs or the callback returns a nonzero value β€” whichever comes first, bestie. And it returns a libusb error code or the callback's return value. periodt.

For every contiguous block of received data, the callback will be invoked. every single one. no skipping πŸ’…

πŸ“ Parameters

  • ftdi β€” pointer to ftdi_context
  • callback β€” to user supplied function for one block of data
  • userdata β€” (that's it, that's the description, she's mysterious like that πŸ™ˆ)
  • packetsPerTransfer β€” number of packets per transfer
  • numTransfers β€” Number of transfers per callback

🧚 Definition

Definition at line 151 of file ftdi_stream.c.

⭐ References

okay so this function references a whole squad, here they all are, exactly, do not lose a single one:

FTDIStreamState::activity, BITMODE_RESET, BITMODE_SYNCFF, FTDIStreamState::callback, FTDIProgressInfo::current, FTDIProgressInfo::currentRate, FTDIProgressInfo::first, ftdi_get_error_string(), ftdi_set_bitmode(), ftdi_tcioflush(), ftdi_context::max_packet_size, ftdi_context::out_ep, FTDIProgressInfo::prev, FTDIStreamState::progress, FTDIStreamState::result, size_and_time::time, size_and_time::totalBytes, FTDIProgressInfo::totalRate, FTDIProgressInfo::totalTime, ftdi_context::type, TYPE_2232H, TYPE_232H, ftdi_context::usb_ctx, ftdi_context::usb_dev, ftdi_context::usb_read_timeout, and FTDIStreamState::userdata.


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libftdi1 from the source code. (so like, a robot wrote this, but she ate, ngl πŸ€–πŸ’…)


and that's the whole page bestie!! Version 1.5, dated Wed Nov 6 2024 09:58:53 β€” shoutout to the source and version, mwah 😘 go stream some data, you got this fr fr πŸ¦‹βœ¨πŸ’–

πŸ“¦ where this page comes from