Lines Matching refs:msgs
71 static int ina237_emul_transfer_i2c(const struct emul *target, struct i2c_msg msgs[], int num_msgs, in ina237_emul_transfer_i2c() argument
77 if (!msgs || num_msgs < 1 || num_msgs > 2) { in ina237_emul_transfer_i2c()
82 if (msgs[0].flags & I2C_MSG_READ) { in ina237_emul_transfer_i2c()
89 if (msgs[0].len != 3) { in ina237_emul_transfer_i2c()
95 uint8_t reg = msgs[0].buf[0]; in ina237_emul_transfer_i2c()
96 uint16_t val = sys_get_be16(&msgs[0].buf[1]); in ina237_emul_transfer_i2c()
108 if ((msgs[1].flags & I2C_MSG_READ) == I2C_MSG_WRITE) { in ina237_emul_transfer_i2c()
112 uint8_t reg = msgs[0].buf[0]; in ina237_emul_transfer_i2c()
121 if (msgs[1].len == 2) { in ina237_emul_transfer_i2c()
122 sys_put_be16(reg_ptr->value, msgs[1].buf); in ina237_emul_transfer_i2c()
124 } else if (msgs[1].len == 3) { in ina237_emul_transfer_i2c()
125 sys_put_be24(reg_ptr->value, msgs[1].buf); in ina237_emul_transfer_i2c()
128 LOG_ERR("Invalid read length: %d", msgs[1].len); in ina237_emul_transfer_i2c()