Lines Matching refs:msgs
82 static int ina230_emul_transfer_i2c(const struct emul *target, struct i2c_msg msgs[], int num_msgs, in ina230_emul_transfer_i2c() argument
88 if (!msgs || num_msgs < 1 || num_msgs > 2) { in ina230_emul_transfer_i2c()
93 if (msgs[0].flags & I2C_MSG_READ) { in ina230_emul_transfer_i2c()
100 if (msgs[0].len != 3) { in ina230_emul_transfer_i2c()
106 uint8_t reg = msgs[0].buf[0]; in ina230_emul_transfer_i2c()
107 uint16_t val = sys_get_be16(&msgs[0].buf[1]); in ina230_emul_transfer_i2c()
119 if ((msgs[1].flags & I2C_MSG_READ) == I2C_MSG_WRITE) { in ina230_emul_transfer_i2c()
123 uint8_t reg = msgs[0].buf[0]; in ina230_emul_transfer_i2c()
132 if (msgs[1].len == 2) { in ina230_emul_transfer_i2c()
133 sys_put_be16(reg_ptr->value, msgs[1].buf); in ina230_emul_transfer_i2c()
135 } else if (msgs[1].len == 3) { in ina230_emul_transfer_i2c()
136 sys_put_be24(reg_ptr->value, msgs[1].buf); in ina230_emul_transfer_i2c()
139 LOG_ERR("Invalid read length: %d", msgs[1].len); in ina230_emul_transfer_i2c()