Lines Matching refs:msgs
68 static int max17048_emul_transfer_i2c(const struct emul *target, struct i2c_msg *msgs, in max17048_emul_transfer_i2c() argument
76 __ASSERT_NO_MSG(msgs && num_msgs); in max17048_emul_transfer_i2c()
78 i2c_dump_msgs_rw(target->dev, msgs, num_msgs, addr, false); in max17048_emul_transfer_i2c()
81 if (msgs->flags & I2C_MSG_READ) { in max17048_emul_transfer_i2c()
85 if (msgs->len != 1) { in max17048_emul_transfer_i2c()
86 LOG_ERR("Unexpected msg0 length %d", msgs->len); in max17048_emul_transfer_i2c()
89 reg = msgs->buf[0]; in max17048_emul_transfer_i2c()
92 msgs++; in max17048_emul_transfer_i2c()
93 if (msgs->flags & I2C_MSG_READ) { in max17048_emul_transfer_i2c()
94 switch (msgs->len - 1) { in max17048_emul_transfer_i2c()
103 sys_put_le16(val, msgs->buf); in max17048_emul_transfer_i2c()
106 LOG_ERR("Unexpected msg1 length %d", msgs->len); in max17048_emul_transfer_i2c()
111 if (msgs->len != 2) { in max17048_emul_transfer_i2c()
112 LOG_ERR("Unexpected msg1 length %d", msgs->len); in max17048_emul_transfer_i2c()
114 uint16_t value = sys_get_le16(msgs->buf); in max17048_emul_transfer_i2c()