Lines Matching refs:msgs
217 struct i2c_msg *msgs,
226 struct i2c_msg *msgs,
523 void i2c_dump_msgs_rw(const struct device *dev, const struct i2c_msg *msgs, uint8_t num_msgs,
540 static inline void i2c_dump_msgs(const struct device *dev, const struct i2c_msg *msgs, in i2c_dump_msgs() argument
543 i2c_dump_msgs_rw(dev, msgs, num_msgs, addr, false); in i2c_dump_msgs()
584 static inline void i2c_xfer_stats(const struct device *dev, struct i2c_msg *msgs, in i2c_xfer_stats() argument
595 if (msgs[i].flags & I2C_MSG_READ) { in i2c_xfer_stats()
596 bytes_read += msgs[i].len; in i2c_xfer_stats()
598 bytes_written += msgs[i].len; in i2c_xfer_stats()
677 static inline void i2c_xfer_stats(const struct device *dev, struct i2c_msg *msgs, in i2c_xfer_stats() argument
681 ARG_UNUSED(msgs); in i2c_xfer_stats()
790 struct i2c_msg *msgs, uint8_t num_msgs,
794 struct i2c_msg *msgs, uint8_t num_msgs, in z_impl_i2c_transfer() argument
805 msgs[num_msgs - 1].flags |= I2C_MSG_STOP; in z_impl_i2c_transfer()
808 int res = api->transfer(dev, msgs, num_msgs, addr); in z_impl_i2c_transfer()
810 i2c_xfer_stats(dev, msgs, num_msgs); in z_impl_i2c_transfer()
813 i2c_dump_msgs_rw(dev, msgs, num_msgs, addr, true); in z_impl_i2c_transfer()
844 struct i2c_msg *msgs, in i2c_transfer_cb() argument
863 msgs[num_msgs - 1].flags |= I2C_MSG_STOP; in i2c_transfer_cb()
866 return api->transfer_cb(dev, msgs, num_msgs, addr, cb, userdata); in i2c_transfer_cb()
885 struct i2c_msg *msgs, in i2c_transfer_cb_dt() argument
890 return i2c_transfer_cb(spec->bus, msgs, num_msgs, spec->addr, cb, userdata); in i2c_transfer_cb_dt()
916 static inline int i2c_write_read_cb(const struct device *dev, struct i2c_msg *msgs, in i2c_write_read_cb() argument
921 if ((msgs == NULL) || (num_msgs != 2)) { in i2c_write_read_cb()
925 msgs[0].buf = (uint8_t *)write_buf; in i2c_write_read_cb()
926 msgs[0].len = num_write; in i2c_write_read_cb()
927 msgs[0].flags = I2C_MSG_WRITE; in i2c_write_read_cb()
929 msgs[1].buf = (uint8_t *)read_buf; in i2c_write_read_cb()
930 msgs[1].len = num_read; in i2c_write_read_cb()
931 msgs[1].flags = I2C_MSG_RESTART | I2C_MSG_READ | I2C_MSG_STOP; in i2c_write_read_cb()
933 return i2c_transfer_cb(dev, msgs, num_msgs, addr, cb, userdata); in i2c_write_read_cb()
957 static inline int i2c_write_read_cb_dt(const struct i2c_dt_spec *spec, struct i2c_msg *msgs, in i2c_write_read_cb_dt() argument
962 return i2c_write_read_cb(spec->bus, msgs, num_msgs, spec->addr, write_buf, num_write, in i2c_write_read_cb_dt()
994 struct i2c_msg *msgs, in i2c_transfer_signal() argument
1005 return api->transfer_cb(dev, msgs, num_msgs, addr, z_i2c_transfer_signal_cb, sig); in i2c_transfer_signal()
1092 const struct i2c_msg *msgs,
1111 struct i2c_msg *msgs, uint8_t num_msgs) in i2c_transfer_dt() argument
1113 return i2c_transfer(spec->bus, msgs, num_msgs, spec->addr); in i2c_transfer_dt()