i2c_smbus_read_word_data(9)
πΈ i2c_smbus_read_word_data(9) πΈ
okay so bestie, welcome to the Kernel API Manual π this one's about i2c_smbus_read_word_data, and it's genuinely so straightforward you're gonna slay it.
β¨ NAME β¨
i2c_smbus_read_word_data β the SMBus "read word" protocol, that's it, that's the whole vibe π
β¨ SYNOPSIS β¨
s32 i2c_smbus_read_word_data (const struct i2c_client *client , u8
command );
like literally one call, no cap π₯
β¨ ARGUMENTS β¨
clientβ the handle to your slave device π«Ά it's theconst struct i2c_client *, y'know, the whole connection momentcommandβ au8byte, and it's interpreted by the slave. not by us. we just hand it over, main character energy π
β¨ DESCRIPTION β¨
okay so here's what happens: this bad boy executes the SMBus "read word" protocol π and it returns negative errno if something goes sideways π β otherwise you get a 16-bit unsigned "word" that the device sent back to you. sixteen whole bits of data, we love to see it π
heads up: negative return = errno, not data. don't be out here reading error codes as words, bestie π
β¨ SEE ALSO β¨
the kernel file lives at ./drivers/i2c/i2c-core-smbus.c btw, iykyk π
i2c_smbus_pec(9)i2c_smbus_read_byte(9)i2c_smbus_write_byte(9)i2c_smbus_read_byte_data(9)i2c_smbus_write_byte_data(9)i2c_smbus_write_word_data(9)i2c_smbus_read_block_data(9)i2c_smbus_write_block_data(9)i2c_smbus_xfer(9)i2c_smbus_read_i2c_block_data_or_emulated(9)i2c_new_smbus_alert_device(9)
aaaand that's the page, bestie π¦ go read some words off a slave device, periodt β¨
π sign-off time π β this whole thing comes from ./drivers/i2c, dated October 2026, and it's the i2c_smbus_read_word_data(9) page from the Kernel API Manual. mwah, go forth and i2c π
π¦ 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