Lines Matching refs:msgs
223 static int sbs_gauge_emul_transfer_i2c(const struct emul *target, struct i2c_msg *msgs, in sbs_gauge_emul_transfer_i2c() argument
234 __ASSERT_NO_MSG(msgs && num_msgs); in sbs_gauge_emul_transfer_i2c()
236 i2c_dump_msgs_rw(target->dev, msgs, num_msgs, addr, false); in sbs_gauge_emul_transfer_i2c()
239 if (msgs->flags & I2C_MSG_READ) { in sbs_gauge_emul_transfer_i2c()
243 if (msgs->len != 1) { in sbs_gauge_emul_transfer_i2c()
244 LOG_ERR("Unexpected msg0 length %d", msgs->len); in sbs_gauge_emul_transfer_i2c()
247 reg = msgs->buf[0]; in sbs_gauge_emul_transfer_i2c()
250 msgs++; in sbs_gauge_emul_transfer_i2c()
251 if (msgs->flags & I2C_MSG_READ) { in sbs_gauge_emul_transfer_i2c()
252 switch (msgs->len) { in sbs_gauge_emul_transfer_i2c()
261 sys_put_le16(val, msgs->buf); in sbs_gauge_emul_transfer_i2c()
266 rc = emul_sbs_gauge_buffer_read(target, reg, (char *)msgs->buf); in sbs_gauge_emul_transfer_i2c()
269 LOG_ERR("Unexpected msg1 length %d", msgs->len); in sbs_gauge_emul_transfer_i2c()
274 if (msgs->len != 2) { in sbs_gauge_emul_transfer_i2c()
275 LOG_ERR("Unexpected msg1 length %d", msgs->len); in sbs_gauge_emul_transfer_i2c()
277 uint16_t value = sys_get_le16(msgs->buf); in sbs_gauge_emul_transfer_i2c()