spi_sync_transfer(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ spi_sync_transfer(9) ✨

okay bestie, sit down, because we're diving into the Kernel API Manual and today's main character is spi_sync_transfer πŸŽ€ this is the synchronous SPI data transfer girlie and honestly she's lowkey iconic. no cap.


🌸 NAME 🌸

spi_sync_transfer β€” synchronous SPI data transfer πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

int spi_sync_transfer (struct spi_device *spi , struct spi_transfer
*xfers , unsigned int num_xfers );

like, that's the whole vibe. three args, one return, slay ✨


πŸ’– ARGUMENTS πŸ’–

  • spi β€” the device you're exchanging data with! the buddy you're talking to over SPI 🫢
  • xfers β€” an array of spi_transfers. yes, an array, plural energy πŸ‘‘
  • num_xfers β€” how many items are actually in that xfer array. the count. the receipts. πŸ”₯

😴 CONTEXT 😴

can sleep πŸ’€

fr fr remember this one β€” it can sleep, so don't you dare call it from a context where sleeping is a crime (iykyk). ngl that's important.

⭐ DESCRIPTION ⭐

so what does it actually do? it does a synchronous SPI data transfer of the given spi_transfer array. that's the whole thing. it takes your little array of transfers and sends them all off, synchronously, and waits. main character energy 🌈

and if you want the more specific semantics β€” like the detailed lore, the fine print, the "okay but what does synchronous actually mean here" β€” go peek at spi_sync. that's where the real details live. this page is just the "here's the array version" announcement πŸŽ€


πŸ”₯ RETURN πŸ”₯

  • zero on success β€” we love a zero, that's the win condition πŸ₯³
  • else a negative error code β€” 😭 that's the "something went wrong" signal. negative. always negative. no guessing.

not me getting emotional over error codes πŸ’œ


🧚 SEE ALSO 🧚

okay this list is a whole friend group and you're gonna meet all of them πŸ’… from the kernel file ./include/linux/spi/spi.h:

like, that's 21 whole entries. obsessed. read them all, don't skip, I'm literally begging πŸ™ˆ


and that's the page bestie!! πŸ’– this cutie lives at ./include/linux/spi and the version is October 2026, filed under spi_sync_transfer(9) β€” go forth and transfer your data synchronously, you've got this πŸ¦‹βœ¨πŸ“

πŸ“¦ where this page comes from