Lines Matching refs:msgs

88 static int i2c_emul_send_to_target(const struct device *dev, struct i2c_msg *msgs, uint8_t num_msgs)  in i2c_emul_send_to_target()  argument
98 if (i2c_is_read_op(&msgs[i])) { in i2c_emul_send_to_target()
107 if (len > msgs[i].len) { in i2c_emul_send_to_target()
111 memcpy(msgs[i].buf, ptr, len); in i2c_emul_send_to_target()
113 callbacks->buf_write_received(data->target_cfg, msgs[i].buf, in i2c_emul_send_to_target()
114 msgs[i].len); in i2c_emul_send_to_target()
116 if (i2c_is_stop_op(&msgs[i])) { in i2c_emul_send_to_target()
129 LOG_DBG(" msgs[%u].flags? 0x%02x", i, msgs[i].flags); in i2c_emul_send_to_target()
130 if (i2c_is_read_op(&msgs[i])) { in i2c_emul_send_to_target()
131 for (uint32_t j = 0; j < msgs[i].len; ++j) { in i2c_emul_send_to_target()
136 (void *)&msgs[i].buf[j]); in i2c_emul_send_to_target()
138 &msgs[i].buf[j]); in i2c_emul_send_to_target()
141 (void *)&msgs[i].buf[j]); in i2c_emul_send_to_target()
143 &msgs[i].buf[j]); in i2c_emul_send_to_target()
150 for (uint32_t j = 0; j < msgs[i].len; ++j) { in i2c_emul_send_to_target()
161 msgs[i].buf[j]); in i2c_emul_send_to_target()
162 rc = callbacks->write_received(data->target_cfg, msgs[i].buf[j]); in i2c_emul_send_to_target()
168 if (i2c_is_stop_op(&msgs[i])) { in i2c_emul_send_to_target()
180 static int i2c_emul_transfer(const struct device *dev, struct i2c_msg *msgs, uint8_t num_msgs, in i2c_emul_transfer() argument
203 return i2c_emul_send_to_target(dev, msgs, num_msgs); in i2c_emul_transfer()
216 return i2c_transfer(conf->forward_list[i].bus, msgs, num_msgs, addr); in i2c_emul_transfer()
230 ret = emul->mock_api->transfer(emul->target, msgs, num_msgs, addr); in i2c_emul_transfer()
236 return api->transfer(emul->target, msgs, num_msgs, addr); in i2c_emul_transfer()