spi_sync_transfer(9)
β¨ 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 ofspi_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:
struct spi_statistics(9)struct spi_delay(9)struct spi_device(9)struct spi_driver(9)spi_unregister_driver(9)module_spi_driver(9)struct spi_controller(9)struct spi_res(9)struct spi_transfer(9)struct spi_message(9)spi_message_init_with_transfers(9)spi_is_bpw_supported(9)spi_bpw_to_bytes(9)spi_controller_xfer_timeout(9)struct spi_replaced_transfers(9)spi_write(9)spi_read(9)spi_w8r8(9)spi_w8r16(9)spi_w8r16be(9)struct spi_board_info(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms