/* I2C communication The way we read a value is first writing the address we want to read and then wait for 2 bytes containing the data.  */
int max17048_read_register(const struct device *dev, uint8_t registerId, uint16_t *response)
/* I2C communication The way we read a value is first writing the address we want to read and then wait for 2 bytes containing the data.  */
int max17048_read_register(const struct device *dev, uint8_t registerId, uint16_t *response)
{
	uint8_t max17048_buffer[2];
	const struct max17048_config *cfg = dev->config;
	int rc = i2c_write_read_dt(&cfg->i2c, &registerId, sizeof(registerId), max17048_buffer,
				   sizeof(max17048_buffer));
	if (rc != 0) {
		LOG_ERR("Unable to read register, error %d", rc);
		return rc;
	}
	*response = sys_get_be16(max17048_buffer);
	return 0;
}