Lines Matching refs:emul
58 struct i2c_emul *emul = NULL; in i2c_emul_find() local
60 emul = CONTAINER_OF(node, struct i2c_emul, node); in i2c_emul_find()
61 if (emul->addr == addr) { in i2c_emul_find()
62 return emul; in i2c_emul_find()
184 struct i2c_emul *emul; in i2c_emul_transfer() local
220 emul = i2c_emul_find(dev, addr); in i2c_emul_transfer()
221 if (!emul) { in i2c_emul_transfer()
225 api = emul->api; in i2c_emul_transfer()
226 __ASSERT_NO_MSG(emul->api); in i2c_emul_transfer()
227 __ASSERT_NO_MSG(emul->api->transfer); in i2c_emul_transfer()
229 if (emul->mock_api != NULL && emul->mock_api->transfer != NULL) { 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()
259 int i2c_emul_register(const struct device *dev, struct i2c_emul *emul) in i2c_emul_register() argument
262 const char *name = emul->target->dev->name; in i2c_emul_register()
264 sys_slist_append(&data->emuls, &emul->node); in i2c_emul_register()
266 LOG_INF("Register emulator '%s' at I2C addr %02x", name, emul->addr); in i2c_emul_register()