spi_w8r16be(9)
hiii bestie π this is the spi_w8r16be(9) page from the Kernel API Manual, and we're gonna make it make sense together. No cap.
β¨ NAME β¨
spi_w8r16be β SPI synchronous 8 bit write followed by 16 bit big-endian read. That's the whole vibe: write 8 bits, then read 16 bits big-endian. π
πΈ SYNOPSIS πΈ
ssize_t spi_w8r16be (struct spi_device *spi , u8 cmd );
π ARGUMENTS π
spiβ device with which data will be exchanged. literally the device bestie is talking to.cmdβ command to be written before data is read back. writes first, then reads back.
π΄ CONTEXT π΄
can sleep β yes bestie, it can sleep. π΄ Callable only from contexts that can sleep.
π¦ DESCRIPTION π¦
Okay so this function is similar to spi_w8r16, with the exception that it will convert the read 16 bit data word from big-endian to native endianness. so it's the big-endian-to-native-endianness remix of spi_w8r16. π₯
Callable only from contexts that can sleep. that's the rule, bestie β no sneaky calls from places that can't sleep. π
π RETURN π
You get the (unsigned) sixteen bit number returned by the device in CPU endianness, or else a negative error code. That's the tea. β
π₯ SEE ALSO π₯
Kernel file: ./include/linux/spi/spi.h β plus the whole squad:
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_sync_transfer(9)spi_write(9)spi_read(9)spi_w8r8(9)spi_w8r16(9)struct spi_board_info(9)
mwah π this page's source/version is ./include/linux/spi, dated October 2026, and it's the spi_w8r16be(9) manual page β bye bestie! π«Άβ¨
π¦ 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