comedi_buf_read_samples(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… comedi_buf_read_samples(9) β€” Kernel API Manual

okay so bestie, welcome to comedi_buf_read_samples(9), straight out of the Kernel API Manual ✨ this is the little kernel-side icon that scoops sample data out of a COMEDI buffer, and honestly? she ate.


πŸŽ€ NAME

comedi_buf_read_samples β€” Read sample data from COMEDI buffer 🌸


✨ SYNOPSIS

unsigned int comedi_buf_read_samples (struct comedi_subdevice *s , void
*data , unsigned int nsamples );

πŸ¦‹ ARGUMENTS

  • s β€” the COMEDI subdevice, your main character for this whole operation πŸ‘‘
  • data β€” pointer to destination, i.e. where the samples are gonna land 🎯
  • nsamples β€” maximum number of samples to read, the ceiling, the limit, the "don't get carried away" πŸ’…

πŸ’– DESCRIPTION

So here's the vibe: you read up to nsamples samples out of the COMEDI acquisition data buffer that's chillin' with the subdevice 🫢, mark that data as read βœ…, and update the acquisition scan progress so everyone stays in the loop πŸ‘€.

The number of samples actually read gets limited to however many are available β€” no reaching for samples that aren't there, that would be embarrassing πŸ™ˆ. And if any samples get read at all, she sets the COMEDI_CB_BLOCK event flag, which is what causes waiting tasks to be woken when the event flags get processed ⭐. literally the whole point.


πŸ”₯ RETURN

The amount of data read in bytes πŸ“ (bytes, bestie, not samples β€” read the unit, iykyk).


🌈 SEE ALSO

Kernel file ./drivers/comedi/comedi_buf.c, plus the whole friend group:


ngl she's the read half of the read/write duo, and she's highkey carrying the buffer game πŸ’€

mwah πŸ’‹ that's the page! shoutout to ./drivers/comedi for being the home base, and mark your calendars for October 2026 β€” that's the date on this little icon, and no cap, she'll still be slaying then πŸ§šβ€β™€οΈπŸ’œ

πŸ“¦ where this page comes from