i2c_master_send(9)
π i2c_master_send(9)
okay so welcome to the Kernel API Manual bestie, and today's main character is i2c_master_send β the little function that could, and does, one message at a time. let me put you on π«Ά
β¨ NAME β¨
i2c_master_send β issue a single I2C message in master transmit mode
like literally just one (1) message, in master transmit mode, that's the whole job and she does it flawlessly π
π¦ SYNOPSIS π¦
int i2c_master_send (const struct i2c_client *client , const char *buf ,
int count );
the signature is giving "three args and a dream" and honestly? iconic.
π ARGUMENTS π
clientβ handle to the slave device. this is your little guy, your target, your pen pal on the bus πbufβ the data that will be written to the slave. the actual payload, the ~content~, the message itself β¨countβ how many bytes to write. must be less than 64k, becausemsg.lenisu16β no cap, that's just the type fr fr. keep it under 64k or the universe (and the u16) says no π
πΈ DESCRIPTION πΈ
returns a negative errno, or else the number of bytes written.
that's it. that's the whole description. she's a simple queen with a simple contract: negative errno = something went sideways π, anything else = how many bytes actually got written π
no cap, read that return value. it's the whole plot.
π SEE ALSO π
- kernel file
./include/linux/i2c.hβ the source of truth, go read her π
and the whole extended friend group, in the order the manual lists them:
i2c_master_recv(9)i2c_master_recv_dmasafe(9)i2c_master_send_dmasafe(9)struct i2c_device_identity(9)enum i2c_driver_flags(9)struct i2c_driver(9)struct i2c_client(9)struct i2c_board_info(9)I2C_BOARD_INFO(9)struct i2c_algorithm(9)struct i2c_lock_operations(9)struct i2c_timings(9)struct i2c_bus_recovery_info(9)struct i2c_adapter_quirks(9)i2c_lock_bus(9)i2c_trylock_bus(9)i2c_unlock_bus(9)i2c_mark_adapter_suspended(9)i2c_mark_adapter_resumed(9)i2c_check_quirks(9)module_i2c_driver(9)builtin_i2c_driver(9)
go follow all of them, they're all in ./include/linux and they're all slay in their own way π
mwah π that's the page! brought to you by ./include/linux, dated October 2026, and of course the one and only i2c_master_send(9) β go send exactly one message bestie, 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