pub unsafe extern "C" fn i2c_write_byte(
dev: i2c_t,
addr: u16,
data: u8,
flags: u8,
) -> c_int
Expand description
@brief Convenience function for writing a single byte onto the bus
@pre i2c_acquire must be called before accessing the bus
@param[in] dev I2C peripheral device @param[in] addr 7-bit or 10-bit device address (right-aligned) @param[in] data byte to write to the device @param[in] flags optional flags (see @ref i2c_flags_t)
@return 0 When success @return -EIO When slave device doesn’t ACK the byte @return -ENXIO When no devices respond on the address sent on the bus @return -ETIMEDOUT When timeout occurs before device’s response @return -EINVAL When an invalid argument is given @return -EOPNOTSUPP When MCU driver doesn’t support the flag operation @return -EAGAIN When a lost bus arbitration occurs