i2c_master_send(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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, because msg.len is u16 β€” 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:

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