Function riot_sys::i2c_write_regs

source ·
pub unsafe extern "C" fn i2c_write_regs(
    dev: i2c_t,
    addr: u16,
    reg: u16,
    data: *const c_void,
    len: size_t,
    flags: u8
) -> c_int
Expand description

@brief Convenience function for writing data to a given register address

@note This function is using a continuous sequence for writing to the specified register address. It first writes the register then data.

@pre i2c_acquire must be called before accessing the bus

@param[in] dev I2C peripheral device @param[in] reg register address to read from (8- or 16-bit, right-aligned) @param[in] addr 7-bit or 10-bit device address (right-aligned) @param[out] data memory location to store received data @param[in] len the number of bytes to write @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